/* ============================================================
   pages.css – Stili comuni alle sottopagine
   (Oratorio, Rocca, Chiesa, Parmigiano, Sagra, Crescentine)
   ============================================================ */

/* ── Page Hero ────────────────────────────────── */
.page-hero {
  position: relative;
  height: 56vh;
  min-height: 380px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--stone);
}
.page-hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
}
.page-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(43,35,24,.92) 0%,
    rgba(43,35,24,.3) 60%,
    transparent 100%
  );
  z-index: 1;
}
.page-hero__content {
  position: relative;
  z-index: 2;
  padding: 3rem 0;
  width: 100%;
}
.page-hero__content .container {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

/* ── Breadcrumb ───────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .82rem;
  color: rgba(255,255,255,.55);
}
.breadcrumb a {
  color: var(--gold-light);
  transition: color .2s;
}
.breadcrumb a:hover { color: var(--white); }
.breadcrumb span { color: rgba(255,255,255,.35); }

.page-hero__title {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 700;
  color: var(--white);
  line-height: 1.1;
}
.page-hero__subtitle {
  font-family: var(--font-body);
  font-style: italic;
  color: rgba(255,255,255,.7);
  font-size: 1rem;
}

/* ── Article Layout ───────────────────────────── */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 3.5rem;
  align-items: start;
  padding: 4rem 0;
}
.article-body h2 {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 700;
  color: var(--stone);
  margin: 2rem 0 .75rem;
  padding-top: .5rem;
  border-top: 2px solid var(--gold);
  display: inline-block;
}
.article-body h2:first-child { margin-top: 0; }
.article-body p {
  font-family: var(--font-body);
  color: var(--stone-mid);
  font-size: 1.02rem;
  line-height: 1.85;
  margin-bottom: 1.25rem;
}
.article-body strong { color: var(--stone); font-weight: 600; }
.article-body em { font-style: italic; }

/* ── Highlight Box ────────────────────────────── */
.highlight-box {
  background: linear-gradient(135deg, rgba(232,160,32,.12), rgba(193,68,14,.08));
  border-left: 4px solid var(--gold);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
}
.highlight-box p {
  margin: 0;
  font-style: italic;
  color: var(--stone);
  font-size: .97rem;
}

/* ── Inscription Box ─────────────────────────── */
.inscription-box {
  background: var(--cream);
  border: 2px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 2rem;
  margin: 2rem 0;
  text-align: center;
  box-shadow: inset 0 2px 8px rgba(43,35,24,.08);
}
.inscription-text {
  font-family: 'Lora', Georgia, serif;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--stone);
  margin: 0;
  letter-spacing: .02em;
}

/* ── Sidebar ──────────────────────────────────── */
.article-sidebar {
  position: sticky;
  top: 76px;
}
.sidebar-card {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.sidebar-card__header {
  background: linear-gradient(135deg, var(--gold), var(--terra));
  padding: 1rem 1.25rem;
  color: var(--white);
  font-weight: 700;
  font-size: .9rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.sidebar-card__body {
  padding: 1.25rem;
}
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: .55rem 0;
  border-bottom: 1px solid rgba(43,35,24,.07);
  font-size: .88rem;
}
.info-row:last-child { border-bottom: none; }
.info-row__label { color: var(--stone-light); font-weight: 600; }
.info-row__value { color: var(--stone); text-align: right; max-width: 60%; }

.sidebar-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.detail-chip {
  display: inline-block;
  padding: .3rem .75rem;
  background: rgba(232,160,32,.15);
  color: var(--terra);
  border-radius: 50px;
  font-size: .78rem;
  font-weight: 700;
  margin: .25rem .2rem 0 0;
}

/* ── Timeline Mini (oratorio, rocca) ──────────── */
.timeline-mini {
  display: flex;
  flex-direction: column;
  gap: .8rem;
}
.timeline-mini__item {
  padding-left: 1.25rem;
  border-left: 2px solid var(--gold);
  position: relative;
}
.timeline-mini__item::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 2px;
  width: 12px;
  height: 12px;
  background: var(--gold);
  border-radius: 50%;
  border: 2px solid var(--white);
}
.timeline-mini__year {
  font-weight: 700;
  color: var(--terra);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  display: block;
  margin-bottom: .2rem;
}
.timeline-mini__text {
  font-size: .82rem;
  color: var(--stone-mid);
  font-family: var(--font-body);
  line-height: 1.5;
}

/* ── Feature List (oratorio, rocca, chiesa, crescentine) ── */
.feature-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin: 2rem 0;
}
.feature-list__item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.feature-list__icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  margin-top: .1rem;
}
.feature-list__text h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--stone);
  margin-bottom: .2rem;
}
.feature-list__text p {
  font-size: .9rem;
  color: var(--stone-mid);
  font-family: var(--font-body);
  margin: 0;
  line-height: 1.6;
}

/* ── Media Figure (images & videos) ──────────── */
.media-figure {
  margin: 2rem 0;
  text-align: center;
}
.media-figure img,
.media-figure video {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}
.media-figure figcaption {
  margin-top: .75rem;
  font-size: .9rem;
  color: var(--stone-mid);
  font-style: italic;
  font-family: var(--font-body);
}

/* ── Back Link ────────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: var(--terra);
  font-weight: 600;
  font-size: .9rem;
  margin-bottom: 3rem;
  padding: .6rem 1.25rem;
  border: 2px solid var(--terra);
  border-radius: 50px;
  transition: background .2s, color .2s;
}
.back-link:hover {
  background: var(--terra);
  color: var(--white);
}

/* ── Sidebar Gallery ──────────────────────────── */
.sidebar-gallery {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 1.5rem;
}
.sidebar-gallery h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--stone);
  margin-bottom: 1.25rem;
  padding-bottom: .75rem;
  border-bottom: 2px solid var(--gold);
}
.sidebar-gallery__item {
  margin-bottom: 1.5rem;
}
.sidebar-gallery__item img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transition: transform .3s ease, box-shadow .3s ease;
}
.sidebar-gallery__item img:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-md);
}
.sidebar-gallery__item figcaption {
  font-size: .85rem;
  color: var(--stone-mid);
  margin-top: .5rem;
  line-height: 1.5;
  font-style: italic;
}
.sidebar-gallery__item:last-child {
  margin-bottom: 0;
}

/* ── Archive Hero ─────────────────────────────── */
.page-hero--archivio {
  background-image:
    linear-gradient(to top, rgba(43,35,24,.92) 0%, rgba(43,35,24,.5) 60%, rgba(43,35,24,.3) 100%),
    url('images/pagina.png');
  background-size: cover;
  background-position: center;
}

/* ── PDF Viewer ───────────────────────────────── */
.pdf-viewer-container {
  max-width: 1000px;
  margin: 0 auto;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 1.5rem;
}

.pdf-object {
  width: 100%;
  height: 80vh;
  min-height: 600px;
  border: 2px solid var(--gold);
  border-radius: var(--radius-sm);
  background: #f5f5f5;
}

.pdf-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 2rem;
  text-align: center;
  background: var(--cream);
  border-radius: var(--radius-sm);
}

.pdf-fallback p {
  margin: 1rem 0;
  color: var(--stone);
  font-size: 1rem;
}

.pdf-fallback .btn {
  margin: 0.5rem;
}

/* Mobile PDF View */
.pdf-mobile-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  text-align: center;
  background: linear-gradient(135deg, rgba(232,160,32,.08), rgba(193,68,14,.05));
  border-radius: var(--radius-md);
  border: 2px dashed var(--gold);
}

.pdf-mobile-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.pdf-mobile-container h3 {
  font-size: 1.5rem;
  color: var(--stone);
  margin: 0.5rem 0;
  font-weight: 700;
}

.pdf-mobile-desc {
  font-size: 1.1rem;
  color: var(--stone-mid);
  font-style: italic;
  margin: 0.5rem 0 1.5rem;
}

.pdf-mobile-info {
  font-size: 0.9rem;
  color: var(--stone-light);
  margin-bottom: 2rem;
  padding: 0.5rem 1rem;
  background: var(--cream);
  border-radius: var(--radius-sm);
}

.pdf-mobile-container .btn--large {
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  margin: 1rem 0;
}

.pdf-mobile-hint {
  font-size: 0.85rem;
  color: var(--stone-light);
  margin-top: 1rem;
  font-style: italic;
}

@media (max-width: 768px) {
  .pdf-viewer-container {
    padding: 1rem;
  }

  .pdf-object {
    height: 70vh;
    min-height: 500px;
  }

  .pdf-fallback {
    padding: 1.5rem;
  }

  .pdf-fallback p {
    font-size: 0.9rem;
  }
}

/* ── Responsive ───────────────────────────────── */
@media (max-width: 900px) {
  .article-layout { grid-template-columns: 1fr; }
  .article-sidebar { position: static; }
}
