/* ============================================================================
   Connected Memories — dedicated immersive editorial article styles.
   Loaded ONLY on the connected-memories template (all selectors are .cm-*
   prefixed, so nothing here touches the rest of the site).
   ========================================================================= */

/* Self-hosted display face (same files the main site uses). */
@font-face { font-family: 'Space Grotesk'; font-style: normal; font-weight: 300 700; font-display: swap; src: url('/fonts/space-grotesk/latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2122, U+2212; }
/* Latin-Extended (Romanian ă ș ț ş ţ …) so diacritics stay in Space Grotesk. */
@font-face { font-family: 'Space Grotesk'; font-style: normal; font-weight: 300 700; font-display: swap; src: url('/fonts/space-grotesk/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; }

:root {
  --cm-bg: #050B12;
  --cm-bg-soft: #0B1724;
  --cm-blue-deep: #0A3C62;
  --cm-blue: #0061A4;
  --cm-blue-soft: #3381B6;
  --cm-gold: #F5B400;
  --cm-text: #EAECEF;
  --cm-text-muted: #BFC9D6;
  --cm-ink: #111827;
  --cm-max: 1180px;
  --cm-narrow: 720px;
  --cm-radius: 28px;
  /* Feather size for the cinematic image mask (fade-to-transparent). UNDO: set to 0. */
  --cm-blend-top: 30%;
  --cm-blend-bottom: 34%;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
/* Kill the native mobile tap flash (the blue-grey square) — the template isn't
   under Tailwind's preflight, so WebKit's default still applied here. Interactive
   elements give their own feedback (:active) instead. */
a, button, summary, input, textarea, label { -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 50% 0%, rgba(0, 97, 164, 0.18), transparent 42rem),
    var(--cm-bg);
  color: var(--cm-text);
  font-family: Inter, "Source Sans 3", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.75;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

.cm-article {
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(5, 11, 18,0) 0%, rgba(5, 11, 18,1) 100%),
    var(--cm-bg);
}

.cm-container { width: min(calc(100% - 40px), var(--cm-max)); margin-inline: auto; }
.cm-container-narrow { width: min(calc(100% - 40px), var(--cm-narrow)); margin-inline: auto; }

/* ---- Slim site chrome (immersive layout) ---- */
.cm-topbar {
  position: absolute; inset-inline: 0; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  width: min(calc(100% - 40px), var(--cm-max)); margin: 1.4rem auto 0;
}
.cm-brand {
  display: inline-flex; align-items: center; gap: .55rem; text-decoration: none;
  color: #fff; font-family: "Space Grotesk", system-ui, sans-serif; font-weight: 800; font-size: 1.12rem; letter-spacing: -0.02em;
}
.cm-brand b { color: #fff; } .cm-brand span { color: #7cc0f5; }
.cm-brand__dot { width: .5rem; height: .5rem; border-radius: 999px; background: var(--cm-gold); box-shadow: 0 0 12px rgba(245,180,0,.7); }
/* Same height as the rest of the site's header logo (configurable via Branding). */
.cm-brand__logo { display: block; height: var(--logo-h-m, 40px); width: auto; max-width: 220px; object-fit: contain; }
@media (min-width: 1024px) { .cm-brand__logo { height: var(--logo-h-d, 50px); } }
.cm-back {
  display: inline-flex; align-items: center; gap: .4rem; text-decoration: none;
  padding: .5rem .9rem; border-radius: 999px; font-size: .8rem; font-weight: 600;
  color: rgba(234,236,239,.85); border: 1px solid rgba(234,236,239,.18);
  background: rgba(8,18,29,.42); backdrop-filter: blur(10px); transition: color .15s, border-color .15s;
}
.cm-back:hover { color: #fff; border-color: rgba(234,236,239,.4); }

.cm-footer {
  background: var(--cm-bg); color: rgba(234,236,239,.5);
  border-top: 1px solid rgba(234,236,239,.08);
  padding-block: 2.4rem; text-align: center; font-size: .84rem;
}
.cm-footer a { color: rgba(234,236,239,.72); text-decoration: none; margin: 0 .6rem; }
.cm-footer a:hover { color: #fff; }
.cm-footer__line { margin-top: .6rem; }

/* ---- HERO ---- */
.cm-hero { position: relative; min-height: 100svh; display: grid; align-items: end; isolation: isolate; overflow: hidden; background: #050B12; }
.cm-hero__image { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.cm-hero__overlay {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(5, 11, 18,0.95) 0%, rgba(5, 11, 18,0.62) 38%, rgba(5, 11, 18,0.28) 75%),
    linear-gradient(0deg, rgba(5, 11, 18,1) 0%, rgba(5, 11, 18,0.08) 46%),
    radial-gradient(circle at 30% 55%, rgba(0, 97, 164, 0.2), transparent 34rem);
}
.cm-hero__content { padding-block: clamp(5rem, 9vw, 9rem); }
.cm-kicker { margin: 0 0 1rem; color: var(--cm-gold); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; }
.cm-hero h1 {
  max-width: 850px; margin: 0;
  font-family: "Space Grotesk", Inter, system-ui, sans-serif;
  font-size: clamp(2.6rem, 6.8vw, 6rem); line-height: 0.95; letter-spacing: -0.07em; color: #fff; text-wrap: balance;
}
.cm-lead { max-width: 680px; margin: 1.6rem 0 0; font-size: clamp(1.15rem, 2vw, 1.55rem); color: var(--cm-text-muted); }
.cm-meta { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 2rem; color: rgba(234, 236, 239, 0.72); font-size: 0.86rem; }
.cm-meta span { padding: 0.42rem 0.72rem; border: 1px solid rgba(234, 236, 239, 0.16); border-radius: 999px; background: rgba(5, 11, 18,0.42); backdrop-filter: blur(10px); }
/* Tag chips in the hero: editorial dark chips with a gold hover. */
.cm-meta--tags span { transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease; cursor: default; }
.cm-meta--tags span:hover { border-color: rgba(245, 180, 0, 0.55); color: var(--cm-text); background: rgba(245, 180, 0, 0.10); }

/* ---- CONTENT ---- */
/* Hierarchy: H2 = "Capitolul N" (small gold marker) · H3 = the chapter title (large). */
.cm-content { background: linear-gradient(180deg, #050B12 0%, #080F19 35%, #050B12 100%); }
.cm-text-block { padding-block: clamp(3.5rem, 7vw, 6.5rem); }
/* Opening gap after the hero: the hero content sits flush to its bottom edge, so
   some air is needed — but the full inter-chapter rhythm (~100px) read as a dark
   void. Give the intro its own smaller top padding across all sizes: ~48px on
   phones/tablets, up to 72px on desktop — breathes, but the article starts sooner.
   Higher specificity than `.cm-text-block` so it wins without a media override. */
.cm-text-block.cm-intro { padding-top: clamp(3rem, 5vw, 4.5rem); }

.cm-text-block h2 {
  margin: 0 0 0.7rem;
  font-family: "Space Grotesk", Inter, system-ui, sans-serif;
  font-size: 0.82rem; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--cm-gold);
}
/* Peer chapters that share one text block (no image between) get breathing room. */
.cm-text-block h2:not(:first-child) { margin-top: clamp(3.5rem, 7vw, 5.5rem); }

.cm-text-block h3 {
  margin: 0 0 1.4rem;
  font-family: "Space Grotesk", Inter, system-ui, sans-serif;
  font-size: clamp(1.9rem, 4.6vw, 3.4rem); line-height: 1.06; letter-spacing: -0.05em; color: #fff; text-wrap: balance;
}

.cm-text-block p { margin: 0 0 1.4rem; font-size: clamp(1.05rem, 1.4vw, 1.2rem); line-height: 1.8; color: rgba(234, 236, 239, 0.84); }
.cm-text-block p strong { color: #fff; }
.cm-intro .cm-container-narrow > p:first-child::first-letter { float: left; padding: 0.14em 0.14em 0 0; font-family: "Space Grotesk", Inter, system-ui, sans-serif; font-size: 5.2rem; line-height: 0.75; color: var(--cm-gold); }

blockquote {
  margin: 3rem 0; padding: 2rem; border-left: 3px solid var(--cm-gold);
  border-radius: 0 var(--cm-radius) var(--cm-radius) 0; background: rgba(234, 236, 239, 0.045); color: #fff;
  font-family: "Space Grotesk", Inter, system-ui, sans-serif; font-size: clamp(1.4rem, 3vw, 2.2rem); line-height: 1.25; letter-spacing: -0.035em;
}
/* Balance the quote card: the inner paragraph's bottom margin left more air below
   the text (~54px) than above (~32px). Drop it so padding reads even, top & bottom.
   Scoped under .cm-text-block to outrank `.cm-text-block p { margin: 0 0 1.4rem }`. */
.cm-text-block blockquote p { margin: 0; }
/* Quote → next contained image: this block already ends in a padded, separated
   quote, so its full bottom padding doubled the gap. Trim only the quote-bearing
   block (via :has) — every other text↔image transition is untouched. */
.cm-text-block:has(blockquote) { padding-bottom: clamp(2.25rem, 4.5vw, 4rem); }

/* ---- IMAGES ---- */
.cm-cinematic { position: relative; margin: 0; }
.cm-cinematic picture { display: block; }
.cm-cinematic img { width: 100%; object-fit: cover; background: #050B12; }
/* Clip the reveal zoom on full-bleed/final figures (contained keep their shadow). */
.cm-fullbleed, .cm-final { overflow: hidden; }
.cm-fullbleed { width: 100vw; margin-left: 50%; transform: translateX(-50%); }
.cm-fullbleed img { min-height: clamp(420px, 70vw, 850px); }
.cm-contained { width: min(calc(100% - 40px), var(--cm-max)); margin: clamp(1rem, 2.5vw, 2rem) auto; }
.cm-contained img { border-radius: var(--cm-radius); box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(234, 236, 239, 0.08); }
.cm-symbol-frame { width: min(calc(100% - 40px), 1040px); }
.cm-final { width: 100vw; margin-left: 50%; transform: translateX(-50%); padding-top: clamp(2rem, 5vw, 5rem); }

/* Cinematic "melt": the image fades to TRANSPARENT at top & bottom (CSS mask),
   revealing the unified page background — a true dissolve, not a colour overlay.
   Caption is a sibling below, so it stays crisp; contained images are untouched. */
.cm-fullbleed picture, .cm-final picture {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 var(--cm-blend-top), #000 calc(100% - var(--cm-blend-bottom)), transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 var(--cm-blend-top), #000 calc(100% - var(--cm-blend-bottom)), transparent 100%);
}

/* CM-004 ("Ferestre către o comunitate") melts a little more; vars cascade into the
   mask. UNDO the whole effect: set --cm-blend-top/bottom to 0 in :root. */
.cm-fullbleed:has(img[src*="CM-004"]) { --cm-blend-top: 42%; --cm-blend-bottom: 46%; }
.cm-final img { min-height: clamp(380px, 56vw, 720px); }
figcaption { width: min(calc(100% - 40px), var(--cm-max)); margin: 0.8rem auto 0; color: rgba(234, 236, 239, 0.42); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; }
.cm-contained figcaption, .cm-symbol-frame figcaption { width: auto; }

/* ---- EPILOGUE ---- */
.cm-epilogue { padding-bottom: clamp(2rem, 4vw, 3.25rem); }
.cm-epilogue h3 { color: var(--cm-gold); }
/* Memorable closer — the last line ("Ne vedem în hub.") reads as a statement. */
.cm-epilogue .cm-container-narrow > p:last-child {
  margin-top: 2.25rem; margin-bottom: 0; color: #fff;
  font-family: "Space Grotesk", Inter, system-ui, sans-serif;
  font-size: clamp(1.5rem, 3vw, 2.2rem); line-height: 1.2; letter-spacing: -0.03em;
}

/* ---- OUTRO: share + next actions ---- */
.cm-outro { width: min(calc(100% - 40px), var(--cm-narrow)); margin: 0 auto; padding-bottom: clamp(7rem, 12vw, 11rem); }
.cm-outro__sep { height: 1px; background: rgba(234, 236, 239, 0.1); margin-bottom: clamp(1.8rem, 4vw, 2.65rem); }

.cm-share__intro { margin: 0 0 1.25rem; color: rgba(234, 236, 239, 0.72); font-size: 1.02rem; }
.cm-share__row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.cm-share__btn {
  display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer;
  padding: 0.58rem 1.05rem; border-radius: 999px; font-size: 0.9rem; font-weight: 600;
  font-family: inherit; text-decoration: none; line-height: 1;
  color: rgba(234, 236, 239, 0.85); background: rgba(234, 236, 239, 0.045);
  border: 1px solid rgba(234, 236, 239, 0.16);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.cm-share__btn:hover, .cm-share__btn:focus-visible {
  color: var(--cm-gold); border-color: rgba(245, 180, 0, 0.5); background: rgba(245, 180, 0, 0.06); outline: none;
}
.cm-share__btn svg { width: 1rem; height: 1rem; flex: none; }
.cm-share__copy.is-copied { color: var(--cm-gold); border-color: rgba(245, 180, 0, 0.5); }

.cm-next { margin-top: clamp(3rem, 6vw, 4.5rem); }
.cm-next__title {
  margin: 0 0 0.6rem; font-family: "Space Grotesk", Inter, system-ui, sans-serif;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--cm-gold);
}
.cm-next__link {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 0.25rem; text-decoration: none; color: #fff;
  border-bottom: 1px solid rgba(234, 236, 239, 0.08);
  font-family: "Space Grotesk", Inter, system-ui, sans-serif;
  font-size: clamp(1rem, 1.7vw, 1.15rem); font-weight: 500; letter-spacing: -0.01em;
  transition: color 0.15s, padding-left 0.15s;
}
.cm-next__link:hover, .cm-next__link:focus-visible { color: var(--cm-gold); padding-left: 0.55rem; outline: none; }
.cm-next__arrow { color: rgba(234, 236, 239, 0.4); transition: transform 0.15s, color 0.15s; }
.cm-next__link:hover .cm-next__arrow, .cm-next__link:focus-visible .cm-next__arrow { color: var(--cm-gold); transform: translateX(4px); }

/* Desktop: tighten the ending so it doesn't feel empty (mobile keeps the base values). */
@media (min-width: 1024px) {
  .cm-outro { padding-bottom: 7.5rem; } /* ~11rem -> 7.5rem, ~32% less space above the footer */
  .cm-next { margin-top: 3.7rem; }      /* ~4.5rem -> 3.7rem, share + next read as one section */
}

/* ---- RESPONSIVE ---- */
@media (max-width: 820px) {
  .cm-hero { min-height: 86svh; }
  .cm-hero__overlay {
    background:
      linear-gradient(0deg, rgba(5, 11, 18,1) 0%, rgba(5, 11, 18,0.52) 52%, rgba(5, 11, 18,0.35) 100%),
      radial-gradient(circle at 50% 60%, rgba(0, 97, 164, 0.22), transparent 24rem);
  }
  .cm-hero__image { object-position: 62% center; }
  .cm-meta { gap: 0.45rem; }
  .cm-fullbleed img, .cm-final img { min-height: 360px; }
  .cm-contained img { border-radius: 18px; }
  blockquote { padding: 1.35rem; }
  .cm-topbar { margin-top: 1rem; }
}

/* Mobile-only typography refinements (phones / small tablets). */
@media (max-width: 768px) {
  /* Fully disable the drop-cap — the giant "Î" broke the first word ("Î" + "nainte"). */
  .cm-intro .cm-container-narrow > p:first-child::first-letter {
    float: none; padding: 0; font-size: inherit; line-height: inherit; color: inherit; font-family: inherit;
  }

  /* Tighter, comfier body for long-form reading. */
  .cm-text-block p { font-size: 1.05rem; line-height: 1.72; }

  /* Large chapter titles: still premium, a touch smaller. */
  .cm-text-block h3 { font-size: clamp(1.55rem, 5.5vw, 1.95rem); line-height: 1.1; }

  /* More legible captions (still not full white). */
  figcaption { color: rgba(234, 236, 239, 0.7); }

  /* Keep the pull-quote premium but compact. */
  blockquote { font-size: 1.25rem; line-height: 1.32; margin: 2rem 0; padding: 1.2rem 1.35rem; }

  /* Contained images (CM-003/005/006): wider, flatter, tighter — editorial, not card. */
  .cm-contained, .cm-symbol-frame { width: calc(100% - 24px); margin-top: 0.25rem; margin-bottom: 0.25rem; }
  /* Softer, more discreet depth on mobile (keep it editorial, less elevated-card). */
  .cm-contained img { border-radius: 13px; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(234, 236, 239, 0.05); }

  /* Full-bleed images (CM-002/004/007): less dark gap before, caption sits closer
     to the next chapter (spacing only — image size unchanged). */
  .cm-fullbleed, .cm-final { margin-top: -0.85rem; }
  .cm-fullbleed + .cm-text-block, .cm-final + .cm-text-block { padding-top: 2.9rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .cm-cinematic img { transition: transform 900ms ease, filter 900ms ease; }
  .cm-cinematic:hover img { transform: scale(1.01); filter: saturate(1.04); }
  .cm-contained:hover img { transform: scale(1.012); }

  /* ---- Subtle scroll reveals (only once JS adds .cm-anim) ---- */
  /* Contained: gentle fade-in + rise as it enters the viewport. */
  .cm-anim .cm-contained {
    opacity: 0; transform: translateY(26px);
    transition: opacity 900ms cubic-bezier(.2, .7, .2, 1), transform 900ms cubic-bezier(.2, .7, .2, 1);
  }
  .cm-anim .cm-contained.is-revealed { opacity: 1; transform: none; }

  /* Full-bleed & final: cinematic settle from a barely-there zoom (on <picture>,
     so it never fights the img hover transform). */
  .cm-anim .cm-fullbleed picture,
  .cm-anim .cm-final picture {
    transform: scale(1.045); transform-origin: center;
    transition: transform 1300ms cubic-bezier(.2, .7, .2, 1); will-change: transform;
  }
  .cm-anim .cm-fullbleed.is-revealed picture,
  .cm-anim .cm-final.is-revealed picture { transform: scale(1); }

  /* Hero: oversized so the JS parallax translate never exposes an edge. */
  .cm-anim .cm-hero__image { top: -12.5%; height: 125%; will-change: transform; }
}

/* ============================================================================
   „Amintiri din rețea" — moderated memories section (from the comments pack,
   adapted to the CM design system: uses --cm-gold/--cm-text tokens).
   ============================================================================ */
.cm-comments {
  --cmc-border: rgba(234, 236, 239, 0.10);
  --cmc-text: rgba(234, 236, 239, 0.86);
  --cmc-muted: rgba(234, 236, 239, 0.58);
  --cmc-soft: rgba(191, 201, 214, 0.72);
  position: relative;
  width: min(calc(100% - 40px), 1080px);
  /* .cm-outro above already ends in a 7–11rem padding, so keep the top gap
     small; give the bottom real air before the footer border. */
  margin: clamp(1rem, 2vw, 2rem) auto clamp(4.5rem, 8vw, 7rem);
  padding: clamp(2rem, 4vw, 3.25rem);
  border: 1px solid var(--cmc-border);
  border-radius: 30px;
  background:
    radial-gradient(circle at 20% 0%, rgba(0, 97, 164, 0.11), transparent 34rem),
    linear-gradient(180deg, rgba(234, 236, 239, 0.048), rgba(234, 236, 239, 0.022));
  box-shadow:
    0 32px 90px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.035);
  overflow: hidden;
}
.cm-comments::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(245, 180, 0, 0.08), transparent 24%),
    radial-gradient(circle at 85% 20%, rgba(51, 129, 182, 0.11), transparent 24rem);
  pointer-events: none;
}
.cm-comments__inner { position: relative; z-index: 1; }
.cm-comments__header { max-width: 760px; }
.cm-comments__eyebrow {
  margin: 0 0 0.75rem;
  color: var(--cm-gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.20em;
  text-transform: uppercase;
}
.cm-comments h2 {
  margin: 0;
  font-family: "Space Grotesk", Inter, system-ui, sans-serif;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.055em;
  color: #fff;
  text-wrap: balance;
}
.cm-comments__lead {
  max-width: 720px;
  margin: 1.1rem 0 0;
  color: var(--cmc-soft);
  font-size: clamp(1rem, 1.35vw, 1.12rem);
  line-height: 1.75;
}
.cm-comments__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: clamp(1.4rem, 3vw, 2.5rem);
  align-items: start;
  margin-top: clamp(1.8rem, 4vw, 3rem);
}
.cm-comments__form-card {
  padding: clamp(1.2rem, 2.4vw, 1.8rem);
  border: 1px solid var(--cmc-border);
  border-radius: 22px;
  background: rgba(5, 11, 18, 0.52);
  backdrop-filter: blur(14px);
}
.cm-comment-form { display: grid; gap: 1.1rem; }
.cm-form-row { display: grid; gap: 1rem; }
.cm-form-row--split { grid-template-columns: 1fr 1fr; }
.cm-field { display: grid; gap: 0.48rem; }
.cm-field label {
  color: rgba(234, 236, 239, 0.72);
  font-size: 0.84rem;
  font-weight: 700;
}
.cm-field input,
.cm-field textarea {
  width: 100%;
  border: 1px solid rgba(234, 236, 239, 0.12);
  border-radius: 15px;
  background: rgba(2, 7, 13, 0.76);
  color: #fff;
  font: inherit;
  font-size: 0.98rem;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}
.cm-field input { min-height: 48px; padding: 0 0.95rem; }
.cm-field textarea {
  resize: vertical;
  min-height: 150px;
  padding: 0.9rem 0.95rem;
  line-height: 1.65;
}
.cm-field input::placeholder,
.cm-field textarea::placeholder { color: rgba(191, 201, 214, 0.42); }
.cm-field input:focus,
.cm-field textarea:focus {
  border-color: rgba(245, 180, 0, 0.52);
  box-shadow: 0 0 0 4px rgba(245, 180, 0, 0.08);
  background: rgba(2, 7, 13, 0.92);
}
.cm-consent {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 0.7rem;
  align-items: start;
  color: rgba(234, 236, 239, 0.66);
  font-size: 0.88rem;
  line-height: 1.55;
}
.cm-consent input { width: 16px; height: 16px; margin-top: 0.18rem; accent-color: var(--cm-gold); }
.cm-comment-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1rem;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.2rem;
}
.cm-comment-submit {
  appearance: none;
  border: 1px solid rgba(245, 180, 0, 0.42);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(245, 180, 0, 0.18), rgba(245, 180, 0, 0.08)),
    rgba(5, 11, 18, 0.68);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  min-height: 44px;
  padding: 0 1.2rem;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}
.cm-comment-submit:hover {
  transform: translateY(-1px);
  border-color: rgba(245, 180, 0, 0.68);
  background:
    linear-gradient(180deg, rgba(245, 180, 0, 0.24), rgba(245, 180, 0, 0.10)),
    rgba(5, 11, 18, 0.82);
}
.cm-comment-note { margin: 0; color: var(--cmc-muted); font-size: 0.82rem; }
.cm-comments__side-note {
  padding: 1.25rem;
  border-left: 2px solid rgba(245, 180, 0, 0.38);
  border-radius: 0 18px 18px 0;
  background: rgba(245, 180, 0, 0.045);
}
.cm-comments__side-note p {
  margin: 0;
  color: rgba(234, 236, 239, 0.74);
  font-size: 0.95rem;
  line-height: 1.7;
}
.cm-comments__list { display: grid; gap: 1rem; margin-top: clamp(2rem, 4vw, 3rem); }
.cm-comments-empty {
  border: 1px dashed rgba(234, 236, 239, 0.16);
  border-radius: 18px;
  background: rgba(5, 11, 18, 0.38);
  padding: 1.1rem 1.25rem;
}
.cm-comments-empty p { margin: 0; color: var(--cmc-muted); font-size: 0.95rem; }
.cm-comment {
  padding: clamp(1rem, 2vw, 1.4rem);
  border: 1px solid var(--cmc-border);
  border-radius: 20px;
  background: rgba(5, 11, 18, 0.44);
}
.cm-comment__header {
  display: flex;
  gap: 1rem;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.cm-comment h3 {
  margin: 0;
  color: #fff;
  font-family: "Space Grotesk", Inter, system-ui, sans-serif;
  font-size: 1.05rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.cm-comment__header p,
.cm-comment time { margin: 0.22rem 0 0; color: var(--cmc-muted); font-size: 0.78rem; }
.cm-comment > p { margin: 0; color: var(--cmc-text); font-size: 0.98rem; line-height: 1.72; }
.cm-comment-alert {
  margin-bottom: 1.1rem;
  padding: 0.95rem 1.1rem;
  border: 1px solid rgba(245, 180, 0, 0.28);
  border-radius: 16px;
  background: rgba(245, 180, 0, 0.075);
  color: rgba(234, 236, 239, 0.86);
  font-size: 0.92rem;
}
.cm-field-error { margin: 0.35rem 0 0; color: #ffb4b4; font-size: 0.82rem; }
.cm-hp { position: absolute !important; left: -9999px !important; opacity: 0 !important; }

@media (max-width: 920px) {
  .cm-comments__grid { grid-template-columns: 1fr; }
  .cm-comments__side-note {
    border-left: 0;
    border-top: 2px solid rgba(245, 180, 0, 0.34);
    border-radius: 18px;
  }
}
@media (max-width: 768px) {
  .cm-comments {
    width: calc(100% - 24px);
    /* Pull the card up into the outro's 7.5rem bottom padding: ~124px of gap
       after "Înapoi la blog" read as detached on phones; ~88px (-29%) keeps air
       but makes the memories feel like the article's natural continuation. */
    margin-top: -1.5rem;
    margin-bottom: 4rem;
    padding: 1.15rem;
    border-radius: 22px;
  }
  .cm-comments h2 { font-size: clamp(1.72rem, 8vw, 2.35rem); letter-spacing: -0.045em; }
  .cm-comments__lead { font-size: 1rem; line-height: 1.65; }
  .cm-form-row--split { grid-template-columns: 1fr; }
  .cm-field input { min-height: 46px; }
  .cm-field textarea { min-height: 140px; }
  .cm-comment-form__actions { align-items: stretch; }
  .cm-comment-submit { width: 100%; }
  .cm-comment__header { display: grid; gap: 0.35rem; }
  .cm-comments__list { gap: 0.85rem; }
}
@media (prefers-reduced-motion: reduce) {
  .cm-field input,
  .cm-field textarea,
  .cm-comment-submit { transition: none; }
  .cm-comment-submit:hover { transform: none; }
}

/* ============================================================================
   Back-to-top — discrete floating pill, CM style: dark translucent, gold accent.
   Hidden by default; .is-visible is toggled from connected-memories.js (after
   ~800px of scroll, and never while the memories section / footer is in view).
   ============================================================================ */
.cm-totop {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: calc(clamp(1rem, 3vw, 2rem) + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.58rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(234, 236, 239, 0.14);
  background: rgba(5, 11, 18, 0.55);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  color: var(--cm-text-muted);
  font: 600 0.82rem/1 "Space Grotesk", Inter, system-ui, sans-serif;
  cursor: pointer;
  box-shadow: 0 12px 30px -14px rgba(0, 0, 0, 0.6);
  opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity .25s ease, transform .25s ease, color .18s ease, border-color .18s ease, background .18s ease;
}
.cm-totop.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.cm-totop svg { width: 1rem; height: 1rem; color: var(--cm-gold); }
.cm-totop:hover, .cm-totop:focus-visible {
  color: #fff; border-color: rgba(245, 180, 0, 0.55); background: rgba(5, 11, 18, 0.72);
}
.cm-totop:focus-visible { outline: 2px solid rgba(245, 180, 0, 0.6); outline-offset: 2px; }
/* Tactile press feedback (replaces the removed native tap highlight). */
.cm-totop:active { transform: scale(0.94); background: rgba(5, 11, 18, 0.8); }

@media (max-width: 768px) {
  .cm-totop { right: 0.85rem; bottom: calc(0.85rem + env(safe-area-inset-bottom, 0px)); padding: 0.5rem 0.75rem; font-size: 0.78rem; }
}
/* Phones (< sm, same 640px condition as the main site's .to-top): icon only —
   the label drops and the button becomes a perfect circle, like the main site's. */
@media (max-width: 639px) {
  .cm-totop span { display: none; }
  .cm-totop { width: 2.5rem; height: 2.5rem; padding: 0; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .cm-totop { transition: opacity .15s ease; transform: none; }
}
