/*
Theme Name:   Progetto 4P
Description:  Tema per Progetto 4P
Author:       Care srl
Author URI:   https://carecom.it
Template:     care-boilerplate
Version:      1.0.0
License:      GNU General Public License v2 or later
License URI:  http://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  progetto4p
*/

/* --- MANROPE --- */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('fonts/manrope-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('fonts/manrope-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --- NEWSREADER NORMAL --- */
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('fonts/newsreader-normal-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('fonts/newsreader-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --- NEWSREADER ITALIC --- */
@font-face {
  font-family: 'Newsreader';
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url('fonts/newsreader-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Newsreader';
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url('fonts/newsreader-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Colors - Tonal Layering */
  --surface-container-lowest: #ffffff;
  --surface-container-low: #f6f3ee;
  --surface: #fcf9f4;
  --surface-container-high: #ebe8e3;
  --surface-container-highest: #e4dfd7;

  /* Colors - Brand */
  --primary: #6d1516;
  --primary-container: #8d2c2a;
  --on-primary: #ffffff;
  --on-surface: #1c1c19;
  --outline-variant: #dcc0be;
  --tertiary: #433523;

  /* Fonts */
  --font-display: 'Newsreader', serif;
  --font-body: 'Manrope', sans-serif;

  /* Typography Scale */
  --text-display-lg: 3.5rem;
  --text-headline-lg: 2.5rem;
  --text-headline-sm: 1.5rem;
  --text-title-md: 1rem;
  --text-body-sm: 0.75rem;

  /* Spacing */
  --spacing-6: 2rem;
  --spacing-20: 7rem;

  /* Radius */
  --radius-default: 0.25rem;
  --radius-lg: 0.5rem;

  /* Effects */
  --shadow-ambient: 0px 10px 30px rgba(28, 28, 25, 0.06);
  --glass-bg: rgba(252, 249, 244, 0.8);
  --glass-blur: blur(12px);
  --ghost-border: rgba(220, 192, 190, 0.2);
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--surface);
  color: var(--on-surface);
  font-family: var(--font-body);
}

h1,
h2,
h3,
h4,
h5,
h6,
.font-display {
  font-family: var(--font-display);
  font-weight: 400;
  margin-top: 0;
}

.page-content,
.entry-content,
.entry-summary {
  margin: 0;
}

.post,
.page {
  margin: 0;
}

/* Base Links */
a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sr-only:focus-visible {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

a:visited {
  color: var(--primary);
}

a:hover,
a:focus,
a:active {
  color: var(--primary-container);
}

/* ==========================================================================
   App Shell (Header & Navigation)
   ========================================================================== */

/* Top Header */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--spacing-6);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  z-index: 100;
  /* No solid border as per DESIGN.md */
}

.app-header__left,
.app-header__right {
  flex: 1;
  display: flex;
}

.app-header__right {
  justify-content: flex-end;
}

.app-header__center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}

.app-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-headline-sm);
  font-weight: 400;
  margin: 0;
  color: var(--on-surface);
}

.icon-button {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.language-selector {
  font-family: var(--font-body);
  font-size: var(--text-body-sm);
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
}

.language-selector a {
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

.language-selector a:hover {
  opacity: 1;
}

.language-selector .active {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
  opacity: 1;
}

.language-selector .sep {
  margin: 0 4px;
  opacity: 0.4;
}

/* App Content Area */
.app-content {
  padding-top: 60px;
  /* Header height */
  padding-bottom: 70px;
  /* Bottom nav height */
  min-height: 100vh;
  min-height: 100dvh;
  box-sizing: border-box;
}

.home .app-content {
  max-height: 100%;
}

/* Navigation Base */
.app-nav {
  position: fixed;
  z-index: 90;
  display: flex;
  background-color: var(--surface-container-low);
}

.nav-item,
.nav-item:visited,
.nav-item:focus,
.nav-item:active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--on-surface);
  opacity: 0.6;
  transition: all 0.3s ease;
  min-width: 48px;
  /* Tap target accessibility */
  min-height: 48px;
}

.nav-item span {
  font-family: var(--font-body);
  font-size: var(--text-body-sm);
  font-weight: 600;
  text-transform: uppercase;
  margin-top: 4px;
}

.nav-item.active,
.nav-item.active:visited {
  color: var(--primary);
  opacity: 1;
}

.nav-item i {
  stroke-width: 1.5;
  /* Requested by user */
  width: 24px;
  height: 24px;
}

/* Mobile: Bottom Navbar */
@media (max-width: 767px) {
  .app-nav {
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    flex-direction: row;
    justify-content: space-around;
  }
}

/* Desktop: Navigation Rail (Left) */
@media (min-width: 768px) {
  .app-header {
    left: 80px;
    /* Make space for rail */
  }

  .app-nav {
    top: 0;
    left: 0;
    bottom: 0;
    width: 80px;
    flex-direction: column;
    justify-content: center;
    gap: var(--spacing-6);
    background-color: var(--surface-container-lowest);
    /* No border as per DESIGN.md, using surface-container-lowest shift */
  }

  .app-content {
    padding-left: 80px;
    /* Make space for rail */
    padding-bottom: 0;
  }

  /* Single POI Full Width Hero */
  .app-content.app-content--full {
    padding-left: 0;
  }

  .app-content.app-content--full .poi-hero__overlay {
    padding-left: calc(80px + var(--spacing-6));
  }

  .app-content.app-content--full .poi-single-container {
    padding-left: calc(80px + var(--spacing-6));
  }
}

/* ==========================================================================
   Global Loader (Step 2)
   ========================================================================== */
.global-loader {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--surface);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

body>.global-loader {
  position: fixed;
}

.global-loader.global-loader--hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.global-loader__spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--outline-variant);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: global-loader-spin 1s linear infinite;
}

@keyframes global-loader-spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Cinematic Loader (GSAP Animated) */
.cinematic-loader {
  position: fixed;
  top: 60px;
  /* Below the header so the title stays visible */
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--surface);
  z-index: 99;
  /* Below header (100) */
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 768px) {
  .cinematic-loader {
    left: 80px;
    /* Align with rail nav */
  }
}

.cinematic-loader__content {
  text-align: center;
  max-width: 600px;
  padding: var(--spacing-6);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cinematic-loader__image {
  width: auto;
  max-width: 100%;
  max-height: 40vh;
  max-height: 40dvh;
  margin-bottom: 40px;
  opacity: 0;
  /* Animated via GSAP */
  transform: scale(0.9);
}

.cinematic-loader__text {
  opacity: 0;
  /* Animated via GSAP */
  transform: translateY(20px);
}

.cinematic-loader__text p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-headline-sm);
  color: var(--on-surface);
  margin: 0 0 16px 0;
  line-height: 1.4;
}

.cinematic-loader__author {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-body-sm);
  color: var(--tertiary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
}

.cinematic-loader__spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--outline-variant);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: global-loader-spin 1s linear infinite;
  margin-top: 32px;
  opacity: 0;
  /* Animated via GSAP */
  transform: translateY(20px);
}

/* ==========================================================================
   Homepage Components (Step 3)
   ========================================================================== */

/* Map Background Placeholder */
.map-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
}

.map-placeholder-bg {
  width: 100%;
  height: 100%;
  background-color: var(--surface-container-high);
  /* Optional pattern to simulate map lines */
  background-image: radial-gradient(var(--outline-variant) 1px, transparent 1px);
  background-size: 20px 20px;
}

/* Map UI Toggle */
.map-ui-toggle-btn {
  position: absolute;
  top: 80px;
  /* Aligned below the header */
  right: var(--spacing-6);
  z-index: 150;
  /* Above everything */
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  box-shadow: var(--shadow-ambient);
  cursor: pointer;
  transition: all 0.3s ease;
}

.map-ui-toggle-btn:hover {
  background-color: var(--surface-container-lowest);
}

.map-ui-toggle-btn i {
  width: 24px;
  height: 24px;
  stroke-width: 1.5;
}

.map-ui-toggle-btn .icon-show {
  display: none;
}

body.map-fullscreen-mode .map-ui-toggle-btn .icon-hide {
  display: none;
}

body.map-fullscreen-mode .map-ui-toggle-btn .icon-show {
  display: block;
}

/* ==========================================================================
   Map Filters (Chips)
   ========================================================================== */
.map-filters {
  position: absolute;
  top: 80px;
  right: calc(var(--spacing-6) + 60px);
  /* Posizionato a sinistra del bottone eye */
  z-index: 150;
  display: flex;
  gap: 8px;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

body.map-fullscreen-mode .map-filters {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-20px);
}

.map-filter-pill {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: none;
  border-radius: 100px;
  height: 48px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--on-surface);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: var(--shadow-ambient);
  cursor: pointer;
  transition: all 0.3s ease;
  opacity: 0.5;
}

.map-filter-pill.active {
  opacity: 1;
  background: var(--surface-container-lowest);
}

.pin-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.pin-dot--luogo {
  background-color: var(--primary);
}

.pin-dot--comune {
  background-color: #d4a373;
}

@media (max-width: 767px) {
  .map-filters {
    top: 140px;
    right: var(--spacing-6);
  }
}

/* ==========================================================================
   Advanced Custom Markers & Animated InfoWindow
   ========================================================================== */

.custom-marker-wrapper {
  position: relative;
  cursor: pointer;
}

/* Il Pin (SVG) */
.custom-marker-wrapper__pin {
  width: 48px;
  height: 48px;
  position: relative;
  z-index: 2;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.custom-marker-wrapper:hover .custom-marker-wrapper__pin {
  transform: scale(1.15);
}

/* La InfoWindow custom animata */
.custom-marker-wrapper__card {
  position: absolute;
  bottom: calc(100% + 12px);
  /* Sopra il pin */
  left: 50%;
  width: 240px;
  background-color: var(--surface-container-lowest);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-ambient);
  overflow: hidden;
  z-index: 10;

  /* Stato iniziale (Nascosto) */
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(20px) scale(0.9);
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Stato Attivo (Visibile) */
.custom-marker-wrapper.is-expanded .custom-marker-wrapper__card {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0) scale(1);
  pointer-events: auto;
}

/* Stili Interni della Card */
.custom-marker-wrapper__image {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
  background-color: var(--surface-container-high);
  /* Fallback bg */
}

.custom-marker-wrapper__content {
  padding: 16px;
}

.custom-marker-wrapper__cat {
  display: block;
  font-family: var(--font-body);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
  font-weight: 600;
}

.custom-marker-wrapper__title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-headline-sm);
  color: var(--on-surface);
  font-weight: 400;
  margin: 0 0 12px 0;
  line-height: 1.2;
}

.custom-marker-wrapper__link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-body);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  text-decoration: none;
}

/* UI Elements transitions for Fullscreen Mode */
.app-header,
.app-nav,
.floating-card-wrapper,
.bottom-sheet {
  transition: opacity 0.5s ease, transform 0.5s ease;
}

body.map-fullscreen-mode .app-header {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-20px);
}

body.map-fullscreen-mode .app-nav {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 767px) {
  body.map-fullscreen-mode .app-nav {
    transform: translateY(20px);
  }
}

@media (min-width: 768px) {
  body.map-fullscreen-mode .app-nav {
    transform: translateX(-20px);
  }
}

body.map-fullscreen-mode .floating-card-wrapper,
body.map-fullscreen-mode .bottom-sheet {
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
}


/* Base Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-default);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-body-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  border: none;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn:visited,
.btn:focus,
.btn:active {
  text-decoration: none;
}

.btn i {
  width: 18px;
  height: 18px;
}

.btn--primary,
.btn--primary:visited,
.btn--primary:focus,
.btn--primary:active {
  background-color: var(--primary);
  color: var(--on-primary);
  background-image: linear-gradient(135deg, var(--primary) 0%, var(--primary-container) 100%);
}

.btn--primary:hover {
  filter: brightness(1.1);
  color: antiquewhite;
}

.btn--secondary,
.btn--secondary:visited,
.btn--secondary:focus,
.btn--secondary:active {
  background-color: var(--surface-container-highest);
  color: var(--on-surface);
}

.btn--secondary:hover {
  background-color: var(--surface-container-high);
}

/* Floating Card "Cenere e Terra" */
.floating-card-wrapper {
  position: relative;
  z-index: 10;
  padding: var(--spacing-6);
  max-width: 600px;
  margin: 0 auto;
}

.floating-card {
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  padding: 32px;
  box-shadow: var(--shadow-ambient);
  /* No border */
}

.floating-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.floating-card__title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-headline-lg);
  font-weight: 400;
  margin: 0;
  color: var(--on-surface);
  line-height: 1.1;
}

.floating-card__logo {
  font-family: var(--font-body);
  font-size: 10px;
  color: var(--tertiary);
  text-align: right;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.4;
}

.floating-card__subtitle {
  font-family: var(--font-body);
  font-size: var(--text-body-sm);
  color: var(--on-surface);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  margin-bottom: 24px;
  line-height: 1.5;
}

.floating-card__divider {
  border: none;
  height: 1px;
  background-color: var(--outline-variant);
  opacity: 0.3;
  width: 40px;
  margin: 0 0 24px 0;
}

.floating-card__quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-title-md);
  color: var(--tertiary);
  margin: 0;
  line-height: 1.6;
}

.floating-card__quotes-carousel {
  position: relative;
  transition: height 0.6s ease;
}

.floating-card__quotes-carousel .floating-card__quote {
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 0;
  transform: translateY(15px);
  pointer-events: none;
}

.floating-card__quotes-carousel .floating-card__quote.active {
  position: relative;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.floating-card__quotes-carousel .floating-card__quote.fade-out {
  opacity: 0;
  transform: translateY(-15px);
  position: absolute;
}

/* Bottom Sheet "Discovery Nearby" */
.bottom-sheet {
  position: relative;
  z-index: 20;
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  margin-top: 40px;
  border-radius: 24px 24px 0 0;
  padding: 16px var(--spacing-6) 40px var(--spacing-6);
  box-shadow: var(--shadow-ambient);
}

.bottom-sheet__drag-handle {
  width: 40px;
  height: 4px;
  background-color: var(--outline-variant);
  border-radius: 2px;
  margin: 0 auto 24px auto;
  opacity: 0.5;
}

.bottom-sheet__title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-headline-lg);
  color: var(--primary);
  margin: 0 0 8px 0;
  font-weight: 400;
}

.bottom-sheet__subtitle {
  font-family: var(--font-body);
  font-size: var(--text-title-md);
  color: var(--tertiary);
  margin: 0 0 24px 0;
}

.bottom-sheet__actions {
  display: flex;
  gap: 16px;
  margin-bottom: 32px;
}

.bottom-sheet__actions .btn {
  flex: 1;
}

/* Image Cards */
.bottom-sheet__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
}

.image-card {
  position: relative;
  display: block;
  height: 240px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  /* No borders */
}

.image-card__bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.5s ease;
}

.image-card__gradient {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(28, 28, 25, 0) 0%, rgba(28, 28, 25, 0.8) 100%);
}

.image-card__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--primary-container);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.image-card:hover .image-card__bg {
  transform: scale(1.05);
}

.image-card:hover .image-card__overlay {
  opacity: 0.1;
  /* 10% come da DESIGN.md */
}

.image-card__content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.image-card__chapter {
  font-family: var(--font-body);
  font-size: 10px;
  color: rgba(255, 255, 255, 0.8);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}

.image-card__title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-headline-sm);
  color: #ffffff;
  margin: 0;
  font-weight: 400;
}

/* Media Query Desktop Adjustments */
@media (min-width: 768px) {
  .bottom-sheet {
    max-width: 480px;
    margin: 40px var(--spacing-6) 40px auto;
  }
}

/* ==========================================================================
   POI Archive (Step 1)
   ========================================================================== */

.archive-container {
  padding: var(--spacing-6) var(--spacing-6) 80px;
  position: relative;
}

.archive-header {
  margin-bottom: var(--spacing-6);
}

.archive-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-display-lg);
  color: var(--on-surface);
  font-weight: 400;
  margin: 0 0 16px 0;
  line-height: 1.1;
}

.archive-description {
  font-family: var(--font-body);
  font-size: var(--text-title-md);
  color: var(--tertiary);
  margin: 0;
  line-height: 1.6;
}

/* Filters */
.poi-filters {
  background-color: var(--surface-container-low);
  padding: 24px;
  border-radius: var(--radius-lg);
  margin-bottom: 40px;
}

.poi-filters__form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

@media (min-width: 768px) {
  .poi-filters__form {
    flex-direction: row;
    align-items: flex-end;
  }

  .poi-filters__group {
    flex: 1;
  }
}

.poi-filters__label {
  display: block;
  font-family: var(--font-body);
  font-size: 10px;
  color: var(--tertiary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

@media (min-width: 768px) {
  .poi-filters__label {
    font-size: 12px;
  }
}

.poi-filters__select-wrapper {
  position: relative;
}

.poi-filters__select {
  width: 100%;
  appearance: none;
  background-color: var(--surface-container-lowest);
  border: none;
  /* No-line rule */
  padding: 12px 16px;
  border-radius: var(--radius-default);
  font-family: var(--font-body);
  font-size: var(--text-body-sm);
  color: var(--on-surface);
  cursor: pointer;
}

@media (min-width: 768px) {
  .poi-filters__select {
    font-size: var(--text-body-md);
    padding: 16px 20px;
  }
}

.poi-filters__select-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--tertiary);
  width: 16px;
  height: 16px;
}

.poi-filters__chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  background-color: var(--surface-container-highest);
  border: none;
  padding: 8px 16px;
  border-radius: 100px;
  font-family: var(--font-body);
  font-size: var(--text-body-sm);
  font-weight: 600;
  color: var(--on-surface);
  cursor: pointer;
  transition: all 0.2s ease;
}

@media (min-width: 768px) {
  .chip {
    font-size: 13px;
    padding: 12px 20px;
  }
}

.chip.active {
  background-color: var(--primary);
  color: var(--on-primary);
}

.poi-filters__distance-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.poi-filters__distance-header .poi-filters__label {
  margin-bottom: 0;
}

.poi-filters__location-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: var(--on-surface-variant);
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: color 0.3s ease;
}

.poi-filters__location-btn:hover {
  color: var(--primary);
}

.poi-filters__location-btn i {
  width: 16px;
  height: 16px;
}

.poi-filters__location-display {
  font-family: var(--font-body);
  font-size: 10px;
  margin-top: 8px;
  color: var(--on-surface-variant);
}

@media (min-width: 768px) {
  .poi-filters__location-display {
    font-size: 12px;
  }
}

.poi-filters__group--distance.is-disabled {
  opacity: 0.5;
}

.poi-filters__group--distance.is-disabled .poi-filters__select-wrapper {
  pointer-events: none;
}

/* POI List & Card */
.poi-list {
  display: flex;
  flex-direction: column;
  gap: 60px;
  /* Spaziatura ampia */
}

@media (min-width: 768px) {
  .poi-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
  }
}

@media (min-width: 1024px) {
  .poi-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

.poi-card__link {
  text-decoration: none;
  display: block;
  color: inherit;
}

.poi-card__image-wrapper {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 24px;
}

.poi-card__image {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
}

.poi-card__distance-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background-color: var(--surface-container-lowest);
  color: var(--primary);
  padding: 6px 10px;
  border-radius: var(--radius-default);
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: var(--shadow-ambient);
}

.poi-card__distance-badge i {
  width: 12px;
  height: 12px;
}

.poi-card__category {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 10px;
  color: var(--tertiary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

/* Horizontal Accent line for category */
.poi-card__accent-line-horiz {
  display: inline-block;
  width: 24px;
  height: 1px;
  background-color: var(--outline-variant);
}

.poi-card__title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-headline-lg);
  color: var(--on-surface);
  font-weight: 400;
  margin: 0 0 16px 0;
  line-height: 1.1;
}

.poi-card__excerpt {
  font-family: var(--font-body);
  font-size: var(--text-title-md);
  color: var(--on-surface);
  line-height: 1.6;
  opacity: 0.8;
}

.poi-pagination {
  display: flex;
  justify-content: space-between;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--outline-variant);
  /* allowed as a generic separator, or use background shift */
  border-color: rgba(220, 192, 190, 0.2);
  /* Ghost border */
}

.poi-pagination a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--tertiary);
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.poi-pagination a i {
  width: 14px;
  height: 14px;
}

/* ==========================================================================
   POI Single (Step 2)
   ========================================================================== */

.poi-back-nav {
  background-color: var(--surface-container-lowest);
  padding: 16px 0;
}

.poi-back-nav__container {
  max-width: 1920px;
  margin: 0 auto;
  padding: 0 var(--spacing-6);
}

.poi-back-btn,
.poi-back-btn:visited,
.poi-back-btn:focus,
.poi-back-btn:active {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  color: var(--on-surface);
  text-decoration: none;
  transition: color 0.3s ease;
}

@media (min-width: 768px) {
  .poi-back-btn {
    font-size: 12px;
  }
}

.poi-back-btn i {
  width: 16px;
  height: 16px;
  vertical-align: middle;
}

.poi-back-btn:hover {
  color: var(--primary);
}

.poi-hero {
  position: relative;
  height: 60vh;
  height: 60dvh;
  min-height: 400px;
  margin-bottom: var(--spacing-6);
}

.poi-hero__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.poi-hero__overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px var(--spacing-6);
  background: linear-gradient(to bottom, rgba(28, 28, 25, 0) 0%, rgba(28, 28, 25, 0.8) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.poi-hero__category {
  font-family: var(--font-body);
  font-size: 10px;
  color: rgba(255, 255, 255, 0.8);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.poi-hero__title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-display-lg);
  color: #ffffff;
  font-weight: 400;
  margin: 0;
  line-height: 1.1;
}

.poi-single-container {
  padding: 0 var(--spacing-6) 60px var(--spacing-6);
  max-width: 1920px;
  /*margin: 0 auto;*/
}

@media (min-width: 1024px) {
  .poi-single-container {
    display: grid;
    grid-template-columns: minmax(0, 800px) 350px;
    justify-content: start;
    gap: 80px;
    align-items: start;
  }
}

.poi-single-content {
  max-width: 800px;
  width: 100%;
  margin-bottom: 60px;
}

@media (min-width: 1024px) {
  .poi-single-content {
    margin-bottom: 0;
  }
}

.poi-single-sidebar {
  position: sticky;
  top: 100px;
  /* offset for sticky scrolling */
}

/* POI Admin Actions */
.poi-admin-actions {
  display: flex;
  gap: 16px;
  padding: var(--spacing-6);
  margin-top: var(--spacing-6);
  border-top: 1px solid var(--ghost-border);
  justify-content: flex-start;
}

@media (max-width: 1024px) {
  .poi-admin-actions {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .poi-admin-actions {
    flex-direction: column;
    padding: var(--spacing-6);
  }
}

/* Vertical Accent as requested */
.poi-section-header {
  display: flex;
  align-items: stretch;
  /* To make the accent take full height */
  gap: 16px;
  margin-bottom: 32px;
}

.poi-vertical-accent {
  width: 4px;
  background-color: var(--primary);
  /* NEVER USE BORDER */
}

.poi-section-header__text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.poi-section-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-headline-sm);
  color: var(--primary);
  font-weight: 400;
  margin: 0 0 4px 0;
}

.poi-section-subtitle {
  font-family: var(--font-body);
  font-size: 10px;
  color: var(--tertiary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.poi-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-headline-lg);
  color: var(--on-surface);
  line-height: 1.3;
  margin-bottom: var(--spacing-6);
}

.poi-description {
  font-family: var(--font-body);
  font-size: var(--text-title-md);
  color: var(--on-surface);
  line-height: 1.8;
  margin-bottom: 60px;
}

.poi-description p {
  margin-top: 0;
  margin-bottom: 24px;
}

/* ==========================================================================
   POI Schede Content Blocks
   ========================================================================== */

.poi-schede-container {
  margin-top: 40px;
  scroll-margin-top: 80px;
  /* Accounts for fixed app-header height */
}

.poi-scheda__title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-headline-md);
  color: var(--on-surface);
  font-weight: 400;
  margin-bottom: 32px;
}

.poi-scheda-block {
  margin-bottom: 32px;
}

.poi-scheda-block:last-child {
  margin-bottom: 0;
}

/* Text Block */
.poi-scheda-block--testo {
  font-family: var(--font-body);
  font-size: var(--text-body-md);
  color: var(--on-surface);
  line-height: 1.8;
}

.poi-scheda-block--testo p {
  margin-top: 0;
  margin-bottom: 20px;
}

.poi-scheda-block--testo p:last-child {
  margin-bottom: 0;
}

.poi-scheda-block--citazione {
  padding: var(--spacing-6);
  background-color: var(--surface-container-highest);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-lg);
  margin-bottom: 32px;
}

.poi-scheda-block--citazioni {
  margin: 32px 0;
  position: relative;
}
.poi-scheda-block--citazioni .splide__track {
  padding: 0 64px;
}
@media (max-width: 768px) {
  .poi-scheda-block--citazioni .splide__track {
    padding: 0 48px;
  }
}
.poi-scheda-block--citazioni .splide__list {
  align-items: flex-start;
}
.poi-scheda-block--citazioni .poi-scheda-block--citazione {
  margin-bottom: 0;
  width: 100%;
}
.poi-scheda-block--citazioni .splide__pagination {
  bottom: -24px;
}

.poi-scheda-blockquote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-headline-sm);
  color: var(--on-surface);
  margin: 0 0 16px 0;
  line-height: 1.4;
}

.poi-scheda-blockquote:last-child {
  margin-bottom: 0;
}

.poi-scheda-cite {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-body-sm);
  color: var(--tertiary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
}

.poi-scheda-block--immagine-singola {
  margin-bottom: 32px;
}

.poi-scheda-block--immagine-singola img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  display: block;
  margin-bottom: 12px;
  box-shadow: var(--shadow-ambient);
}

.poi-scheda-didascalia {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--tertiary);
  text-align: center;
  font-style: italic;
  margin: 0;
}

.poi-scheda-alt-text {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--tertiary);
  text-align: center;
  font-style: italic;
  margin: 8px 0 0 0;
}

/* Gallery Block */
.poi-scheda-block--galleria {
  margin: 32px 0;
  border-radius: var(--radius-lg);
  position: relative;
}

.poi-scheda-block--galleria img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: contain;
  background-color: transparent;
  border-radius: var(--radius-lg);
  display: block;
}

.poi-scheda-block--galleria .poi-scheda-alt-text {
  margin-bottom: 40px;
}

.glightbox-clean .gslide-description {
  background: transparent !important;
  text-align: center !important;
}
.glightbox-clean .gslide-title {
  color: #fff !important;
}

/* Splide Arrows */
.poi-scheda-block--galleria .splide__arrow,
.poi-scheda-block--citazioni .splide__arrow {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  z-index: 2;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.poi-scheda-block--galleria:hover .splide__arrow,
.poi-scheda-block--citazioni:hover .splide__arrow {
  opacity: 1;
}

.poi-scheda-block--galleria .splide__arrow--prev,
.poi-scheda-block--citazioni .splide__arrow--prev {
  left: -20px;
}

.poi-scheda-block--galleria .splide__arrow--next,
.poi-scheda-block--citazioni .splide__arrow--next {
  right: -20px;
}

.poi-scheda-block--galleria .splide__arrow svg,
.poi-scheda-block--citazioni .splide__arrow svg {
  width: 28px !important;
  height: 28px !important;
  stroke: var(--primary);
  stroke-width: 2.5px;
}

/* Splide Pagination */
.poi-scheda-block--galleria .splide__pagination,
.poi-scheda-block--citazioni .splide__pagination {
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
  z-index: 2;
}

.poi-scheda-block--citazioni .splide__pagination {
  bottom: -24px;
}

.poi-scheda-block--galleria .splide__pagination__page,
.poi-scheda-block--citazioni .splide__pagination__page {
  background: lightgray;
  border: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  transition: all 0.3s ease;
}

.poi-scheda-block--citazioni .splide__pagination__page {
  background: var(--surface-container-highest);
}

.poi-scheda-block--galleria .splide__pagination__page.is-active,
.poi-scheda-block--citazioni .splide__pagination__page.is-active {
  background: var(--primary);
  transform: scale(1.2);
}

/* Audio Block */
.poi-scheda-block--audio {
  background-color: var(--surface-container-low);
  padding: 24px;
  border-radius: var(--radius-lg);
}

.poi-scheda-block--audio audio {
  width: 100%;
  outline: none;
  margin-bottom: 16px;
  border-radius: 100px;
  /* Modern audio player look if supported */
}

.poi-scheda-audio-transcript {
  font-family: var(--font-body);
  font-size: var(--text-body-sm);
  color: var(--tertiary);
  line-height: 1.6;
  border-top: 1px solid var(--outline-variant);
  padding-top: 16px;
}

/* Video Block */
.poi-scheda-block--video {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background-color: var(--surface-container-lowest);
}

.poi-scheda-block--video video {
  width: 100%;
  display: block;
  border-radius: var(--radius-lg);
}

.poi-video-embed {
  position: relative;
  padding-bottom: 56.25%;
  /* 16:9 Aspect Ratio */
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.poi-video-embed iframe,
.poi-video-embed object,
.poi-video-embed embed {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ==========================================================================
   POI Single Timeline & Mobile Nav (Step 5)
   ========================================================================== */

.poi-timeline {
  display: none;
  /* Hidden on mobile */
}

.poi-mobile-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--surface-container-low);
  padding: 16px;
  border-radius: var(--radius-lg);
  margin-top: 40px;
}

.poi-mobile-nav__info {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
}

.poi-mobile-nav__step {
  font-family: var(--font-body);
  font-size: 10px;
  color: var(--tertiary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}

.poi-mobile-nav__title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-headline-sm);
  color: var(--on-surface);
  margin: 0;
  line-height: 1.2;
}

@media (min-width: 1024px) {
  .poi-mobile-nav {
    display: none;
    /* Hidden on desktop */
  }

  .poi-timeline {
    display: flex;
    flex-direction: column;
    padding-left: 12px;
    /* Space for the line */
  }

  .poi-timeline__item {
    display: flex;
    gap: 24px;
    position: relative;
    cursor: pointer;
    min-height: 80px;
    opacity: 0.6;
    transition: opacity 0.3s ease;
  }

  .poi-timeline__item:hover {
    opacity: 0.8;
  }

  .poi-timeline__item.active {
    opacity: 1;
  }

  .poi-timeline__marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
  }

  .poi-timeline__dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--outline-variant);
    background-color: var(--surface);
    transition: all 0.4s ease;
    margin-top: 4px;
  }

  .poi-timeline__item:hover .poi-timeline__dot {
    border-color: var(--primary);
  }

  .poi-timeline__item.active .poi-timeline__dot {
    background-color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(109, 21, 22, 0.4);
    transform: scale(1.2);
  }

  .poi-timeline__line {
    width: 2px;
    background-color: var(--outline-variant);
    flex-grow: 1;
    margin-top: 8px;
    margin-bottom: 8px;
    transition: background-color 0.4s ease;
  }

  .poi-timeline__item.active .poi-timeline__line {
    background-color: var(--primary);
  }

  .poi-timeline__content {
    padding-bottom: 32px;
    transform: translateY(0);
    transition: transform 0.3s ease;
  }

  .poi-timeline__item.active .poi-timeline__content {
    transform: translateX(8px);
  }

  .poi-timeline__step {
    display: block;
    font-family: var(--font-body);
    font-size: 10px;
    color: var(--tertiary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 4px;
  }

  .poi-timeline__title {
    font-family: var(--font-display);
    font-style: italic;
    font-size: var(--text-title-md);
    color: var(--on-surface);
    margin: 0;
    line-height: 1.4;
    transition: color 0.3s ease;
  }

  .poi-timeline__item.active .poi-timeline__title {
    color: var(--primary);
    font-size: var(--text-headline-sm);
  }
}

@media (min-width: 768px) {
  .poi-plan-visit__actions {
    flex-direction: row;
  }
}

/* ==========================================================================
   POI Theme Taxonomy (Step 3)
   ========================================================================== */

.theme-container {
  padding: var(--spacing-6);
  max-width: 800px;
  margin: 0 auto;
}

.theme-header {
  margin-bottom: var(--spacing-6);
}

.theme-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-display-lg);
  color: var(--on-surface);
  font-weight: 400;
  margin: 0 0 32px 0;
  line-height: 1.1;
}

.theme-intro {
  display: flex;
  align-items: stretch;
  gap: 16px;
  background-color: var(--surface-container-low);
  padding: 24px;
  border-radius: var(--radius-lg);
}

.theme-intro__text {
  font-family: var(--font-body);
  font-size: var(--text-title-md);
  color: var(--on-surface);
  line-height: 1.6;
}

.theme-intro__text p {
  margin: 0;
}

/* Theme Cards */
.theme-cards-list {
  display: flex;
  flex-direction: column;
  gap: 40px;
  margin-bottom: 60px;
}

.theme-card {
  background-color: var(--surface-container-lowest);
  border-radius: var(--radius-lg);
  overflow: hidden;
  /* NO borders as per DESIGN.md */
  box-shadow: var(--shadow-ambient);
}

.theme-card__link {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  color: inherit;
}

.theme-card__image-wrapper {
  width: 100%;
  height: 200px;
}

.theme-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.theme-card__content {
  padding: 24px;
}

.theme-card__meta {
  display: block;
  font-family: var(--font-body);
  font-size: 10px;
  color: var(--tertiary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.theme-card__title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-headline-sm);
  color: var(--on-surface);
  font-weight: 400;
  margin: 0 0 16px 0;
  line-height: 1.2;
}

.theme-card__excerpt {
  font-family: var(--font-body);
  font-size: var(--text-body-sm);
  color: var(--on-surface);
  opacity: 0.8;
  line-height: 1.6;
  margin-bottom: 24px;
}

.theme-card__action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-body);
  font-size: 10px;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.theme-card__action i {
  width: 14px;
  height: 14px;
}

/* Theme CTA Finale */
.theme-cta {
  background-color: var(--primary);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  margin-bottom: 40px;
  background-image: linear-gradient(135deg, var(--primary) 0%, var(--primary-container) 100%);
}

.theme-cta__title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-headline-lg);
  color: var(--on-primary);
  font-weight: 400;
  margin: 0 0 16px 0;
}

.theme-cta__text {
  font-family: var(--font-body);
  font-size: var(--text-body-sm);
  color: var(--on-primary);
  opacity: 0.9;
  line-height: 1.6;
  margin: 0 auto 32px auto;
  max-width: 400px;
}

.theme-cta__actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

.theme-cta__btn-dark {
  background-color: var(--primary-container);
  color: var(--on-primary);
  width: 100%;
  max-width: 300px;
}

.theme-cta__btn-dark:hover {
  background-color: var(--primary);
}

.theme-cta__btn-light {
  background-color: var(--surface-container-lowest);
  color: var(--primary);
  width: 100%;
  max-width: 300px;
}

.theme-cta__btn-light:hover {
  background-color: var(--surface-container-low);
}

@media (min-width: 768px) {
  .theme-cta {
    padding: 64px 40px;
  }

  .theme-cta__actions {
    flex-direction: row;
    justify-content: center;
  }
}

/* ==========================================================================
   About Page Components
   ========================================================================== */

.about-page {
  padding: var(--spacing-6);
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
}

.about-hero {
  margin-bottom: var(--spacing-20);
  margin-top: calc(var(--spacing-20) + 40px);
  position: relative;
}

.about-hero__title {
  font-family: var(--font-display);
  font-size: var(--text-display-lg);
  color: var(--primary);
  font-style: italic;
  margin-bottom: var(--spacing-6);
  margin-left: -20px;
  position: relative;
  z-index: 2;
}

.about-hero__content {
  background-color: var(--surface-container-low);
  padding: 64px 48px;
  border-radius: var(--radius-lg);
  position: relative;
  z-index: 1;
}

.about-hero__subtitle {
  font-family: var(--font-display);
  font-size: var(--text-headline-sm);
  color: var(--on-surface);
  line-height: 1.6;
}

.about-partners {
  margin-bottom: var(--spacing-20);
  background-color: var(--surface-container-highest);
  padding: 64px;
  border-radius: var(--radius-lg);
}

.about-partners__title {
  font-family: var(--font-body);
  font-size: var(--text-title-md);
  color: var(--on-surface);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 40px;
  font-weight: 700;
  border-bottom: 1px solid var(--ghost-border);
  padding-bottom: 16px;
  display: inline-block;
}

.partners-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 24px;
  align-items: center;
}

.partner-logo {
  height: 160px;
  background-color: var(--surface-container-lowest);
  border-radius: var(--radius-default);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-ambient);
  padding: 16px;
  box-sizing: border-box;
}

.partner-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.partner-logo__text {
  font-family: var(--font-body);
  font-size: var(--text-body-sm);
  color: var(--tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
  font-weight: 600;
}

.about-content {
  margin-bottom: var(--spacing-20);
  padding-left: 10%;
  max-width: 800px;
  position: relative;
}

.about-content::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  background-color: var(--outline-variant);
  border-radius: 2px;
  opacity: 0.5;
}

.about-content__title {
  font-family: var(--font-display);
  font-size: var(--text-headline-lg);
  color: var(--on-surface);
  margin-bottom: 40px;
  font-style: italic;
}

.about-content__body {
  font-family: var(--font-body);
  font-size: var(--text-title-md);
  line-height: 2;
  color: var(--on-surface);
}

.about-content__body p {
  margin-bottom: 32px;
}

.about-content__actions {
  margin-top: 48px;
}

@media (max-width: 768px) {
  .about-hero {
    margin-top: var(--spacing-6);
  }

  .about-hero__title {
    margin-left: 0;
    font-size: var(--text-headline-lg);
  }

  .about-hero__content {
    margin-left: 0;
    padding: 32px 24px;
  }

  .about-partners {
    margin-right: 0;
    padding: 32px 24px;
  }

  .about-content {
    padding-left: 24px;
  }

  .poi-back-nav,
  .poi-hero {
    width: calc(100% + 40px);
    margin-left: -20px;
  }
}

/* ==========================================================================
   Interreg Logo & Footer
   ========================================================================== */
.interreg-logo {
  width: 100%;
  height: auto;
  max-width: 285px;
}

@media (min-width: 768px) {
  .interreg-logo {
    max-width: 355px;
  }
}

/* Homepage Map Container Logo Wrapper (Desktop) */
body.home .interreg-logo-wrapper {
  position: absolute;
  bottom: 20px;
  left: 90px;
  z-index: 10;
  pointer-events: none;
}

/* Footer Logo Alignment */
body.home .site-footer {
  display: none !important;
}

.site-footer {
  position: relative;
  padding: 0;
  background-color: var(--surface);
}

body:not(.home) .site-footer {
  width: calc(100% + 40px);
  margin-left: -20px;
}

.footer-interreg-logo {
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

/* ==========================================================================
   Mobile Homepage Layout Improvements
   ========================================================================== */
@media (max-width: 767px) {

  /* Reduce global typography scale on mobile */
  :root {
    --text-display-lg: 2.5rem;
    --text-headline-lg: 2rem;
    --text-headline-md: 1.5rem;
    --text-headline-sm: 1.25rem;
    --text-title-md: 1rem;
    --text-body-md: 0.9375rem;
    --text-body-sm: 0.8125rem;
  }

  .poi-single-container,
  .about-page {
    padding-left: 0;
    padding-right: 0;
  }


  /* Prevent scrolling on the entire page */
  body.home {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100vh;
    height: 100dvh;
  }

  /* Restructure the layout using flexbox to manage hierarchy and space */
  body.home .site-main {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    max-height: 100%;
    overflow: hidden;
  }

  /* 1. Floating Card - sits at top and takes natural height */
  body.home .floating-card-wrapper {
    position: relative;
    order: 1;
    margin: 0;
    padding: var(--spacing-4);
    z-index: 10;
  }

  body.home .floating-card__header {
    margin-bottom: 0;
  }

  body.home .floating-card {
    padding: 20px 24px;
  }

  body.home .floating-card__title {
    font-size: var(--text-headline-sm);
    margin-bottom: 0;
  }

  body.home .floating-card__subtitle {
    margin-bottom: 12px;
  }

  body.home .floating-card__divider,
  body.home .floating-card__quotes-carousel {
    display: none;
  }

  .app-header__center {
    position: relative;
    left: auto;
    transform: none;
    text-align: left;
    flex: 2;
  }

  /* 2. Map Filters - overlay on map top right */
  body.home .map-filters {
    position: relative;
    top: auto;
    right: 10px;
    order: 2;
    width: auto;
    align-self: flex-end;
    justify-content: flex-end;
    padding: 0;
    margin-top: 10px;
    margin-bottom: -50px;
    /* Pull map up under filters */
    margin-right: var(--spacing-4);
    z-index: 10;
  }

  body.home .map-filter-pill {
    height: 36px;
    font-size: 11px;
    padding: 0 12px;
  }

  /* 3. Map Container - fills the remaining space */
  body.home .map-container {
    position: relative;
    order: 3;
    flex-grow: 1;
    width: 100%;
    height: auto;
    min-height: 250px;
    z-index: 1;
    /* Removed border radius */
    border-radius: 0;
    overflow: hidden;
  }

  /* Hide map UI button on mobile */
  body.home .map-ui-toggle-btn {
    display: none !important;
  }

  /* 4. Bottom Sheet */
  body.home .bottom-sheet {
    display: none !important;
  }

  body.home .interreg-logo-wrapper {
    position: fixed;
    bottom: 70px;
    /* immediately above app-nav */
    left: 0;
    width: 100%;
    background-color: var(--surface-container-low);
    display: flex;
    justify-content: center;
    z-index: 80;
    pointer-events: auto;
  }



  .archive-container {
    padding: 20px 0 60px;
  }

  body:not(.home) .app-content {
    padding-left: 20px;
    padding-right: 20px;
  }
}

@media (max-width: 380px) {
  body.home .floating-card__title {
    font-size: var(--text-title-md);
    margin-bottom: 0;
  }
}

/* ==========================================================================
   PWA Install Banner
   ========================================================================== */
.pwa-install-banner {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.pwa-install-banner.is-visible {
  display: flex;
}

.pwa-install-banner__wrapper {
  background-color: var(--surface);
  border-radius: var(--radius-lg);
  padding: var(--spacing-6);
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-ambient);
  display: flex;
  flex-direction: column;
  gap: 24px;
  text-align: center;
}

.pwa-install-banner .pwa-text {
  font-size: var(--text-title-md);
  color: var(--on-surface);
  margin: 0;
  font-weight: 600;
}

.pwa-install-banner__actions {
  display: flex;
  gap: 16px;
  justify-content: center;
}

@media (max-width: 768px) {
  .pwa-install-banner__wrapper {
    padding: 24px 16px;
  }

  .pwa-install-banner__actions {
    width: 100%;
  }

  .pwa-install-banner__actions .btn {
    flex: 1;
  }
}