/*
Theme Name:  Material News
Theme URI:   https://example.com
Author:      Il tuo nome
Author URI:  https://example.com
Description: Tema editoriale ispirato a Material Design / Google News. Layout boxed, max 960px, responsive.
Version:     1.0.1
License:     GNU General Public License v2 or later
Text Domain: material-news
Tags:        news, blog, responsive, material-design
*/

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --c-primary:       #1a73e8;
  --c-primary-dark:  #1557b0;
  --c-surface:       #ffffff;
  --c-bg:            #f1f3f4;
  --c-text:          #202124;
  --c-text-2:        #5f6368;
  --c-text-3:        #80868b;
  --c-border:        #dadce0;
  --c-red:           #d93025;
  --c-green:         #188038;
  --c-amber:         #f29900;
  --c-blue-light:    #e8f0fe;
  --radius:          8px;
  --radius-lg:       12px;
  --font:            "Google Sans", Roboto, "Helvetica Neue", Arial, sans-serif;
  --max-w:           960px;
  --box-shadow:      0 1px 3px rgba(32,33,36,.12), 0 1px 2px rgba(32,33,36,.08);
  --box-shadow-hover:0 4px 12px rgba(32,33,36,.18);
}

@media (prefers-color-scheme: dark) {
  :root {
    --c-surface:    #1e1e1e;
    --c-bg:         #121212;
    --c-text:       #e8eaed;
    --c-text-2:     #9aa0a6;
    --c-text-3:     #5f6368;
    --c-border:     #3c4043;
    --c-blue-light: #1a2744;
  }
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

/* ============================================================
   BOXED WRAPPER
   ============================================================ */
/* FIX #1: .site-wrapper era senza min-height; aggiunto display:flex+column
   per assicurare che il footer rimanga sempre in basso */
.site-wrapper {
  max-width: var(--max-w);
  margin: 0 auto;
  background: var(--c-bg);
  box-shadow: 0 0 0 1px var(--c-border);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-content { flex: 1; }

/* ============================================================
   HEADER & TOPBAR
   ============================================================ */
/* FIX #2: Il site-header aveva position:sticky ma era dentro .site-wrapper
   non sul viewport. Corretto con position:sticky + top:0 sul wrapper. */
.site-header {
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  position: sticky;
  top: 0;
  z-index: 200;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 20px;
  gap: 12px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  /* FIX #3: min-width:0 impedisce overflow del flex child */
  min-width: 0;
  flex: 1;
}

.hamburger {
  width: 24px; height: 24px;
  display: flex; flex-direction: column;
  justify-content: space-around;
  cursor: pointer; flex-shrink: 0;
  background: none; border: none; padding: 0;
}
.hamburger span {
  height: 2px; background: var(--c-text-2);
  border-radius: 1px; display: block;
  transition: transform .2s;
}

/* FIX #4: .site-branding era senza flex-shrink:0, si comprimeva sotto altri flex items */
.site-branding { flex-shrink: 0; }

.site-branding .site-title {
  font-size: 20px; font-weight: 500;
  color: var(--c-primary); letter-spacing: -.4px;
  line-height: 1;
  white-space: nowrap;
}
.site-branding .site-title span { color: var(--c-text-2); }
.site-branding .site-title:hover { text-decoration: none; }

/* FIX #5: la search form nel topbar non aveva form { width:100% } — 
   il tag <form> dentro il wrapper non ereditava la larghezza */
.search-form-topbar {
  display: flex;
  align-items: center;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: 24px;
  padding: 0 16px;
  gap: 8px;
  height: 38px;
  flex: 1;
  max-width: 320px;
  transition: box-shadow .2s, border-color .2s;
  min-width: 0;
}
.search-form-topbar form {
  display: flex;
  width: 100%;
  min-width: 0;
}
.search-form-topbar:focus-within {
  box-shadow: 0 1px 6px rgba(32,33,36,.28);
  border-color: transparent;
}
.search-form-topbar input[type="search"] {
  border: none; background: transparent;
  font-size: 14px; color: var(--c-text);
  outline: none; width: 100%; font-family: var(--font);
  /* FIX #6: senza min-width:0 l'input overflow sul mobile */
  min-width: 0;
}
.search-icon {
  width: 18px; height: 18px;
  fill: var(--c-text-2); flex-shrink: 0;
}

.topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.btn-subscribe {
  background: var(--c-primary); color: #fff;
  border: none; border-radius: 20px;
  padding: 7px 16px; font-size: 13px; font-weight: 500;
  cursor: pointer; font-family: var(--font);
  white-space: nowrap; transition: background .15s;
  display: inline-block;
}
.btn-subscribe:hover {
  background: var(--c-primary-dark);
  text-decoration: none;
  color: #fff;
}

/* FIX #7: .avatar mancava di definizione in style.css (presente solo in HTML template) */
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--c-primary); color: #fff;
  font-size: 12px; font-weight: 500;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  user-select: none;
}

/* ============================================================
   NAV TABS
   ============================================================ */
.nav-tabs-bar {
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-tabs-bar::-webkit-scrollbar { display: none; }

/* FIX #8: .nav-tabs era ul > li > a ma lo stile usava .nav-tabs li a
   senza margin/padding su ul, causava overflow. Corretto. */
.nav-tabs {
  display: flex;
  padding: 0 12px;
  white-space: nowrap;
  margin: 0;
  list-style: none;
}

.nav-tabs li { display: block; }

.nav-tabs li a {
  display: block;
  padding: 13px 14px;
  font-size: 13px; font-weight: 500;
  color: var(--c-text-2);
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.nav-tabs li a:hover {
  color: var(--c-text);
  text-decoration: none;
  background: rgba(0,0,0,.03);
}
.nav-tabs li.current-menu-item > a,
.nav-tabs li a.active {
  color: var(--c-primary);
  border-bottom-color: var(--c-primary);
}

/* ============================================================
   LAYOUT CONTAINER
   ============================================================ */
/* FIX #9: padding era su .site-content, ma il grid era dentro .content-area.
   Uniformato. */
.site-content { padding: 20px; }

.content-area {
  display: grid;
  /* La prima colonna prende tutto lo spazio disponibile,
     la sidebar è fissa a 280px. min-width:0 sul main evita overflow. */
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 20px;
  align-items: start;
}

/* main-content deve stare nella prima colonna, widget-area nella seconda.
   Forziamo l'assegnazione esplicita per evitare che WP inserisca
   markup extra che sfasa il grid. */
.content-area .main-content {
  grid-column: 1;
  min-width: 0;
}
.content-area .widget-area {
  grid-column: 2;
  min-width: 0;
}

@media (max-width: 768px) {
  .content-area {
    grid-template-columns: 1fr;
  }
  .content-area .main-content { grid-column: 1; }
  .widget-area { display: none; }
}

/* ============================================================
   TOPIC CHIPS
   ============================================================ */
.topic-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.chip {
  padding: 6px 14px;
  border: 1px solid var(--c-border);
  border-radius: 16px;
  font-size: 13px; color: var(--c-text-2);
  cursor: pointer; background: var(--c-surface);
  transition: all .15s; text-decoration: none;
  display: inline-block;
  white-space: nowrap;
}
.chip:hover { background: var(--c-bg); text-decoration: none; }
.chip.active, .chip.current-cat {
  background: var(--c-blue-light);
  color: var(--c-primary);
  border-color: #c5d8fd;
  text-decoration: none;
}
@media (prefers-color-scheme: dark) {
  .chip.active, .chip.current-cat {
    background: #1a2744;
    color: #8ab4f8;
    border-color: #2a4280;
  }
}

/* ============================================================
   SECTION HEADER
   ============================================================ */
.section-hdr {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.section-hdr h2 { font-size: 15px; font-weight: 500; color: var(--c-text); }
.section-hdr .view-all {
  font-size: 13px; font-weight: 500; color: var(--c-primary);
  white-space: nowrap;
}
.section-hdr .view-all:hover { text-decoration: underline; }

/* ============================================================
   HERO CARD
   ============================================================ */
/* FIX #11: .hero-card era <a> ma mancavano color:inherit e display:block
   coerenti con il tema; il testo ereditava il colore link blu. */
.hero-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow .2s;
  margin-bottom: 20px;
  display: block;
  color: inherit;
}
.hero-card:hover { box-shadow: var(--box-shadow-hover); text-decoration: none; }

.hero-card .post-thumbnail {
  width: 100%;
  aspect-ratio: 16/7;
  overflow: hidden;
  background: var(--c-blue-light);
}
.hero-card .post-thumbnail img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .3s;
}
.hero-card:hover .post-thumbnail img { transform: scale(1.02); }

.hero-card .card-body { padding: 18px 20px; }

.hero-card .post-category {
  font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .8px;
  color: var(--c-primary);
  margin-bottom: 8px;
  display: inline-block;
}

/* Regola base per .post-category in tutti i contesti.
   mn_get_primary_category() emette <a class="post-category">,
   quindi questa classe può stare sia su <a> che su <div>/<span>. */
.post-category {
  font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .8px;
  color: var(--c-primary);
  display: inline-block;
  margin-bottom: 6px;
  text-decoration: none;
}
.post-category:hover { text-decoration: none; color: var(--c-primary-dark); }
/* Link annidato dentro un div.post-category (caso legacy) */
.post-category a,
.post-category a:hover {
  color: var(--c-primary);
  text-decoration: none;
}

.hero-card .post-title {
  font-size: 22px; font-weight: 500; line-height: 1.3;
  color: var(--c-text); margin-bottom: 10px;
}
/* FIX #14: .post-excerpt era definito solo sul hero, senza classe scoping:
   aggiunto il selettore padre per evitare collision future */
.hero-card .post-excerpt {
  font-size: 14px; color: var(--c-text-2);
  line-height: 1.65; margin-bottom: 14px;
}

/* ============================================================
   POST META (condiviso tra hero, single, card)
   ============================================================ */
.post-meta {
  display: flex; align-items: center;
  gap: 6px; font-size: 12px; color: var(--c-text-3);
  flex-wrap: wrap;
}
/* FIX #15: .dot aveva definizioni duplicate e inconsistenti (3px vs 4px);
   unificato a 3px */
.dot {
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--c-text-3); display: inline-block;
  flex-shrink: 0;
}
.post-meta .author-name { font-weight: 500; color: var(--c-text-2); }
.read-time { font-size: 12px; color: var(--c-text-3); }

/* ============================================================
   DISCOVER STRIP
   ============================================================ */
.discover-strip-wrapper { margin-bottom: 20px; }

.discover-strip {
  display: flex; gap: 12px;
  overflow-x: auto; padding-bottom: 8px;
  scrollbar-width: none;
  /* FIX #16: senza padding-left il primo card veniva tagliato sul bordo */
  padding-left: 1px;
}
.discover-strip::-webkit-scrollbar { display: none; }

.discover-card {
  flex-shrink: 0; width: 190px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  overflow: hidden; cursor: pointer;
  transition: box-shadow .2s;
  display: block;
  /* FIX #17: color:inherit mancante; i link dentro le card erano blu */
  color: inherit;
}
.discover-card:hover { box-shadow: var(--box-shadow-hover); text-decoration: none; }
.discover-card .post-thumbnail {
  width: 100%; aspect-ratio: 3/2;
  overflow: hidden; background: var(--c-blue-light);
}
.discover-card .post-thumbnail img {
  width: 100%; height: 100%; object-fit: cover;
}
.discover-card .card-body { padding: 10px 12px; }
.discover-card .post-category {
  font-size: 10px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .8px;
  color: var(--c-text-3);
  margin-bottom: 4px;
  display: block;
  text-decoration: none;
}
.discover-card .post-category:hover { color: var(--c-text-3); text-decoration: none; }
.discover-card .post-title {
  font-size: 13px; font-weight: 500; line-height: 1.35;
  color: var(--c-text);
  display: -webkit-box;
  -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================================
   NEWS LIST
   ============================================================ */
.news-list {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
}

/* FIX #18: .news-item era <article> (non <a>), le azioni erano <button>;
   il hover background non si propagava correttamente senza position:relative */
.news-item {
  display: flex; gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--c-border);
  transition: background .15s;
  align-items: flex-start;
  position: relative;
}
.news-item:last-child { border-bottom: none; }
.news-item:hover { background: var(--c-bg); }

.news-item .news-content { flex: 1; min-width: 0; }

/* FIX #19: .post-source nel template usava .news-item-source ma nel PHP
   era .post-source — il CSS ora copre entrambi */
.news-item .post-source,
.news-item .news-item-source {
  font-size: 11px; color: var(--c-text-3);
  margin-bottom: 5px;
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
}
.news-item .post-source .badge,
.news-item .news-item-source .badge { margin-left: auto; }

.news-item .post-title {
  font-size: 15px; font-weight: 500; line-height: 1.35;
  color: var(--c-text); margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
/* FIX #20: i link del titolo nella news-item ereditavano il colore primario */
.news-item .post-title a {
  color: var(--c-text);
  text-decoration: none;
}
.news-item .post-title a:hover { color: var(--c-primary); }

.news-item .news-actions {
  display: flex; gap: 4px; margin-top: 8px;
}
.action-btn {
  background: none; border: none; cursor: pointer;
  padding: 4px 8px; border-radius: 4px;
  font-size: 12px; color: var(--c-text-2);
  display: flex; align-items: center; gap: 4px;
  font-family: var(--font);
  transition: background .15s;
  /* FIX #21: position:relative z-index per stare sopra l'hover dell'article */
  position: relative; z-index: 1;
}
.action-btn:hover { background: var(--c-bg); }
.action-btn svg { width: 14px; height: 14px; fill: var(--c-text-2); }

/* FIX #22: il thumbnail nella news-item era 80x80 nel CSS ma nel PHP
   usava mn-thumb che è 160x160; aggiunto min-height per evitare collasso */
.news-item .post-thumbnail {
  width: 80px;
  height: 80px;
  min-width: 80px;
  border-radius: var(--radius);
  overflow: hidden; flex-shrink: 0;
  background: var(--c-blue-light);
}
.news-item .post-thumbnail img {
  width: 100%; height: 100%; object-fit: cover;
}
/* FIX #23: .thumb-placeholder non aveva dimensioni definite nel CSS — collassava */
.thumb-placeholder {
  width: 80px; height: 80px;
  background: var(--c-blue-light);
  border-radius: var(--radius);
  flex-shrink: 0;
}
.news-item .thumb-placeholder {
  width: 80px; height: 80px;
}

/* ============================================================
   BADGE
   ============================================================ */
.badge {
  display: inline-block; padding: 2px 8px;
  border-radius: 4px; font-size: 11px; font-weight: 500;
  /* FIX #24: white-space:nowrap mancante; i badge si spezzavano su 2 righe */
  white-space: nowrap;
}
.badge-red   { background: #fce8e6; color: #c5221f; }
.badge-blue  { background: var(--c-blue-light); color: var(--c-primary-dark); }
.badge-green { background: #e6f4ea; color: #137333; }
.badge-amber { background: #fef0cd; color: #835700; }
@media (prefers-color-scheme: dark) {
  .badge-red   { background: #3c1412; color: #f28b82; }
  .badge-blue  { background: #1a2744; color: #8ab4f8; }
  .badge-green { background: #0d2b18; color: #81c995; }
  .badge-amber { background: #3b2a00; color: #fdd663; }
}

/* ============================================================
   PAGINATION
   ============================================================ */
/* FIX #25: .pagination necessitava di margin-top per distanziarsi dalla news-list */
.pagination {
  display: flex; justify-content: center;
  gap: 6px; padding: 8px 0 16px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.page-numbers {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 500;
  color: var(--c-text-2); border: 1px solid var(--c-border);
  background: var(--c-surface); transition: all .15s;
  text-decoration: none;
}
.page-numbers:hover {
  border-color: var(--c-primary); color: var(--c-primary);
  text-decoration: none;
}
.page-numbers.current {
  background: var(--c-primary); color: #fff;
  border-color: var(--c-primary);
}
/* FIX #26: WP genera anche .prev/.next come link senza numero — 
   devono avere width:auto */
.page-numbers.prev,
.page-numbers.next {
  width: auto; padding: 0 12px;
}

/* ============================================================
   SINGLE POST
   ============================================================ */
.single-article {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
}
.single-article .post-thumbnail img {
  width: 100%; aspect-ratio: 16/7; object-fit: cover;
  display: block;
}
.single-article .article-body { padding: 24px 28px; }

@media (max-width: 600px) {
  .single-article .article-body { padding: 16px; }
}

.single-article .post-category {
  font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .8px;
  color: var(--c-primary); margin-bottom: 10px;
  display: block;
}
.single-article .post-title {
  font-size: 28px; font-weight: 500; line-height: 1.25;
  margin-bottom: 14px; color: var(--c-text);
}
.single-article .post-meta {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--c-border);
}
.single-article .entry-content {
  font-size: 16px; line-height: 1.75; color: var(--c-text);
}
.single-article .entry-content p { margin-bottom: 1.4em; }
.single-article .entry-content h2 {
  font-size: 20px; font-weight: 500; margin: 1.8em 0 .8em;
}
.single-article .entry-content h3 {
  font-size: 17px; font-weight: 500; margin: 1.6em 0 .7em;
}
.single-article .entry-content ul,
.single-article .entry-content ol { margin: 0 0 1.4em 1.5em; }
.single-article .entry-content li { margin-bottom: .4em; }
.single-article .entry-content blockquote {
  border-left: 3px solid var(--c-primary);
  padding: 8px 16px; margin: 1.6em 0;
  color: var(--c-text-2); font-style: italic;
  background: var(--c-blue-light);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.single-article .entry-content a { color: var(--c-primary); }

/* FIX #27: le immagini nell'entry-content non avevano max-width+border-radius */
.single-article .entry-content img {
  max-width: 100%; height: auto;
  border-radius: var(--radius);
  margin: 1.2em 0;
}

/* ============================================================
   POST TAGS
   ============================================================ */
.post-tags {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 24px; padding-top: 16px;
  border-top: 1px solid var(--c-border);
}
.post-tags a {
  padding: 4px 12px; border: 1px solid var(--c-border);
  border-radius: 16px; font-size: 12px; color: var(--c-text-2);
  background: var(--c-bg); transition: all .15s;
}
.post-tags a:hover {
  color: var(--c-primary); border-color: var(--c-primary);
  text-decoration: none;
}

/* ============================================================
   SIDEBAR WIDGETS
   ============================================================ */
.widget-area {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 116px;
  max-height: calc(100vh - 130px);
  overflow-y: auto;
  scrollbar-width: none;
}
.widget-area::-webkit-scrollbar { display: none; }

.widget {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 16px;
}
.widget-title {
  font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .8px;
  color: var(--c-text-3); margin-bottom: 14px;
}

/* trending */
.trending-list { padding: 0; margin: 0; }
.trending-list li {
  display: flex; align-items: flex-start;
  gap: 12px; padding: 8px 0;
  border-bottom: 1px solid var(--c-border);
  cursor: pointer;
}
.trending-list li:first-child { padding-top: 0; }
.trending-list li:last-child { border-bottom: none; padding-bottom: 0; }
.trending-num {
  font-size: 20px; font-weight: 500;
  color: var(--c-border); min-width: 24px; line-height: 1;
  flex-shrink: 0;
}
/* FIX #29: .trending-text e .trending-sub non avevano min-width:0 —
   il testo lungo usciva fuori dal contenitore */
.trending-list li > div { min-width: 0; }
.trending-text {
  font-size: 13px; font-weight: 500; color: var(--c-text);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.trending-sub  { font-size: 11px; color: var(--c-text-3); margin-top: 2px; }

/* newsletter widget */
.widget-newsletter p {
  font-size: 13px; color: var(--c-text-2);
  line-height: 1.6; margin-bottom: 12px;
}
/* FIX #30: il campo email nel widget non aveva box-sizing definito,
   padding+border causavano overflow */
.widget-newsletter input[type="email"] {
  width: 100%; padding: 9px 12px; margin-bottom: 8px;
  border: 1px solid var(--c-border); border-radius: var(--radius);
  background: var(--c-bg); color: var(--c-text);
  font-size: 13px; font-family: var(--font); outline: none;
  box-sizing: border-box;
}
.widget-newsletter input[type="email"]:focus {
  border-color: var(--c-primary);
}
.widget-newsletter .btn-nl {
  width: 100%; padding: 10px;
  background: var(--c-primary); color: #fff;
  border: none; border-radius: var(--radius);
  font-size: 14px; font-weight: 500;
  cursor: pointer; font-family: var(--font);
  transition: background .15s;
}
.widget-newsletter .btn-nl:hover { background: var(--c-primary-dark); }

/* recenti sidebar */
.widget-recent { padding: 0; margin: 0; }
.widget-recent li {
  border-bottom: 1px solid var(--c-border);
  padding: 10px 0;
}
.widget-recent li:first-child { padding-top: 0; }
.widget-recent li:last-child { border-bottom: none; padding-bottom: 0; }
.widget-recent a {
  font-size: 13px; font-weight: 500; color: var(--c-text);
  display: block;
}
.widget-recent a:hover { color: var(--c-primary); text-decoration: none; }
.widget-recent .item-date { font-size: 11px; color: var(--c-text-3); margin-top: 3px; }

/* ============================================================
   SEARCH FORM (standalone — usata in 404 e content-none)
   ============================================================ */
/* FIX #31: la search form standalone non aveva stili propri nel CSS del tema;
   copiava il topbar .search-form-topbar ma con class="search-form" */
.search-form {
  display: flex;
  max-width: 400px;
  margin: 0 auto;
}
.search-form .search-form-topbar {
  width: 100%;
  max-width: 100%;
}

/* ============================================================
   404 / NO RESULTS
   ============================================================ */
.page-no-results {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 48px 32px;
  text-align: center;
}
.page-no-results h1 {
  font-size: 72px; font-weight: 300;
  color: var(--c-border); line-height: 1;
}
.page-no-results h2 {
  font-size: 22px; font-weight: 500;
  margin: 12px 0 8px;
}
.page-no-results p {
  font-size: 15px; color: var(--c-text-2); margin-bottom: 20px;
}

/* ============================================================
   FOOTER
   ============================================================ */
/* FIX #32: il footer era dentro site-wrapper ma non aveva margin-top automatico;
   con flex su .site-wrapper ora si posiziona in fondo */
.site-footer {
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  padding: 28px 20px 20px;
  margin-top: auto;
}
.footer-inner {
  display: flex; flex-wrap: wrap;
  gap: 16px; justify-content: space-between;
  align-items: flex-start;
}
.footer-brand .site-title {
  font-size: 18px; font-weight: 500;
  color: var(--c-primary);
  display: block;
}
.footer-brand .site-title:hover { text-decoration: none; }
.footer-brand .site-title span { color: var(--c-text-2); }
.footer-brand .tagline { font-size: 12px; color: var(--c-text-3); margin-top: 4px; }

.footer-nav { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.footer-nav a { font-size: 12px; color: var(--c-text-3); }
.footer-nav a:hover { color: var(--c-primary); text-decoration: none; }

.footer-bottom {
  margin-top: 20px; padding-top: 16px;
  border-top: 1px solid var(--c-border);
  display: flex; flex-wrap: wrap; gap: 8px;
  justify-content: space-between;
  font-size: 11px; color: var(--c-text-3);
}
.footer-bottom a { color: var(--c-text-3); }
.footer-bottom a:hover { color: var(--c-primary); }

/* ============================================================
   PAGE TEMPLATE (page.php)
   ============================================================ */
/* FIX #33: la page aveva .single-article senza .post-meta,
   ma la classe era comunque applicata — nessun problema strutturale,
   ma assicuriamo padding corretto su pagine statiche */
.page .single-article .article-body { padding: 28px 32px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 600px) {
  .topbar { padding: 0 12px; }
  /* FIX #34: la search nel topbar su mobile occupava spazio inutile
     e comprimeva il logo */
  .search-form-topbar { display: none; }
  .btn-subscribe { display: none; }
  .site-content { padding: 12px; }
  .hero-card .post-title { font-size: 18px; }
  .single-article .post-title { font-size: 22px; }
  .page-no-results { padding: 32px 16px; }
  .page-no-results h1 { font-size: 52px; }
}

@media (max-width: 400px) {
  .nav-tabs li a { padding: 12px 10px; font-size: 12px; }
  .topic-chips { gap: 6px; }
  .chip { padding: 5px 10px; font-size: 12px; }
}

/* ============================================================
   ACCESSIBILITÀ & PRINT
   ============================================================ */
/* FIX #35: focus outline mancante — elementi interattivi non visibili
   con tastiera */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

/* ============================================================
   MOBILE DRAWER
   ============================================================ */
#mn-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 300;
  opacity: 0;
  transition: opacity .25s;
}
#mn-drawer-overlay.visible {
  display: block;
  opacity: 1;
}

#mn-drawer {
  position: fixed;
  top: 0; left: 0;
  width: 280px;
  height: 100%;
  background: var(--c-surface);
  z-index: 400;
  transform: translateX(-100%);
  transition: transform .25s cubic-bezier(.4,0,.2,1);
  overflow-y: auto;
  box-shadow: 2px 0 12px rgba(0,0,0,.15);
  display: flex;
  flex-direction: column;
}
#mn-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--c-border);
}
.drawer-logo {
  font-size: 18px; font-weight: 500;
  color: var(--c-primary);
}
.drawer-logo span { color: var(--c-text-2); }

.drawer-close {
  background: none; border: none;
  cursor: pointer; padding: 4px;
  color: var(--c-text-2);
  border-radius: 4px;
  display: flex; align-items: center;
  transition: background .15s;
}
.drawer-close:hover { background: var(--c-bg); }

.drawer-menu {
  list-style: none;
  padding: 8px 0;
  margin: 0;
  border-bottom: 1px solid var(--c-border);
}
.drawer-menu li a {
  display: block;
  padding: 12px 20px;
  font-size: 14px; font-weight: 500;
  color: var(--c-text);
  transition: background .15s, color .15s;
}
.drawer-menu li a:hover,
.drawer-menu li.current-menu-item > a {
  background: var(--c-blue-light);
  color: var(--c-primary);
  text-decoration: none;
}

.drawer-section-title {
  font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .8px;
  color: var(--c-text-3);
  padding: 16px 20px 8px;
}
.drawer-cats {
  list-style: none; margin: 0; padding: 0 0 16px;
}
.drawer-cats li a {
  display: block;
  padding: 8px 20px;
  font-size: 13px; color: var(--c-text-2);
  transition: color .15s;
}
.drawer-cats li a:hover { color: var(--c-primary); text-decoration: none; }

/* Hamburger → X animation quando il drawer è aperto */
.hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}
.hamburger span {
  transition: transform .2s, opacity .2s;
}
