/* =========================================================
   Enxoval.pt "Casa" - base
   Fonts, type, links, buttons, forms, tables, FAQ, post blocks, focus, motion.
   Colour values live in tokens.css only.
   Fonts are self-hosted: Lora 500 and Nunito Sans (OFL licence texts are in assets/fonts/).
   ========================================================= */

/* ---------- 1. Fonts ----------
   Lora 500 (headings, subtitles) and Nunito Sans 400-700 (text). Self-hosted, latin subset (OFL texts in assets/fonts/).
   Lora files are static Medium: the 400-700 range on the face makes every heading weight use the 500 glyphs (no faux bold).
   Nunito Sans is variable: the 400-700 range clamps any other weight into the allowed set. No Nunito Sans italic file:
   body italics are synthesized, as today (TYPE-SPEC.md section 2).
   The "Fallback" faces are local system fonts scaled to the metrics of the web font, so the swap does not move text (CLS). */
@font-face {
  font-family: 'Lora';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/lora-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Lora';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/lora-500-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Nunito Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/nunito-sans-wght-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Metric-matched fallbacks (fontTools, weighted by the site's own text; evidence/drift-and-metrics.txt). */
@font-face {
  font-family: 'Lora Fallback';
  src: local('Georgia');
  size-adjust: 105.46%;
  ascent-override: 95.39%;
  descent-override: 25.98%;
  line-gap-override: 0%;
}
@font-face {
  font-family: 'Lora Fallback Android';
  src: local('Noto Serif'), local('NotoSerif');
  size-adjust: 97.15%;
  ascent-override: 103.55%;
  descent-override: 28.20%;
  line-gap-override: 0%;
}
@font-face {
  font-family: 'Nunito Sans Fallback';
  src: local('Arial'), local('ArialMT');
  size-adjust: 99.96%;
  ascent-override: 101.14%;
  descent-override: 35.31%;
  line-gap-override: 0%;
}
@font-face {
  font-family: 'Nunito Sans Fallback Android';
  src: local('Roboto'), local('Roboto-Regular');
  size-adjust: 101.57%;
  ascent-override: 99.54%;
  descent-override: 34.75%;
  line-gap-override: 0%;
}

/* ---------- 2. Type scale (Lora: 56 / 36 mobile, 30 section) ---------- */
:root {
  /* Astra prints html{font-size:112.5%} from its body font option. All rem values here assume 16px. */
  font-size: 100%;
  --fs-h1: clamp(2.25rem, 1.5rem + 3.2vw, 3.5rem);         /* 36px at 360, 56px from about 1000 */
  --fs-title: clamp(1.625rem, 1.3rem + 1.45vw, 2.25rem);   /* page and post titles: 26px at 360, 36px desktop */
  --fs-h2: clamp(1.5rem, 1.25rem + 1.1vw, 1.875rem);       /* 24px mobile, 30px desktop */
  --fs-h3: clamp(1.25rem, 1.15rem + 0.4vw, 1.375rem);      /* 20px mobile, 22px desktop */
  --fs-h4: 1rem;
}

body.enx-v2 {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.enx-v2 .entry-content { font-size: 1rem; color: var(--ink-soft); }
/* :where() keeps this at (0,0,1): component rules such as `.enx-hero__tagline{margin:0}` must win. */
:where(body.enx-v2 .entry-content) p { margin-bottom: 1.1em; }
/* Running text in posts: 17 px (owner decision 2026-11-17, TYPE-SPEC.md section 6). Only paragraphs and plain lists that sit
   directly in the post body; cards, tables, notes, buttons and UI keep their sizes. */
body.enx-v2.single-post .entry-content > p:not([class]),
body.enx-v2.single-post .entry-content > :is(ul, ol):not([class]) > li,
body.enx-v2.single-post .tnc-generated-content > p:not([class]),
body.enx-v2.single-post .tnc-generated-content > :is(ul, ol):not([class]) > li { font-size: 1.0625rem; }

/* Headings without a class get the scale. Headings with a class (cards, titles, hero parts)
   keep their own rules; they still get the serif face and weight 500 from the Astra options. */
body.enx-v2 :is(h1, h2, h3):not([class]) {
  font-family: var(--font-head);
  font-weight: var(--fw-head);
  color: var(--ink);
  letter-spacing: -0.01em;
  text-wrap: balance;
}
/* Astra prints `header.entry-header .entry-title{font-weight:600}` (0,2,1) for post and page titles. Headings are Lora 500;
   the family is set here too, so titles do not depend on Astra's inline CSS. */
body.enx-v2 .entry-header .entry-title,
body.enx-v2 .page-title,
body.enx-v2 .ast-archive-title,
body.enx-v2.archive .ast-archive-description .ast-archive-title { font-family: var(--font-head); font-weight: var(--fw-head); color: var(--ink); letter-spacing: -0.01em; text-wrap: balance; }
/* Archive card titles read their weight from this Astra variable (main.min.css `.entry-title a`). */
body.enx-v2 { --ast-blog-title-font-weight: 500; }
body.enx-v2 .page-sub-title { font-family: var(--font-body); font-weight: 400; }
body.enx-v2 h1:not([class]) { font-size: var(--fs-h1); line-height: 1.08; }
body.enx-v2 h2:not([class]) { font-size: var(--fs-h2); line-height: 1.18; }
body.enx-v2 h3:not([class]) { font-size: var(--fs-h3); line-height: 1.25; }
body.enx-v2 h4:not([class]) { font-family: var(--font-body); font-weight: 700; font-size: var(--fs-h4); line-height: 1.3; letter-spacing: 0; color: var(--ink); }
body.enx-v2 :is(h5, h6):not([class]) {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.8125rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
}
body.enx-v2 h1 em,
body.enx-v2 h2 em { font-style: italic; color: var(--sage); }

/* Page and post titles (Astra markup) are smaller than the home hero */
body.enx-v2 .entry-title,
body.enx-v2 .ast-archive-title,
body.enx-v2 .page-title,
body.enx-v2 .ast-archive-description .ast-archive-title {
  font-size: var(--fs-title);
  line-height: 1.12;
}

body.enx-v2 strong,
body.enx-v2 b { font-weight: 700; }
body.enx-v2 ::selection { background: var(--sage-tint); color: var(--ink); }

/* ---------- 3. Links ---------- */
body.enx-v2 a { text-decoration-thickness: from-font; text-underline-offset: 3px; }
body.enx-v2 .entry-content a:not([class]) {
  color: var(--sage-deep);
  text-decoration: underline;
}
body.enx-v2 .entry-content a:not([class]):hover { color: var(--ink); }
/* Astra prints `.ast-single-post .entry-content a{text-decoration:underline}` (0,2,1), which beats every
   single-class `text-decoration:none` on card, tile and list links. Links that carry a class are components,
   so they are not underlined; plain text links (no class) keep the underline above. */
body.enx-v2 .entry-content a[class]:not(.enx-link-inherit):not(.enx-link-on-dark) { text-decoration: none; }
/* legacy.css sets a font family on `body, .site-content, .ast-container`. The wrappers re-declare it for
   everything inside them, so the body font below is lost. Same wrappers, higher specificity, new font. */
body.enx-v2 .site-content,
body.enx-v2 .ast-container { font-family: var(--font-body); }
/* Page background: mockup uses --surface; white cards then read as cards. */
body.enx-v2,
body.enx-v2 .site-content,
body.enx-v2 #content { background-color: var(--surface); }

/* ---------- 4. Buttons ---------- */
body.enx-v2 .btn-hero-primary,
body.enx-v2 .btn-hero-secondary,
body.enx-v2 .wp-block-button__link,
body.enx-v2 .ast-button,
body.enx-v2 .button,
body.enx-v2 input[type="submit"],
body.enx-v2 input[type="button"],
body.enx-v2 button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 14px 24px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9375rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
body.enx-v2 .btn-hero-primary,
body.enx-v2 .wp-block-button__link,
body.enx-v2 .ast-button,
body.enx-v2 .button,
body.enx-v2 input[type="submit"],
body.enx-v2 input[type="button"],
body.enx-v2 button[type="submit"] {
  background: var(--sage);
  border: 1.5px solid var(--sage);
  color: var(--white);
  box-shadow: none;
}
body.enx-v2 .btn-hero-primary:hover,
body.enx-v2 .wp-block-button__link:hover,
body.enx-v2 .ast-button:hover,
body.enx-v2 .button:hover,
body.enx-v2 input[type="submit"]:hover,
body.enx-v2 input[type="button"]:hover,
body.enx-v2 button[type="submit"]:hover {
  background: var(--sage-deep);
  border-color: var(--sage-deep);
  color: var(--white);
}
body.enx-v2 .btn-hero-secondary {
  background: transparent;
  border: 1.5px solid color-mix(in srgb, var(--ink) 18%, var(--line));
  color: var(--ink);
  box-shadow: none;
}
body.enx-v2 .btn-hero-secondary:hover {
  background: var(--sage-tint);
  border-color: var(--sage);
  color: var(--ink);
}

/* ---------- 5. Forms ---------- */
body.enx-v2 input[type="text"],
body.enx-v2 input[type="email"],
body.enx-v2 input[type="url"],
body.enx-v2 input[type="password"],
body.enx-v2 input[type="search"],
body.enx-v2 input[type="number"],
body.enx-v2 input[type="tel"],
body.enx-v2 select,
body.enx-v2 textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  min-height: 44px;
  padding: 10px 16px;
  box-shadow: none;
}
body.enx-v2 textarea { min-height: 120px; }
body.enx-v2 input::placeholder,
body.enx-v2 textarea::placeholder { color: var(--muted); opacity: 1; }
body.enx-v2 input[type="text"]:focus,
body.enx-v2 input[type="email"]:focus,
body.enx-v2 input[type="url"]:focus,
body.enx-v2 input[type="password"]:focus,
body.enx-v2 input[type="search"]:focus,
body.enx-v2 input[type="number"]:focus,
body.enx-v2 input[type="tel"]:focus,
body.enx-v2 select:focus,
body.enx-v2 textarea:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 3px var(--sage-tint);
  outline: none;
}
body.enx-v2 label { font-weight: 600; color: var(--ink); }
body.enx-v2 input[type="checkbox"],
body.enx-v2 input[type="radio"] { accent-color: var(--sage); }

/* ---------- 6. Tables ---------- */
body.enx-v2 .comparison-table-wrap {
  overflow-x: auto;
  margin: 30px 0;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: none;
}
body.enx-v2 .enxoval-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
  border: 0;
}
body.enx-v2 .enxoval-table th {
  background: var(--sage-tint);
  color: var(--ink);
  text-align: left;
  padding: 14px 16px;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 0;
}
body.enx-v2 .enxoval-table td {
  padding: 14px 16px;
  color: var(--ink-soft);
  font-size: 0.9375rem;
  border: 0;
  border-bottom: 1px solid var(--line);
}
body.enx-v2 .enxoval-table tr:last-child td { border-bottom: 0; }
body.enx-v2 .enxoval-table tbody tr:nth-child(even) td { background: var(--surface); }

/* ---------- 7. FAQ ---------- */
body.enx-v2 .enxoval-faq details {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0;
  margin-bottom: 10px;
}
body.enx-v2 .enxoval-faq summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  padding: 14px 18px;
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
}
body.enx-v2 .enxoval-faq summary::-webkit-details-marker { display: none; }
body.enx-v2 .enxoval-faq summary::after {
  content: "+";
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--sage-tint);
  color: var(--sage-deep);
  font-weight: 700;
  font-size: 1.125rem;
  line-height: 1;
}
body.enx-v2 .enxoval-faq details[open] summary::after { content: "\2212"; }
body.enx-v2 .enxoval-faq .enxoval-faq-answer {
  margin: 0;
  padding: 0 18px 16px;
  color: var(--ink-soft);
  font-size: 0.9688rem;
  line-height: 1.7;
}

/* ---------- 8. Post blocks (42 posts use these classes; no markup change) ---------- */
body.enx-v2 .review-box-container { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 30px 0; }
@media (max-width: 760px) { body.enx-v2 .review-box-container { grid-template-columns: 1fr; } }
body.enx-v2 .review-box {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: none;
}
body.enx-v2 .review-box h4 {
  margin-top: 0;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
body.enx-v2 .review-box li { color: var(--ink-soft); font-size: 0.9375rem; }
body.enx-v2 .review-box.pros { background: var(--sage-tint); border-color: var(--sage-mid); }
body.enx-v2 .review-box.pros h4 { color: var(--sage-deep); }
body.enx-v2 .review-box.pros li::before { color: var(--sage-deep); }
body.enx-v2 .review-box.cons { background: var(--sand); border-color: var(--sand-deep); }
body.enx-v2 .review-box.cons h4 { color: var(--ink); }
body.enx-v2 .review-box.cons li::before { color: var(--ink-soft); }

body.enx-v2 .tips-container {
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 6px solid var(--sage);
  border-radius: var(--radius-lg);
  box-shadow: none;
}
body.enx-v2 .tips-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 24px; }
body.enx-v2 .tip-item {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 18px;
}
body.enx-v2 .tip-item h4 { font-family: var(--font-body); font-weight: 700; font-size: var(--fs-h4); text-transform: none; letter-spacing: 0; color: var(--ink); }
body.enx-v2 .tip-item p { color: var(--ink-soft); font-size: 0.9375rem; }

body.enx-v2 .cal-list li { color: var(--ink-soft); }
body.enx-v2 .cal-list li::before { color: var(--sage); }
body.enx-v2 .cal-list strong { color: var(--ink); }
body.enx-v2 .cal-note { color: var(--muted); }

body.enx-v2 .exw-subnote {
  background: var(--sand);
  border: 1px dashed var(--sand-deep);
  border-radius: var(--radius-md);
  color: var(--ink-soft);
}

/* The plugin generated-content sheet redefines the old tokens inside this wrapper. Put the new values back. */
body.enx-v2 .tnc-generated-content {
  --card-bg: var(--white);
  --text-main: var(--ink);
  --text-muted: var(--muted);
  --accent-red: var(--sage);
  --accent-red-light: var(--sage-tint);
  --radius-card: var(--radius-lg);
  --radius-btn: var(--radius-pill);
  --shadow-soft: 0 4px 20px rgb(46 50 45 / 0.06);
  --verdict-bg: var(--sage-tint);
  --verdict-text: var(--sage-deep);
  color: var(--ink-soft);
}
body.enx-v2 .tnc-generated-content .comparison-table-wrap { box-shadow: none; }

/* ---------- 9. Complianz banner (uses its own custom properties on :root) ---------- */
:root:root {
  --cmplz_banner_background_color: var(--white);
  --cmplz_banner_border_color: var(--line);
  --cmplz_banner_border_radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) var(--radius-lg);
  --cmplz_text_color: var(--ink);
  --cmplz_hyperlink_color: var(--sage-deep);
  --cmplz_button_accept_background_color: var(--sage);
  --cmplz_button_accept_border_color: var(--sage);
  --cmplz_button_accept_text_color: var(--white);
  --cmplz_button_deny_background_color: var(--white);
  --cmplz_button_deny_border_color: var(--sage);
  --cmplz_button_deny_text_color: var(--sage-deep);
  --cmplz_button_settings_background_color: var(--white);
  --cmplz_button_settings_border_color: var(--line);
  --cmplz_button_settings_text_color: var(--ink);
  --cmplz_button_border_radius: var(--radius-pill) var(--radius-pill) var(--radius-pill) var(--radius-pill);
  --cmplz_slider_active_color: var(--sage);
  --cmplz_slider_inactive_color: var(--sage-mid);
}
body.enx-v2 .cmplz-cookiebanner { font-family: var(--font-body); }
body.enx-v2 .cmplz-cookiebanner .cmplz-btn { min-height: 44px; font-weight: 700; }
body.enx-v2 .cmplz-cookiebanner .cmplz-title { font-weight: 600; } /* Complianz prints 500 */

/* ---------- 10. Focus (keyboard) ---------- */
body.enx-v2 a:focus-visible,
body.enx-v2 button:focus-visible,
body.enx-v2 summary:focus-visible,
body.enx-v2 [tabindex]:focus-visible,
body.enx-v2 input:focus-visible,
body.enx-v2 select:focus-visible,
body.enx-v2 textarea:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

/* ---------- 11. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html:focus-within { scroll-behavior: auto; }
  body.enx-v2 *,
  body.enx-v2 *::before,
  body.enx-v2 *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
