/* Brand Color & Font Variables */
:root {
    --dune-sand: #F0EBE3;
    --forest-green: #2C4A3C;
    --sky-mist: #A2B4C1;
    --sky-mist-light: #eaf0f4;
    --terracotta-sun: #E87461;

    --font-family: 'Inter', sans-serif; /* Primary UI Font */
    --font-serif: 'Lora', serif; /* Secondary Body Font */
    
    --primary: var(--forest-green);
    --primary-inverse: var(--dune-sand);
    --primary-hover: #243f32;
    --contrast: var(--forest-green);
    --contrast-inverse: var(--dune-sand);
    --background-color: var(--dune-sand);
    --card-background-color: #FFFFFF;
    --card-border-color: var(--sky-mist);
    --h1-color: var(--forest-green);
    --h2-color: var(--forest-green);
    --h3-color: var(--forest-green);
}

/* Override Pico.css variables with matching specificity */
:host(:not([data-theme=dark])), :root:not([data-theme=dark]), [data-theme=light] {
    /* Background and text colors */
    --pico-background-color: var(--dune-sand);
    --pico-color: var(--forest-green);
    
    /* Primary colors */
    --pico-primary: var(--forest-green);
    --pico-primary-background: var(--forest-green);
    --pico-primary-border: var(--forest-green);
    --pico-primary-underline: rgba(44, 74, 60, 0.5);
    --pico-primary-hover: var(--primary-hover);
    --pico-primary-hover-background: var(--primary-hover);
    --pico-primary-hover-border: var(--primary-hover);
    --pico-primary-hover-underline: var(--primary-hover);
    --pico-primary-focus: rgba(44, 74, 60, 0.5);
    --pico-primary-inverse: #FFFFFF;
    
    /* Heading colors */
    --pico-h1-color: var(--forest-green);
    --pico-h2-color: var(--forest-green);
    --pico-h3-color: var(--forest-green);
    --pico-h4-color: var(--forest-green);
    --pico-h5-color: var(--forest-green);
    --pico-h6-color: var(--forest-green);
    
    /* Muted colors */
    --pico-muted-color: var(--sky-mist);
    --pico-muted-border-color: var(--sky-mist);
    
    /* Form elements */
    --pico-form-element-background-color: #FFFFFF;
    --pico-form-element-border-color: var(--sky-mist);
    --pico-form-element-color: var(--forest-green);
    --pico-form-element-active-border-color: var(--forest-green);
    --pico-form-element-focus-color: var(--forest-green);
    
    /* Card colors */
    --pico-card-background-color: #FFFFFF;
    --pico-card-border-color: var(--sky-mist);
    
    /* Progress bar */
    --pico-progress-color: var(--forest-green);
    --pico-progress-background-color: var(--sky-mist-light);
    
    /* Secondary colors (for secondary buttons, etc.) */
    --pico-secondary: var(--sky-mist);
    --pico-secondary-background: var(--sky-mist);
    --pico-secondary-border: var(--sky-mist);
    --pico-secondary-hover: var(--forest-green);
    --pico-secondary-hover-background: var(--forest-green);
    --pico-secondary-hover-border: var(--forest-green);
    
    /* Contrast colors */
    --pico-contrast: var(--forest-green);
    --pico-contrast-background: var(--forest-green);
    --pico-contrast-border: var(--forest-green);
    --pico-contrast-hover: var(--primary-hover);
    --pico-contrast-hover-background: var(--primary-hover);
    --pico-contrast-hover-border: var(--primary-hover);
    --pico-contrast-inverse: var(--dune-sand);
}

/* Use Inter for headings and UI elements */
h1, h2, h3, h4, h5, h6, button, a[role=button], summary, kbd {
    font-family: var(--font-family);
}

/* Header logo: 200px width + 10px margin */
.header-logo {
    width: 200px;
    height: auto;
    margin-right: 10px;
    vertical-align: middle;
    max-width: 100%;
}

/* Vertically center-align menu (and hamburger) with logo */
#site-header nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

/* Header navigation styling */
header nav a {
    color: var(--forest-green) !important;
}
header nav a:hover {
    color: var(--primary-hover) !important;
}

/* Button text color fix */
button, a[role="button"], input[type="submit"], input[type="button"] {
    color: #FFFFFF !important;
}
button:hover, a[role="button"]:hover, input[type="submit"]:hover, input[type="button"]:hover {
    color: #FFFFFF !important;
}

/* Use Lora for body copy */
body, p {
    font-family: var(--font-serif);
}

/* Custom Button Style for Accent Color */
.cta-button {
    --background-color: var(--terracotta-sun);
    --border-color: var(--terracotta-sun);
    --color: #FFFFFF;
}
.cta-button:hover {
    --background-color: #d96350;
    --border-color: #d96350;
}

/* General component styles */
.favorite-icon {
    cursor: pointer;
    transition: color 0.2s ease-in-out, transform 0.2s ease-in-out;
    min-width: 48px;
    min-height: 48px;
    padding: 12px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.favorite-icon.saved {
    color: var(--terracotta-sun);
    font-variation-settings: 'FILL' 1;
}
.favorite-icon:hover {
    transform: scale(1.1);
}
.font-lora {
    font-family: var(--font-serif);
}
.sticky-map {
    position: sticky;
    top: 5rem;
    height: 80vh;
}

/* Add a visible focus ring for keyboard users, but not for mouse clicks */
:focus-visible {
    outline: 2px solid var(--sky-mist);
    outline-offset: 2px;
    border-radius: var(--border-radius);
}

/* Loader Component */
.loader-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4rem 0;
  flex-direction: column;
}

.loader {
  width: 48px;
  height: 48px;
  border: 3px solid var(--sky-mist);
  border-bottom-color: var(--forest-green);
  border-radius: 50%;
  display: inline-block;
  box-sizing: border-box;
  animation: rotation 1s linear infinite;
}

/* For accessibility, hide the text visually but keep for screen readers */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@keyframes rotation {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Site footer - brand compliant (dune-sand, forest-green, sky-mist) */
body > footer,
.site-footer {
  flex-shrink: 0;
  display: block !important;
  visibility: visible !important;
  margin-top: auto;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  border-top: 1px solid var(--sky-mist);
  background-color: var(--dune-sand);
  color: var(--forest-green);
  min-height: 4rem;
  font-family: var(--font-serif);
}
body > footer a,
.site-footer a {
  color: var(--forest-green);
  font-family: var(--font-family);
}
body > footer a:hover,
.site-footer a:hover {
  color: var(--primary-hover);
}
.site-footer small {
  font-family: var(--font-serif);
}

/* Footer legal block: center on mobile, right-align on desktop */
.footer-legal {
  text-align: center;
}
.footer-legal-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.footer-legal-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.25rem 0;
  box-sizing: border-box;
}
@media (min-width: 768px) {
  .footer-legal {
    text-align: right;
  }
  .footer-legal-links {
    justify-content: flex-end;
  }
}

/* Touch targets: minimum 48px for WCAG 2.1 AA */
.cta-button {
  min-height: 48px;
  padding: 0.75rem 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Notice Card Component */
.notice-card {
  text-align: center;
  border: 1px dashed var(--sky-mist);
  padding: 3rem 2rem;
  background-color: var(--sky-mist-light);
}
.notice-card .notice-icon {
  font-size: 2.5rem;
  color: var(--forest-green);
  margin-bottom: 0.5rem;
}

/* Flexible images: prevent layout breaking on narrow screens */
figure img,
img {
  max-width: 100%;
}

/* search_summary_bar: horizontal layout by default */
.search-summary-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
}

/* ========== Mobile & tablet overrides (< 768px) ========== */
@media (max-width: 767px) {
  /* Mobile nav: hamburger with collapsible menu */
  #site-header .nav-menu-details {
    display: block;
  }
  #site-header .nav-menu-details summary {
    list-style: none;
    list-style-type: none;
    cursor: pointer;
    padding: 0.5rem;
    min-width: 48px;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    appearance: none;
  }
  #site-header .nav-menu-details summary::-webkit-details-marker {
    display: none !important;
  }
  #site-header .nav-menu-details summary::marker {
    display: none !important;
    content: none;
  }
  #site-header .nav-menu-details summary::before,
  #site-header .nav-menu-details summary::after {
    display: none !important;
  }
  #site-header .nav-menu-details:not([open]) .nav-menu-links {
    display: none;
  }
  #site-header .nav-menu-links {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    background-color: var(--background-color);
    padding: 1.5rem 1rem 2rem;
    margin: 0;
    list-style: none;
    z-index: 1000;
    overflow-y: auto;
  }
  #site-header .nav-menu-links li {
    margin: 0;
    border: none;
    flex-shrink: 0;
  }
  #site-header .nav-menu-links .nav-menu-close-item {
    align-self: flex-end;
    margin-bottom: 0.5rem;
  }
  #site-header .nav-menu-links .nav-menu-close {
    min-width: 48px;
    min-height: 48px;
    padding: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--forest-green);
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  #site-header .nav-menu-links .nav-menu-close:hover {
    color: var(--primary-hover);
  }
  #site-header .nav-menu-links a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    min-height: 48px;
    box-sizing: border-box;
    font-size: 1.125rem;
    border-bottom: 1px solid var(--sky-mist-light);
  }
  #site-header nav {
    position: relative;
  }
}

@media (min-width: 768px) {
  #site-header .nav-menu-details {
    display: contents;
  }
  #site-header .nav-menu-details summary {
    display: none;
  }
  #site-header .nav-menu-links {
    display: flex;
  }
  #site-header .nav-menu-close-item {
    display: none;
  }
}

@media (max-width: 767px) {
  /* article_hero: reduce negative margin on mobile */
  figure figcaption[style*="margin-top: -5rem"] {
    margin-top: -2rem !important;
  }

  /* search_summary_bar: stacked layout */
  .search-summary-bar {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }
  .search-summary-bar .search-summary-sep {
    display: none;
  }

  /* Progress bars: scale to screen width (booking footer & progress component) */
  footer progress,
  .booking-progress-bar progress,
  .site-footer progress {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
}

/* Booking footer: stacked layout on very small screens (< 576px) */
@media (max-width: 575px) {
  .footer-booking-nav {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }
  .footer-booking-nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
  }
  .footer-booking-progress-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }
  .footer-booking-progress-item {
    width: 100%;
  }
  .footer-booking-progress-item progress {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .footer-booking-step-item {
    width: 100%;
  }
}

/* Destination “in numbers”: emphasize figures, keep labels quiet */
.destination-stats .destination-stats-grid {
  gap: 1rem 0.75rem;
}
.stat-card .stat-dek {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted-color, #5c6c66);
  margin: 0 0 0.4rem;
  line-height: 1.25;
}
.stat-card .stat-number {
  font-family: var(--font-serif, Georgia, serif);
  font-size: clamp(1.65rem, 4.5vw, 2.35rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--h2-color, var(--forest-green));
  font-variant-numeric: tabular-nums;
}
.stat-card .stat-number--value {
  margin: 0;
  white-space: normal;
  line-height: 1.25;
  hyphens: manual;
  word-break: break-word;
}
.stat-card .stat-number--solo {
  font-size: clamp(1.25rem, 3.5vw, 1.65rem);
  line-height: 1.3;
  margin: 0;
}
.stat-card .stat-prose {
  text-align: left;
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
}
.stat-card .stat-prose--value {
  font-size: clamp(1rem, 2.8vw, 1.2rem);
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
}
.stat-card .stat-qualifier {
  margin: 0.4rem 0 0;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--muted-color, #5c6c66);
  max-width: 24rem;
  margin-left: auto;
  margin-right: auto;
}

/* Destination hero: horizontal carousel */
.destination-hero-carousel {
  margin: 0;
}
.destination-hero-carousel__chrome {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: var(--card-background-color, #fff);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(44, 74, 60, 0.12);
}
.destination-hero-carousel__viewport {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  max-height: 420px;
  /* Each slide width = this scrollport (fixes flex % vs track width in some layouts). */
  container-type: inline-size;
  container-name: dest-hero;
}
.destination-hero-carousel__viewport:focus-visible {
  outline: 2px solid var(--pico-primary, var(--forest-green));
  outline-offset: 2px;
}
.destination-hero-carousel__track {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  height: 100%;
  min-height: 280px;
  width: max-content;
  min-width: 100%;
}
.destination-hero-carousel__slide {
  display: block;
  box-sizing: border-box;
  flex: 0 0 100%;
  scroll-snap-align: start;
  min-height: 280px;
  max-height: 420px;
}
/* Slide width = scrollport width (avoids flex % resolving against the growing track). */
@supports (width: 100cqi) {
  .destination-hero-carousel__slide {
    flex: 0 0 100cqi;
    width: 100cqi;
    min-width: 100cqi;
    max-width: 100cqi;
  }
}
.destination-hero-carousel__img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 280px;
  max-height: 420px;
  object-fit: cover;
}
.destination-hero-carousel__btn {
  flex: 0 0 auto;
  width: 2.5rem;
  min-width: 2.5rem;
  border: none;
  background: rgba(44, 74, 60, 0.08);
  color: var(--forest-green);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s ease;
}
.destination-hero-carousel__btn:hover {
  background: rgba(44, 74, 60, 0.15);
}
.destination-hero-carousel__btn:focus-visible {
  outline: 2px solid var(--forest-green);
  outline-offset: -2px;
}
.destination-hero-carousel__btn .material-symbols-outlined {
  font-size: 2rem;
}
@media (max-width: 575px) {
  .destination-hero-carousel__btn {
    width: 2rem;
    min-width: 2rem;
  }
}
