/* ==========================================================================
   Costi Cohen — Shared Global Styles
   Loaded on all custom-template pages (homepage, about, stamp-duty, etc.)
   ========================================================================== */

/* --- Web Fonts --- */
@font-face {
  font-family: 'Austin News Deck';
  src: url('assets/fonts/AustinNewsDeck-Roman-Web.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Austin News Deck';
  src: url('assets/fonts/AustinNewsDeck-Italic-Web.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Graphik';
  src: url('assets/fonts/Graphik-Regular-Web.woff2') format('woff2'),
       url('assets/fonts/Graphik-Regular-Web.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Graphik';
  src: url('assets/fonts/Graphik-Medium-Web.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Graphik';
  src: url('assets/fonts/Graphik-RegularItalic-Web.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* --- Design Tokens --- */
:root {
  --cc-bg: #fafcf9;
  --cc-ink: #1e1e1e;
  --cc-ink-2: #515151;
  --cc-archive: #807f7a;
  --cc-dark-parchment: #8f7f65;
  --cc-newsprint: #d9d9d9;
  --cc-font-heading: 'Austin News Deck', serif;
  --cc-font-body: 'Graphik', sans-serif;
  --cc-font-footer: 'Graphik', sans-serif;
  --cc-max-width: 1512px;
  --cc-gutter: 28px;
}

/* --- Page-level Reset ---
   Every custom template wrapper carries .cc-page.

   Wrapped in :where() so it has zero specificity. Written plainly, `.cc-page *`
   scores 0,1,0 — an exact tie with any single-class component rule — and this
   file loads after the component stylesheets, so the reset won every tie and
   silently ate their margin and padding. That is why shared components used to
   need `margin: … !important`. They don't any more. */
:where(.cc-page, .cc-page *, .cc-page *::before, .cc-page *::after) {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Headings carry no size of their own — the design assigns it per component.
   :where() is load-bearing here: as a plain `.cc-page h1` this sat at
   specificity 0,1,1 and outranked every `.cc-my-title` class in the codebase,
   which is the single biggest reason heading rules were written with
   !important. At 0,0,0 a plain class selector wins. */
:where(.cc-page) :where(h1, h2, h3, h4, h5, h6) {
  font-size: inherit;
  font-weight: inherit;
  /* Not `inherit`: display type at 44px inheriting body's 1.48 is far too
     loose, and inheriting whatever a plugin set on body is how the same title
     rendered in a 22.5px box on one page and 25px on another. */
  line-height: 1.2;
}

/* --- Base element defaults ---
   Kadence's stylesheet used to supply these and no longer loads on our pages
   (see inc/cc-assets.php).

   Everything here is wrapped in :where(), which zeroes the selector's
   specificity. That is the whole point: a base rule must never outrank a
   component's own class. Kadence's `button { … }` at specificity 0,0,1 beat
   `.cc-btn` because it loaded later; these rules sit at 0,0,0 and lose to
   anything, in any file, in any order. Write plain class selectors from here
   on — no !important needed. */
:where(.cc-page) :where(img, video, canvas) {
  display: block;
  max-width: 100%;
}

:where(.cc-page) :where(svg) {
  max-width: 100%;
}

/* Form controls don't inherit typography on their own — every browser hands
   them a ~13px system font instead. */
:where(.cc-page) :where(button, input, select, textarea) {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

/* No text-align here on purpose: the UA default (center) is what the existing
   buttons were rendering with, and components that want left set it. */
:where(.cc-page) :where(button) {
  cursor: pointer;
}

:where(.cc-page) :where(a) {
  color: inherit;
  text-decoration: none;
}

:where(.cc-page) :where(ul, ol) {
  list-style: none;
}

:where(.cc-page) :where(table) {
  border-collapse: collapse;
}

/* --- Body-level overrides --- */
body.cc-custom-page {
  background: var(--cc-bg);
  color: var(--cc-ink);
  font-family: var(--cc-font-body);
  /* The site's body-copy default. This used to come from whichever of
     Kadence's or Elementor's kit stylesheets loaded on a given page, so the
     inherited size differed page to page (14px on the homepage, 20px on
     Transactions) — anything that didn't set its own size drifted with it. */
  font-size: 14px;
  line-height: 1.48;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
}

/* --- Kadence / Theme wrapper neutraliser --- */
body.cc-custom-page .site,
body.cc-custom-page .site-container,
body.cc-custom-page .entry-content-wrap,
body.cc-custom-page .content-wrap,
body.cc-custom-page .site-inner-wrap,
body.cc-custom-page .content-container,
body.cc-custom-page .site-main,
body.cc-custom-page .kadence-inner-wrap,
body.cc-custom-page .content-area {
  max-width: 100%;
  padding: 0;
  margin: 0;
  width: 100%;
}

/* --- Hide Kadence / Elementor chrome --- */
.cc-page #qodef-page-header,
.cc-page #qodef-page-footer,
.cc-page #qodef-page-title,
.cc-page .qodef-page-content-section,
.cc-page .site-header,
.cc-page .site-footer,
.cc-page #wrapper,
.cc-page .entry-content-wrap,
.cc-page .content-wrap,
.cc-page .site-container > .site-inner-wrap,
.cc-page header.entry-header,
.cc-page .kadence-pro-header,
.cc-page .site-above-header-wrap,
.cc-page .site-header-wrap,
.cc-page .site-below-header-wrap,
.cc-page .site-footer-wrap,
.cc-page .elementor-location-popup,
.cc-page .elementor-popup-modal,
.cc-page .dialog-widget,
.cc-page .dialog-lightbox-widget,
.cc-page [data-elementor-type="popup"],
.cc-page .elementor-sticky,
.cc-page .e-landing-page,
.cc-page .elementor-location-header,
.cc-page .elementor-location-footer {
  display: none;
}

/* --- Topbar re-apply (wildcard reset kills these) --- */
.cc-page .cc-topbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background: var(--cc-bg);
  height: 79px;
}

.cc-page .cc-topbar__inner {
  max-width: var(--cc-max-width);
  margin: 0 auto;
  padding: 0 var(--cc-gutter);
  padding-bottom: 13px;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
}

/* Centre (not baseline) so ABOUT / CONTACT line up with the burger bars. */
.cc-page .cc-topbar__nav {
  display: flex;
  gap: 40px;
  align-items: center;
}

.cc-page .cc-topbar__menu {
  margin-left: 40px;
}

.cc-page .cc-menu-overlay__inner {
  padding: 140px var(--cc-gutter) 33px;
}

/* --- Visually hidden ---
   For content that has to exist for screen readers and crawlers but has no
   place in the visual design — the <h1> on pages whose hero is a photograph or
   a set of peer headings. Text is real and matches the page subject; this is
   not a display:none hide, so assistive tech still reads it. */
.cc-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Shared Arrow --- */
.cc-about-arrow {
  flex-shrink: 0;
  color: var(--cc-ink-2);
}

/* --- Footer --- */
.cc-footer {
  background: var(--cc-bg);
  width: 100%;
  padding: 30px var(--cc-gutter) 20px;
}

.cc-footer__divider {
  height: 0;
  border-top: 0.5px solid var(--cc-archive);
  margin-bottom: 45px;
}

.cc-footer__content {
  display: grid;
  grid-template-columns: 492fr 246fr 248fr 498fr;
  gap: 0 40px;
  margin-bottom: 210px;
}

.cc-footer__logo {
  padding-right: 20px;
}

.cc-footer__logo img {
  width: 104px;
  height: auto;
  margin-bottom: 24px;
}

.cc-footer__desc {
  font-family: var(--cc-font-body);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.48;
  letter-spacing: 0.28px;
  color: var(--cc-ink-2);
}

.cc-footer__nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cc-footer__nav a {
  font-family: var(--cc-font-body);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--cc-archive);
  text-decoration: none;
}

.cc-footer__about {
  padding-left: 0;
}

.cc-footer__newsletter {
  display: grid;
  grid-template-columns: 492fr 246fr 248fr 498fr;
  gap: 0 40px;
  margin-bottom: 61px;
}

.cc-footer__newsletter-box {
  grid-column: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0.5px solid var(--cc-archive);
  padding: 16px 20px;
  cursor: pointer;
  transition: background 0.3s;
}

.cc-footer__newsletter-box:hover {
  background: var(--cc-dark-parchment);
  border-color: var(--cc-dark-parchment);
}

.cc-footer__newsletter-box:hover .cc-footer__newsletter-label,
.cc-footer__newsletter-box:hover .cc-footer__newsletter-arrow {
  color: var(--cc-bg);
}

.cc-footer__newsletter-label {
  font-family: var(--cc-font-body);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--cc-archive);
  transition: color 0.3s;
}

.cc-footer__newsletter-arrow {
  color: var(--cc-archive);
  transition: color 0.3s;
}

.cc-footer__bottom-divider {
  height: 0;
  border-top: 0.5px solid var(--cc-archive);
  margin-bottom: 24px;
}

.cc-footer__bottom-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.cc-footer__bottom-left,
.cc-footer__bottom-center,
.cc-footer__bottom-right {
  display: flex;
  gap: 20px;
}

.cc-footer__bottom-links span,
.cc-footer__bottom-links a {
  font-family: var(--cc-font-footer);
  font-weight: 500;
  font-size: 8px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--cc-archive);
  text-decoration: none;
}

.cc-footer__bottom-links a:hover {
  color: var(--cc-dark-parchment);
}

/* === Mobile Breakpoint === */
@media (max-width: 768px) {
  :root {
    --cc-gutter: 20px;
  }

  body.cc-custom-page {
    overflow-x: hidden;
  }

  .cc-page .cc-topbar {
    height: 60px;
  }

  .cc-page .cc-topbar__inner {
    grid-template-columns: 1fr auto;
    padding-left: 20px;
    padding-right: 20px;
  }

  .cc-footer__content {
    grid-template-columns: 1fr;
    gap: 30px;
    margin-bottom: 50px;
  }

  .cc-footer__logo img {
    margin: 0 auto 24px;
    display: block;
  }

  .cc-footer__desc {
    text-align: center;
  }

  .cc-footer__nav {
    align-items: center;
  }

  .cc-footer__bottom-links {
    flex-direction: column;
    gap: 16px;
    align-items: center;
  }

  .cc-footer__bottom-left,
  .cc-footer__bottom-center,
  .cc-footer__bottom-right {
    justify-content: center;
  }

  .cc-footer__newsletter {
    margin-left: 0;
  }

  .cc-footer__newsletter-box {
    flex-direction: row;
  }
}
