:root {
  --bg: #F4F6F8;
  --ink: #1A1A1A;
  --ink-soft: #4A4E54;
  --line: #D7DCE2;
  --politica: #2B5CE6;
  --economia: #C41E5A;
  --intrattenimento: #D9A521;
  --masthead-brown: #6B5842;
  --gutter: 22px;
  --grid-line: 20px;
  --font-display: "Archivo Black", "Barlow Condensed", sans-serif;
  --font-condensed: "Barlow Condensed", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-masthead: "Playfair Display", Georgia, serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

img { max-width: 100%; display: block; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ---------- Masthead ---------- */

.masthead {
  background: var(--bg);
  border-bottom: 3px solid var(--ink);
  padding: 36px var(--gutter) 26px;
}

.masthead-inner {
  max-width: 720px;
}

.masthead-name {
  font-family: var(--font-masthead);
  font-size: clamp(2.4rem, 9vw, 3.4rem);
  line-height: 0.92;
  letter-spacing: -0.01em;
  display: flex;
  flex-wrap: wrap;
  gap: 0.18em;
  text-transform: uppercase;
}

/* Wordmark is the one place the site echoes logo.png directly: a Didone
   serif (Playfair Display, closest free match to the logo's high-contrast
   letterforms), warm brown/sepia color, roman vs italic between the two
   words, and only the first letter of each word bold - the rest regular.
   Section headings, story titles and everything else on the page stay in
   the grotesque display font from the brief, so the page as a whole still
   reads distinct from Pulso Nacional and Punto Italia's serif identities;
   only this logo lockup borrows the brand mark's own serif. Electric blue
   stays reserved for Politica Nazionale's section tag/heading/content. */
.masthead-word,
.masthead-word--italic {
  color: var(--masthead-brown);
}

.masthead-word { font-style: normal; }
.masthead-word--italic { font-style: italic; }

.masthead-initial { font-weight: 700; }
.masthead-rest { font-weight: 400; }

.masthead-slogan {
  font-family: var(--font-condensed);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
  margin: 10px 0 22px;
  max-width: 40ch;
}

.section-tag {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 4px;
}

.section-tag-item {
  font-family: var(--font-condensed);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  color: var(--ink);
  padding: 6px 2px;
  position: relative;
}

.section-tag-item::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0;
  height: 3px;
  background: var(--tag-color);
  transition: right 0.25s ease;
}

.section-tag-item:hover::after,
.section-tag-item:active::after {
  right: 0;
}

.section-tag-sep {
  color: var(--line);
  font-weight: 700;
}

/* ---------- Sections ---------- */

.edition {
  max-width: 720px;
  margin: 0 auto;
}

.section-block {
  padding: 46px var(--gutter) 8px;
  scroll-margin-top: 12px;
}

.section-heading {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: clamp(1.5rem, 6vw, 2rem);
  color: var(--section-color);
  margin: 0 0 30px;
  padding-left: var(--grid-line);
  letter-spacing: -0.01em;
}

.story-list {
  display: flex;
  flex-direction: column;
}

/* ---------- Story block ---------- */

.story {
  position: relative;
  padding-left: var(--grid-line);
  margin-bottom: 58px;
  cursor: pointer;
}

.story:last-child { margin-bottom: 8px; }

.story-tab {
  position: absolute;
  top: -6px;
  left: -3px;
  width: 20px;
  height: 30px;
  background: var(--section-color);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 76%, 0 100%);
}

.story-title {
  font-family: var(--font-display);
  font-size: 1.28rem;
  line-height: 1.18;
  margin: 6px 0 12px;
  color: var(--ink);
}

.story-preview {
  font-size: 0.98rem;
  color: var(--ink-soft);
  margin: 0 0 14px;
}

.story-preview .emphasis {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.32em;
  line-height: 1;
  color: var(--section-color);
  letter-spacing: -0.01em;
}

.story-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.read-more {
  font-family: var(--font-condensed);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.86rem;
  letter-spacing: 0.04em;
  color: var(--section-color);
}

.share-btn {
  font-family: var(--font-condensed);
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  padding: 6px 10px;
  border: 1px solid var(--line);
}

.share-btn:hover { border-color: var(--ink-soft); }

.story-image-wrap {
  margin: 16px 0;
  background: #E7EAED;
}

.story-image {
  width: 100%;
  height: auto;
  display: block;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 3px solid var(--ink);
  padding: 30px var(--gutter) 46px;
  margin-top: 40px;
}

.footer-name {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 1.1rem;
  margin: 0 0 8px;
}

.footer-note {
  font-size: 0.82rem;
  color: var(--ink-soft);
  max-width: 52ch;
  margin: 0;
}

/* ---------- Overlay (full article) ---------- */

.overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 100;
  display: none;
  overflow: hidden;
}

.overlay.open { display: block; }

.overlay-panel {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.overlay-scroll {
  overflow-y: auto;
  height: 100%;
  padding: 64px var(--gutter) 60px;
  max-width: 720px;
  margin: 0 auto;
  position: relative;
}

.overlay-close {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 38px;
  height: 38px;
  background: var(--ink);
  color: var(--bg);
  font-size: 1rem;
  z-index: 101;
}

.overlay-tab {
  width: 20px;
  height: 30px;
  margin-bottom: 14px;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 76%, 0 100%);
}

.overlay-image {
  width: 100%;
  height: auto;
  margin: 0 0 22px;
  background: #E7EAED;
}

.overlay-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 6.5vw, 2.1rem);
  line-height: 1.15;
  margin: 0 0 22px;
}

.overlay-body {
  font-size: 1rem;
  color: var(--ink);
  white-space: pre-wrap;
}

.overlay-body p {
  margin: 0 0 18px;
}

.overlay-share {
  margin-top: 30px;
}

/* ---------- Responsive safety ---------- */

@media (max-width: 380px) {
  :root {
    --gutter: 16px;
  }
}
