/* Stili comuni. Le regole specifiche e responsive restano nelle pagine. */
:root {
  --brand-blue: #1e5678;
  --brand-blue-dark: #143d57;
  --whatsapp-green: #25d366;
  --whatsapp-green-dark: #1da851;
  --brand-blue-soft: #e8f1f7;
  --brand-blue-faint: #f4f8fb;
  --brand-blue-light: #edf4f9;
  --brand-blue-note: #f2f7fa;
  --brand-blue-note-text: #355369;
  --brand-blue-panel: #eef5fa;
  --brand-blue-border: #cfdfea;
  --brand-blue-panel-text: #2f4f65;
  --brand-blue-rgb: 30, 86, 120;
  --brand-blue-dark-rgb: 20, 61, 87;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f5f5f5;
  color: #222;
}

.brand-header {
  background: white;
  padding: 22px 20px;
  border-bottom: 2px solid var(--brand-blue);
}

.brand-header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.brand-main {
  display: flex;
  align-items: center;
  gap: 18px;
  text-decoration: none;
  color: inherit;
}

.brand-logo {
  width: 95px;
  height: 95px;
  object-fit: contain;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  flex-shrink: 0;
}

.brand-text p {
  margin: 8px 0 0;
  font-size: 18px;
  color: #555;
}

.navbar {
  background: #33363b;
  position: sticky;
  top: 0;
  z-index: 10;
}

.navbar-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0 10px;
}

.navbar a {
  color: white;
  text-decoration: none;
  padding: 16px 20px;
  display: inline-block;
  font-size: 16px;
  letter-spacing: 0.3px;
  text-align: center;
}

.navbar a:hover,
.navbar a.active {
  background: var(--brand-blue);
}

footer {
  background: #2f3134;
  color: #f1f1f1;
  padding: 34px 20px;
  margin-top: 40px;
}

.footer-box h4 {
  margin: 0 0 14px;
  font-size: 20px;
  color: #ffffff;
}

.footer-box p, .footer-box a {
  margin: 0 0 10px;
  color: #d9d9d9;
  text-decoration: none;
  line-height: 1.6;
  display: block;
}

.footer-box a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.footer-brand {
  font-size: 22px;
  font-weight: bold;
  color: #ffffff;
  margin-bottom: 10px;
  display: block;
  text-decoration: none;
}

.footer-note {
  margin-top: 10px;
  font-size: 14px;
  color: #bfc4c9;
}

.brand-socials {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.social-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #f3f3f3;
  border: 1px solid #e4e4e4;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #444;
  text-decoration: none;
  transition: all 0.2s ease;
}

.social-icon:hover {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
  color: white;
  transform: translateY(-2px);
}

.social-icon svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
  display: block;
}

.footer-download-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 6px;
}

.footer-download-btn {
  display: block;
  background: var(--brand-blue);
  color: white !important;
  text-decoration: none !important;
  padding: 12px 14px;
  border-radius: 8px;
  font-weight: bold;
  line-height: 1.4;
  transition: background 0.2s ease, transform 0.2s ease;
}

.footer-download-btn:hover {
  background: var(--brand-blue-dark);
  transform: translateY(-2px);
  text-decoration: none !important;
}

.whatsapp-floating {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--whatsapp-green);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(0,0,0,0.22);
  z-index: 999;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.whatsapp-floating:hover {
  background: var(--whatsapp-green-dark);
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 12px 24px rgba(0,0,0,0.28);
}

.whatsapp-floating svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
  display: block;
}

/* Card condivise tra home ed elenco escursioni. */
.cards .card-link {
  display: flex;
  align-self: flex-start;
}
.card-link .card {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.card-link .card img {
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  display: block;
  flex-shrink: 0;
}
.card-link .card h3 {
  margin: 16px 0 12px;
  font-size: 21px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.card-link .card-badges {
  position: absolute;
  top: 0;
  left: 20px;
  right: 20px;
  transform: translateY(-50%);
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}
.cards .card-link {
  margin-top: 32px;
}
.card-link .card.has-badges {
  border: 2px solid var(--brand-blue);
  padding-top: 32px;
}
.card-link .card.has-badges.annullata {
  border-color: #d32f2f;
}
.card-link .card-badges .badge {
  max-width: 100%;
  line-height: 1.2;
  padding: 6px 10px;
  border-radius: 6px;
}
.card-link .card-badges:empty {
  display: none;
}
.card-action {
  display: block;
  margin-top: auto;
  padding-top: 20px;
  color: var(--brand-blue);
  font-weight: bold;
  font-size: 15px;
}
.card-link:focus-visible {
  outline: 3px solid var(--brand-blue);
  outline-offset: 4px;
  border-radius: 14px;
}

/* Navigazione mobile: gli stessi collegamenti del menu desktop. */
.navbar .menu-toggle { display: none; }
@media (max-width: 700px) {
  .brand-header { padding: 12px 6px 4px; }
  .brand-header .brand-header-content {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
  }
  .brand-header .brand-main {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: none;
    gap: clamp(8px, 2.5vw, 14px);
    text-align: left;
  }
  .brand-header .brand-logo { width: min(17%, 72px); height: auto; aspect-ratio: 1; }
  .brand-header .brand-text { flex: 0 1 306px; min-width: 0; container-type: inline-size; }
  .brand-header .brand-text h1 { font-size: min(7.6vw, 30px); font-size: min(9.8cqi, 30px); line-height: 1.2; text-align: center; }
  .brand-header .brand-text p {
    max-width: none;
    margin-top: 5px;
    font-size: min(3.3vw, 14px);
    font-size: min(4.8cqi, 14px);
    text-align: center;
    line-height: 1.35;
    color: #666;
    text-wrap: balance;
  }
  .brand-header .brand-socials { width: 100%; justify-content: center; gap: 12px; }
  .brand-header .social-icon { width: 44px; height: 44px; }
}
@media (max-width: 1024px) {
  .navbar.menu-ready .navbar-content a { padding: 12px 14px; font-size: 14px; }
  .navbar .menu-toggle-icon, .navbar .menu-toggle-icon span { width: 20px; }
  .navbar.menu-ready { padding: 0 10px; }
  .navbar .menu-toggle-label { display: none; }
  .navbar.menu-ready .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-left: 0;
    margin-right: auto;
    padding: 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: white;
    font: inherit;
    cursor: pointer;
  }
  .menu-toggle-icon { display: flex; flex-direction: column; gap: 5px; width: 24px; }
  .menu-toggle-icon span { display: block; height: 2px; width: 24px; background: currentColor; transition: transform .18s ease, opacity .18s ease; }
  .menu-open .menu-toggle-icon span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .menu-open .menu-toggle-icon span:nth-child(2) { opacity: 0; }
  .menu-open .menu-toggle-icon span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .navbar.menu-ready .navbar-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: auto;
    width: max-content;
    max-width: 100vw;
    margin: 0;
    border-radius: 0 0 8px 0;
    max-height: calc(100vh - 76px);
    max-height: calc(100dvh - 76px);
    overflow-y: auto;
    padding: 8px 14px 14px;
    background: #33363b;
    border-top: 1px solid rgba(255,255,255,.15);
    box-shadow: 0 10px 16px rgba(0,0,0,.18);
  }
  .navbar.menu-ready.menu-open .navbar-content { display: flex; flex-direction: column; gap: 4px; align-items: stretch; }
  .navbar.menu-ready .navbar-content a { display: block; width: 100%; padding: 12px 14px; text-align: left; border-radius: 6px; }
  .navbar.menu-ready .menu-toggle:focus-visible, .navbar.menu-ready .navbar-content a:focus-visible { outline: 2px solid white; outline-offset: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  .menu-toggle-icon span { transition: none; }
}

/* Dimensioni compatte per smartphone. */
@media (max-width: 700px) {
  .brand-header .brand-socials { gap: 4px; }
  .brand-header .social-icon {
    background: transparent;
    border-color: transparent;
  }
  .brand-header .social-icon svg { width: 18px; height: 18px; }
  body .hero { min-height: 340px; padding: 32px 18px; }
  body .hero-content h2 { font-size: 30px; line-height: 1.15; margin-bottom: 14px; }
  body .hero-content p { font-size: 16px; line-height: 1.45; margin-bottom: 22px; }
  body .hero-buttons { gap: 10px; }
  body .btn { font-size: 14px; padding: 12px 16px; }
  body .page-header { padding: 28px 16px; }
  body .page-header h2 { font-size: 28px; line-height: 1.2; }
  body .page-header p { font-size: 16px; line-height: 1.45; }
  body .section { padding: 30px 16px; }
  body .section-title { font-size: 25px; line-height: 1.2; }
  body .section-subtitle { font-size: 15px; line-height: 1.45; margin-bottom: 20px; }
  body .cards { gap: 16px; }
  .cards .card-link:not(.more-card-link) { flex: 0 0 72%; min-width: 0; max-width: 270px; }
  .card-link .card { padding: 14px; border-radius: 12px; }
  .card-link .card h3 { font-size: 18px; line-height: 1.3; margin: 12px 0 10px; }
  .card-link .card p { font-size: 14px; margin: 6px 0; }
  .card-link .card-action { font-size: 14px; padding-top: 14px; }
  .card-link .card.has-badges { padding-top: 24px; }
  .card-link .card-badges .badge { font-size: 10px; padding: 5px 8px; }
  body .contenuto { padding: 22px 16px 36px; }
  body .event-intro { padding: 16px; gap: 16px; margin-bottom: 20px; }
  body .event-info h1 { font-size: 24px; margin-bottom: 14px; }
  body .event-meta { font-size: 15px; }
  body .event-info .whatsapp-box { margin-top: 16px; padding-top: 16px; }
  body .event-info .whatsapp-btn { font-size: 14px; padding: 12px 14px; }
  body .event-poster { width: 100%; max-width: 320px; justify-self: center; }
  body .sezione { padding: 16px; }
  body .sezione h2 { font-size: 22px; }
  body .events-content { padding: 28px 16px 36px; }
  body .events-intro { margin-bottom: 24px; }
  body .events-intro h1 { font-size: 28px; }
  body .events-intro p { font-size: 16px; line-height: 1.5; }
  body .event-story { padding: 16px; gap: 16px; margin-bottom: 22px; }
  body .event-copy h2 { font-size: 22px; }
  body .event-copy p, body .event-narrative p { font-size: 15px; line-height: 1.55; }
  body .event-copy .event-partner { font-size: 12px; }
  body .event-gallery, body .event-photo-row { gap: 6px; }
  body .whatsapp-floating { width: 46px; height: 46px; right: 12px; bottom: 12px; }
  body .whatsapp-floating svg { width: 24px; height: 24px; }
  body footer { padding: 26px 16px; }
  body .footer-box h4 { font-size: 18px; }
  body .footer-box p, body .footer-box a { font-size: 14px; }
}

/* Anteprima della storia e footer compatti su smartphone. */
@media (max-width: 700px) {
  body .chi-siamo-box { padding: 18px; gap: 20px; }
  body .chi-siamo-text h3 { font-size: 24px; margin-bottom: 12px; }
  body .chi-siamo-text p { font-size: 15px; line-height: 1.55; margin: 0 0 16px; }
  body .chi-siamo-gallery { gap: 8px; }
  body .chi-siamo-gallery img { height: 150px; }
  body footer { padding: 24px 16px 72px; }
  body .footer-content { gap: 22px; }
  body .footer-box { min-width: 0; }
  body .footer-box h4 { font-size: 16px; margin-bottom: 10px; }
  body .footer-box p { font-size: 13px; line-height: 1.5; margin-bottom: 5px; }
  body .footer-box a { font-size: 13px; overflow-wrap: anywhere; }
  body .footer-box .footer-brand { font-size: 18px; margin-bottom: 8px; }
  body .footer-navigation {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 16px;
    align-items: start;
  }
  body .footer-navigation h4 { grid-column: 1 / -1; }
  body .footer-navigation a { margin: 0; padding: 10px 0; min-height: 40px; line-height: 20px; }
  body .footer-download-buttons { gap: 8px; margin-top: 0; }
  body .footer-box .footer-download-btn {
    margin: 0;
    padding: 12px;
    min-height: 44px;
    font-size: 13px;
    line-height: 1.4;
    border-radius: 6px;
    text-align: center;
  }
}

/* Continuita dell'intestazione tra smartphone e tablet. */
@media (min-width: 701px) and (max-width: 900px) {
  .brand-header .brand-header-content { align-items: center; }
  .brand-header .brand-main { width: 100%; align-items: center; justify-content: center; gap: 12px; }
  .brand-header .brand-logo { width: 72px; height: 72px; }
  .brand-header .brand-text { flex: 0 1 306px; min-width: 0; text-align: center; }
  .brand-header .brand-text h1 { font-size: 30px; line-height: 1.2; }
  .brand-header .brand-text p { font-size: 14px; line-height: 1.4; text-align: center; }
  .brand-header .brand-socials { justify-content: center; }
}

/* Footer distribuito in colonne su telefoni e tablet. */
@media (max-width: 1024px) {
  body footer { padding: 24px 16px 64px; }
  body .footer-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px 24px;
    align-items: start;
  }
  body .footer-content > .footer-box:first-child,
  body .footer-documents { grid-column: 1 / -1; }
  body .footer-box { min-width: 0; }
  body .footer-box h4 { font-size: 16px; margin: 0 0 8px; }
  body .footer-box p { font-size: 13px; line-height: 1.5; margin: 0 0 4px; }
  body .footer-box a { font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
  body .footer-box .footer-brand { font-size: 19px; margin-bottom: 8px; }
  body .footer-navigation { display: block; }
  body .footer-navigation a,
  body .footer-information a { margin: 0; padding: 6px 0; min-height: 32px; }
  body .footer-download-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
  }
  body .footer-box .footer-download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    min-height: 44px;
    padding: 10px;
    font-size: 13px;
    line-height: 1.4;
    text-align: center;
  }
}
@media (min-width: 600px) and (max-width: 1024px) {
  body .footer-navigation {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 16px;
  }
  body .footer-navigation h4 { grid-column: 1 / -1; }
}

/* Storia completa su desktop, anteprima su telefoni e tablet. */
.chi-siamo-text .story-preview { display: none; }
@media (max-width: 1024px) {
  .chi-siamo-text .story-preview { display: block; }
  .chi-siamo-text .story-full { display: none; }
}

/* Galleria Chi siamo: scorrimento naturale con il dito su smartphone. */
@media (max-width: 700px) {
  body .gallery {
    display: flex;
    gap: 12px;
    max-width: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    padding-bottom: 10px;
    scrollbar-width: thin;
    scrollbar-color: var(--brand-blue) transparent;
  }
  body .gallery img {
    flex: 0 0 85%;
    width: 85%;
    min-width: 0;
    height: 210px;
    object-fit: cover;
    scroll-snap-align: start;
  }
  body .gallery:focus-visible {
    outline: 2px solid var(--brand-blue);
    outline-offset: 4px;
  }
}

/* Elenchi delle escursioni passate: righe compatte. */
body .archive-list { gap: 10px; }
body .archive-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
}
.archive-item .archive-item-left, .archive-item .left {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
}
body .archive-item h3 {
  width: 100%;
  margin: 0 0 3px;
  font-size: 17px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
body .archive-item p { margin: 0; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.archive-item .archive-badges { width: 100%; margin-bottom: 2px; }
.archive-item .badge { font-size: 10px; margin-bottom: 2px; padding: 4px 7px; }
.archive-item .right, .archive-item .archive-item-right { min-width: 0; }
.archive-item .right a, .archive-item .archive-item-right a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 12px;
  font-size: 13px;
  line-height: 1.3;
}
body .archive-item-faded::after { height: 32px; }
@media (max-width: 700px) {
  body .archive-list { gap: 7px; }
  body .archive-item { padding: 8px 10px; gap: 8px; }
  .archive-item .archive-item-left, .archive-item .left { gap: 2px 8px; }
  body .archive-item p { font-size: 12px; line-height: 1.35; }
  body .archive-item h3 { font-size: 14px; line-height: 1.25; margin-bottom: 2px; }
  .archive-item .right a, .archive-item .archive-item-right a {
    width: 56px;
    white-space: normal;
    padding: 6px;
    min-height: 44px;
    text-align: center;
    font-size: 12px;
  }
}

/* Escursioni: righe e titoli centrati nella fascia tablet. */
@media (min-width: 701px) and (max-width: 1024px) {
  .page-escursioni .section-title,
  .page-escursioni .section-subtitle,
  .page-escursioni .hero-small { text-align: center; }
  .page-escursioni .cards {
    justify-content: center;
    gap: 20px;
    width: 100%;
  }
  .page-escursioni .cards .card-link {
    flex: 0 1 280px;
    min-width: 0;
  }
  .page-escursioni .card-link .card { width: 100%; }
}

/* Marchio nel footer, con nome accessibile del collegamento. */
body .footer-box .footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.footer-brand .footer-logo {
  display: block;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  object-fit: contain;
  border-radius: 50%;
}
@media (max-width: 1024px) {
  .footer-brand .footer-logo { width: 44px; height: 44px; }
  body .footer-box .footer-brand { gap: 10px; }
}

@media (min-width: 1025px) {
  body .footer-box .footer-brand {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    font-size: 17px;
    line-height: 1.25;
  }
  .footer-brand .footer-logo { width: 44px; height: 44px; }
  .footer-brand span { min-width: 0; }
}

.footer-bear {
  display: block;
  width: 110px;
  max-width: 100%;
  height: auto;
  margin: 10px 0 0 auto;
}
@media (max-width: 1024px) {
  .footer-bear { width: 72px; margin-top: 8px; }
}

/* Introduzioni aperte, coerenti con home ed elenco escursioni. */
body .page-introduction {
  background: transparent;
  border: 0;
  box-shadow: none;
  border-radius: 0;
  padding: 0;
  margin-bottom: 32px;
}
body .page-introduction h2, body .page-introduction h3 { color: #222; }
body .events-intro h1, body .event-copy h2 { color: #222; }

/* Logo compatto nella barra smartphone dopo lo scorrimento. */
body .navbar .navbar-scroll-logo { display: none; }
@media (max-width: 700px) {
  body .navbar.menu-ready .navbar-scroll-logo {
    display: block; position: absolute; left: 50%; top: 50%;
    transform: translate(-50%, -50%); width: 34px; height: 34px;
    object-fit: contain; border-radius: 50%; pointer-events: none;
    opacity: 0; visibility: hidden; transition: opacity .2s ease;
  }
  body .navbar.menu-ready.header-scrolled-away .navbar-scroll-logo {
    opacity: 1; visibility: visible;
  }
}
@media (prefers-reduced-motion: reduce) {
  body .navbar.menu-ready .navbar-scroll-logo { transition: none; }
}
