/*
 * theme.css — design tokens and foundations for leticiapsiquiatra.com.br
 *
 * Loaded after the vendored template stylesheet (style.css) so that rules of
 * equal specificity here win. style.css references the tokens below through
 * var(); the values themselves live only in this file.
 *
 * Contrast targets (WCAG 2.2 AA): 4.5:1 body text, 3:1 large text, UI parts
 * and focus indicators. Ratios quoted in comments were computed against the
 * exact hex values, not eyeballed.
 */

/* ------------------------------------------------------------------ */
/* 1. Fonts                                                           */
/* ------------------------------------------------------------------ */

/* Self-hosted Montserrat (variable, latin subset, covers pt-BR). Replaces the
   Google Fonts request, which loaded Poppins/Raleway while the CSS asked for
   Montserrat, so the site rendered in the system fallback font. */
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/montserrat-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-compatible fallback so text keeps its box while Montserrat loads
   (avoids the layout shift that font-display: swap otherwise causes).
   Overrides are the Montserrat-over-Arial values used by next/font. */
@font-face {
  font-family: "Montserrat Fallback";
  src: local("Arial"), local("Liberation Sans"), local("Helvetica Neue"), local("Helvetica");
  size-adjust: 112.83%;
  ascent-override: 85.79%;
  descent-override: 22.25%;
  line-gap-override: 0%;
}

/* ------------------------------------------------------------------ */
/* 2. Tokens                                                          */
/* ------------------------------------------------------------------ */

:root {
  --font-sans: "Montserrat", "Montserrat Fallback", system-ui, -apple-system,
    "Segoe UI", Roboto, sans-serif;

  /* Brand palette: the original template values, kept by owner decision
     (2026-09-28) after previewing AA-adjusted shades and judging the originals
     more elegant. Known WCAG ratios, so nobody re-measures them: lavender
     #8781a3 is 3.7:1 against white in either direction (AA for large text and
     UI only); gold #e0af6a is 1.75:1 on cream and 2.0:1 under white text.
     Changing a value here changes it everywhere; see [[impeccable-design-plan]]
     in the project memory for the AA-safe alternatives that were tried. */
  --color-primary-light: #8781a3;
  --color-primary: #8781a3;
  --color-primary-deep: #6e6890;   /* template's original link colour and gradient end */
  --color-primary-dark: #5a5479;   /* hover */
  --color-on-primary: #fff;

  --color-accent: #e0af6a;
  --color-accent-text: #e0af6a;    /* gold as text (hero headline, eyebrow) */
  --color-accent-on-dark: #e0af6a; /* gold text on lavender (cookie banner link) */
  --color-on-accent: #fff;         /* text on gold surfaces (footer band, CTA button) */

  --color-text: #595959;           /* 7.0:1 on white */
  --color-heading: #333;
  --color-bg: #fff;
  --color-bg-cream: #f5efe6;
  --color-bg-muted: #fbfbfb;
  --color-border: #ddd;
  --color-focus: var(--color-primary-dark);

  /* Spacing scale, 4px base. */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Type scale, 1.25 ratio from 1rem. */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  --leading-tight: 1.2;
  --leading-snug: 1.35;
  --leading-normal: 1.6;

  --radius-sm: 4px;
  --radius-md: 8px;
}

/* ------------------------------------------------------------------ */
/* 3. Base typography                                                 */
/* ------------------------------------------------------------------ */

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  color: var(--color-heading);
  line-height: var(--leading-snug);
}
h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
  line-height: var(--leading-normal);
}

a {
  font-family: var(--font-sans);
  color: var(--color-primary);
}
a:hover {
  color: var(--color-primary-dark);
}

/* Montserrat's uppercase tracks wide at display sizes; tighten the hero
   headings (desktop h1 and the mobile role=heading paragraph). */
.home-single-slide h1,
.home-single-slide h2,
[role="heading"][aria-level="1"] {
  letter-spacing: -0.02em;
}

/* Montserrat is ~13% wider than the fallback the site used to render in; the
   header contact label wrapped to two lines in its 3-column slot. */
.logo-area .header-info-box p {
  font-size: var(--text-sm);
  white-space: nowrap;
}

/* Bootstrap's vendored file was hand-edited to make .text-primary the brand
   lavender; keep that intent here instead, with the AA-safe shade. */
.text-primary {
  color: var(--color-primary) !important;
}

/* ------------------------------------------------------------------ */
/* 4. Accessibility foundations                                       */
/* ------------------------------------------------------------------ */

/* style.css removes the focus outline on links and buttons. Restore a ring for
   keyboard focus only: inner white ring so it reads on lavender surfaces,
   outer brand ring so it reads on white. */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible,
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 0;
  box-shadow: 0 0 0 6px var(--color-focus);
}

/* Skip link: visible only when focused. */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  z-index: 10000;
  padding: var(--space-2) var(--space-4);
  background: var(--color-primary);
  color: var(--color-on-primary);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-weight: 600;
}
.skip-link:focus {
  top: 0;
}

/* The desktop "Condições Clínicas" dropdown opened on hover only, so keyboard
   users could not reach the condition pages. Mirror the hover rule. */
.mainmenu-area .navbar ul li:focus-within .dropdown-menu {
  top: 115%;
  opacity: 1;
  visibility: visible;
  -webkit-transform: scaleY(1);
  transform: scaleY(1);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  /* Fixed-attachment parallax on the call-to-action band. */
  .section-back-image {
    background-attachment: scroll !important;
  }
  /* WOW.js hides .wow elements until they animate in. */
  .wow {
    visibility: visible !important;
  }
}

