/* ── Font Gothic locale ───────────────────────────────────────────────────── */
@font-face {
  font-family: 'UnifrakturMaguntia';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/UnifrakturMaguntia.woff2') format('woff2');
}

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

:root {
  --color-bg:        #f8f9f9;
  --color-bg-alt:    #f0f0f4;
  --color-header:    #191726;
  --color-accent:    #5441a7;
  --color-accent-dk: #3a2d7a;
  --color-text:      #222;
  --color-text-muted:#666;
  --color-border:    #ddd;
  --font-body:       Georgia, 'Times New Roman', serif;
  --font-ui:         'Helvetica Neue', Arial, sans-serif;
  --max-width:       1100px;
  --gap:             2rem;
}

html { font-size: 17px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.75;
}

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

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

/* ── Layout helpers ───────────────────────────────────────────────────────── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ── Header ───────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--color-header);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: .75rem;
  padding-bottom: .75rem;
}

.logo {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  text-decoration: none;
}
.logo-main {
  font-family: var(--font-ui);
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: .5px;
}
.gothic-font {
  font-family: 'UnifrakturMaguntia', cursive;
  font-size: 2rem;
  font-weight: 400;
  letter-spacing: 1px;
}
.logo-sub {
  font-family: var(--font-ui);
  font-size: .7rem;
  color: rgba(255,255,255,.55);
  letter-spacing: .5px;
  text-transform: uppercase;
}

/* ── Navigation ───────────────────────────────────────────────────────────── */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid rgba(255,255,255,.3);
  color: #fff;
  font-size: 1.4rem;
  padding: .25rem .6rem;
  cursor: pointer;
  border-radius: 4px;
}

.nav-list {
  display: flex;
  list-style: none;
  gap: 0;
  align-items: center;
}

.nav-list > li > a {
  display: block;
  padding: .55rem .85rem;
  color: rgba(255,255,255,.85);
  font-family: var(--font-ui);
  font-size: .88rem;
  font-weight: 500;
  white-space: nowrap;
  border-radius: 4px;
  transition: background .15s, color .15s;
}
.nav-list > li > a:hover,
.nav-list > li.active > a {
  background: var(--color-accent);
  color: #fff;
  text-decoration: none;
}

/* Dropdown */
.has-dropdown { position: relative; }
.has-dropdown > a .arrow { font-size: .65rem; opacity: .7; }

.dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--color-header);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 6px;
  list-style: none;
  min-width: 200px;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  z-index: 200;
}
.dropdown li a {
  display: block;
  padding: .55rem 1rem;
  color: rgba(255,255,255,.8);
  font-family: var(--font-ui);
  font-size: .85rem;
  transition: background .12s;
}
.dropdown li a:hover {
  background: var(--color-accent);
  color: #fff;
  text-decoration: none;
}
.has-dropdown:hover .dropdown { display: block; }

/* ── Breadcrumb ───────────────────────────────────────────────────────────── */
.breadcrumb-bar {
  background: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border);
  padding: .45rem 0;
}
.breadcrumb {
  font-family: var(--font-ui);
  font-size: .8rem;
  color: var(--color-text-muted);
}
.breadcrumb a { color: var(--color-text-muted); }
.breadcrumb a:hover { color: var(--color-accent); text-decoration: underline; }
.breadcrumb .sep { margin: 0 .35rem; opacity: .6; }
.breadcrumb span { color: var(--color-text); }

/* ── Main layout (articolo a larghezza piena) ─────────────────────────────── */
.main-layout {
  max-width: 820px;
  margin: 0 auto;
  padding-top: 2rem;
  padding-bottom: 3rem;
}

/* ── Article ──────────────────────────────────────────────────────────────── */
.article-title {
  font-family: var(--font-ui);
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.25;
  color: #1a1a2e;
  margin-bottom: 1.25rem;
}

.hero-img {
  margin-bottom: 1.5rem;
  border-radius: 8px;
  overflow: hidden;
}
.hero-img img {
  width: 100%;
  height: 380px;
  object-fit: cover;
}

.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 1rem auto;
  display: block;
}
.article-body figure {
  margin: 1.5rem 0;
  text-align: center;
}
.article-body figcaption,
.article-body .wp-caption-text {
  font-family: var(--font-ui);
  font-size: .82rem;
  color: var(--color-accent);
  font-style: italic;
  margin-top: .4rem;
  text-align: center;
}
.article-body a {
  color: var(--color-accent);
  text-decoration: underline;
}
.article-body strong, .article-body b {
  font-weight: 700;
  color: #1a1a2e;
}
.article-body ul, .article-body ol {
  margin: 1rem 0 1rem 1.5rem;
}
.article-body li {
  margin-bottom: .4rem;
}
.article-body blockquote {
  border-left: 3px solid var(--color-accent);
  padding: .6rem 1rem;
  background: var(--color-bg-alt);
  border-radius: 0 6px 6px 0;
  margin: 1.2rem 0;
  font-style: italic;
}

.article-body h2 {
  font-family: var(--font-ui);
  font-size: 1.3rem;
  font-weight: 600;
  color: #1a1a2e;
  margin: 1.8rem 0 .6rem;
  padding-bottom: .3rem;
  border-bottom: 2px solid var(--color-accent);
}
.article-body h3 {
  font-family: var(--font-ui);
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
  margin: 1.4rem 0 .5rem;
}
.article-body p {
  margin-bottom: 1.1rem;
  text-align: justify;
  hyphens: auto;
}

/* Gallery dentro articolo */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.gallery-item img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--color-border);
}

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.sidebar { position: sticky; top: 4rem; }

.widget {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}
.widget-title {
  font-family: var(--font-ui);
  font-size: .95rem;
  font-weight: 700;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: .8rem;
  padding-bottom: .4rem;
  border-bottom: 1px solid var(--color-border);
}
.widget-list { list-style: none; }
.widget-list li { border-bottom: 1px solid var(--color-bg-alt); }
.widget-list li:last-child { border-bottom: none; }
.widget-list a {
  display: block;
  padding: .4rem 0;
  font-family: var(--font-ui);
  font-size: .88rem;
  color: var(--color-text);
}
.widget-list a:hover { color: var(--color-accent); text-decoration: none; padding-left: .3rem; }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--color-header);
  color: rgba(255,255,255,.7);
  margin-top: 2rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2.5rem;
  padding: 2.5rem 1.25rem;
}
.footer-side { display: flex; flex-direction: column; gap: 1.5rem; }
.footer-disclaimer {
  font-size: .78rem;
  color: rgba(255,255,255,.5);
  line-height: 1.6;
  margin-top: .6rem;
}
.footer-disclaimer a {
  color: rgba(255,255,255,.6);
  text-decoration: underline;
}
.footer-nav-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 1.5rem;
}

.footer-brand .logo-main { color: #fff; font-family: var(--font-ui); font-size: 1.3rem; font-weight: 700; }
.footer-brand p { font-size: .85rem; margin-top: .5rem; }

.footer-nav h4 {
  font-family: var(--font-ui);
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: rgba(255,255,255,.5);
  margin-bottom: .75rem;
}
.footer-nav h5 {
  font-family: var(--font-ui);
  font-size: .78rem;
  font-weight: 700;
  color: var(--color-accent);
  margin: .9rem 0 .4rem;
  letter-spacing: .3px;
}
.footer-nav-col > h5:first-child { margin-top: 0; }
.footer-nav ul { list-style: none; margin-bottom: 0; }
.footer-nav li { margin-bottom: .3rem; }
.footer-nav a { color: rgba(255,255,255,.7); font-family: var(--font-ui); font-size: .85rem; }
.footer-nav a:hover { color: #fff; text-decoration: none; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: .9rem 1.25rem;
  font-family: var(--font-ui);
  font-size: .78rem;
  color: rgba(255,255,255,.4);
  text-align: center;
}

/* ── Intro testo categoria ────────────────────────────────────────────────── */
.category-intro {
  font-family: var(--font-ui);
  font-size: 1.05rem;
  color: var(--color-text-muted);
  line-height: 1.7;
  border-left: 3px solid var(--color-accent);
  padding: .6rem 1rem;
  background: var(--color-bg-alt);
  border-radius: 0 6px 6px 0;
  margin-bottom: 1.5rem;
}

/* ── FAQ Accordion ────────────────────────────────────────────────────────── */
.faq-section {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--color-border);
}
.faq-title {
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--color-accent);
  margin-bottom: 1rem;
}
.faq-item {
  border: 1px solid var(--color-border);
  border-radius: 6px;
  margin-bottom: .5rem;
  overflow: hidden;
}
.faq-item[open] {
  border-color: var(--color-accent);
}
.faq-question {
  font-family: var(--font-ui);
  font-size: .95rem;
  font-weight: 600;
  padding: .85rem 1rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  color: #1a1a2e;
}
.faq-question::-webkit-details-marker { display: none; }
.faq-question::after {
  content: '▾';
  color: var(--color-accent);
  font-size: .8rem;
  transition: transform .2s;
}
.faq-item[open] .faq-question::after {
  transform: rotate(180deg);
}
.faq-question:hover { background: var(--color-bg-alt); }
.faq-answer {
  padding: .75rem 1rem 1rem;
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
}
.faq-answer p {
  font-size: .92rem;
  margin: 0;
  line-height: 1.65;
  color: var(--color-text);
}

/* ── Articoli correlati ───────────────────────────────────────────────────── */
.related-articles {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--color-border);
}
.related-title {
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--color-accent);
  margin-bottom: 1rem;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.related-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: var(--color-text);
  transition: box-shadow .2s, transform .2s;
}
.related-card:hover {
  box-shadow: 0 4px 16px rgba(84,65,167,.15);
  transform: translateY(-2px);
  text-decoration: none;
}
.rc-img img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}
.rc-img-empty { height: 80px; background: var(--color-bg-alt); }
.rc-body { padding: .75rem; }
.rc-title {
  font-family: var(--font-ui);
  font-size: .88rem;
  font-weight: 600;
  color: #1a1a2e;
  line-height: 1.3;
  margin: 0 0 .3rem;
}
.rc-excerpt {
  font-family: var(--font-ui);
  font-size: .78rem;
  color: var(--color-text-muted);
  line-height: 1.4;
  margin: 0;
}
@media (max-width: 640px) {
  .related-grid { grid-template-columns: 1fr; }
}

/* ── Article grid (lista articoli in categoria) ───────────────────────────── */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.article-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: var(--color-text);
  transition: box-shadow .2s, transform .2s;
}
.article-card:hover {
  box-shadow: 0 6px 20px rgba(84,65,167,.15);
  transform: translateY(-2px);
  text-decoration: none;
}

.card-img img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}
.card-img-empty {
  height: 120px;
  background: var(--color-bg-alt);
}

.card-body {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.card-title {
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 600;
  color: #1a1a2e;
  line-height: 1.3;
  margin: 0;
  border: none;
  padding: 0;
}

.card-excerpt {
  font-family: var(--font-ui);
  font-size: .82rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin: 0;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .main-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-nav-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--color-header); padding: .5rem; }
  .site-nav.open { display: block; }
  .nav-list { flex-direction: column; align-items: stretch; }
  .nav-list > li > a { padding: .7rem 1rem; }
  .dropdown { position: static; border: none; box-shadow: none; padding-left: 1rem; display: none; }
  .has-dropdown:hover .dropdown { display: none; }
  .has-dropdown.open .dropdown { display: block; }
  .article-title { font-size: 1.45rem; }
  .hero-img img { height: 220px; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-nav-grid { grid-template-columns: 1fr; }
}
