/* =========================================================
   SENATO – VISITA PAPA LEONE XIV (splash page)
   style.css (pulito, senza duplicati)
   ========================================================= */

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

html { scroll-behavior: smooth; }

body{
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  color: #222;
  background: #b7b8ac;
}

img{ max-width: 100%; display: block; }
a{ color: inherit; text-decoration: none; }

/* WRAPPER */
.page-wrapper{
  min-height: 100vh;
  background: #b7b8ac;
  color: #fff;
}

/* =========================================================
   TOP NAV (desktop + mobile)
   ========================================================= */

.top-nav{
  position: fixed;
  top: 0; left: 0; width: 100%;
  z-index: 1000;
  background: rgba(168, 168, 163, 0.75);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
}



/* logo */
.top-nav__logo{
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  opacity: 0.9;
}
.top-nav__logo img{
  display: block;
  max-height: 70px;
  width: auto;
}

/* menu (desktop) */
.top-nav__menu{
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.top-nav__menu a{
  position: relative;
  padding-bottom: 0.2rem;
  white-space: nowrap;
}
.top-nav__menu a::after{
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 2px;
  background: #e7c379;
  transition: width 0.2s ease-out;
}
.top-nav__menu a:hover::after,
.top-nav__menu a:focus-visible::after{ width: 100%; }

/* hamburger */
.nav-toggle{
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  margin-left: auto;
}
.nav-toggle span{
  width: 26px;
  height: 3px;
  background: #333;
  border-radius: 2px;
  transition: all .25s ease;
}

/* mobile behaviour */
@media (max-width: 1024px){
  .top-nav{ flex-wrap: nowrap; align-items: center; }

  .top-nav__logo{ flex: 1; }
  .top-nav__logo img{ max-height: 56px; }

  .nav-toggle{ display: flex; }

  .top-nav__menu{
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(8px);
    display: none;               /* chiuso di default */
    flex-direction: column;
    align-items: flex-start;
    gap: .8rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(0,0,0,.1);
    white-space: normal;
  }

  .top-nav__menu.open{
    display: flex;
    background: rgba(184, 184, 185, 0.97);
  }
}

/* back to top */
.back-to-top{
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #e7c379;
  color: #111;
  font-size: 1.4rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d1b266;
  box-shadow: 0 6px 20px rgba(0,0,0,.35);
  cursor: pointer;
  transition: background .2s ease, transform .15s ease;
  z-index: 9999;
}
.back-to-top:hover{
  background: #f0d48e;
  transform: translateY(-2px);
}

/* =========================================================
   SECTIONS (base)
   ========================================================= */

section{
  position: relative;
  min-height: 80vh;
  display: flex;
  align-items: center;
  padding: 3rem 1.5rem 3rem;
}

.section--dark{
  background: #e7e3d7;
  color: #222;
}

.section--light{
  background: #f5f5f5;
  color: #222;
}

.section__inner{
  max-width: 1180px;
  margin: 0 auto;
}

.section__eyebrow{
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.75rem;
  margin-bottom: 0.75rem;
  opacity: 0.9;
}

.section__title{
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
  margin-bottom: 1rem;
}

.section__subtitle{
  font-size: 1.05rem;
  max-width: 600px;
  opacity: 0.95;
  margin-bottom: 1.5rem;
}

.section__body{
  font-size: 0.98rem;
  max-width: 720px;
  opacity: 0.95;
}

.section__meta{
  margin-top: 1.5rem;
  font-size: 0.9rem;
  opacity: 0.85;
}

/* full width photo sections + caption */
.section--photo{
  position: relative;
  padding: 0;
  min-height: auto;
  background: transparent;
}
.section-photo-img{
  width: 100%;
  height: auto;
  display: block;
}
.section-photo-caption{
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  background: rgba(0,0,0,0.6);
  color: #fff;
  padding: 0.45rem 0.9rem;
  border-radius: 4px;
  font-size: 0.8rem;
  line-height: 1.4;
  max-width: 80%;
}
@media (max-width: 600px){
  .section-photo-caption{
    left: 0.75rem;
    right: 0.75rem;
    max-width: none;
    font-size: 0.78rem;
  }
}

/* --- Chiusura mostra: layout pulito a tutta sezione --- */
.closure .section__inner{
  max-width: 1280px; /* più largo del resto, per evitare effetto “colonnina” */
}

.closure .closure-lede,
.closure .closure-body{
  max-width: none;     /* niente blocco stretto */
}

.closure .closure-lede{
  margin-top: 10px;
  font-size: 1.05rem;
  line-height: 1.6;
}

.closure .closure-video{
  margin-top: 22px;
}

.closure .video-wrapper{
  width: 100%;
  position: relative;
  padding-top: 56.25%;
  border-radius: 18px;
  overflow: hidden;
}

.closure .video-wrapper iframe{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* mini-gallery 3+3 in stile “gallery” */
.closure .closure-mini-grid{
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

/* riuso struttura .gallery-item ma con altezza più controllata qui */
.closure .closure-mini-grid .gallery-item{
  border-radius: 16px;
  overflow: hidden;
}

.closure .closure-mini-grid .gallery-item > img{
  width: 100%;
  height: 220px;       /* più piccole e ordinate */
  object-fit: cover;
  display: block;
}

/* se vuoi far leggere le caption come nella gallery */
.closure .closure-mini-grid .gallery-item__inner{
  padding: 12px;
}

/* Mobile */
@media (max-width: 980px){
  .closure .section__inner{ max-width: 100%; }
  .closure .closure-mini-grid{ grid-template-columns: 1fr; }
  .closure .closure-mini-grid .gallery-item > img{ height: auto; }
}



/* =========================================================
   HERO
   ========================================================= */

.hero{
  min-height: 100vh;
  background-image:
    linear-gradient(to bottom, rgba(0,0,0,0.35), rgba(0,0,0,0.55)),
    url("img/hero-placeholder.jpg");
  background-size: cover;
  background-position: center;
  color: #fff;
  text-align: left;
}

.hero__inner{
  max-width: 960px;
  margin: 0 auto;
}

.hero__eyebrow{
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.75rem;
  opacity: 0.9;
  margin-bottom: 0.75rem;
}

.hero__title{
  font-size: clamp(2.6rem, 5vw, 3.8rem);
  line-height: 1.05;
  margin-bottom: 1rem;
}

.hero__subtitle{
  font-size: 1.1rem;
  max-width: 540px;
  opacity: 0.95;
  margin-bottom: 2rem;
}

.hero__meta{
  font-size: 0.95rem;
  opacity: 0.9;
  margin-bottom: 2.5rem;
}

.hero__buttons{
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* iPad/tablet landscape special crop */
@media (min-width: 821px) and (max-width: 1024px){
  .hero{ background-position: 77% center; }
}
@media (max-width: 820px){
  .hero{ background-position: 77% center; }
}

.hero__scroll-indicator{
  position: absolute;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  opacity: 0.8;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}
.hero__scroll-indicator span{ font-size: 1.3rem; }

/* buttons */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.3rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.7);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 500;
  background: #f0d48e;
  cursor: pointer;
  transition: background 0.2s ease-out, color 0.2s ease-out, border-color 0.2s ease-out;
}
.btn--primary{
  background: #e7c379;
  border-color: #e7c379;
  color: #1b1305;
}
.btn--primary:hover{
  background: #f0d28c;
  border-color: #f0d28c;
}
.btn--ghost:hover{ background: rgba(255,255,255,0.1); }
.btn span{ margin-left: 0.4rem; font-size: 1rem; }

/* =========================================================
   TWO COLUMN (text + media)
   ========================================================= */

.two-column{
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr);
  gap: 3rem;
  align-items: center;
}

/* media column */
.two-column__image,
.video-block{
  width: 100%;
  justify-self: end;
  max-width: 640px;
}

.section-photo{
  position: relative;
}
.two-column__image .section-photo{
  border-radius: 0;           /* niente bordi tondi di default */
  overflow: hidden;
}

/* image helper class (if used) */
.two-column__image-img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* MOBILE: impila e fai full-bleed per le foto */
@media (max-width: 768px){
  section{ padding: 5rem 1.25rem 3rem; }

  .two-column{
    display: block;
  }

  .two-column__image,
  .video-block{
    max-width: none;
    margin-top: 1.5rem;
    justify-self: auto;
  }

  /* full bleed come section--photo (compensa il padding della section) */
  .two-column__image .section-photo,
  .video-wrapper{
    margin-left: calc(-1.25rem);
    margin-right: calc(-1.25rem);
  }
}
 @media (max-width: 768px){
  section{ padding: 5rem 1.25rem 3rem; }

  .two-column{ display:block; }

  .two-column__image,
  .video-block{
    max-width:none;
    margin-top:1.5rem;
    justify-self:auto;
  }

  /* full-bleed SOLO per le foto, NON per i video */
  .two-column__image .section-photo{
    margin-left: calc(-1.25rem);
    margin-right: calc(-1.25rem);
  }

  /* sicurezza extra: evita overflow laterale su iOS */
  .video-wrapper{
    margin-left: 0;
    margin-right: 0;
  }
}

/* =========================================================
   VIDEO
   ========================================================= */

.video-wrapper{
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  background: #000;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  border-radius: 0;
  overflow: hidden;
}
.video-wrapper iframe,
.video-wrapper video{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* =========================================================
   GALLERY
   ========================================================= */

.gallery-section{
  background: radial-gradient(circle at top, #f9f4e6 0, #f3f1eb 40%, #e1ded7 100%);
  color: #222;
}

.gallery-intro{
  max-width: 720px;
  margin-bottom: 2rem;
  font-size: 0.96rem;
  opacity: 0.9;
}

.gallery-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.gallery-item{
  position: relative;
  overflow: hidden;
  background: #ccc;
  cursor: pointer;
  isolation: isolate;
}

.gallery-item::before{
  content: "";
  display: block;
  padding-top: 66%; /* 3:2 */
}

.gallery-item img{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-item__inner{
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 0.7rem;
  background: linear-gradient(to top, rgba(0,0,0,0.65), rgba(0,0,0,0.1));
  opacity: 1; /* sempre visibile */
  color: #fff;
  font-size: 0.8rem;
}

.gallery-caption{ font-weight: 500; min-height: 1em; } /* se vuota, non sballa */
.gallery-caption-sub{ font-size: 0.75rem; opacity: 0.9; }

/* =========================================================
   LIGHTBOX
   ========================================================= */

.lightbox{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-out;
  z-index: 2000;
}
.lightbox--visible{
  opacity: 1;
  pointer-events: auto;
}

.lightbox__content{
  max-width: 90vw;
  max-height: 85vh;
  position: relative;
}

.lightbox__image{
  max-width: 100%;
  max-height: 80vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7);
  background: #000;
}

.lightbox__caption{
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: #f5f5f5;
  text-align: center;
}

.lightbox__close{
  position: absolute;
  top: -0.75rem;
  right: -0.75rem;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: none;
  background: rgba(0,0,0,0.8);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
}

.lightbox-prev,
.lightbox-next{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,.6);
  color: #fff;
  border: none;
  font-size: 2.2rem;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-prev:hover,
.lightbox-next:hover{ background: rgba(0,0,0,.8); }
.lightbox-prev{ left: 16px; }
.lightbox-next{ right: 16px; }


/* Utility */
.section--wide{ min-height: auto; }

.related-articles{
  background: #f5f5f5;
  color: #222;
}

/* =========================================================
   RELATED ARTICLES (Approfondimenti)
   ========================================================= */

.related-articles__intro{ max-width: 62ch; }

.related-articles__grid{
  margin-top: 1.25rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.article-card{
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1rem;
  background: rgba(255,255,255,0.35);
  border: 1px solid rgba(0,0,0,0.08);
  overflow: hidden;
  color: inherit;
}

.article-card__media{ background: rgba(0,0,0,0.06); }
.article-card__media img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.article-card__body{
  padding: 0.9rem 1rem 0.9rem 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
}

.article-card__kicker{
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.8;
}
.article-card__title{
  font-size: 1.05rem;
  line-height: 1.2;
  font-weight: 600;
}
.article-card__cta{
  margin-top: 0.25rem;
  font-size: 0.95rem;
  opacity: 0.85;
}

@media (max-width: 820px){
  .related-articles__grid{ grid-template-columns: 1fr; }
  .article-card{ grid-template-columns: 1fr; }
  .article-card__body{ padding: 0.85rem 0.95rem; }
}

/* =========================================================
   FOOTER (DM)
   ========================================================= */

.dm-footer{
  width: 100%;
  background-color: var(--backColorFooter);
  text-align: center;
  border-top: 1px solid var(--colorBorder);
}
.dm-footerDiv{
  display: inline-block;
  padding-left: 5px;
}
.dm-socialIcons:hover{ opacity: 0.4; }
.dm-footerWidth{
  width: 40%;
  margin-left: auto;
  margin-right: auto;
}

footer{
  background: #e2e2e2;
  color: #333;
  font-size: 0.8rem;
  padding: 1rem;
  text-align: center;
}
footer a{
  text-decoration: underline;
  text-underline-offset: 2px;
}
