/*
Theme Name: Consenso Figaro
Theme URI: https://www.consenso.online/
Author: Consenso
Description: Quotidiano politico ispirato a Le Figaro — masthead serif, filetti, accento rosso, griglia editoriale.
Version: 1.1.0
Text Domain: consenso-figaro
Requires at least: 6.0
Requires PHP: 8.0
*/

:root {
  --fg-bg: #f7f5f0;
  --fg-paper: #fffef9;
  --fg-ink: #111111;
  --fg-muted: #5a564e;
  --fg-line: #1a1a1a;
  --fg-hair: #d4cfc4;
  --fg-red: #c8102e;
  --fg-red-dark: #9a0c23;
  --fg-serif: "Libre Baskerville", "Times New Roman", Times, serif;
  --fg-sans: "Source Sans 3", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --fg-max: 1120px;
  --fg-tap: 44px;
}

*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}
body {
  margin: 0;
  font-family: var(--fg-sans);
  font-size: 1rem;
  color: var(--fg-ink);
  background:
    radial-gradient(900px 320px at 50% -60px, rgba(200,16,46,0.05), transparent 60%),
    var(--fg-bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--fg-red); }
img, video, svg { max-width: 100%; height: auto; display: block; }
.screen-reader-text {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0);
}

.fg-wrap { width: min(100% - 1.5rem, var(--fg-max)); margin-inline: auto; }

/* Utility bar */
.fg-util {
  border-bottom: 1px solid var(--fg-hair);
  background: var(--fg-paper);
  font-size: 0.78rem;
  color: var(--fg-muted);
}
.fg-util .fg-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 36px;
  gap: 0.65rem;
}
.fg-util .fg-wrap > div:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fg-util a {
  color: var(--fg-muted);
  display: inline-flex;
  align-items: center;
  min-height: var(--fg-tap);
}
.fg-util a:hover { color: var(--fg-red); }

/* Masthead — Figaro style, mobile-scaled */
.fg-masthead {
  background: var(--fg-paper);
  border-bottom: 3px double var(--fg-line);
  padding: 0.9rem 0 0.7rem;
  text-align: center;
}
.fg-brand {
  font-family: var(--fg-serif);
  font-weight: 700;
  font-size: clamp(2rem, 11vw, 3.2rem);
  letter-spacing: 0.02em;
  line-height: 1;
  color: var(--fg-ink) !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--fg-tap);
  animation: fg-ink .7s ease both;
}
.fg-brand em {
  font-style: normal;
  color: var(--fg-red);
}
.fg-tagline {
  margin: 0.45rem 0 0;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  padding-inline: 0.5rem;
}
.fg-date {
  margin-top: 0.3rem;
  font-family: var(--fg-serif);
  font-size: 0.88rem;
}

/* Nav — hamburger + full-width menu on small screens */
.fg-nav-bar {
  background: var(--fg-paper);
  border-bottom: 1px solid var(--fg-line);
  position: sticky;
  top: 0;
  z-index: 40;
}
.fg-nav-bar .fg-wrap {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: var(--fg-tap);
  margin: 0.45rem 0;
  background: transparent;
  border: 1px solid var(--fg-line);
  padding: 0.45rem 0.75rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.fg-nav {
  display: none;
  flex-direction: column;
  align-items: stretch;
  list-style: none;
  margin: 0 0 0.5rem;
  padding: 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  width: 100%;
  border-top: 1px solid var(--fg-hair);
}
.fg-nav-bar.is-open .fg-nav { display: flex; }
.fg-nav a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--fg-tap);
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--fg-hair);
}
.fg-nav li:last-child a { border-bottom: 0; }
.fg-nav a::after { display: none; }
.fg-nav .current-menu-item > a { color: var(--fg-red); }

/* Homepage — single column lead */
.fg-home { padding: 1.15rem 0 2rem; }
.fg-lead-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.15rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--fg-line);
}
.fg-lead { display: block; }
.fg-lead-media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #e8e4da;
  border: 1px solid var(--fg-hair);
}
.fg-lead-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .7s ease;
}
.fg-lead:hover .fg-lead-media img { transform: scale(1.03); }
.fg-kicker {
  display: inline-block;
  margin-top: 0.75rem;
  color: var(--fg-red);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.fg-lead h2 {
  margin: 0.3rem 0 0.5rem;
  font-family: var(--fg-serif);
  font-size: clamp(1.4rem, 5.5vw, 1.9rem);
  line-height: 1.2;
  font-weight: 700;
}
.fg-deck {
  color: var(--fg-muted);
  font-size: 1rem;
  max-width: 40rem;
  margin: 0;
}

.fg-side-list {
  border-left: 0;
  padding-left: 0;
  border-top: 1px solid var(--fg-hair);
  padding-top: 0.85rem;
}
.fg-side-item {
  display: block;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--fg-hair);
}
.fg-side-item:first-child { padding-top: 0; }
.fg-side-item:last-child { border-bottom: 0; }
.fg-side-item h3 {
  margin: 0.25rem 0 0;
  font-family: var(--fg-serif);
  font-size: 1.05rem;
  line-height: 1.3;
  font-weight: 700;
}

/* Rubriche — 2-up on mobile */
.fg-rubriche {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 1.25rem 0;
  border: 1px solid var(--fg-line);
  background: var(--fg-paper);
}
.fg-rubrica {
  padding: 0.95rem 0.9rem;
  border-right: 1px solid var(--fg-hair);
  border-bottom: 1px solid var(--fg-hair);
  min-height: var(--fg-tap);
  transition: background .2s ease;
}
.fg-rubriche .fg-rubrica:nth-child(2n) { border-right: 0; }
.fg-rubriche .fg-rubrica:nth-last-child(-n+2) { border-bottom: 0; }
.fg-rubrica:hover { background: #fff7f8; }
.fg-rubrica strong {
  display: block;
  font-family: var(--fg-serif);
  font-size: 0.98rem;
}
.fg-rubrica span {
  color: var(--fg-muted);
  font-size: 0.82rem;
}

/* Section */
.fg-section { margin-top: 1.5rem; }
.fg-section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 0.9rem;
  font-family: var(--fg-serif);
  font-size: 1.2rem;
}
.fg-section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--fg-line);
}
.fg-section-title span {
  color: var(--fg-red);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: var(--fg-sans);
  font-weight: 700;
}

.fg-tri {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.1rem;
}
.fg-card {
  background: var(--fg-paper);
  border-top: 2px solid var(--fg-line);
  padding-top: 0.85rem;
  animation: fg-rise .55s ease both;
}
.fg-card:nth-child(2) { animation-delay: .07s; }
.fg-card:nth-child(3) { animation-delay: .14s; }
.fg-card h3 {
  margin: 0.3rem 0 0.45rem;
  font-family: var(--fg-serif);
  font-size: 1.12rem;
  line-height: 1.3;
}
.fg-meta { color: var(--fg-muted); font-size: 0.8rem; }

/* Article */
.fg-main { padding: 1.5rem 0 2.5rem; }
.fg-article {
  max-width: 720px;
  margin: 0 auto;
  background: var(--fg-paper);
  border: 1px solid var(--fg-hair);
  padding: 1.15rem 1.05rem 1.4rem;
}
.fg-article h1 {
  font-family: var(--fg-serif);
  font-size: clamp(1.55rem, 6vw, 2.2rem);
  line-height: 1.2;
  margin: 0.35rem 0 0.9rem;
}
.fg-article .entry-content p { font-size: 1.05rem; }
.fg-article .entry-content img {
  max-width: 100%;
  height: auto;
}
.fg-article .entry-content p:first-of-type::first-letter {
  font-family: var(--fg-serif);
  font-size: 2.8rem;
  float: left;
  line-height: 0.85;
  padding: 0.1rem 0.4rem 0 0;
  color: var(--fg-red);
  font-weight: 700;
}

/* Footer — stacked */
.fg-footer {
  margin-top: 1.5rem;
  border-top: 3px double var(--fg-line);
  background: var(--fg-paper);
  padding: 1.75rem 0 1.35rem;
}
.fg-footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
.fg-footer h3 {
  font-family: var(--fg-serif);
  font-size: 1.05rem;
  margin: 0 0 0.55rem;
  border-bottom: 1px solid var(--fg-hair);
  padding-bottom: 0.35rem;
}
.fg-footer ul { list-style: none; margin: 0; padding: 0; }
.fg-footer li { margin: 0.15rem 0; font-size: 0.92rem; }
.fg-footer a {
  display: inline-flex;
  align-items: center;
  min-height: var(--fg-tap);
}
.fg-copy {
  margin-top: 1.25rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--fg-hair);
  font-size: 0.8rem;
  color: var(--fg-muted);
  text-align: center;
}

@keyframes fg-ink {
  from { opacity: 0; letter-spacing: 0.12em; }
  to { opacity: 1; letter-spacing: 0.02em; }
}
@keyframes fg-rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* —— Enhancements (min-width) —— */
@media (min-width: 600px) {
  .fg-wrap { width: min(100% - 2rem, var(--fg-max)); }
  .fg-brand { font-size: clamp(2.6rem, 8vw, 3.6rem); }
  .fg-tagline { font-size: 0.82rem; letter-spacing: 0.14em; }
  .fg-lead h2 { font-size: clamp(1.65rem, 3.5vw, 2.2rem); }
  .fg-deck { font-size: 1.05rem; }
  .fg-tri { grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
  .fg-article { padding: clamp(1.25rem, 3vw, 2.4rem); }
  .fg-footer-grid { grid-template-columns: 1.3fr 1fr; }
  .fg-article .entry-content p:first-of-type::first-letter { font-size: 3.2rem; }
}

@media (min-width: 900px) {
  body {
    background:
      radial-gradient(1200px 400px at 50% -80px, rgba(200,16,46,0.05), transparent 60%),
      var(--fg-bg);
  }
  .fg-masthead { padding: 1.1rem 0 0.85rem; }
  .fg-brand { font-size: clamp(2.4rem, 7vw, 4.2rem); }
  .fg-tagline { font-size: 0.86rem; }
  .fg-date { font-size: 0.92rem; }

  .menu-toggle { display: none; }
  .fg-nav-bar .fg-wrap { display: block; }
  .fg-nav {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.15rem 1.35rem;
    margin: 0;
    padding: 0.65rem 0;
    border-top: 0;
    font-size: 0.9rem;
    width: auto;
  }
  .fg-nav a {
    justify-content: flex-start;
    min-height: auto;
    padding: 0 0 0.2rem;
    border-bottom: 0;
  }
  .fg-nav a::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 2px;
    background: var(--fg-red);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .25s ease;
    display: block;
  }
  .fg-nav a:hover::after,
  .fg-nav .current-menu-item > a::after { transform: scaleX(1); }

  .fg-home { padding: 1.5rem 0 2.5rem; }
  .fg-lead-grid {
    grid-template-columns: 1.55fr 1fr;
    gap: 1.5rem;
    padding-bottom: 1.5rem;
  }
  .fg-lead h2 { font-size: clamp(1.7rem, 3.4vw, 2.55rem); }
  .fg-side-list {
    border-top: 0;
    padding-top: 0;
    border-left: 1px solid var(--fg-hair);
    padding-left: 1.25rem;
  }
  .fg-side-item h3 { font-size: 1.12rem; }

  .fg-rubriche { grid-template-columns: repeat(4, 1fr); margin: 1.5rem 0; }
  .fg-rubrica {
    border-bottom: 0;
    border-right: 1px solid var(--fg-hair);
    padding: 1rem 1.05rem;
  }
  .fg-rubriche .fg-rubrica:nth-child(2n) { border-right: 1px solid var(--fg-hair); }
  .fg-rubriche .fg-rubrica:nth-child(4n) { border-right: 0; }
  .fg-rubriche .fg-rubrica:nth-last-child(-n+2) { border-bottom: 0; }
  .fg-rubrica strong { font-size: 1.02rem; }

  .fg-section { margin-top: 1.75rem; }
  .fg-section-title { font-size: 1.35rem; margin-bottom: 1rem; }
  .fg-tri { grid-template-columns: repeat(3, 1fr); }
  .fg-card h3 { font-size: 1.2rem; }
  .fg-main { padding: 2rem 0 3rem; }
  .fg-article h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); }
  .fg-article .entry-content p { font-size: 1.08rem; }
  .fg-footer { margin-top: 2rem; padding: 2rem 0 1.5rem; }
  .fg-footer-grid { grid-template-columns: 1.3fr 1fr 1fr; gap: 1.5rem; }
  .fg-copy { margin-top: 1.5rem; }
}

@media (min-width: 1200px) {
  .fg-nav { gap: 0.15rem 1.5rem; }
}
