/*
 * Nucleul editorial claudiabenea.ro — design system pe tokens --cb-* (tema din
 * admin) + scara tipografica EXACTA din specificatia ClaudeDesign (Turul 7,
 * "Valori exacte, testate pe romana"). Mobile-first 380px; fara animatii,
 * fara canvas, fara JS obligatoriu: "hartia apartine citirii".
 *
 * Reguli mostenite din spec:
 *  - spatiere pe scara de 4px: 4 8 12 16 20 24 32 44 64; margine laterala 20px
 *  - tinte de atingere: minim 44px, standard 48px, CTA principal 52px
 *  - numere: tabular-nums, mii cu spatiu fin, virgula zecimala (se fac in PHP)
 *  - display >40px cere line-height minim 1,08 (coliziuni Î cu ș/ț)
 *  - sub 14px nu se foloseste Newsreader (virgula diacriticelor devine invizibila)
 *  - text curent max 68 caractere pe rand
 */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body.cb-editorial {
  margin: 0;
  overflow-x: clip; /* hero-ul full-bleed foloseste 100vw (include scrollbar) */
  background: var(--cb-paper);
  color: var(--cb-ink);
  font-family: var(--cb-font-text);
  font-size: 17px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
}

/* ---- containere ---- */
.cb-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px; /* marginea laterala constanta din spec */
}
.cb-wrap--wide { max-width: 960px; }

/* ---- tipografie: FAMILIA 01 Newsreader ---- */
.cb-display {
  font-family: var(--cb-font-display);
  font-weight: 300;
  font-size: 32px;         /* mobil 32/1,08 */
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--cb-petrol);
  margin: 0;
}
.cb-title {
  font-family: var(--cb-font-display);
  font-weight: 300;
  font-size: 27px;         /* mobil 27/1,12 */
  line-height: 1.12;
  color: var(--cb-petrol);
  margin: 0;
}
.cb-intro {
  font-family: var(--cb-font-display);
  font-weight: 300;
  font-size: 20px;
  line-height: 1.34;
  color: var(--cb-deep);
  margin: 0;
}
@media (min-width: 700px) {
  .cb-display { font-size: 44px; line-height: 1.08; } /* regula: >40px => lh minim 1,08 */
  .cb-title { font-size: 32px; line-height: 1.08; }
}

/* ---- tipografie: FAMILIA 02 Archivo ---- */
.cb-body p, .cb-body ul, .cb-body ol { max-width: 68ch; }
.cb-secondary {
  font-size: 15px;
  line-height: 1.5;
  color: var(--cb-deep);
}
.cb-label {
  font-weight: 600;
  font-size: 13px;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

/* ---- tipografie: FAMILIA 03 IBM Plex Mono ---- */
.cb-hud {
  font-family: var(--cb-font-mono);
  font-weight: 400;
  font-size: 22px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.cb-annot {
  font-family: var(--cb-font-mono);
  font-weight: 400;
  font-size: 11px;
  line-height: 1.5;
  color: var(--cb-deep);
}
.cb-kicker {
  font-family: var(--cb-font-mono);
  font-weight: 500;
  font-size: 9px;
  line-height: 1.2;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cb-deep);
}
.cb-mono-cell {
  font-family: var(--cb-font-mono);
  font-weight: 400;
  font-size: 12px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* ---- linkuri si butoane: albastrul = DOAR accent apa ---- */
a { color: var(--cb-water); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--cb-water-deep); }

.cb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  font-family: var(--cb-font-text);
  font-weight: 500;
  font-size: 15px;
  line-height: 1;
  color: var(--cb-paper);
  background: var(--cb-water);
  border: 0;
  text-decoration: none;
  cursor: pointer;
}
.cb-btn:hover { background: var(--cb-water-deep); color: var(--cb-paper); }
.cb-btn--primary { min-height: 52px; }
.cb-btn--ghost {
  background: transparent;
  color: var(--cb-ink);
  box-shadow: inset 0 0 0 1px var(--cb-muted);
}
.cb-btn--ghost:hover { background: var(--cb-surface); color: var(--cb-ink); }

/* ---- header / footer editorial ----
 * sticky pe toate paginile; logo stanga / meniu centru / social+cautare dreapta.
 * varianta --overlay (homepage cu hero video): transparent peste hero, text alb,
 * devine hartie la scroll (clasa .is-solid pusa de JS-ul din layout). */
.cb-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--cb-surface-alt);
  background: var(--cb-paper);
  transition: background 0.25s ease, border-color 0.25s ease;
}
.cb-header__in {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding-top: 8px;
  padding-bottom: 8px;
}
.cb-wordmark {
  justify-self: start;
  font-family: var(--cb-font-display);
  font-weight: 400;
  font-size: 20px;
  color: var(--cb-petrol);
  text-decoration: none;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.cb-wordmark:hover { color: var(--cb-petrol); }
.cb-nav { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.cb-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  font-size: 15px;
  font-weight: 500;
  color: var(--cb-ink);
  text-decoration: none;
}
.cb-nav a:hover { color: var(--cb-water); }
.cb-nav a.active { color: var(--cb-water); box-shadow: inset 0 -2px 0 var(--cb-water); }

.cb-actions {
  position: relative;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 2px;
}
.cb-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--cb-ink);
  cursor: pointer;
  list-style: none; /* summary */
}
.cb-icon-btn::-webkit-details-marker { display: none; }
.cb-icon-btn:hover { color: var(--cb-water); }

/* cautarea: <details> fara JS; formularul cade sub header, aliniat dreapta */
.cb-search { position: static; }
.cb-search__form {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: flex;
  gap: 8px;
  padding: 12px;
  background: var(--cb-paper);
  border: 1px solid var(--cb-surface-alt);
  box-shadow: 0 8px 24px rgba(12, 35, 31, 0.12);
}
.cb-search__input {
  width: min(260px, 60vw);
  min-height: 48px;
  padding: 0 12px;
  font-family: var(--cb-font-text);
  font-size: 15px;
  color: var(--cb-ink);
  background: var(--cb-paper);
  border: 1px solid var(--cb-muted);
}
.cb-search__input:focus { outline: 2px solid var(--cb-water); outline-offset: -1px; }

/* pe ecrane inguste meniul coboara pe randul doi, scrollabil orizontal */
@media (max-width: 899px) {
  .cb-header__in {
    grid-template-columns: 1fr auto;
    grid-template-areas: 'brand actions' 'nav nav';
    row-gap: 0;
  }
  .cb-wordmark { grid-area: brand; }
  .cb-actions { grid-area: actions; }
  .cb-nav {
    grid-area: nav;
    min-width: 0; /* altfel min-content-ul meniului umfla grid-ul peste viewport */
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .cb-nav a { white-space: nowrap; }
}

/* header transparent peste hero-ul video (doar cu .cb-header--overlay);
 * fixed, nu sticky: hero-ul incepe de la y=0 si video-ul curge sub header */
.cb-header--overlay { position: fixed; left: 0; right: 0; }
.cb-header--overlay:not(.is-solid) {
  background: transparent;
  border-color: transparent;
}
.cb-header--overlay:not(.is-solid) .cb-wordmark,
.cb-header--overlay:not(.is-solid) .cb-nav a,
.cb-header--overlay:not(.is-solid) .cb-icon-btn {
  color: #F4F8F3;
  text-shadow: 0 1px 8px rgba(12, 35, 31, 0.35);
}
.cb-header--overlay:not(.is-solid) .cb-nav a:hover,
.cb-header--overlay:not(.is-solid) .cb-icon-btn:hover { color: #FFFFFF; }
.cb-header--overlay:not(.is-solid) .cb-nav a.active {
  color: #FFFFFF;
  box-shadow: inset 0 -2px 0 #FFFFFF;
}

.cb-footer {
  margin-top: 64px;
  border-top: 1px solid var(--cb-surface-alt);
  padding: 32px 0 44px;
}

/* ---- hero video full-bleed (homepage) ----
 * sectiunea sparge containerul .cb-wrap si acopera tot viewport-ul; posterul
 * sta ca background sub video (fallback + prefers-reduced-motion). */
.cb-hero {
  position: relative;
  width: 100vw;
  margin: 0 calc(50% - 50vw);
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: url('/video/hero-poster.jpg') center / cover no-repeat var(--cb-petrol);
}
.cb-hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cb-hero__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(15, 49, 56, 0.45) 0%,
    rgba(15, 49, 56, 0.10) 32%,
    rgba(15, 49, 56, 0.06) 55%,
    rgba(12, 35, 31, 0.68) 100%
  );
}
.cb-hero__content {
  position: relative;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 140px 20px 72px;
}
.cb-hero__content .cb-kicker { color: rgba(244, 248, 243, 0.85); }
.cb-hero__content .cb-display { color: #F4F8F3; max-width: 15ch; }
.cb-hero__content .cb-intro { color: rgba(244, 248, 243, 0.92); max-width: 46ch; }
.cb-btn--ghost-light {
  background: transparent;
  color: #F4F8F3;
  box-shadow: inset 0 0 0 1px rgba(244, 248, 243, 0.65);
}
.cb-btn--ghost-light:hover { background: rgba(244, 248, 243, 0.14); color: #FFFFFF; }
@media (prefers-reduced-motion: reduce) {
  .cb-hero__video { display: none; }
}

/* ---- sectiuni si carduri de continut ---- */
.cb-section { margin-top: 44px; }
.cb-card {
  background: var(--cb-surface);
  padding: 20px;
}
.cb-hr { border: 0; border-top: 1px solid var(--cb-surface-alt); margin: 32px 0; }

/* ---- tabelul buletinului / comparatorului: cifre la dreapta, zero bare ---- */
.cb-table { width: 100%; border-collapse: collapse; }
.cb-table th {
  text-align: left;
  font-family: var(--cb-font-mono);
  font-weight: 500;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cb-deep);
  padding: 8px 0;
  border-bottom: 1px solid var(--cb-muted);
}
.cb-table td {
  padding: 10px 0;
  border-bottom: 1px solid var(--cb-surface-alt);
  font-size: 15px;
}
.cb-table td.num {
  font-family: var(--cb-font-mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

/* ---- amprenta minerala (SVG 5b) ---- */
.cb-fingerprint { display: block; }
.cb-fingerprint-legend { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; }
.cb-fingerprint-legend dt {
  font-family: var(--cb-font-mono);
  font-size: 11px;
  color: var(--cb-deep);
  margin: 0;
}
.cb-fingerprint-legend dd { font-size: 13px; margin: 0; color: var(--cb-ink); }
.cb-fingerprint-disclaimer {
  font-family: var(--cb-font-display);
  font-weight: 300;
  font-size: 20px;
  line-height: 1.34;
  color: var(--cb-petrol);
  margin: 12px 0 0;
}

/* ---- formulare (contact): 48px, subliniere groasa la focus, fundal deschis ---- */
.cb-field { margin-bottom: 20px; }
.cb-field label { display: block; margin-bottom: 8px; }
.cb-field input[type="text"],
.cb-field input[type="email"],
.cb-field textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  font-family: var(--cb-font-text);
  font-size: 15px;
  color: var(--cb-ink);
  background: var(--cb-surface);
  border: 0;
  border-bottom: 2px solid var(--cb-muted);
  border-radius: 0;
}
.cb-field textarea { min-height: 120px; line-height: 1.5; resize: vertical; }
.cb-field input:focus, .cb-field textarea:focus {
  outline: none;
  border-bottom: 3px solid var(--cb-water);
}
/* motivul ca butoane radio-pastila, nu dropdown */
.cb-choice { display: flex; flex-wrap: wrap; gap: 8px; }
.cb-choice label {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  background: var(--cb-surface);
  font-size: 15px;
  cursor: pointer;
  margin: 0;
}
.cb-choice input { position: absolute; opacity: 0; }
.cb-choice input:checked + span { color: var(--cb-paper); }
.cb-choice label:has(input:checked) { background: var(--cb-petrol); color: var(--cb-paper); }

/* ---- liste blog / catalog ---- */
.cb-list { list-style: none; margin: 0; padding: 0; }
.cb-list li { border-bottom: 1px solid var(--cb-surface-alt); }
.cb-list a {
  display: block;
  padding: 16px 0;
  text-decoration: none;
  color: var(--cb-ink);
}
.cb-list a:hover .cb-list__title { color: var(--cb-water); }
.cb-list__title {
  font-family: var(--cb-font-display);
  font-weight: 400;
  font-size: 20px;
  line-height: 1.3;
  color: var(--cb-petrol);
}

/* ---- utilitare de spatiere (scara de 4px din spec) ---- */
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; } .mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; } .mt-44 { margin-top: 44px; } .mt-64 { margin-top: 64px; }

/* ---- Calatoria I (pagina statica a flagship-ului) ---- */
.cb-journey-frame {
  margin-top: 64px;
  padding: 32px 0;
}
.cb-journey-frame--dark {
  background: var(--cb-petrol);
  color: var(--cb-paper);
  margin-left: -20px;
  margin-right: -20px;
  padding: 32px 20px 44px;
}
.cb-journey-frame--dark .cb-kicker { color: var(--cb-surface); }
.cb-journey-frame--dark .cb-annot { color: var(--cb-muted); }
.cb-journey-frame--dark .cb-journey-phrase { color: var(--cb-paper); }
.cb-journey-phrase {
  font-family: var(--cb-font-display);
  font-weight: 300;
  font-size: 27px;
  line-height: 1.16;
  color: var(--cb-petrol);
  max-width: 22ch;
  margin: 24px 0 0;
}
.cb-journey-hud { display: flex; gap: 32px; flex-wrap: wrap; margin-top: 24px; }
.cb-journey-hud > div { display: flex; flex-direction: column; gap: 4px; }
.cb-journey-frame--dark .cb-journey-hud .cb-hud { color: var(--cb-paper); }

/* aparitie la scroll — progresiv (view-timeline), fara JS; fallback = vizibil */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .cb-journey-frame > * {
      animation: cb-frame-in linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 40%;
    }
    @keyframes cb-frame-in {
      from { opacity: 0; transform: translateY(12px); }
      to { opacity: 1; transform: none; }
    }
  }
}

/* ---- motion-ul carotei (homepage) — DOAR cu preferinta de miscare activa;
   varianta statica ramane cea canonica (indexata, reduced-motion) ---- */
@media (prefers-reduced-motion: no-preference) {
  /* pulsul lent al firului de apa: opacitate .5 -> 1, 4s (din spec 2a "Viu") */
  .cb-carota-water { animation: cb-water-pulse 4s ease-in-out infinite; }
  @keyframes cb-water-pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
  }
  /* etichetele intra decalat, cate una pe strat (o singura data, la incarcare) */
  .cb-carota-label { opacity: 0; animation: cb-label-in 0.6s ease-out forwards; }
  .cb-carota-label:nth-of-type(1) { animation-delay: 0.2s; }
  .cb-carota-label:nth-of-type(2) { animation-delay: 0.5s; }
  .cb-carota-label:nth-of-type(3) { animation-delay: 0.8s; }
  .cb-carota-label:nth-of-type(4) { animation-delay: 1.1s; }
  .cb-carota-label:nth-of-type(5) { animation-delay: 1.4s; }
  @keyframes cb-label-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

/* continutul migrat din WP (body-ul articolelor) */
.cb-prose img, .cb-prose iframe, .cb-prose video { max-width: 100%; height: auto; }
.cb-prose figure { margin: 24px 0; }
