/* =========================================================================
   base.css — design tokens, fonts, reset, layout, header, footer, mobile bar.
   Loaded on every page. Per-page CSS loads conditionally on top of this.

   Palette (fixed, no other colors):
   --brand  #052698  deep blue: headings, accents, footer, hero tones
   --accent #21BCEE  the ONE accent: CTAs, links, hover, underlines only
   --ink    #181818  body text / dark surfaces
   --white  #FFFFFF  backgrounds / text on dark
   ========================================================================= */

/* ---- Self-hosted fonts. Both Manrope and Inter are variable fonts and both
   subsets include Romanian diacritics: latin-ext carries ă/Ă (U+0102-0103)
   and comma-below ș/Ș ț/Ț (U+0218-021B); latin carries â/î. Verified in the
   font cmaps before shipping. ---- */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('../fonts/manrope-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: 'Manrope';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('../fonts/manrope-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/inter-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: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---- Tokens ---- */
:root {
  --brand:       #052698;
  --brand-deep:  #041D73; /* derived shade of --brand for gradients/hover on dark */
  --accent:      #21BCEE;
  --ink:         #181818;
  --white:       #FFFFFF;

  /* Neutrals only (tints of ink/white, no new hues). */
  --gray-50:  #F6F7F9;
  --gray-200: #E4E7EC;
  --gray-500: #5C6470;

  --font-display: 'Manrope', system-ui, -apple-system, sans-serif;
  --font-body:    'Inter', system-ui, -apple-system, sans-serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --container: 1200px;
  --gutter: 24px;
  --radius: 16px;
  --header-h: 104px;
  --header-h-compact: 76px;
  --mobile-bar-h: 60px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html { scroll-padding-top: calc(var(--header-h-compact) + 16px); }
body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img, picture, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); }
p { margin: 0 0 1em; }

/* ---- Typography, fluid with clamp ---- */
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--brand); line-height: 1.12; margin: 0 0 0.5em; font-weight: 800; }
h1 { font-size: clamp(2.1rem, 5.2vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); }
h3 { font-size: clamp(1.15rem, 2.2vw, 1.45rem); }
.muted { color: var(--gray-500); }

/* Kicker: brand blue on light backgrounds (accent cyan on white fails
   contrast); the accent version applies on dark blue sections below. */
.kicker {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 0.75rem;
}
.section--brand .kicker,
.page-hero .kicker,
.hero .kicker { color: var(--accent); }

/* ---- Layout: container + 12-column grid ---- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.grid-12 { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gutter); }
.section { padding-block: clamp(64px, 9vw, 120px); }
.section--tint { background: var(--gray-50); }
.section--center { text-align: center; }
.section--brand { background: linear-gradient(160deg, var(--brand) 0%, var(--brand-deep) 100%); color: var(--white); }
.section--brand h2, .section--brand h3 { color: var(--white); }
.section-head { max-width: 720px; margin-bottom: clamp(2rem, 5vw, 3.5rem); }

/* ---- Accessibility ---- */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: var(--ink);
  padding: 0.6rem 1rem; z-index: 1000; font-weight: 600;
}
.skip-link:focus { left: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.screen-reader-text {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---- Buttons: accent is reserved for CTAs/links/hover only ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.85rem 1.6rem; border-radius: 999px;
  font-family: var(--font-display); font-weight: 700; font-size: 0.95rem;
  text-decoration: none; cursor: pointer; border: 2px solid transparent;
  transition: transform 0.2s var(--ease-out), background-color 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.btn--accent { background: var(--accent); color: var(--ink); }
.btn--outline { border-color: var(--accent); color: var(--brand); background: transparent; }
.section--brand .btn--outline, .hero .btn--outline { color: var(--white); }
.btn--text {
  padding: 0; border: 0; border-radius: 0; background: none; color: var(--brand);
  text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 5px;
}

/* ---- Header: sticky, compacts on scroll (is-compact set by main.js) ---- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  transition: box-shadow 0.25s;
}
.site-header.is-compact { box-shadow: 0 4px 24px rgba(24, 24, 24, 0.08); }
.site-header__inner {
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center;
  gap: 1.25rem; min-height: var(--header-h);
  transition: min-height 0.25s var(--ease-out);
}
.site-header.is-compact .site-header__inner { min-height: var(--header-h-compact); }
.site-header__brand { display: flex; align-items: center; gap: 0.65rem; text-decoration: none; min-width: 0; }
/* SVG wordmark (assets/img/logo.svg, stacked 2-line, brand accent + white G).
   Height animates with the compact header; width follows the intrinsic
   1648:687 ratio. */
.site-header__logo {
  display: block; height: 64px; width: auto;
  transition: height 0.25s var(--ease-out);
}
.site-header.is-compact .site-header__logo { height: 52px; }
/* WP custom-logo override (if one is ever set in the Customizer). */
.site-header__brand .custom-logo { display: block; max-height: 64px; width: auto; }
.site-nav { justify-self: end; }
.site-nav__menu { list-style: none; display: flex; gap: 1.6rem; margin: 0; padding: 0; }
.site-nav__menu a {
  text-decoration: none; color: var(--ink);
  font-family: var(--font-display); font-weight: 600; font-size: 0.95rem;
  padding-block: 0.35rem; border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.site-nav__toggle { display: none; background: none; border: 0; padding: 0.5rem; flex-direction: column; gap: 5px; cursor: pointer; }
.site-nav__toggle span { width: 24px; height: 2px; background: var(--ink); display: block; transition: transform 0.2s, opacity 0.2s; }

/* ---- Footer (deep blue) ---- */
.site-footer { background: var(--brand-deep); color: var(--white); padding-block: clamp(3rem, 6vw, 4.5rem) 1.5rem; }
.site-footer a { color: var(--white); text-decoration: none; }
.site-footer a:focus-visible { outline-color: var(--accent); }
.site-footer__inner { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem; }
.site-footer__logo { display: block; height: 56px; width: auto; margin-bottom: 1rem; }
.site-footer__name { font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; margin: 0 0 0.2em; }
.site-footer__spec { color: var(--accent); font-weight: 600; margin: 0 0 1em; }
.site-footer__cities { margin: 0; opacity: 0.85; }
.site-footer__heading {
  font-family: var(--font-display); font-weight: 700; font-size: 0.82rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin: 0 0 1rem;
}
.site-footer__contact, .site-footer__social { display: grid; gap: 0.5rem; align-content: start; }
.site-footer__legal { margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid rgba(255, 255, 255, 0.18); font-size: 0.85rem; opacity: 0.85; }
.site-footer__legal p { margin: 0; }
.site-footer__legal a { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }

/* ---- Sticky mobile bar: call + WhatsApp. Desktop: hidden. ---- */
.mobile-bar {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  height: var(--mobile-bar-h);
  background: var(--white); border-top: 1px solid var(--gray-200);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.mobile-bar__btn {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  flex: 1; height: 100%;
  font-family: var(--font-display); font-weight: 700; font-size: 0.95rem;
  text-decoration: none;
}
.mobile-bar__btn--call { background: var(--brand); color: var(--white); }
.mobile-bar__btn--wa { background: var(--accent); color: var(--ink); }
.mobile-bar__icon { flex: 0 0 auto; }

/* ---- Cards (shared card base used by services/locations) ---- */
.card {
  background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius);
  padding: clamp(1.4rem, 3vw, 2rem);
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out), border-color 0.25s;
}

/* ---- Contact cards (shared by the Acasă contact section and the dedicated
   Contact page since 1.3.0) ---- */
.contact-card { display: grid; gap: 0.25rem; text-decoration: none; padding: 1.25rem 1.4rem; }
.contact-card__label {
  font-family: var(--font-display); font-weight: 700; font-size: 0.78rem;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--gray-500);
}
.contact-card__value { font-family: var(--font-display); font-weight: 700; color: var(--brand); overflow-wrap: anywhere; }

/* ---- Page hero (shared by Servicii and Programări) ---- */
.page-hero {
  background: linear-gradient(160deg, var(--brand) 0%, var(--brand-deep) 100%);
  color: var(--white);
  padding-block: clamp(56px, 8vw, 96px);
}
.page-hero h1 { color: var(--white); max-width: 20ch; }
.page-hero__lead { max-width: 60ch; margin: 0; opacity: 0.9; }

/* ---- Service cards (shared by Acasă and Servicii) ---- */
.service-card { display: flex; flex-direction: column; }
.service-card__num {
  font-family: var(--font-display); font-weight: 800; font-size: 0.9rem;
  color: var(--accent); letter-spacing: 0.1em; margin-bottom: 0.75rem;
}
.service-card h3, .service-card__title { margin-bottom: 0.6em; }
.service-card__title { font-size: clamp(1.15rem, 2.2vw, 1.45rem); }
.service-card__list { margin: 0; padding: 0 0 0 1.1rem; display: grid; gap: 0.5rem; }
.service-card__list li::marker { color: var(--accent); }

.section-cta { margin-top: clamp(2rem, 5vw, 3rem); margin-bottom: 0; }

/* ---- Scroll reveal: the hidden start-state applies only when JS runs, so
   the no-JS page is complete and visible. ---- */
.js-enabled .reveal { opacity: 0; transform: translate3d(0, 24px, 0); }
/* Directional variants for alternating sections. 16px stays inside the
   smallest gutter (18px at 480px), so a hidden reveal--right element can
   never push the page into horizontal overflow. */
.js-enabled .reveal--left { transform: translate3d(-16px, 0, 0); }
.js-enabled .reveal--right { transform: translate3d(16px, 0, 0); }
.js-enabled .reveal.is-visible {
  opacity: 1; transform: translate3d(0, 0, 0);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
  /* Cascade for card grids: per-item delay set via nth-child in page CSS.
     Kept small (≤ 270ms) so a card revealed on its own never feels stuck. */
  transition-delay: var(--du-stagger, 0s);
}

/* ---- Accent underline that draws itself under kicker'd headings when the
   section reveals. Full-width by default, so the no-JS page shows the
   finished underline; the scaleX(0) start-state only applies while JS is
   running and the reveal has not fired yet. ---- */
.reveal .kicker + h2::after {
  content: "";
  display: block;
  width: 56px; height: 3px;
  margin-top: 0.45em;
  background: var(--accent);
  border-radius: 2px;
  transform-origin: left center;
  transition: transform 0.7s var(--ease-out) 0.35s;
}
.js-enabled .reveal:not(.is-visible) .kicker + h2::after { transform: scaleX(0); }

/* ---- Generic page content (page.php) ---- */
.page-content { max-width: 760px; }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .site-nav__menu { gap: 1.1rem; }
}
@media (max-width: 768px) {
  :root { --header-h: 80px; --header-h-compact: 68px; }
  .site-header__inner { grid-template-columns: auto 1fr auto; }
  .site-header__logo { height: 50px; }
  .site-header.is-compact .site-header__logo { height: 42px; }
  .site-header__cta { display: none; }
  .site-nav__toggle { display: flex; justify-self: end; }
  .site-nav {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--white); border-bottom: 1px solid var(--gray-200);
    padding: 1rem var(--gutter) 1.5rem;
  }
  .site-header.is-open .site-nav { display: block; }
  .site-header.is-open .site-nav__toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .site-header.is-open .site-nav__toggle span:nth-child(2) { opacity: 0; }
  .site-header.is-open .site-nav__toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .site-nav__menu { flex-direction: column; gap: 0.25rem; }
  .site-nav__menu a { display: block; padding: 0.6rem 0; font-size: 1.05rem; border-bottom: 0; }
  .site-footer__inner { grid-template-columns: 1fr; gap: 2rem; }
  .mobile-bar { display: flex; }
  /* Keep content and footer clear of the fixed bar. */
  body { padding-bottom: calc(var(--mobile-bar-h) + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 480px) {
  :root { --gutter: 18px; }
}

/* ---- Hover states only for real pointers; accent used for hover ---- */
@media (hover: hover) and (pointer: fine) {
  /* Gentle lift on the primary CTA: transform + shadow only, with a press
     state so the button feels physical without being flashy. */
  .btn--accent:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 10px 24px rgba(33, 188, 238, 0.35); }
  .btn--accent:active { transform: translateY(-1px) scale(0.99); box-shadow: 0 4px 12px rgba(33, 188, 238, 0.2); }
  .btn--outline:hover { background: var(--accent); color: var(--ink); }
  .btn--text:hover { color: var(--accent); }
  .site-nav__menu a:hover { color: var(--brand); border-bottom-color: var(--accent); }
  .site-footer a:hover { color: var(--accent); }
  .card:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(5, 38, 152, 0.10); border-color: var(--accent); }
  .contact-card:hover .contact-card__value { color: var(--accent); }
}

/* ---- Reduced motion: an off switch, not a slowdown ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .js-enabled .reveal,
  .js-enabled .reveal--left,
  .js-enabled .reveal--right { opacity: 1; transform: none; }
  /* Underline in its final drawn state, even if JS never adds .is-visible. */
  .js-enabled .reveal:not(.is-visible) .kicker + h2::after { transform: none; }
}
