/* =========================================
   FONT IMPORTS
========================================= */
@import url('https://fonts.googleapis.com/css2?family=Kunstler+Script&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville&display=swap');

/* =========================================
   VARIABLES (colors, spacing)
========================================= */
:root {
  --green: #3F7233;
  --green-dark: #2E5D1F;
  --red: rgb(197, 90, 17);
  --bg: #F5EFE0;
  --shadow: rgba(0, 0, 0, 0.08);
}

/* =========================================
   BASE STYLES
========================================= */
html,
body {
  background: var(--bg) url('https://www.transparenttextures.com/patterns/paper-fibers.png') repeat;
  font-family: "Libre Baskerville", serif, Georgia, Times, serif;
  color: var(--red);
  font-size: 1.2rem;
  line-height: 1.8;
  letter-spacing: 0.2px;
  max-width: 840px;
  margin: 40px auto;
  padding: 0 20px;
  text-align: center;
  box-sizing: border-box;
  overflow-x: hidden;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

main {
  padding-bottom: 180px;
}

/* prevent TOC overlap */

/* =========================================
   PASSWORD OVERLAY
========================================= */
#password-container {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.password-box {
  text-align: center;
}

.password-box input,
.password-box button {
  font-size: 1.2rem;
  padding: 0.5rem;
  margin-top: 0.5rem;
}

.password-box button {
  margin-left: 0.5rem;
}

/* =========================================
   HEADINGS
========================================= */
h1,
h2,
h3 {
  color: var(--red);
  margin: 0.2rem 0;
  line-height: 1.2;
}

/* =========================================
   MAIN WEDDING HEADER
========================================= */
header .main-title {
  font-family: "Kunstler Script", cursive, serif;
  font-size: 4.5rem;
  font-weight: normal;
  margin: 0.3rem 0;
}

header .main-title::after {
  content: "***";
  display: block;
  font-family: "Kunstler Script", cursive, serif;
  font-size: 4rem;
  color: var(--green);
  margin: 0.5rem auto 0;
  opacity: 0.9;
}

header .sub-title {
  font-family: "Kunstler Script", cursive;
  font-size: 3rem;
  margin: 0.2rem 0;
  font-weight: 590; /* medium thickness between normal (400) and bold (700) */
}

/* =========================================
   IMAGES
========================================= */
img,
iframe {
  max-width: 75%;
  height: auto;
  display: block;
  margin: 1rem auto;
}

.perosa-img {
  max-width: 30%;
  height: auto;
  display: block;
  margin: 1rem auto;
}

/* =========================================
   LANGUAGE FLAGS
========================================= */
.lang-flags {
  position: fixed;
  top: 15px;
  right: 15px;
  display: flex;
  gap: 8px;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.lang-flags.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.lang-flags img {
  width: 88px;
  height: 64px;
  object-fit: contain;
  padding: 5px 8px;
  border-radius: 10px;
  background: rgba(245, 239, 224, 0.9);
  cursor: pointer;
  border: 2px solid transparent;
  box-shadow: 0 0 6px rgba(63, 58, 54, 0.05);
  opacity: 0.6;
  transition: opacity 0.2s ease, border-color 0.3s ease;
}

.lang-flags img:hover,
.lang-flags img.active {
  opacity: 1;
  border-color: var(--red);
}

/* =========================================
   TABS
========================================= */
.tab-nav-wrapper {
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 10px 0;
  background: transparent;
}

.tab-nav {
  display: flex;
  justify-content: center;
  gap: 15px;
  padding: 10px 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.tab-nav::-webkit-scrollbar {
  display: none;
}

.tab-nav button {
  flex: 0 0 auto;
  width: 30%;
  min-width: 105px;
  padding: 10px 0;
  font-size: 1rem;
  text-align: center;
  background: var(--green);
  color: var(--bg);
  cursor: pointer;
  font-weight: 400;
  letter-spacing: 0.4px;
  border-radius: 8px;
  border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tab-nav button:hover {
  box-shadow: 0 4px 12px rgba(84, 130, 53, 0.25);
  transform: translateY(-2px);
}

.tab-nav button.active {
  font-weight: 600;
  background: var(--green-dark);
  color: var(--bg);
  box-shadow: 0 5px 10px rgba(84, 130, 53, 0.5);
  transform: none;
  position: relative;
}

.tab-content {
  display: none;
  padding: 1rem 0;
}

.tab-content.active {
  display: block;
}

.tab-content article {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: none;
  position: relative;
}

.tab-content article::after {
  content: "";
  display: block;
  height: 1px;
  width: 60%;
  margin: 2rem auto 0;
  background: linear-gradient(to right, transparent, var(--green), transparent);
  opacity: 0.7;
}

#program-a article:last-child {
  border: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

/* =========================================
   PROGRAM SECTION
========================================= */
#program-a img {
  max-width: 80%;
  max-height: 300px;
  border: 1px solid var(--green);
  border-radius: 3px;
}

#program-a img[alt="parking"] {
  border: none;
}

#program-a p,
#program-b p {
  margin: 0.5rem 0 1.2rem;
  line-height: 1.6;
  color: #000;
}

.section-divider {
  border: none;
  height: 1px;
  width: 40%;
  background: var(--green);
  margin: 1rem auto 2rem;
  opacity: 0.85;
}

/* =========================================
   INFO TAB LAYOUT
========================================= */
#location-a {
  max-width: 760px;
  margin: 0 auto;
  text-align: left;
  line-height: 1.7;
}

#location-a h1,
#location-a h2,
#location-a h3,
#location-a h4 {
  text-align: center;
  font-weight: bold;
  margin: 0.5rem 0;
}

#location-a p {
  text-align: left;
  line-height: 1.6;
  margin: 0.5rem 0 1.2rem;
  color: #000;
}

#location-a a {
  text-decoration: none;
  border-bottom: none;
  /* subtle underline */
}

#location-a a:hover {
  color: #004a99;
  border-bottom-color: #004a99;
}

/* Bullet lists */
#location-a ul {
  margin: 1rem 0;
  padding-left: 1.4rem;
}

#location-a ul li {
  margin-bottom: 0.6rem;
  line-height: 1.6;
  color: #333;
}

#parking-b ul {
  padding-left: 1rem;        /* riduce lo spazio a sinistra */
  margin: 0.8rem 0;           /* margine tra lista e altri elementi */
  list-style-position: inside; /* il bullet è vicino al testo */
}

#parking-b ul li {
  margin-bottom: 0.6rem;
  line-height: 1.6;
  color: #333;               /* testo grigio scuro coerente */
  text-align: left;          /* forza allineamento a sinistra */
}

#location-a ul li::marker {
  color: var(--green);
  font-size: 1.1rem;
}

#location-a img,
#location-a iframe {
  max-width: 55%;
  margin: 1.2rem auto;
  display: block;
  border-radius: 6px;
}

#location-a .mini-toc {
  margin: 1.5rem auto 2rem;
  padding: 12px 16px;
}

/* ========================================= 
   METEO SECTION
========================================= */
.weather-container {
  max-width: 840px;
  /* website width */
  width: 100%;
  /* take full width of container */
  margin: 0 auto;
  /* center it */
}

.weather-container a.weatherwidget-io,
.weather-container iframe {
  width: 100% !important;
  /* force full width */
  max-width: 100% !important;
  display: block;
  margin: 0 auto !important;
}

/* =========================================
   MINI TOC
========================================= */
.mini-toc {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 12px;
  margin: 0 auto 12px;
  border-radius: 12px;
  max-width: 300px;
  background: transparent;
  backdrop-filter: blur(4px);
  font-size: 1rem;
  color: var(--green);
  align-items: flex-start;
}

.mini-toc a {
  text-decoration: none;
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.2s ease, color 0.2s ease;
}

.mini-toc a:hover {
  color: var(--red);
  transform: scale(1.05);
}

.mini-toc span {
  color: var(--red);
}

/* =========================================
   FLOAT TOC
========================================= */
.floating-toc {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 18px;
  justify-content: center;
  align-items: center;
  padding: 6px 12px;
  border-radius: 18px;
  font-size: 1.3rem;
  z-index: 950;
  opacity: 0;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(5px);
  box-shadow: 0 2px 6px var(--shadow);
  transition: opacity 0.3s ease;
}

.floating-toc.show {
  opacity: 1;
  pointer-events: auto;
}

.floating-toc a {
  text-decoration: none;
  color: var(--green);
  transition: transform 0.2s ease, color 0.2s ease;
}

.floating-toc a:hover {
  color: var(--red);
  transform: scale(1.2);
}

.floating-toc i {
  font-size: 22px;
  color: var(--green);
  margin: 0 4px;
}

.floating-toc .toc-label {
  display: none;
}

.floating-toc .toc-separator {
  color: var(--red);
  margin: 0 6px;
}

/* =========================================
   Gift List
========================================= */

#gifts-a .gift-option,
#gifts-b .gift-option {
  margin: 1rem auto;
  padding: 0.8rem 1rem;
  max-width: 600px;
  text-align: center;
  font-size: 1.15rem;
  line-height: 1.4;
  color: #111; /* darker, neutral text */
}


/* =========================================
   RSVP BUTTON
========================================= */
.rsvp-button {
  display: inline-block;
  background: var(--red);
  color: var(--bg);
  padding: 12px 30px;
  margin: 20px auto 0;
  font-weight: 500;
  font-size: 1.2rem;
  text-decoration: none;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(197, 90, 17, 0.3);
  transition: background-color 0.3s ease, transform 0.2s ease;
  cursor: pointer;
  max-width: 300px;
  width: 100%;
}

.rsvp-button:hover,
.rsvp-button:focus {
  background-color: rgb(160, 70, 15);
  transform: scale(1.05);
  outline: none;
}

/* =========================================
   LANGUAGE SECTIONS
========================================= */
.lang-section {
  display: none;
  font-weight: 400;
}

.lang-section.active {
  display: block;
}

.lang-section strong {
  font-weight: 700;
}

/* =========================================
   RESPONSIVE
========================================= */
@media (max-width: 700px) {
  .tab-nav button {
    font-size: 0.9rem;
    padding: 8px 6px;
  }

  header .main-title {
    font-size: 3.5rem;
  }

  header .main-title::after {
    font-size: 2.5rem;
  }

  header .sub-title {
    font-size: 2.5rem;
  }

  #info img,
  #info iframe {
    max-width: 70%;
  }

.perosa-img {
  max-width: 75%
   }
}

@media (max-width: 450px) {
  body {
    padding: 0 10px;
    font-size: 1rem;
  }

  header .main-title {
    font-size: 3rem;
  }

  header .main-title::after {
    font-size: 2rem;
  }

  header .sub-title {
    font-size: 2rem;
  }

  header img {
    max-width: 80vw;
  }

  .lang-flags img {
    width: 80px;
    height: 52px;
    border-radius: 8px;
  }

  #program-a article {
    padding: 0.8rem 1rem;
  }

  #program-a img {
    max-width: 80vw;
  }

  .tab-nav button {
    font-size: 0.85rem;
  }

  .floating-toc {
    font-size: 1rem;
    gap: 10px;
    padding: 4px 8px;
  }

  #location-a img,
  #location-a iframe {
    max-width: 90%;
  }
}

