@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

section[id] {
  scroll-margin-top: 125px;
}

@media (max-width: 768px) {
  section[id] {
    scroll-margin-top: 165px;
  }
}

/* Hero Section with Snow Mountain Landscape */
.hero {
  padding: 12px 0 6px;
}

.heroCard {
  position: relative;
  padding: 48px 40px;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border: none;
}

.hero-bg-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('../images/alpine_mountains.jpg');
  background-size: cover;
  background-position: center 30%;
  z-index: 1;
  opacity: 0.9;
  filter: var(--hero-filter);
  transition: transform 6s ease-out, opacity 0.35s ease, filter 0.35s ease;
}

.hero-bg-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  z-index: 1;
  opacity: 0.92;
  filter: var(--hero-filter);
  pointer-events: none;
  transition: opacity 0.35s ease, filter 0.35s ease;
}

.heroCard:hover .hero-bg-img {
  transform: scale(1.03);
  opacity: 0.96;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: var(--hero-overlay-bg);
  z-index: 2;
  transition: background 0.35s ease;
}

.hero-content {
  position: relative;
  z-index: 3;
}

h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 40px;
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -1px;
  margin: 0 0 16px;
  color: #faf6f0;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.55);
}

.sub {
  margin: 0;
  color: #f3ede2;
  font-size: 16px;
  line-height: 1.85;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.65);
}

.sub b {
  color: var(--hero-sub-highlight);
  font-weight: 700;
}

.sub a {
  color: var(--hero-link);
  text-decoration: underline;
  text-decoration-color: rgba(253, 230, 138, 0.55);
  text-underline-offset: 3px;
  font-weight: 600;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.sub a:hover {
  color: #ffffff;
  text-decoration-color: #ffffff;
}

.hero-about-link-row {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.hero-about-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 10px;
  background: rgba(250, 246, 240, 0.16);
  border: 1px solid rgba(250, 246, 240, 0.38);
  color: #faf6f0;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.2s ease;
}

.hero-about-pill:hover {
  background: rgba(250, 246, 240, 0.28);
  border-color: #ffffff;
  color: #ffffff;
  transform: translateY(-1px);
}

/* Course Cards Grid */
.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 860px) {
  .cards {
    grid-template-columns: 1fr;
  }
  h1 {
    font-size: 32px;
  }
  .heroCard {
    padding: 32px 24px;
    min-height: 280px;
  }
}

/* Gallery Text & Teaching / Camp Photo Grid */
.gallery-text a {
  color: var(--accent-primary);
  font-weight: 600;
}

.gallery-text a:hover {
  color: var(--accent-secondary);
}

.gallery-info-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.gallery-head p {
  margin-top: 4px;
  font-size: 14.5px;
  color: var(--muted);
}

.teaching-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 18px;
}

.gallery-card {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  padding: 0;
  margin: 0;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-elevated);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s ease, box-shadow 0.25s ease;
}

.gallery-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-hover);
}

.gallery-card:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-card:hover img {
  transform: scale(1.03);
}

.gallery-card-caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 24px 12px 9px;
  background: linear-gradient(to top, rgba(20, 15, 10, 0.78) 0%, rgba(20, 15, 10, 0.35) 60%, transparent 100%);
  color: #faf6f0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.1px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}

@media (max-width: 820px) {
  .teaching-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 14px;
  }
}

@media (max-width: 520px) {
  .teaching-gallery-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .gallery-card-caption {
    font-size: 12px;
    padding: 18px 10px 7px;
  }
}

/* Native Lightbox Dialog */
.gallery-lightbox {
  max-width: min(920px, 94vw);
  width: 100%;
  padding: 0;
  border: 1px solid var(--card-border);
  border-radius: 18px;
  background: var(--card-bg);
  color: var(--text);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}

.gallery-lightbox:modal {
  overscroll-behavior: contain;
}

.gallery-lightbox::backdrop {
  background: rgba(18, 14, 11, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  overflow: hidden;
  overscroll-behavior: contain;
}

.lightbox-inner {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lightbox-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lightbox-counter {
  font-family: 'Outfit', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
}

.lightbox-close-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.lightbox-close-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.lightbox-stage {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #14110e;
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 80vh;
  min-height: 280px;
}

.lightbox-stage img {
  max-width: 100%;
  max-height: 76vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(20, 16, 12, 0.65);
  color: #faf6f0;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.lightbox-nav-btn:hover {
  background: rgba(180, 83, 9, 0.88);
  border-color: rgba(255, 255, 255, 0.5);
}

.lightbox-nav-btn.prev {
  left: 12px;
}

.lightbox-nav-btn.next {
  right: 12px;
}

.lightbox-caption {
  margin: 0;
  font-size: 14.5px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.55;
}

/* Footer Layout */
footer {
  padding: 24px 0 40px;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--card-border);
  margin-top: 24px;
}

.foot {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  justify-content: space-between;
  align-items: center;
}

.links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}

.links a {
  color: var(--muted);
  font-size: 13px;
}

.links a.ghost {
  padding: 7px 14px;
  border-radius: 10px;
  font-size: 13px;
  color: var(--ghost-text);
}

.links a:hover {
  color: var(--text);
}

.links a.foot-minimal {
  font-size: 12.5px;
  opacity: 0.8;
  padding: 6px 6px;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--card-border);
}

.links a.foot-minimal:hover {
  opacity: 1;
  text-decoration-color: var(--accent-primary);
}
