/* About page — featured image + info + scrollable strip (all photos) */

#about-gallery {
  --ag-bg: #0e7c86;
  --ag-accent: #fff;
  --ag-muted: rgba(255, 255, 255, 0.82);
  --ag-soft: rgba(255, 255, 255, 0.58);
  --ag-border: rgba(255, 255, 255, 0.55);
  --ag-glow: rgba(0, 0, 0, 0.22);
  --ag-img-w: 100%;
  --ag-nav-gap: 72px;
  background: var(--ag-bg);
  color: var(--ag-accent);
  height: 100dvh;
  max-height: 100dvh;
  min-height: 100dvh;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding:
    calc(var(--ag-nav-gap) + 92px)
    clamp(10px, 2.5vw, 24px)
    max(14px, env(safe-area-inset-bottom));
  gap: clamp(8px, 1.4vh, 16px);
  transition:
    background-color 0.65s ease,
    color 0.45s ease;
}

html[data-theme="light"] #about-gallery { --ag-bg: #0e7c86; }

#about-gallery.is-palette-snap {
  transition: none;
}

.ag-view {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  overflow: hidden;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
}

.ag-card {
  width: var(--ag-text-w, var(--ag-img-w, 100%));
  max-width: 100%;
  max-height: 100%;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: clamp(4px, 0.55vh, 8px);
  box-sizing: border-box;
  will-change: width;
  flex: 0 1 auto;
  min-height: 0;
  overflow: hidden;
}

.ag-head,
.ag-meta {
  flex-shrink: 0;
}

.ag-head,
.ag-meta,
.ag-feature-wrap {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.ag-feature-wrap {
  width: 100%;
  flex: 0 0 auto;
  min-height: 0;
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.ag-feature-wrap.is-dragging {
  cursor: grabbing;
}

.ag-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

#about-gallery.is-sliding .ag-slide img {
  transition: opacity 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.ag-feature-wrap.is-dragging .ag-slide img {
  transform: none;
  filter: none;
}

.ag-slide img.is-loading {
  opacity: 0.25;
  filter: none;
}

#about-gallery.is-simple-fade #ag-img-a {
  opacity: 0.05;
}

.ag-slide-viewport {
  width: 100%;
  max-height: 100%;
  overflow: hidden;
  border-radius: clamp(8px, 2vw, 12px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.24);
  background: transparent;
  will-change: height, max-width;
  transition: none;
}

#about-gallery.is-sliding .ag-slide-viewport {
  box-shadow: none;
}

.ag-slide-track {
  display: flex;
  width: 200%;
  height: 100%;
  will-change: transform;
}

.ag-slide-track.is-dragging .ag-slide img {
  transition: none;
}

.ag-slide {
  flex: 0 0 50%;
  margin: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ag-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  flex-shrink: 0;
}

.ag-title {
  display: none;
  margin: 0;
  width: 100%;
  min-height: 1.05em;
  padding: 0;
  box-sizing: border-box;
  font-family: "Dream Avenue", serif;
  font-weight: 400;
  font-size: clamp(1.35rem, calc(var(--ag-text-w, 360px) * 0.072), 2.85rem);
  line-height: 1;
  text-transform: uppercase;
  color: var(--ag-accent);
  position: relative;
  overflow: visible;
  pointer-events: none;
  transition: color 0.45s ease-out, opacity 0.45s ease;
}

.ag-title.is-reveal {
  display: block;
}

.ag-title.is-spread {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.ag-title-letter {
  line-height: 1;
  white-space: nowrap;
}

.ag-title.is-changing {
  opacity: 0;
}

.ag-meta {
  width: 100%;
  text-align: center;
  flex-shrink: 0;
  transition:
    opacity 0.45s ease,
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.ag-meta.is-changing {
  opacity: 0;
  transform: translateY(8px);
}

.ag-region {
  margin: 0 0 6px;
  width: 100%;
  max-width: 100%;
  font-size: clamp(9px, calc(var(--ag-text-w, 360px) * 0.028), 12px);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ag-muted);
  transition: color 0.45s ease;
}

.ag-desc {
  margin: 0;
  width: 100%;
  max-width: 100%;
  font-size: clamp(12px, calc(var(--ag-text-w, 360px) * 0.034), 15px);
  line-height: 1.5;
  color: var(--ag-muted);
  font-style: italic;
  transition: color 0.45s ease;
}

.ag-strip-wrap {
  flex-shrink: 0;
  width: calc(100% + clamp(10px, 2.5vw, 24px) * 2);
  margin:
    0
    calc(-1 * clamp(10px, 2.5vw, 24px))
    0;
  padding:
    10px clamp(10px, 2.5vw, 24px)
    max(12px, env(safe-area-inset-bottom));
  background: linear-gradient(
    180deg,
    transparent 0%,
    color-mix(in srgb, var(--ag-bg) 82%, rgba(0, 0, 0, 0.45)) 38%,
    color-mix(in srgb, var(--ag-bg) 92%, rgba(0, 0, 0, 0.55)) 100%
  );
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.65s ease;
}

.ag-strip-label {
  margin: 0 0 8px;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ag-soft);
  text-align: center;
}

.ag-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 12px;
  padding: 2px 4px 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  cursor: grab;
}

.ag-strip::-webkit-scrollbar {
  display: none;
}

.ag-thumb {
  flex: 0 0 auto;
  width: 72px;
  height: 54px;
  padding: 0;
  border: 2px solid var(--ag-border);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.58;
  scroll-snap-align: center;
  background: rgba(0, 0, 0, 0.18);
  transition:
    opacity 0.25s ease,
    border-color 0.35s ease,
    transform 0.25s ease,
    box-shadow 0.35s ease;
}

.ag-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ag-thumb:hover {
  opacity: 0.88;
}

.ag-strip:active {
  cursor: grabbing;
}

.ag-thumb.is-active {
  opacity: 1;
  border-color: var(--ag-accent);
  box-shadow: 0 0 0 1px var(--ag-accent), 0 8px 20px var(--ag-glow);
  transform: translateY(-2px) scale(1.04);
}

body[data-page="about"].is-hero-active #chrome:not(.is-solid) {
  color: var(--ag-accent, #fff);
  text-shadow: 0 1px 14px color-mix(in srgb, var(--ag-bg, #000) 75%, transparent);
  transition:
    background 0.4s ease,
    color 0.45s ease,
    text-shadow 0.45s ease,
    transform 1.2s cubic-bezier(0.19, 1, 0.22, 1),
    opacity 1.2s ease;
}

body[data-page="about"].is-hero-active #chrome:not(.is-solid) .ch-brand,
body[data-page="about"].is-hero-active #chrome:not(.is-solid) .ch-brand span {
  color: var(--ag-accent, #fff);
}

body[data-page="about"].is-hero-active #chrome:not(.is-solid) .ch-nav a {
  color: var(--ag-muted, rgba(255, 255, 255, 0.82));
}

body[data-page="about"].is-hero-active #chrome:not(.is-solid) .ch-nav a:hover,
body[data-page="about"].is-hero-active #chrome:not(.is-solid) .ch-nav a.is-active {
  color: var(--ag-accent, var(--accent));
}

body[data-page="about"].is-hero-active #chrome:not(.is-solid) .ch-nav a::after {
  background: var(--ag-accent, var(--accent));
}

body[data-page="about"].is-hero-active #chrome:not(.is-solid) .ch-cta {
  color: var(--ag-accent, var(--accent));
  border-color: var(--ag-accent, var(--accent));
}

body[data-page="about"].is-hero-active #chrome:not(.is-solid) .ch-cta:hover {
  background: var(--ag-accent, var(--accent));
  color: var(--ag-bg, var(--bg));
}

body[data-page="about"].is-hero-active #chrome:not(.is-solid) .theme-toggle,
body[data-page="about"].is-hero-active #chrome:not(.is-solid) .ch-burger {
  color: var(--ag-accent, #fff);
  border-color: var(--ag-border, var(--line));
}

body[data-page="about"].is-hero-active #chrome:not(.is-solid) .theme-toggle:hover {
  background: var(--ag-accent, var(--accent));
  border-color: var(--ag-accent, var(--accent));
  color: var(--ag-bg, var(--bg));
}

body[data-page="about"].is-hero-active #chrome.is-open + #menu a {
  color: var(--ag-muted, var(--fg));
}

body[data-page="about"].is-hero-active #chrome.is-open + #menu a:hover {
  color: var(--ag-accent, var(--accent));
}

body[data-page="about"].is-hero-active #chrome:not(.is-solid) .ch-nav a,
body[data-page="about"].is-hero-active #chrome:not(.is-solid) .ch-brand,
body[data-page="about"].is-hero-active #chrome:not(.is-solid) .theme-toggle,
body[data-page="about"].is-hero-active #chrome:not(.is-solid) .ch-burger,
body[data-page="about"].is-hero-active #chrome:not(.is-solid) .ch-cta {
  transition: color 0.45s ease, border-color 0.45s ease, background 0.3s ease;
}

@media (min-width: 721px) {
  .ag-thumb {
    width: 76px;
    height: 56px;
  }

  .ag-strip-wrap {
    width: 100%;
    margin: auto 0 0;
    padding: 10px 0 0;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .ag-strip {
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
    scrollbar-color: var(--ag-border) transparent;
  }

  .ag-strip::-webkit-scrollbar {
    display: block;
    height: 6px;
  }

  .ag-strip::-webkit-scrollbar-thumb {
    background: var(--ag-border);
    border-radius: 999px;
  }
}

@media (max-width: 720px) {
  #about-gallery {
    gap: 6px;
    padding-top: calc(var(--ag-nav-gap) + 80px);
  }

  #about-gallery.is-frame-locked .ag-slide-viewport {
    flex-shrink: 0;
  }

  #about-gallery.is-frame-locked .ag-slide img {
    object-fit: cover;
  }

  .ag-title {
    font-size: clamp(1.15rem, calc(var(--ag-text-w, 320px) * 0.078), 2rem);
  }

  .ag-desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .ag-thumb {
    width: 62px;
    height: 46px;
  }

  .ag-strip-wrap {
    position: relative;
    bottom: auto;
  }
}

@media (min-width: 721px) {
  .ag-desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

@media (max-width: 420px) {
  .ag-thumb {
    width: 54px;
    height: 40px;
  }

  .ag-region {
    letter-spacing: 0.12em;
  }
}
