/*
Theme Name: Osservatorio del Web
Theme URI: https://osservatoriodelweb.org
Author: MLP Studio Srl
Author URI: https://mlpstudio.it
Description: Tema istituzionale per l'Osservatorio del Web — Associazione senza scopo di lucro che osserva, monitora e analizza l'impatto delle tecnologie digitali sulla società.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: flavor-odw
*/

/* ═══════════════════════════════════════════
   OSSERVATORIO DEL WEB — Design System
   Editorial, institutional-modern prototype
   Brand colors from osservatoriodelweb.org
   ═══════════════════════════════════════════ */

/* ── Custom Properties ── */
:root {
  /* Colors — from osservatoriodelweb.org brand */
  --color-bg:          #ffffff;
  --color-bg-alt:      #f5f4f0;
  --color-bg-card:     #ffffff;
  --color-text:        #29235c;
  --color-text-secondary: #4a4568;
  --color-text-muted:  #7d7896;
  --color-accent:      #29235c;
  --color-accent-hover:#1e1a47;
  --color-border:      #d8d5e0;
  --color-border-light:#eae8f0;
  --color-quote-bar:   #29235c;
  --color-tag-bg:      #edeaf5;
  --color-tag-text:    #4a4568;

  /* Typography — Rubik from the original site */
  --font-serif:   'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-sans:    'Rubik', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Spacing */
  --space-xs:  0.5rem;
  --space-sm:  1rem;
  --space-md:  1.5rem;
  --space-lg:  2.5rem;
  --space-xl:  4rem;
  --space-2xl: 6rem;

  /* Layout */
  --container-max:     1140px;
  --content-narrow:    740px;
  --border-radius:     3px;
}

/* ── Reset & Base ── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ── Layout ── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.content-narrow {
  max-width: var(--content-narrow);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* ── Section rhythm ── */
.section {
  padding: var(--space-2xl) 0;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--space-sm);
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.section-intro {
  font-size: 1.075rem;
  color: var(--color-text-secondary);
  line-height: 1.65;
  margin-bottom: var(--space-xl);
  max-width: 600px;
}


/* ═══════════════════════════════════
   HEADER
   ═══════════════════════════════════ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-border-light);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

.site-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.site-logo img {
  height: 28px;
  width: auto;
}

.site-logo:hover {
  text-decoration: none;
}

.nav-list {
  display: flex;
  list-style: none;
  gap: var(--space-md);
}

.nav-list a {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color 0.2s ease;
}

.nav-list a:hover {
  color: var(--color-text);
  text-decoration: none;
}


/* ═══════════════════════════════════
   HERO
   ═══════════════════════════════════ */

.hero {
  padding: var(--space-2xl) 0;
  background-color: var(--color-accent);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  align-items: center;
}

.hero-content {
  order: 1;
}

.hero-image {
  order: 2;
}

.hero-image img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  opacity: 0.9;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: #ffffff;
  max-width: 700px;
  margin-bottom: var(--space-md);
}

.hero-subtitle {
  font-size: 1.15rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.75);
  max-width: 580px;
  margin-bottom: var(--space-lg);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.cta {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.cta-primary {
  background-color: #ffffff;
  color: var(--color-accent);
}

.cta-primary:hover {
  background-color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
}

.cta-secondary {
  background-color: transparent;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.cta-secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
  text-decoration: none;
}


/* ═══════════════════════════════════
   CHI SIAMO
   ═══════════════════════════════════ */

.chi-siamo {
  background-color: var(--color-bg);
}

.chi-siamo-text {
  background-color: var(--color-bg-alt);
  padding: var(--space-lg);
  border-radius: var(--border-radius);
}

.chi-siamo-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  align-items: center;
}

.chi-siamo-image img {
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.chi-siamo-body p {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}

.chi-siamo-body p:last-child {
  margin-bottom: 0;
}

.chi-siamo-body strong {
  font-weight: 600;
}


/* ═══════════════════════════════════
   AREE DI INTERVENTO — Carousel
   ═══════════════════════════════════ */

.aree {
  background-color: var(--color-bg);
}

/* ── Carousel wrapper ── */
.carousel {
  position: relative;
}

.carousel-track {
  display: flex;
  gap: var(--space-md);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;

  /* Hide scrollbar but keep scroll */
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;       /* IE/Edge */
}

.carousel-track::-webkit-scrollbar {
  display: none;                  /* Chrome/Safari */
}

/* ── Navigation arrows ── */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background-color: var(--color-accent);
  color: #ffffff;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, opacity 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.carousel-btn:hover {
  background-color: var(--color-accent-hover);
}

.carousel-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.carousel-btn--prev {
  left: -22px;
}

.carousel-btn--next {
  right: -22px;
}

/* ── Dots ── */
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: var(--space-md);
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--color-accent);
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.carousel-dot.is-active {
  background-color: var(--color-accent);
}

.carousel-dot:hover {
  background-color: var(--color-accent);
  opacity: 0.6;
}

/* ── Cards inside carousel ── */
.area-card {
  flex: 0 0 calc(33.333% - var(--space-md) * 2 / 3);
  min-width: 280px;
  background-color: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--border-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  scroll-snap-align: start;
}

.area-card-image {
  width: 100%;
  height: 170px;
  overflow: hidden;
}

.area-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.area-card-body {
  padding: var(--space-md);
  flex: 1;
  border-top: 3px solid var(--color-accent);
}

.area-card-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: var(--space-xs);
  color: var(--color-text);
}

.area-card-desc {
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--color-text-secondary);
}


/* ═══════════════════════════════════
   ARTICOLI — Card Grid
   ═══════════════════════════════════ */

.articoli {
  background-color: #f8f8f8;
}

.articoli-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

.articolo-card {
  background-color: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  border-top: 3px solid var(--color-accent);
  border-radius: var(--border-radius);
  padding: var(--space-lg) var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  transition: box-shadow 0.2s ease;
}

.articolo-card:hover {
  box-shadow: 0 4px 16px rgba(41, 35, 92, 0.08);
}

.articolo-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: 0.25rem;
}

.articolo-date {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.articolo-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--color-tag-text);
  background-color: var(--color-tag-bg);
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.articolo-card-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--color-text);
}

.articolo-card-excerpt {
  font-size: 0.925rem;
  line-height: 1.7;
  color: var(--color-text-secondary);
}

.articoli-actions {
  text-align: center;
  margin-top: var(--space-lg);
}

.cta-archivio {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.75rem 2rem;
  color: var(--color-accent);
  border: 2px solid var(--color-accent);
  border-radius: var(--border-radius);
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.cta-archivio:hover {
  background-color: var(--color-accent);
  color: #ffffff;
  text-decoration: none;
}

.articoli-note {
  margin-top: var(--space-sm);
  font-size: 0.85rem;
  color: var(--color-text-muted);
  text-align: center;
}


/* ═══════════════════════════════════
   RASSEGNA STAMPA — Carousel
   ═══════════════════════════════════ */

.rassegna {
  background-color: var(--color-bg);
}

/* ── Carousel wrapper ── */
.rassegna-carousel {
  position: relative;
}

.rassegna-track {
  display: flex;
  gap: var(--space-md);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.rassegna-track::-webkit-scrollbar {
  display: none;
}

/* ── Dots ── */
.rassegna-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: var(--space-md);
}

/* ── Cards ── */
.rassegna-card {
  flex: 0 0 calc(33.333% - var(--space-md) * 2 / 3);
  min-width: 300px;
  background-color: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  border-left: 3px solid var(--color-quote-bar);
  border-radius: var(--border-radius);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  scroll-snap-align: start;
}

.rassegna-quote {
  margin-bottom: 0;
}

.rassegna-quote p {
  font-family: var(--font-serif);
  font-size: 0.975rem;
  font-style: italic;
  line-height: 1.7;
  color: var(--color-text);
}

.rassegna-meta {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
}

.rassegna-source {
  font-size: 0.82rem;
  font-weight: 600;
  font-style: normal;
  color: var(--color-text);
}

.rassegna-date {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

.rassegna-comment {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
}

.rassegna-note {
  margin-top: var(--space-lg);
  font-size: 0.85rem;
  color: var(--color-text-muted);
}


/* ═══════════════════════════════════
   DETAIL PAGES
   ═══════════════════════════════════ */

.detail-page {
  padding-top: 5rem;
}

.detail-header {
  margin-bottom: var(--space-lg);
}

.detail-header .articolo-tag {
  margin-right: var(--space-xs);
}

.detail-header .rassegna-meta {
  margin-bottom: var(--space-sm);
}

.detail-header h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-text);
  letter-spacing: -0.01em;
  margin-top: var(--space-sm);
}

.detail-body {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--color-text);
}

.detail-body p {
  margin-bottom: var(--space-md);
}

.detail-body blockquote {
  font-style: italic;
  font-size: 1.2rem;
  line-height: 1.75;
  color: var(--color-text);
  border-left: 3px solid var(--color-quote-bar);
  padding-left: var(--space-md);
  margin: var(--space-lg) 0;
}

.detail-body .detail-comment {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--color-text-secondary);
  background-color: var(--color-bg-alt);
  padding: var(--space-md);
  border-radius: var(--border-radius);
  margin: var(--space-lg) 0;
}

.detail-body .detail-comment strong {
  font-weight: 600;
  color: var(--color-text);
}

.detail-back {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-accent);
  margin-top: var(--space-lg);
  padding-bottom: var(--space-2xl);
}

.detail-back:hover {
  text-decoration: underline;
}


/* ═══════════════════════════════════
   ARCHIVE PAGES
   ═══════════════════════════════════ */

.archive-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  max-width: 900px;
}

.archive-list .rassegna-card {
  flex: none;
  min-width: 0;
  width: 100%;
  scroll-snap-align: none;
}

.archive-list .articolo-card {
  width: 100%;
}


/* ═══════════════════════════════════
   NEWSLETTER
   ═══════════════════════════════════ */

.newsletter {
  background-color: var(--color-bg-alt);
}

.newsletter .section-title {
  margin-bottom: var(--space-lg);
}

.newsletter-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
}

.newsletter-heading {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
  color: var(--color-text);
}

.contatti-col p {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-xs);
}

.contatti-col .contatti-address {
  margin-top: var(--space-sm);
}

.newsletter-intro {
  font-size: 1.025rem;
  line-height: 1.7;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-lg);
  max-width: 540px;
}

.newsletter-form {
  display: flex;
  gap: var(--space-sm);
  max-width: 480px;
}

.newsletter-form input[type="email"] {
  flex: 1;
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  background-color: var(--color-bg-card);
  color: var(--color-text);
}

.newsletter-form input[type="email"]:focus {
  outline: none;
  border-color: var(--color-accent);
}

.newsletter-form button {
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  color: #ffffff;
  background-color: var(--color-accent);
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: background-color 0.2s ease;
}

.newsletter-form button:hover {
  background-color: var(--color-accent-hover);
}

.newsletter-privacy {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-top: var(--space-sm);
  max-width: 480px;
}

.newsletter-privacy a {
  color: var(--color-text-muted);
  text-decoration: underline;
}

.newsletter-feedback {
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.65rem 1rem;
  border-radius: var(--border-radius);
  margin-bottom: var(--space-sm);
  max-width: 480px;
}

.newsletter-feedback--ok {
  color: #1a6d3a;
  background-color: #e8f5e9;
  border: 1px solid #c8e6c9;
}

.newsletter-feedback--error {
  color: #8b1a1a;
  background-color: #fce4ec;
  border: 1px solid #f8bbd0;
}


/* ═══════════════════════════════════
   RASSEGNA / ARTICOLO — "Leggi tutto" link
   ═══════════════════════════════════ */

.rassegna-read-more,
.articolo-read-more {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-accent);
  margin-top: auto;
  padding-top: var(--space-xs);
}

.rassegna-read-more:hover,
.articolo-read-more:hover {
  text-decoration: underline;
}


/* ═══════════════════════════════════
   CONTATTI
   ═══════════════════════════════════ */

.contatti {
  background-color: var(--color-bg);
}

.contatti-intro {
  font-size: 1.025rem;
  line-height: 1.7;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-xl);
}

.email-link {
  font-weight: 600;
  color: var(--color-accent);
}

.contatti-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: 0.01em;
}

.form-group input,
.form-group textarea {
  font-size: 0.95rem;
  line-height: 1.5;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  background-color: var(--color-bg-card);
  color: var(--color-text);
  transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-accent);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.form-submit {
  align-self: flex-start;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.75rem 2rem;
  color: #fff;
  background-color: var(--color-accent);
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: background-color 0.2s ease;
}

.form-submit:hover {
  background-color: var(--color-accent-hover);
}


/* ═══════════════════════════════════
   FOOTER
   ═══════════════════════════════════ */

.site-footer {
  padding: var(--space-xl) 0 0;
  background-color: var(--color-accent);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

.footer-col {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.875rem;
  line-height: 1.7;
}

.footer-col a {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
}

.footer-col a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.footer-logo-text {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.footer-tagline {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.6;
}

.footer-heading {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: var(--space-xs);
}

.footer-contacts p {
  margin-bottom: 0.25rem;
}

.footer-links ul,
.footer-social ul {
  list-style: none;
}

.footer-links li,
.footer-social li {
  margin-bottom: 0.25rem;
}

.footer-bottom {
  margin-top: var(--space-lg);
  padding: var(--space-sm) 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
}

.footer-bottom p {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.4);
}


/* ═══════════════════════════════════
   RESPONSIVE — Tablet (600px+)
   ═══════════════════════════════════ */

@media (min-width: 600px) {
  .area-card {
    flex: 0 0 calc(50% - var(--space-md) / 2);
  }

  .rassegna-card {
    flex: 0 0 calc(50% - var(--space-md) / 2);
  }

  .articoli-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 900px;
    margin: 0 auto;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* ═══════════════════════════════════
   RESPONSIVE — Desktop (960px+)
   ═══════════════════════════════════ */

@media (min-width: 960px) {
  .hero {
    padding: var(--space-2xl) 0 calc(var(--space-2xl) + 1rem);
  }

  .hero-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
  }

  .hero-content {
    order: 1;
  }

  .hero-image {
    order: 2;
  }

  .hero-title {
    max-width: 750px;
  }

  .chi-siamo-grid {
    grid-template-columns: 5fr 7fr;
    gap: var(--space-2xl);
  }

  .section-title {
    font-size: 2.25rem;
  }

  .area-card {
    flex: 0 0 calc(33.333% - var(--space-md) * 2 / 3);
  }

  .rassegna-card {
    flex: 0 0 calc(33.333% - var(--space-md) * 2 / 3);
  }

  .articoli-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 900px;
    margin: 0 auto;
  }

  .newsletter-grid {
    grid-template-columns: 1fr 1fr;
  }

  .nav-list {
    gap: var(--space-lg);
  }

  .footer-grid {
    grid-template-columns: 2fr 1.5fr 1fr 1fr;
    gap: var(--space-xl);
  }
}


/* ═══════════════════════════════════
   RESPONSIVE — Mobile (max 768px)
   ═══════════════════════════════════ */

@media (max-width: 768px) {
  .site-nav {
    display: none;
  }

  .header-inner {
    justify-content: center;
  }

  .hero-title {
    font-size: 2rem;
  }

  .section {
    padding: var(--space-xl) 0;
  }

  .hero {
    padding: var(--space-xl) 0;
  }

  .hero-actions {
    flex-direction: column;
  }

  .cta {
    text-align: center;
  }

  /* Newsletter: stack on mobile */
  .newsletter-form {
    flex-direction: column;
  }

  /* Carousel: single card, hide arrows (swipe to navigate) */
  .area-card {
    flex: 0 0 85%;
  }

  .rassegna-card {
    flex: 0 0 85%;
  }

  .carousel-btn {
    display: none;
  }
}


/* ═══════════════════════════════════
   ARCHIVE PAGES — Improved
   ═══════════════════════════════════ */

.archive-page {
  padding: var(--space-xl) 0 var(--space-2xl);
}

.archive-header {
  margin-bottom: var(--space-lg);
  padding-top: var(--space-lg);
}

/* Category filters */
.archive-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border-light);
}

.filter-btn {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  background-color: transparent;
  padding: 0.4rem 1rem;
  border: 1px solid var(--color-border-light);
  border-radius: 20px;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.filter-btn:hover {
  color: var(--color-text);
  border-color: var(--color-accent);
  text-decoration: none;
}

.filter-btn.is-active {
  color: #ffffff;
  background-color: var(--color-accent);
  border-color: var(--color-accent);
}

/* Archive grid */
.archive-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  max-width: 900px;
}

.archive-grid .articolo-card {
  width: 100%;
}

.archive-grid--rassegna .rassegna-card {
  flex: none;
  min-width: 0;
  width: 100%;
  scroll-snap-align: none;
}

.archive-empty {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  padding: var(--space-xl) 0;
}

/* Homepage filters */
.home-filters {
  border-bottom: none;
  margin-bottom: var(--space-lg);
}

/* Card wrapper for JS filtering */
.articolo-card-wrap {
  display: flex;
}

.articolo-card-wrap .articolo-card {
  width: 100%;
}

@media (min-width: 600px) {
  .archive-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* ═══════════════════════════════════
   WORDPRESS — Specific Styles
   ═══════════════════════════════════ */

/* Admin bar offset for sticky header */
.admin-bar .site-header {
  top: 32px;
}

@media screen and (max-width: 782px) {
  .admin-bar .site-header {
    top: 46px;
  }
}

/* Screen reader text (WP accessibility) */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute !important;
  width: 1px;
  word-wrap: normal !important;
}

.screen-reader-text:focus {
  background-color: #f1f1f1;
  border-radius: 3px;
  box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
  clip: auto !important;
  clip-path: none;
  color: #21759b;
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  height: auto;
  left: 5px;
  line-height: normal;
  padding: 15px 23px 14px;
  text-decoration: none;
  top: 5px;
  width: auto;
  z-index: 100000;
}

/* WP Navigation menu classes */
.nav-list .menu-item a {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color 0.2s ease;
}

.nav-list .menu-item a:hover {
  color: var(--color-text);
  text-decoration: none;
}

.nav-list .current-menu-item a {
  color: var(--color-text);
}

/* Footer WP menu */
.footer-links .menu,
.footer-social .menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links .menu-item,
.footer-social .menu-item {
  margin-bottom: 0.25rem;
}

.footer-links .menu-item a,
.footer-social .menu-item a {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-size: 0.875rem;
}

.footer-links .menu-item a:hover,
.footer-social .menu-item a:hover {
  color: #ffffff;
  text-decoration: underline;
}

/* WP Alignment classes */
.alignleft {
  float: left;
  margin-right: var(--space-md);
  margin-bottom: var(--space-md);
}

.alignright {
  float: right;
  margin-left: var(--space-md);
  margin-bottom: var(--space-md);
}

.aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--space-md);
}

.alignwide {
  max-width: 100%;
}

.alignfull {
  max-width: 100vw;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
}

/* WP Captions */
.wp-caption {
  max-width: 100%;
  margin-bottom: var(--space-md);
}

.wp-caption-text {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  padding-top: var(--space-xs);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-xs);
  margin-top: var(--space-xl);
  padding-bottom: var(--space-2xl);
}

.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  background-color: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--border-radius);
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.pagination .page-numbers:hover {
  background-color: var(--color-bg-alt);
  color: var(--color-text);
  text-decoration: none;
}

.pagination .page-numbers.current {
  background-color: var(--color-accent);
  color: #ffffff;
  border-color: var(--color-accent);
}

.pagination .page-numbers.dots {
  border: none;
  background: transparent;
}
