/* ==========================================================================
   Gazeta Ditore — editorial advertorial styles
   Mobile-first. One stylesheet, no framework. Warm "magazine" palette with a
   retro TV colour-bars motif. Comments are in English to match the codebase.
   ========================================================================== */

/* ----- 1. Reset (minimal) ------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
img, picture, svg { display: block; max-width: 100%; height: auto; }
button, input { font: inherit; color: inherit; }
a { color: inherit; }

/* ----- 2. Design tokens -------------------------------------------------- */
:root {
  --paper:      #faf7f1;   /* page background  */
  --paper-2:    #f2ece0;   /* panels / ad wells */
  --paper-3:    #ece4d4;
  --ink:        #221e1a;   /* primary text     */
  --ink-soft:   #4a443c;   /* secondary text   */
  --muted:      #7a7165;   /* captions, labels */
  --line:       #e3dac9;   /* hairlines        */
  --teal:       #15605c;   /* primary accent / links */
  --teal-dark:  #0f4a47;
  --teal-tint:  #e7f0ee;
  --amber:      #e2a32c;
  --coral:      #d9573b;
  --footer-bg:  #20211d;   /* dark publication footer */
  --footer-fg:  #d8d2c6;
  --footer-mut: #968f82;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-serif:   Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
  --font-sans:    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --maxw: 720px;     /* reading column   */
  --maxw-wide: 940px;/* hero / footer    */
  --radius: 10px;
  --shadow: 0 1px 2px rgba(34,30,26,.06), 0 8px 24px rgba(34,30,26,.07);

  /* recognisable TV colour-bars (generic, no broadcaster branding) */
  --bars: linear-gradient(90deg,
    #c9c2b4 0 14.285%, var(--amber) 14.285% 28.57%, #2aa39c 28.57% 42.857%,
    #4f9d5a 42.857% 57.14%, #c96aa0 57.14% 71.428%, var(--coral) 71.428% 85.71%,
    #3f6bbf 85.71% 100%);
}

/* ----- 3. Base ----------------------------------------------------------- */
html { scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 20px; }
.wrap--wide { max-width: var(--maxw-wide); }

a { color: var(--teal); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--teal-dark); }

:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 3px; }

.skip-link {
  position: absolute; left: 8px; top: -48px; z-index: 200;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px;
  text-decoration: none; transition: top .15s ease;
}
.skip-link:focus { top: 8px; color: #fff; }

.colour-bars { height: 6px; width: 100%; background: var(--bars); }

/* ----- 4. Header --------------------------------------------------------- */
.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.site-header__inner {
  display: flex; align-items: center; justify-content: center;
  gap: 14px; padding: 14px 20px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand__mark { width: 34px; height: 34px; flex: none; }
.brand__name {
  font-family: var(--font-display);
  font-weight: 900; font-size: 1.55rem; letter-spacing: -.01em;
  color: var(--ink); line-height: 1;
}
.brand__tag {
  display: none; font-family: var(--font-sans); font-size: .62rem;
  letter-spacing: .18em; text-transform: uppercase; color: var(--muted);
}

/* ----- 5. Advertisement slots ------------------------------------------- */
.ad-slot {
  margin: 26px auto; text-align: center;
  display: flex; flex-direction: column; align-items: center;
}
.ad-label {
  font-family: var(--font-sans); font-size: .62rem; font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 8px;
}
.ad-box {
  width: 100%; max-width: 728px; min-height: 96px;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.ad-box img { width: 100%; height: auto; }
.ad-box a { display: block; width: 100%; }
/* network widget containers fill their well; min-height avoids layout shift */
.ad-widget { width: 100%; max-width: 728px; min-height: 250px; }
/* hide a network slot until its widget is actually filled (no empty grey boxes) */
.ad-slot--widget:has(> .ad-widget:empty) { display: none; }

/* ----- 5b. Direct-sold offer banner (poll creative) --------------------- */
.offer-banner {
  width: 100%; max-width: 460px; background: #fff;
  border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  box-shadow: var(--shadow); text-align: center;
  transition: transform .15s ease, box-shadow .15s ease;
}
.offer-banner:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(34,30,26,.16); }
.offer-banner__media { display: block; }
.offer-banner__media img {
  width: 100%; aspect-ratio: 5 / 3; object-fit: cover; display: block; background: var(--paper-2);
}
.offer-banner__body { padding: 18px 18px 18px; }
.offer-banner__q {
  font-family: var(--font-display); font-weight: 900; line-height: 1.12;
  font-size: 1.35rem; color: var(--ink); margin-bottom: 14px;
}
.offer-poll { display: flex; gap: 12px; justify-content: center; margin-bottom: 14px; }
.offer-poll__btn {
  flex: 1 1 0; max-width: 150px; padding: 12px 8px; border-radius: 10px;
  font-family: var(--font-sans); font-weight: 800; font-size: 1.1rem;
  text-decoration: none; border: 2px solid; cursor: pointer; display: block;
  transition: filter .15s ease;
}
.offer-poll__btn:hover { filter: brightness(.96); }
.offer-poll__btn--yes { background: #cfe9ac; border-color: #5a9e3f; color: #2f5d1f; }
.offer-poll__btn--no  { background: #f6c2c2; border-color: #c0504d; color: #7a2622; }
.offer-banner__msg {
  font-family: var(--font-sans); font-size: .92rem; color: var(--ink-soft);
  background: var(--paper-2); border-radius: 10px; padding: 12px 14px; margin-bottom: 14px;
}
.offer-banner__msg a { font-weight: 700; white-space: nowrap; }
.offer-banner__headline {
  display: block; font-family: var(--font-sans); font-weight: 800;
  font-size: 1.08rem; line-height: 1.32; color: var(--ink); text-decoration: none;
}
.offer-banner__headline:hover { text-decoration: underline; }
.offer-banner[hidden], [hidden] { display: none; }

/* ----- 5c. Native offer cards (image + headline) ------------------------ */
.offer-card {
  display: block; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden; box-shadow: var(--shadow);
  text-decoration: none; color: var(--ink);
  transition: transform .15s ease, box-shadow .15s ease;
}
.offer-card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(34,30,26,.16); }
.offer-card--solo { width: 100%; max-width: 460px; margin-inline: auto; }
.offer-card__img {
  width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: var(--paper-2);
}
.offer-card__body { padding: 14px 16px 16px; }
.offer-card__headline {
  font-family: var(--font-sans); font-weight: 800; font-size: 1.06rem;
  line-height: 1.3; color: var(--ink); margin: 0;
}
.offer-card__cta {
  display: inline-block; margin-top: 10px; font-family: var(--font-sans);
  font-weight: 700; font-size: .9rem; color: var(--teal);
}
.offer-card__src {
  display: block; margin-top: 8px; font-family: var(--font-sans);
  font-size: .72rem; letter-spacing: .04em; color: var(--muted);
}

/* "More from our partners" grid of cards */
.offer-grid {
  display: grid; grid-template-columns: 1fr; gap: 16px;
  width: 100%; max-width: 760px; margin-inline: auto;
}
@media (min-width: 600px) { .offer-grid { grid-template-columns: 1fr 1fr; } }

/* ----- 6. Article -------------------------------------------------------- */
.article { padding-top: 8px; }
.kicker {
  font-family: var(--font-sans); font-size: .72rem; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase; color: var(--coral);
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 12px;
}
.kicker::before { content: ""; width: 26px; height: 4px; background: var(--bars); border-radius: 2px; }

.headline {
  font-family: var(--font-display);
  font-weight: 900; line-height: 1.06; letter-spacing: -.018em;
  font-size: clamp(2rem, 6.4vw, 3.2rem);
  color: var(--ink); margin-bottom: 14px;
}
.byline {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  font-family: var(--font-sans); font-size: .86rem; color: var(--muted);
  padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 22px;
}
.byline__author { color: var(--ink-soft); font-weight: 600; }
.byline__dot { width: 4px; height: 4px; border-radius: 50%; background: var(--muted); }

.hero-figure { margin: 0 0 8px; }
.hero-figure img {
  width: 100%; border-radius: var(--radius); box-shadow: var(--shadow);
  background: var(--paper-2);
}
figure { margin: 28px 0; }
figure img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); background: var(--paper-2); }
figcaption {
  font-family: var(--font-sans); font-size: .8rem; color: var(--muted);
  margin-top: 8px; text-align: center; font-style: normal;
}

.prose { font-family: var(--font-serif); font-size: 1.155rem; line-height: 1.75; color: var(--ink); }
.prose > p { margin-bottom: 1.15em; }
.prose .lead {
  font-family: var(--font-sans); font-size: 1.2rem; line-height: 1.6;
  color: var(--ink-soft); font-weight: 400;
}
.prose h2 {
  font-family: var(--font-display); font-weight: 700; line-height: 1.15;
  font-size: clamp(1.45rem, 4.4vw, 1.95rem); letter-spacing: -.012em;
  color: var(--ink); margin: 1.8em 0 .5em;
}
.prose h2::before {
  content: ""; display: block; width: 44px; height: 5px;
  background: var(--bars); border-radius: 3px; margin-bottom: .5em;
}
.prose h3 {
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.2rem; margin: 1.4em 0 .35em; color: var(--ink);
}
.prose a { font-weight: 600; }
.prose strong { font-weight: 700; }
.prose ul, .prose ol { margin: 0 0 1.15em 1.2em; padding: 0; }
.prose li { margin-bottom: .45em; }
.prose blockquote {
  border-left: 4px solid var(--amber); background: var(--paper-2);
  padding: 14px 18px; border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.4em 0; font-style: italic; color: var(--ink-soft);
}
.divider {
  border: 0; height: 1px; background: var(--line);
  max-width: 120px; margin: 2.2em auto;
}

/* ----- 7. Footer --------------------------------------------------------- */
.site-footer { background: var(--footer-bg); color: var(--footer-fg); margin-top: 48px; }
.site-footer a { color: var(--footer-fg); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid {
  display: grid; grid-template-columns: 1fr; gap: 30px;
  padding: 44px 0 28px;
}
.footer-col h3 {
  font-family: var(--font-sans); font-size: .72rem; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase; color: var(--footer-mut);
  margin-bottom: 14px;
}
.footer-col p, .footer-col address { font-size: .92rem; font-style: normal; line-height: 1.6; color: var(--footer-fg); }
.footer-col address { margin-bottom: 6px; }
.footer-links { list-style: none; padding: 0; }
.footer-links li { margin-bottom: 9px; }
.footer-brand { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.footer-brand .brand__name { color: #fff; font-size: 1.3rem; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.12);
  padding: 18px 0 36px; font-size: .82rem; color: var(--footer-mut);
  display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; justify-content: space-between;
}
.footer-bottom a { color: var(--footer-mut); }
.btn-link {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--footer-mut); text-decoration: underline; font-size: inherit;
}
.btn-link:hover { color: #fff; }

/* ----- 8. Legal pages ---------------------------------------------------- */
.legal { padding: 36px 0 8px; }
.legal h1 {
  font-family: var(--font-display); font-weight: 900; letter-spacing: -.015em;
  font-size: clamp(1.8rem, 5.4vw, 2.6rem); line-height: 1.1; margin-bottom: 8px;
}
.legal .updated { font-family: var(--font-sans); font-size: .85rem; color: var(--muted); margin-bottom: 8px; }
.legal__body { font-family: var(--font-serif); font-size: 1.07rem; line-height: 1.72; }
.legal__body h2 {
  font-family: var(--font-display); font-weight: 700; font-size: 1.4rem;
  margin: 1.6em 0 .4em; color: var(--ink); scroll-margin-top: 80px;
}
.legal__body h3 { font-family: var(--font-display); font-size: 1.12rem; margin: 1.2em 0 .3em; }
.legal__body p, .legal__body li { margin-bottom: .8em; }
.legal__body ul, .legal__body ol { margin: 0 0 1em 1.3em; }
.legal__body a { font-weight: 600; }
.legal__intro {
  background: var(--paper-2); border: 1px solid var(--line); border-left: 4px solid var(--amber);
  border-radius: 0 var(--radius) var(--radius) 0; padding: 14px 18px; margin-bottom: 8px;
  font-family: var(--font-sans); font-size: .95rem; color: var(--ink-soft);
}
.placeholder { background: #fff6df; border-bottom: 1px dashed var(--amber); padding: 0 3px; border-radius: 2px; font-family: var(--font-sans); font-size: .92em; }
.legal table { width: 100%; border-collapse: collapse; margin: 1em 0 1.4em; font-family: var(--font-sans); font-size: .9rem; }
.legal th, .legal td { border: 1px solid var(--line); padding: 9px 11px; text-align: left; vertical-align: top; }
.legal th { background: var(--paper-2); font-weight: 700; }
.backlink { display: inline-block; margin: 22px 0 4px; font-family: var(--font-sans); font-weight: 600; }

/* ----- 9. Cookie banner + modal ----------------------------------------- */
.cc-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 120;
  background: #fff; border-top: 4px solid; border-image: var(--bars) 1;
  box-shadow: 0 -8px 30px rgba(34,30,26,.16);
}
.cc-banner__inner {
  max-width: var(--maxw-wide); margin-inline: auto; padding: 16px 20px;
  display: flex; flex-direction: column; gap: 14px;
}
.cc-banner__text strong { font-family: var(--font-display); font-size: 1.05rem; display: block; margin-bottom: 4px; }
.cc-banner__text p { font-size: .9rem; color: var(--ink-soft); }
.cc-banner__actions { display: flex; flex-wrap: wrap; gap: 10px; }

.cc-btn {
  font-family: var(--font-sans); font-weight: 600; font-size: .9rem;
  padding: 10px 16px; border-radius: 8px; cursor: pointer; border: 1.5px solid var(--teal);
  flex: 1 1 auto; min-width: 130px; transition: background .15s ease, color .15s ease;
}
.cc-btn--solid { background: var(--teal); color: #fff; }
.cc-btn--solid:hover { background: var(--teal-dark); border-color: var(--teal-dark); }
.cc-btn--ghost { background: transparent; color: var(--teal); }
.cc-btn--ghost:hover { background: var(--teal-tint); }

.cc-modal { position: fixed; inset: 0; z-index: 130; display: flex; align-items: center; justify-content: center; padding: 18px; }
.cc-modal[hidden] { display: none; }
.cc-modal__backdrop { position: absolute; inset: 0; background: rgba(20,18,15,.55); }
.cc-modal__panel {
  position: relative; background: var(--paper); border-radius: 14px;
  max-width: 540px; width: 100%; max-height: 88vh; overflow: auto;
  padding: 26px 24px; box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.cc-modal__panel h2 { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; margin-bottom: 8px; }
.cc-modal__panel > p { font-size: .92rem; color: var(--ink-soft); margin-bottom: 16px; }
.cc-cats { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 12px; }
.cc-cat { border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 15px; background: #fff; }
.cc-cat__head { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.cc-cat__head input { width: 18px; height: 18px; accent-color: var(--teal); flex: none; }
.cc-cat__name { font-family: var(--font-sans); font-weight: 700; font-size: .98rem; }
.cc-cat__desc { font-size: .85rem; color: var(--muted); margin: 8px 0 0; }
.cc-modal__actions { display: flex; flex-wrap: wrap; gap: 10px; }
html.cc-lock { overflow: hidden; }

/* ----- 10. Reveal + motion ---------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ----- 11. Responsive ---------------------------------------------------- */
@media (min-width: 480px) {
  .cc-banner__actions .cc-btn { flex: 0 1 auto; }
}
@media (min-width: 768px) {
  body { font-size: 1.09rem; }
  .brand__tag { display: block; }
  .site-header__inner { justify-content: space-between; }
  .cc-banner__inner { flex-direction: row; align-items: center; justify-content: space-between; }
  .cc-banner__text { flex: 1; }
  .cc-banner__actions { flex: none; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
}
@media (min-width: 1024px) {
  .ad-slot { margin: 34px auto; }
}

/* ----- 12. Print --------------------------------------------------------- */
@media print {
  .ad-slot, .cc-banner, .cc-modal, .site-footer .footer-bottom { display: none; }
  body { background: #fff; color: #000; }
}
