/* =========================================================
   CECILIA.CSS — ALIGNMENT FIX (site-coherent)
   Scoped: classi cb-*
   ========================================================= */

:root{
  --brand: var(--color-accent, #922A5E);
  --hdr-clamp: clamp(56px, var(--header-h, 72px), 140px);

  /* layout */
  --cb-text-col: 620px;
  --cb-side-col: 260px;
  --cb-col-gap: 2.6rem;

  /* hero */
  --cb-hero-h-desktop: 520px;
  --cb-hero-h-mobile: 420px;

  /* placeholder foto capitolo */
  --cb-photo-h: 320px;

  /* quote */
  --cb-quote-size: 1.15rem;
  --cb-quote-weight: 500;
  --cb-quote-mark-w: 0.2rem;
  --cb-quote-mark-h: 2.2rem;
  --cb-quote-shift: 2.2rem;
}

/* evita overflow laterale */
html, body { overflow-x: hidden; }
@supports (overflow: clip){
  html, body { overflow-x: clip; }
}

.cb-page{ background:#fff; }

/* IMPORTANTISSIMO per sticky: niente overflow/transform sui genitori */
.cb-page,
.cb-page > *{ overflow: visible; }

/* container standard (uguale sito) */
.cb-wrap{
  max-width: var(--container-max, 1100px);
  margin: 0 auto;
  padding-inline: var(--page-pad, clamp(1rem, 4vw, 3rem));
  min-width: 0;
}

/* =========================================================
   HERO
   ========================================================= */
.cb-hero{ padding:0; margin:0; }
.cb-hero__figure{ margin:0; width:100%; background:#eee; }

.cb-hero__figure img{
  display:block;
  width:100%;
  height: var(--cb-hero-h-desktop);
  object-fit: cover;
  object-position: center top;
}

@media (max-width: 900px){
  .cb-hero__figure img{ height: var(--cb-hero-h-mobile); }
}

/* =========================================================
   TOP: titolo + intro + link rapidi
   ========================================================= */
.cb-top{ padding-top: 2.1rem; }

.cb-title{
  margin: 0;
  font-size: clamp(2.1rem, 3.2vw, 3.1rem);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  max-width: 24ch;
}

.cb-topmeta{
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.9rem 1.25rem;
  margin-top: 0.95rem;
}

.cb-intro{
  flex: 1 1 520px;
  min-width: 0;
  max-width: 92ch;
  text-align: left;
}

.cb-under__kicker{
  margin: 0 0 0.85rem 0;
  font-size: 0.92rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--brand);
}

.cb-under__text{
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.65;
  color: #111;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.cb-quicklinks{
  flex: 0 0 auto;
  margin-left: auto;
  display: flex;
  gap: 1.25rem;
  justify-content: flex-end;
  align-items: center;
  text-align: right;
  flex-wrap: wrap;
}

.cb-quicklinks__link{
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  color: #111;
}

.cb-quicklinks__link:hover,
.cb-quicklinks__link:focus-visible{
  color: var(--brand);
}

@media (max-width: 600px){
  .cb-quicklinks{
    justify-content: flex-start;
    text-align: left;
    margin-left: 0;
  }
}

/* =========================================================
   TOPNAV (MOBILE ONLY)
   ========================================================= */
.cb-topnav{
  position: sticky;
  top: calc(var(--hdr-clamp) + 0px);
  z-index: 980;
  background: #fff;
  border-bottom: 1px solid #e9e9e9;
}

.cb-topnav__inner{
  max-width: var(--container-max, 1100px);
  margin: 0 auto;
  padding-inline: var(--page-pad, clamp(1rem, 4vw, 3rem));
  padding-block: 0.55rem 0.45rem;
}

.cb-topnav__scroller{
  display:flex;
  gap:.85rem;
  overflow-x:auto;
  overflow-y:hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width:none;
  white-space:nowrap;
}
.cb-topnav__scroller::-webkit-scrollbar{ display:none; }

.cb-chip{
  position:relative;
  display:inline-block;
  padding: 0.18rem 0 0.55rem;
  color:#777;
  text-decoration:none;
  font-size:.72rem;
  letter-spacing:.11em;
  text-transform:uppercase;
  -webkit-tap-highlight-color: transparent;
}
.cb-chip::after{
  content:"";
  position:absolute; left:0; right:0; bottom:0;
  height:2px;
  background: var(--brand);
  transform: scaleX(0);
  transform-origin:left;
  transition: transform var(--transition, .35s cubic-bezier(.22,.61,.36,1));
  pointer-events:none;
}
.cb-chip.is-active{ color: var(--brand); }
.cb-chip.is-active::after{ transform: scaleX(1); }

@media (min-width: 901px){
  .cb-topnav{ display:none; }
}

/* =========================================================
   LAYOUT: SIDEBAR DESKTOP + CONTENT
   ========================================================= */
.cb-layout{
  max-width: var(--container-max, 1100px);
  margin: 0 auto;
  padding-inline: var(--page-pad, clamp(1rem, 4vw, 3rem));
  padding-bottom: 3rem;
  min-width: 0;
}

/* cb-wrap dentro cb-content non deve ripaddare */
.cb-content > .cb-wrap{
  padding-inline: 0;
  max-width: 100%;
}

/* timeline wrap annidato: niente doppio padding */
.cb-content .cb-timeline > .cb-wrap{
  padding-inline: 0;
  max-width: 100%;
}

@media (min-width: 901px){
  .cb-layout{
    display:grid;
    grid-template-columns: var(--cb-side-col) minmax(0, 1fr);
    gap: var(--cb-col-gap);
    align-items:start;
  }

  .cb-side{
    position: sticky;
    top: calc(var(--hdr-clamp) + 0px);
    align-self:start;
    margin: 0;
    padding: 0;
  }

  .cb-content{ min-width: 0; }

  /* contenuto testo: stretto */
  .cb-content > .cb-wrap{
    max-width: var(--cb-text-col);
  }

  /* ✅ timeline: più larga del testo (usa tutta la colonna content) */
  .cb-content .cb-timeline > .cb-wrap{
    max-width: 100%;
  }
}

@media (max-width: 900px){
  .cb-side{ display:none; }
}

/* sidebar links */
.cb-nav__list{ list-style:none; padding:0; margin:0; }
.cb-nav__link{
  position:relative;
  display:block;
  padding: .55rem 0 .55rem .9rem;
  text-decoration:none;
  color:#777;
  text-transform:uppercase;
  letter-spacing:.12em;
  font-size:.72rem;
  -webkit-tap-highlight-color: transparent;
}
.cb-nav__link:hover{ color:#111; }

.cb-nav__link::before{
  content:"";
  position:absolute;
  left:0;
  top:.8rem;
  width:3px;
  height:0;
  background: var(--brand);
  transition: height var(--transition, .35s cubic-bezier(.22,.61,.36,1));
}
.cb-nav__link.is-active{ color: var(--brand); }
.cb-nav__link.is-active::before{ height: 1.15rem; }

.cb-nav__link:focus,
.cb-nav__link:focus-visible{
  outline:none !important;
  box-shadow:none !important;
}

/* =========================================================
   SEZIONI (chi-*)
   ========================================================= */
.cb-page .chi-section{
  padding: 2.6rem 0;
  scroll-margin-top: calc(var(--hdr-clamp) + 18px);
}

.cb-page .chi-kicker{
  margin: 0 0 0.85rem 0;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #111;
}

.cb-page .chi-text p{
  margin: 0.85rem 0 0;
  font-size: 15px;
  line-height: 1.85;
  color: #222;
}
.cb-page .chi-text p:first-child{ margin-top: 0; }

/* =========================================================
   FOTO CAPITOLO
   ========================================================= */
.cb-photo{ margin: 1.25rem 0 0; }
.cb-photo__ph{
  width: 100%;
  height: var(--cb-photo-h);
  border: 1px solid #d8d8d8;
  border-radius: 4px;
  background: #fff;
  overflow: hidden;
}
.cb-photo__ph > img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* =========================================================
   QUOTE STRIP — full-bleed
   ========================================================= */
.cb-quote-strip{
  width: auto;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  transform: none !important;
  background: #fff;
  border-top: 1px solid #e9e9e9;
  border-bottom: 1px solid #e9e9e9;
  overflow: hidden;
}

.cb-quote-strip__inner{
  max-width: var(--container-max, 1100px);
  margin: 0 auto;
  padding: 2.1rem var(--page-pad, clamp(1rem, 4vw, 3rem)) 1.5rem;
  text-align: left;
}

.cb-quote{
  margin: 0;
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  max-width: 100%;
  margin-left: var(--cb-quote-shift);
}

.cb-quote__mark{
  width: var(--cb-quote-mark-w);
  height: var(--cb-quote-mark-h);
  background: var(--brand);
  border-radius: 999px;
  flex: 0 0 auto;
  margin-top: 0.15rem;
}

.cb-quote__text{
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
  font-size: var(--cb-quote-size);
  line-height: 1.35;
  font-weight: var(--cb-quote-weight);
  color: #111;
}

.cb-quote-actions{
  margin-top: 1.1rem;
  display: flex;
  gap: 1.35rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  text-align: center;
}

.cb-quote-link{
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: #111;
  text-decoration: none;
  font-size: 0.95rem;
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 700px){
  .cb-page{
    --cb-quote-size: 1.05rem;
    --cb-quote-mark-h: 1.9rem;
    --cb-quote-shift: 1.1rem;
  }
  .cb-quote-strip__inner{
    padding-top: 1.8rem;
    padding-bottom: 1.3rem;
  }
  .cb-quote{ gap: 0.75rem; }
  .cb-quote__text{ line-height: 1.28; }
}

/* =========================================================
   TIMELINE — FIX MOBILE
   ========================================================= */
.cb-page .cb-timeline{ padding: 2.25rem 0 2.75rem; }

.cb-page .cb-timeline__title{
  margin: 0 0 1.1rem;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text, #111);
}

.cb-page .cb-timeline__list{ border-top: 1px solid #e3e3e3; }

.cb-page .cb-tl{
  display: grid;
  grid-template-columns: 0.95fr minmax(0, 1.25fr) 0.8fr; /* ✅ si adatta: niente overflow */
  gap: 18px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid #f2f2f2;
  text-decoration: none;
  color: inherit;
}

.cb-page .cb-tl:hover{ background: #fafafa; }
.cb-page .cb-tl:focus-visible{ outline: 2px solid #111; outline-offset: 3px; }

.cb-page .cb-tl__year{
  font-size: clamp(18px, 2.4vw, 26px); /* ✅ titolo al posto dell'anno */
  line-height: 1.06;
  font-weight: 700;
  color: #cabfbf;
  letter-spacing: -0.02em;
  min-width: 0;
  overflow-wrap: anywhere;
}

.cb-page .cb-tl__main{ min-width: 0; }

.cb-page .cb-tl__p{
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: #444;
  max-width: 56ch;
}

.cb-page .cb-tl__thumb{
  margin: 0;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 3px;
  overflow: hidden;
  background: #eee;
}

.cb-page .cb-tl__thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ✅ MOBILE: stack 1 colonna (come ti serve nello screenshot) */
@media (max-width: 900px){
  .cb-page .cb-tl{
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 18px 0;
  }

  .cb-page .cb-tl__year{
    font-size: 22px;
    line-height: 1.08;
  }

  .cb-page .cb-tl__thumb{
    max-width: 100%;
  }

  .cb-page .cb-tl__p{
    max-width: 70ch;
  }
}

/* =========================================================
   VIDEO MODAL (cb-video.js)
   ========================================================= */
.cb-video-modal{
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.cb-video-backdrop{
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: rgba(255,255,255,0.92);
  cursor: pointer;
}

.cb-video-panel{
  position: relative;
  z-index: 1;
  width: min(980px, calc(100% - 28px));
  margin: 0 auto;
  top: 50%;
  transform: translateY(-50%);
  background: #fff;
  border: 1px solid rgba(0,0,0,0.10);
  box-shadow: 0 18px 60px rgba(0,0,0,0.12);
  border-radius: 12px;
  overflow: hidden;
}

.cb-video{
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100dvh - 160px);
  background: #fff;
}

.cb-video-close{
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.14);
  background: #fff;
  color: #111;
  font-size: 28px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.cb-video-close:focus-visible{
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

html.is-modal-open,
body.is-modal-open{ overflow: hidden; }

@media (max-width: 720px){
  .cb-video-panel{
    width: calc(100% - 20px);
    border-radius: 10px;
  }
  .cb-video-close{
    top: 8px;
    right: 8px;
    width: 48px;
    height: 48px;
  }
}
