/* ==========================================================================
   Zagrljaj — typography
   Public site only. Nothing here touches /admin.

   Fonts only: no colour, spacing, or layout is changed. Every rule below
   either sets a family, a weight, tracking, or a per-language correction.

   Load this AFTER the Tailwind CDN script so the overrides land.
   ========================================================================== */

:root {
  /* Lora — serif with calligraphic roots. Headings only. Carries the warmth
     and permanence a care home wants; a geometric sans cannot do this. */
  --font-display: 'Lora', 'Iowan Old Style', 'Times New Roman', Georgia, serif;

  /* Manrope — humanist geometric sans, variable 200–800. Everything else.
     Same family as Techenergo, so the two properties read as related. */
  --font-body: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  /* Eyebrow tracking. Loose in Latin, tighter in Cyrillic (see :lang(ru)). */
  --eyebrow-tracking: 0.18em;
}

/* --------------------------------------------------------------------------
   1. Base
   -------------------------------------------------------------------------- */

body {
  font-family: var(--font-body);
  font-optical-sizing: auto;
  /* Real kerning and ligatures; off by default in some engines at small sizes. */
  font-feature-settings: 'kern' 1, 'liga' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* Older eyes read this site. 400 in Manrope at 16px is comfortable;
     the previous 320–360 weights were never real. */
  font-weight: 400;
}

/* Inputs and buttons don't inherit font by default in every browser. */
input, select, textarea, button { font-family: inherit; }

/* --------------------------------------------------------------------------
   2. Headings

   Tailwind's .font-light (300) is below Lora's 400 minimum, so it would be
   clamped anyway — set it explicitly instead of relying on the clamp.
   .tracking-wide is wrong for a serif at display sizes: serifs already
   carry their own rhythm and extra tracking makes them look stretched.
   -------------------------------------------------------------------------- */

h1, h2, h3,
h1.font-light, h2.font-light, h3.font-light {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

h4, h5, h6 {
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: -0.005em;
}

/* Hero headline — the one place a lighter serif weight reads as elegant
   rather than thin, because the size carries it. */
.hero-title-mobile,
h1.hero-title-mobile.font-light {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.12;
}
/* Overrides Tailwind's .tracking-wide on the hero h1. */
h1.tracking-wide { letter-spacing: -0.02em; }

/* --------------------------------------------------------------------------
   3. Eyebrows — the small uppercase label above each section heading.

   These do most of the work in making a page look considered. Wide tracking,
   small size, heavier weight, sans. Matched to the badge spans already in
   the markup (#services-sub-badge, #daily-badge, #facilities-badge, etc).
   -------------------------------------------------------------------------- */

#services-sub-badge, #daily-badge, #facilities-badge, #location-badge,
#about-badge, .hero-philosophy-title {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: var(--eyebrow-tracking);
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   4. Body copy
   -------------------------------------------------------------------------- */

p, li, dd, .schedule-section-text {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: 0;
}

/* The hero philosophy panel sits on video — a hair more weight holds up
   against a moving background. 320 was compensating for a font that was
   never actually loading. */
.hero-philosophy-text {
  font-family: var(--font-body);
  font-weight: 350;
  letter-spacing: 0;
  line-height: 1.55;
}
@media (max-width: 768px) {
  .hero-philosophy-text { font-weight: 400; }
}

/* --------------------------------------------------------------------------
   5. Navigation, buttons, small UI
   -------------------------------------------------------------------------- */

nav a, .nav-link { font-family: var(--font-body); font-weight: 500; letter-spacing: 0.005em; }
button, .btn { font-family: var(--font-body); font-weight: 600; letter-spacing: 0.01em; }

/* The rotating availability ring is SVG text — it needs the family named
   directly, inherit doesn't reach it. */
.availability-ring text {
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 1.2px;
}

/* Phone numbers, dates, prices — tabular figures stop digits from jittering. */
.zf-day, .tabular, time, [href^="tel:"] {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

/* Admission form keeps the body face at a comfortable size — this form is
   filled in by relatives who are often not young. */
.zf-label { font-family: var(--font-body); font-weight: 500; letter-spacing: 0.01em; }
.zf-input, .zf-opt, .zf-mini-opt { font-family: var(--font-body); font-weight: 400; }

/* --------------------------------------------------------------------------
   6. Per-language corrections

   The part a font picker won't tell you. Both families cover latin,
   latin-ext and cyrillic, so nothing falls back mid-word — but the same
   size does not read the same across scripts.
   -------------------------------------------------------------------------- */

/* Russian. Cyrillic has a taller x-height and more vertical strokes, so it
   reads heavier and wider than Latin at identical settings. Ease off. */
:lang(ru) h1, :lang(ru) h2, :lang(ru) h3 { letter-spacing: -0.005em; }
:lang(ru) .hero-title-mobile { font-size: 0.95em; letter-spacing: 0; }
:lang(ru) #services-sub-badge, :lang(ru) #daily-badge,
:lang(ru) #facilities-badge, :lang(ru) #location-badge,
:lang(ru) .hero-philosophy-title { letter-spacing: 0.12em; }

/* German. "Fürsorge", "Pflegeeinrichtung" — compounds overrun a hero line
   on narrow screens. Let the browser hyphenate rather than shrink type. */
:lang(de) h1, :lang(de) h2 { hyphens: auto; -webkit-hyphens: auto; }

/* Croatian and Slovenian. đ ć č š ž all live in latin-ext, which the font
   link below requests explicitly. Diacritics stack close to the cap line
   at display sizes, so give headings a little more room. */
:lang(hr) h1, :lang(sl) h1, :lang(hr) h2, :lang(sl) h2 { line-height: 1.24; }

/* French. Guillemets and accented capitals (É, À) need the same treatment
   as Latin — no correction required, listed so the set is complete. */

/* --------------------------------------------------------------------------
   7. Motion / accessibility
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  /* Nothing type-related animates, but keep the guard in place. */
}
