/* BUTTONS */
.btn {
  display: inline-block;
  padding: 10px 24px;
  font-weight: 600;
  text-align: center;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}
.btn-primary {
  background-color: var(--color-accent);
  color: #fff;
}
.btn-primary:hover {
  background-color: var(--color-accent-hover);
  color: #fff;
  transform: translateY(-2px);
}
.btn-secondary {
  background-color: transparent;
  color: var(--color-accent);
  border: 2px solid var(--color-accent);
}
.btn-secondary:hover {
  background-color: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  color: #ffffff !important;
}

/* SECTION STRUCTURE */
.home-section {
  padding: var(--space-6) 0;
}
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--space-4);
  border-bottom: 2px solid var(--color-border);
  padding-bottom: var(--space-2);
}
.view-all {
  font-weight: 600;
  font-size: 0.875rem;
}
.text-center {
  text-align: center;
}
.lead {
  font-size: 1.25rem;
  max-width: var(--article-max-width);
  margin: 0 auto var(--space-4);
  color: var(--color-text-muted);
}

/* CARDS & GRIDS */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-5);
}

.card {
  background-color: var(--color-paper);
  color: var(--color-ink);
  /* Subtle organic border radius */
  border-radius: 6px 10px 8px 12px;
  border: 1px solid var(--color-canopy-light);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  /* Apply paper texture */
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
}

/* Base Card Hover Effect */
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(22, 36, 28, 0.15); /* var(--color-canopy-deep) at 15% */
}

/* SVG Leaf Line-draw animation on hover */
.card .card-hover-leaf {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  stroke: var(--color-canopy-light);
  stroke-width: 1.5;
  fill: none;
  stroke-dasharray: 50;
  stroke-dashoffset: 50;
  transition: stroke-dashoffset 0.6s ease;
  pointer-events: none;
  opacity: 0.5;
}

.card:hover .card-hover-leaf {
  stroke-dashoffset: 0;
}

/* Base Card Content Padding */
.card-content {
  padding: var(--space-4);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

/* RESEARCH CARD */
.card-research .card-image-container {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-bottom: 1px solid var(--color-canopy-light);
}

.card-research .card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.card-research:hover .card-image {
  transform: scale(1.03);
}

.card-research .card-badge {
  font-size: 0.75rem;
  color: var(--color-canopy-light);
  margin-bottom: var(--space-2);
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-research .card-title {
  font-size: var(--text-lg);
  margin-bottom: var(--space-2);
}

.card-research .card-summary {
  color: var(--color-canopy-mid);
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
  flex-grow: 1;
}

.card-research .read-more {
  color: var(--color-coral);
  font-weight: 600;
  font-size: var(--text-sm);
  margin-top: auto;
}

/* TEAM CARD (Polaroid Style) */
.card-team-polaroid {
  background: #fff;
  padding: 12px 12px 24px 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  align-items: center;
  text-align: center;
  border-radius: 2px;
  height: 100%;
}

.card-team-polaroid:nth-child(even) {
  transform: rotate(2deg);
}
.card-team-polaroid:nth-child(odd) {
  transform: rotate(-2deg);
}
.card-team-polaroid:hover {
  transform: scale(1.05) rotate(0deg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  z-index: 10;
}

.polaroid-image {
  width: 100%;
  aspect-ratio: 1; /* square photo */
  background: #eee;
  margin-bottom: 16px;
  overflow: hidden;
  display: block;
}

.polaroid-image.no-photo {
  background: transparent;
}

.polaroid-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.polaroid-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.polaroid-title {
  font-size: 1.25rem;
  margin-bottom: 4px;
  color: var(--color-ink);
}

.polaroid-subtitle {
  font-size: 0.75rem;
  color: var(--color-coral);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.polaroid-read-more {
  font-size: 0.75rem;
  color: var(--color-canopy-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
  transition: color 0.2s ease;
  margin-top: auto;
}

.polaroid-read-more:hover {
  color: var(--color-accent);
}

/* PUBLICATION CARD (Academic Style) */
.publication-item {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card-publication {
  border-left: 4px solid var(--color-accent-rust);
  border-radius: 2px 8px 6px 2px;
  background-color: var(--color-paper);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.card-publication .card-link-wrapper {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-publication .card-content {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-publication .publication-meta {
  font-family: var(--font-family-mono);
  font-size: 0.75rem;
  color: var(--color-accent-rust);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-2);
}

.card-publication .publication-separator {
  margin: 0 4px;
  color: var(--color-text-muted);
}

.card-publication .publication-category {
  color: var(--color-accent-ochre, #d4a373);
}

.card-publication .card-title {
  font-size: var(--text-lg);
  margin-bottom: var(--space-2);
  line-height: 1.4;
}

.card-publication .card-authors {
  font-size: 0.85rem;
  color: var(--color-canopy-light);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px dashed var(--color-border);
}

.card-publication .card-journal {
  font-style: italic;
  font-size: 0.95rem;
  color: var(--color-canopy-mid);
  margin-bottom: var(--space-4);
}

.card-publication .card-actions {
  margin-top: auto;
}

.card-publication .card-actions .btn {
  font-size: 0.8rem;
  padding: 6px 16px;
  border-color: var(--color-canopy-light);
  color: var(--color-canopy-mid);
  display: inline-block;
}

.card-publication .card-actions .btn:hover {
  background-color: var(--color-accent-rust);
  color: #fff !important;
  border-color: var(--color-accent-rust);
}

/* SPECIES CARD */
.card-species {
  flex-direction: row;
  align-items: center;
  padding: var(--space-2) var(--space-3);
}

.card-species .card-image-container {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  margin-right: var(--space-3);
  background: var(--color-canopy-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-species .card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card-species:hover .card-image {
  opacity: 1;
}

.card-species .card-leaf-icon {
  position: absolute;
  color: var(--color-fern);
  transition: opacity 0.3s ease;
}

.card-species:hover .card-leaf-icon {
  opacity: 0;
}

.card-species .card-content {
  padding: 0;
}

.card-species .card-title {
  font-size: var(--text-base);
  margin-bottom: 0;
}

.card-species .card-subtitle {
  font-size: var(--text-sm);
  color: var(--color-canopy-mid);
  margin-bottom: 0;
}

/* TEXT CARD (Prose Sections) */
.text-card {
  padding: var(--space-6);
}

.text-card.drop-cap p:first-of-type::first-letter {
  font-family: var(--font-family-headings);
  font-size: 3.5rem;
  float: left;
  line-height: 1;
  margin-right: var(--space-2);
  color: var(--color-coral);
}

.text-card .pull-quote {
  position: relative;
  padding: var(--space-4);
  margin: var(--space-5) 0;
  font-family: var(--font-family-headings);
  font-size: var(--text-xl);
  font-style: italic;
  color: var(--color-canopy-deep);
  border-left: 2px solid var(--color-coral-light);
}

.text-card .pull-quote::before {
  content: '"';
  position: absolute;
  top: -20px;
  left: -10px;
  font-size: 6rem;
  color: var(--color-coral);
  opacity: 0.15;
  font-family: var(--font-family-headings);
}

/* Stagger Fade-in Animation */
@keyframes staggerFade {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stagger-in {
  animation: staggerFade 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  opacity: 0;
}

/* Scroll Reveal Animations */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: opacity, transform;
}
@media (prefers-reduced-motion: reduce) {
  .reveal-on-scroll {
    transition: none;
    transform: none;
    opacity: 1;
  }
}
.reveal-on-scroll.is-revealed {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 100ms; }
.reveal-delay-2 { transition-delay: 200ms; }
.reveal-delay-3 { transition-delay: 300ms; }

/* FULLSCREEN INTRO */
.fullscreen-intro {
  position: relative;
  height: 100vh;
  min-height: 500px;
  width: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-paper);
}

.intro-direct-overlay {
  max-width: 900px;
  margin: 0 auto;
  color: #ffffff;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.intro-direct-overlay .welcome-text h1,
.intro-direct-overlay .welcome-text h2,
.intro-direct-overlay .welcome-text h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: var(--space-4);
  color: #ffffff;
}

.intro-direct-overlay .welcome-text p {
  font-size: 1.25rem;
  line-height: 1.6;
  margin-bottom: var(--space-5);
  color: rgba(255, 255, 255, 0.95);
}

.btn-pill-theme {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff !important;
  font-weight: 700;
  padding: var(--space-3) var(--space-5);
  border-radius: 50px;
  text-decoration: none;
  transition:
    transform 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-pill-theme:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.25);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.btn-pill-theme .icon-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-accent-rust);
  color: #ffffff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 14px;
}

.overlap-cards {
  margin-top: -120px;
  position: relative;
  z-index: 20;
}

/* HERO SLIDER */
.hero-slider {
  position: relative;
  width: 100%;
  height: 60vh;
  min-height: 400px;
  background: #111;
  overflow: hidden;
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}
.slider-container {
  width: 100%;
  height: 100%;
}
.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.slide.active {
  opacity: 1;
}
.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.6;
}
.slide-caption {
  position: absolute;
  bottom: var(--space-5);
  left: var(--space-5);
  color: #fff;
  font-family: var(--font-family-headings);
  font-size: 2rem;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}
.slider-controls {
  position: absolute;
  bottom: calc(120px + var(--space-4));
  right: var(--space-4);
  display: flex;
  gap: var(--space-2);
  z-index: 30;
  pointer-events: auto;
}
.slider-controls button {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid #fff;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s;
}
.slider-controls button:hover {
  background: rgba(255, 255, 255, 0.4);
}

/* ==========================================================================
   HOMEPAGE: WELCOME INTRO
   ========================================================================== */
.home-welcome-intro {
  text-align: center;
  max-width: 900px;
  margin: 0 auto var(--space-6);
  padding: var(--space-6) var(--space-5);
  background: radial-gradient(
    circle at center,
    rgba(217, 113, 78, 0.08) 0%,
    transparent 80%
  );
  border-radius: var(--radius-lg);
  border: 1px solid rgba(217, 113, 78, 0.15);
}

.welcome-text {
  font-family: var(--font-family-headings);
  font-size: 1.75rem;
  font-weight: 300;
  line-height: 1.5;
  color: var(--color-canopy-deep);
  margin-bottom: var(--space-5);
}

.welcome-text p:last-child {
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .welcome-text {
    font-size: 1.3rem;
  }
}

/* ==========================================================================
   HOMEPAGE: PREVIEW CARD (Replaces Scrollytelling)
   ========================================================================== */
.case-preview-section {
  padding: var(--space-6) 0;
}

.case-preview-card {
  position: relative;
  overflow: hidden;
  padding: 0;
  border: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.hero-slider.fullscreen-slider {
  height: 100vh;
  min-height: 500px;
  border-radius: 0;
  box-shadow: none;
}

.slider-dark-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  pointer-events: none; /* Let clicks pass through if needed, though button is inside */
}

.slider-dark-overlay .container {
  pointer-events: auto; /* Re-enable clicks for the button */
}

.case-preview-card.has-bg-image {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: var(--color-paper);
}

.case-preview-card .glass-overlay {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
  padding: var(--space-5);
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  width: 100%;
  height: 100%;
}

@media (min-width: 992px) {
  .case-preview-card .glass-overlay {
    grid-template-columns: 3fr 2fr;
    padding: var(--space-6);
    gap: var(--space-6);
  }
}

.post-fixed-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: -1;
}

.post-glass-content {
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  margin-top: var(--space-6);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.case-preview-content .eyebrow {
  display: inline-block;
  font-family: var(--font-family-headings);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-accent-rust);
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-4);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.case-preview-content .preview-text {
  font-size: var(--text-md); /* Reduced from --text-lg */
  line-height: 1.6;
  margin-bottom: var(--space-4);
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}

.case-preview-content .preview-text.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

.case-preview-content .read-full-story {
  display: inline-flex;
  align-items: center;
  color: var(--color-accent-rust);
  font-weight: 600;
  font-size: var(--text-md);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: var(--space-2) var(--space-4);
  border-radius: 50px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  transition: all 0.2s ease;
}

.case-preview-content .read-full-story:hover {
  background: rgba(255, 255, 255, 0.95);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.1);
  text-decoration: none;
}

/* Stat Highlights Column */
.case-preview-stats {
  position: relative;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stats-glow-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at center,
    rgba(230, 194, 138, 0.2) 0%,
    transparent 70%
  ); /* --color-gold-light */
  z-index: 0;
}

.preview-chips-container {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3) var(--space-4);
  background: #fdfcf0; /* Warm paper card background */
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
  width: 100%;
}

.stat-chip {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  color: var(--color-text-muted);
  padding: 0 0 var(--space-3) 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-family: var(--font-family-mono); /* Technical/Small text */
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.4;
}

.stat-chip:nth-last-child(-n + 2) {
  border-bottom: none;
  padding-bottom: 0;
}

.stat-chip strong,
.stat-chip b {
  font-family: var(--font-family-headings);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-accent-rust);
  text-transform: none;
  letter-spacing: normal;
  line-height: 1.1;
  margin: 4px 0;
  display: block;
}

.stat-chip-hidden {
  opacity: 1;
  transform: none;
}

.stat-chip.is-revealed {
  opacity: 1;
  transform: none;
}

/* ==========================================================================
   FULL STORY PAGE HIGHLIGHTS
   ========================================================================== */
.case-story-content {
  font-family: var(--font-family-headings);
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--color-canopy-deep);
}

.case-story-content p {
  margin-bottom: var(--space-5);
}

.case-story-content strong,
.case-story-content b {
  background-color: rgba(217, 113, 78, 0.15); /* --color-coral */
  padding: 2px 4px;
  border-radius: 3px;
  border-bottom: 2px solid var(--color-coral);
  font-weight: 700;
}

/* ==========================================================================
   FEATURE 8: INTERACTIVE MAP
   ========================================================================== */
.interactive-map-section {
  position: relative;
  padding: var(--space-6) 0;
  overflow: hidden;
  text-align: center; /* Centers the inline-block map container */
}

.map-container {
  position: relative;
  display: inline-block; /* Shrink-wraps the image so hotspots align perfectly */
  max-width: 100%;
  margin: 0 auto;
}

.map-svg {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 75vh; /* Constrains the map to the screen height */
  display: block;
}

.map-hotspots-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.map-hotspot {
  position: absolute;
  width: 16px;
  height: 16px;
  transform: translate(-50%, -50%);
  cursor: pointer;
  pointer-events: auto;
  background: var(--color-coral);
  border: 2px solid #ffffff;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.2s ease,
    background 0.2s ease;
  z-index: 10;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.map-hotspot svg {
  display: none;
}

.map-hotspot:hover,
.map-hotspot:focus {
  transform: translate(-50%, -50%) scale(1.2);
  outline: none;
}

.map-hotspot:focus-visible {
  box-shadow:
    0 0 0 3px var(--color-paper),
    0 0 0 5px var(--color-coral);
}

/* Subtle pulse animation for hotspots */
@keyframes hotspotPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(217, 113, 78, 0.7);
  }
  70% {
    box-shadow: 0 0 0 18px rgba(217, 113, 78, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(217, 113, 78, 0);
  }
}

.map-hotspot::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  animation: hotspotPulse 3s infinite;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .map-hotspot::after {
    animation: none;
  }
}

/* Desktop Popover */
.map-popover {
  position: absolute;
  z-index: 20;
  width: 280px;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 10px) scale(0.95);
  transition:
    opacity 0.3s ease,
    transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.map-popover.is-active {
  opacity: 1;
  pointer-events: auto;
}

.map-popover.is-active:not(.popover-bottom) {
  transform: translate(-50%, -10px) scale(1);
}

.map-popover.is-active.popover-bottom {
  transform: translate(-50%, 10px) scale(1);
}

.map-popover-content {
  position: relative;
  padding: var(--space-3);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  background: rgba(255, 255, 255, 0.4) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-md);
}

/* Arrow */
.map-popover:not(.popover-bottom) .map-popover-content::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 8px 8px 0;
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.4) transparent transparent transparent;
}

.map-popover.popover-bottom .map-popover-content::after {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 0 8px 8px;
  border-style: solid;
  border-color: transparent transparent rgba(255, 255, 255, 0.4) transparent;
}

.map-popover-close {
  display: none; /* Hidden on desktop, handled by mouseleave */
}

.map-popover-icon {
  display: none;
}

.map-popover-title {
  font-size: var(--text-base);
  margin-bottom: var(--space-1);
  font-weight: 700;
}

/* Mobile Bottom Sheet */
@media (max-width: 768px) {
  .map-popover {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: auto;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 1000;
    opacity: 1; /* Always opaque, controlled by transform */
  }

  .map-popover.is-active {
    transform: translateY(0);
  }

  .map-popover-content {
    border-radius: 20px 20px 0 0;
    padding: var(--space-5);
    box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.2);
  }

  .map-popover-content::after {
    display: none; /* No arrow on mobile */
  }

  .map-popover-close {
    display: block;
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
    background: none;
    border: none;
    font-size: 24px;
    color: var(--color-canopy-light);
    cursor: pointer;
  }
}

/* Navigation Dropdown */
.nav-item.has-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  font-weight: 500;
  font-size: 1.05rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0;
  padding-bottom: 4px;
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: var(--color-paper);
  border: 1px solid var(--color-ink-light);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: var(--space-2) 0;
  z-index: 50;
  margin: 0;
}

.nav-dropdown-menu .nav-list-secondary {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-dropdown-menu .nav-item {
  margin: 0;
}

.nav-dropdown-menu .nav-item a {
  display: block;
  padding: var(--space-2) var(--space-4);
  color: var(--color-ink) !important;
  text-decoration: none;
  white-space: nowrap;
}

.nav-dropdown-menu .nav-item a:hover,
.nav-dropdown-menu .nav-item a:focus {
  background: var(--color-sand);
  color: var(--color-coral) !important;
}

.nav-item.has-dropdown:hover .nav-dropdown-menu,
.nav-item.has-dropdown:focus-within .nav-dropdown-menu,
.nav-item.has-dropdown.is-open .nav-dropdown-menu {
  display: block;
}

/* Mobile adjustments */
.mobile-nav .nav-dropdown-menu {
  position: static;
  box-shadow: none;
  border: none;
  background: transparent;
  padding: 0;
  padding-left: var(--space-4);
  margin-top: var(--space-2);
}
.mobile-nav .nav-dropdown-menu .nav-item a {
  padding: var(--space-1) 0;
}

/* PDF PREVIEW MODAL */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-container {
  width: 90vw;
  height: 90vh;
  max-width: 1200px;
  background: var(--color-bg-base);
  border-radius: var(--radius-md);
  position: relative;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 15px;
  background: #333;
  color: #fff;
  border: none;
  font-size: 24px;
  line-height: 1;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.modal-close:hover {
  background: var(--color-accent-rust);
}

.modal-content {
  flex-grow: 1;
  width: 100%;
  height: 100%;
}

/* FORCE SPACE ABOVE EMBEDDED PLUGIN FORMS */
.post-content form {
  margin-top: 90px !important;
}

/* Fallback for margin-collapse: target the Ghost card wrapper */
.post-content *:has(> form) {
  margin-top: 90px !important;
  padding-top: 10px !important;
}

  