/* =====================================================================
   Image Gallery — page styles (after css/base.css).
   Sections: banner entrance · albums (a bento grid; ScrollMagic raises
   the cards in turn and drifts their photos) · photographs (album tabs
   over an even 4-column grid; ScrollMagic raises each row column by
   column). Photos: the live edensolaris.com albums, all 800×533.
   Motion is driven by js/image-gallery.js; every rule here is a resting
   state that reads fine without JS / with reduced motion.
   ===================================================================== */

/* ---------- banner: the title rises from a mask, the photo settles ---------- */
.hero__ln {
  display: block;
  overflow: hidden;
  /* room for descenders and the italic overhang */
  padding: 0 0.12em 0.1em 0;
  margin-bottom: -0.1em;
}

.hero__ln > span {
  display: block;
}

@media (prefers-reduced-motion: no-preference) {
  .hero__img {
    animation: glSettle 2.6s var(--ease) both;
  }

  .hero .crumbs {
    animation: glRise 0.9s var(--ease) 0.15s both;
  }

  .hero__ln > span {
    animation: glLine 1.2s var(--ease) 0.3s both;
  }

  .hero__sub {
    animation: glRise 1s var(--ease) 0.7s both;
  }
}

@keyframes glSettle {
  from {
    scale: 1.12;
  }
  to {
    scale: 1;
  }
}

@keyframes glRise {
  from {
    opacity: 0;
    transform: translate3d(0, 24px, 0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes glLine {
  from {
    transform: translate3d(0, 110%, 0);
  }
  to {
    transform: none;
  }
}

/* ---------- albums: bento ---------- */
.galb {
  background: #FFFFFF;
}

.galb__total,
.gwall__count {
  font-size: 14px;
  color: var(--text-muted);
}

.galb__total b {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 22px;
  color: var(--accent);
}

/* the first album takes a 2×2 block, the other four sit around it
   (rows at half the original height) */
.gbento {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: clamp(120px, 9.5vw, 140px);
  gap: 12px;
}

.gcard {
  position: relative;
  display: block;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 22px;
  background: #2A1E16;
  font: inherit;
  color: #FFFFFF;
  text-align: left;
  cursor: pointer;
  isolation: isolate;
}

.gcard:first-child {
  grid-column: span 2;
  grid-row: span 2;
}

/* oversized so it can drift inside the card (--drift, image-gallery.js) */
.gcard__media {
  position: absolute;
  z-index: -2;
  inset: -8% 0;
}

.gcard__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  translate: 0 var(--drift, 0px);
  transition: scale 1.1s var(--ease);
}

.gcard:hover .gcard__media img {
  scale: 1.06;
}

.gcard::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 14, 9, 0.15) 0%, rgba(20, 14, 9, 0) 35%, rgba(20, 14, 9, 0.78) 100%);
  transition: opacity 0.5s ease;
}

.gcard__tag {
  position: absolute;
  top: 16px;
  left: 16px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.gcard__body {
  position: absolute;
  left: 22px;
  right: 76px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gcard__name {
  font-family: var(--font-serif);
  font-size: clamp(19px, 1.7vw, 24px);
  line-height: 1.15;
}

.gcard:first-child .gcard__name {
  font-size: clamp(26px, 2.4vw, 34px);
}

.gcard__meta {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.82);
}

.gcard__go {
  position: absolute;
  right: 18px;
  bottom: 20px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #FFFFFF;
  transition: transform 0.45s var(--ease);
}

.gcard__go svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gcard:hover .gcard__go {
  transform: translateX(4px);
}

/* the four small cards: name + photo count only, a smaller arrow */
.gcard:not(:first-child) .gcard__place {
  display: none;
}

/* the small cards are short now: tighter insets, smaller text and arrow */
.gcard:not(:first-child) {
  border-radius: 16px;
}

.gcard:not(:first-child) .gcard__tag {
  top: 10px;
  left: 12px;
  padding: 4px 9px;
  font-size: 9px;
}

.gcard:not(:first-child) .gcard__body {
  left: 14px;
  right: 52px;
  bottom: 12px;
  gap: 3px;
}

.gcard:not(:first-child) .gcard__name {
  font-size: clamp(14px, 1.15vw, 16px);
}

.gcard:not(:first-child) .gcard__meta {
  font-size: 11.5px;
}

.gcard:not(:first-child) .gcard__go {
  right: 12px;
  bottom: 12px;
  width: 32px;
  height: 32px;
}

.gcard:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

/* ---------- photographs: tabs + even grid ---------- */
.gtabs {
  display: flex;
  gap: 4px;
  margin-bottom: 28px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}

.gtabs::-webkit-scrollbar {
  display: none;
}

.gtab {
  position: relative;
  flex: none;
  padding: 16px 14px;
  border: 0;
  background: none;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.3s ease;
}

.gtab:first-child {
  padding-left: 0;
}

.gtab sup {
  margin-left: 5px;
  font-size: 10px;
  letter-spacing: 0.04em;
  vertical-align: 0.5em;
  color: var(--accent);
  opacity: 0.75;
}

.gtab::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.45s var(--ease);
}

.gtab:first-child::after {
  left: 0;
}

.gtab:hover,
.gtab.is-active {
  color: var(--ink);
}

.gtab.is-active::after {
  transform: scaleX(1);
}

.ggrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.gtile {
  position: relative;
  display: block;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 16px;
  aspect-ratio: 3 / 2;
  background: #EFE6DA;
  cursor: zoom-in;
}

.gtile.is-hidden {
  display: none;
}

.gtile.is-fresh {
  animation: glTile 0.6s var(--ease) both;
  animation-delay: var(--td, 0ms);
}

@keyframes glTile {
  from {
    opacity: 0;
    transform: translate3d(0, 22px, 0) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.gtile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1s var(--ease);
}

.gtile:hover img {
  transform: scale(1.06);
}

.gtile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(20, 14, 9, 0.7) 0%, rgba(20, 14, 9, 0) 50%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.gtile__cap {
  position: absolute;
  z-index: 1;
  left: 14px;
  right: 60px;
  bottom: 12px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-align: left;
  text-transform: uppercase;
  color: #FFFFFF;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s ease, transform 0.45s var(--ease);
}

.gtile__zoom {
  position: absolute;
  z-index: 1;
  right: 12px;
  bottom: 10px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #FFFFFF;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.35s ease, transform 0.45s var(--ease);
}

.gtile__zoom svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gtile:hover::after,
.gtile:focus-visible::after,
.gtile:hover .gtile__cap,
.gtile:focus-visible .gtile__cap,
.gtile:hover .gtile__zoom,
.gtile:focus-visible .gtile__zoom {
  opacity: 1;
  transform: none;
}

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

.gmore {
  margin-top: 36px;
  text-align: center;
}

.gmore[hidden] {
  display: none;
}

/* ---------- responsive ---------- */
@media (max-width: 1060px) {
  .ggrid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1060px) {
  /* the large album spans the full width, the rest pair up (half height) */
  .gbento {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: clamp(110px, 15vw, 140px);
  }

  .gcard:first-child {
    grid-row: span 1;
  }
}

@media (max-width: 760px) {
  .ggrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .gtile {
    border-radius: 12px;
  }

  .gtile__zoom {
    display: none;
  }

  /* no hover on touch: show the caption at rest, and let it reclaim the
     space the (now hidden) zoom button used to reserve */
  .gtile__cap {
    right: 14px;
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 560px) {
  /* phones: one album per row, half the original 220px */
  .gbento {
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: 110px;
    gap: 10px;
  }

  .gcard:first-child {
    grid-column: span 1;
  }

  .gcard:first-child .gcard__name {
    font-size: 20px;
  }

  .gcard:first-child .gcard__place {
    display: none;
  }

  .gcard:first-child .gcard__tag {
    top: 10px;
    left: 12px;
    padding: 4px 9px;
    font-size: 9px;
  }

  .gcard:first-child .gcard__body {
    left: 14px;
    right: 52px;
    bottom: 12px;
    gap: 3px;
  }

  .gcard:first-child .gcard__go {
    right: 12px;
    bottom: 12px;
    width: 32px;
    height: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gtile.is-fresh {
    animation: none;
  }

  .gcard__media img,
  .gtile img,
  .gtile__cap,
  .gtile__zoom {
    transition: none;
  }
}

/* ---------- life at Solaris: the photo marquee ---------- */
.gmq {
  --cell: 64px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(64px, 8vw, 104px) 0;
  background:
    radial-gradient(ellipse 60% 80% at 92% 0%, rgba(214, 181, 128, 0.26), transparent 70%),
    radial-gradient(ellipse 55% 80% at 0% 100%, rgba(214, 181, 128, 0.18), transparent 70%),
    linear-gradient(180deg, #F4ECDF 0%, #FBF8F2 50%, #F6EFE4 100%);
}

/* the Home "values" grid: fine orange lines with lights running along them */
.gmq__field {
  position: absolute;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  background-image:
    linear-gradient(rgba(241, 89, 34, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(241, 89, 34, 0.09) 1px, transparent 1px);
  background-size: var(--cell) var(--cell);
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, #000 25%, transparent 82%);
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, #000 25%, transparent 82%);
  pointer-events: none;
}

.gmq__pulse {
  position: absolute;
  box-shadow: 0 0 8px 1px rgba(241, 89, 34, 0.35);
  animation: var(--dur, 12s) linear var(--delay, 0s) infinite;
}

.gmq__pulse--h {
  top: calc(var(--row) * var(--cell));
  left: 0;
  width: 180px;
  height: 1px;
  background: linear-gradient(90deg, rgba(241, 89, 34, 0), rgba(241, 89, 34, 0.95), rgba(241, 89, 34, 0));
  animation-name: glPulseX;
}

.gmq__pulse--v {
  top: 0;
  left: calc(var(--col) * var(--cell));
  width: 1px;
  height: 180px;
  background: linear-gradient(180deg, rgba(241, 89, 34, 0), rgba(241, 89, 34, 0.95), rgba(241, 89, 34, 0));
  animation-name: glPulseY;
}

@keyframes glPulseX {
  from {
    transform: translateX(-200px);
  }
  to {
    transform: translateX(100vw);
  }
}

@keyframes glPulseY {
  from {
    transform: translateY(-200px);
  }
  to {
    transform: translateY(800px);
  }
}

.gmq__head {
  margin-bottom: clamp(32px, 4vw, 48px);
  text-align: center;
}

.gmq__head .eyebrow {
  justify-content: center;
}

.gmq__title {
  margin-top: 14px;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(30px, 3.4vw, 46px);
  line-height: 1.12;
  color: var(--ink);
}

.gmq__title em {
  font-style: italic;
  color: var(--accent);
}

/* a row: the track holds its photos twice and slides by half its width,
   so the loop is seamless; the edges fade out */
.gmq__row {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.gmq__row + .gmq__row {
  margin-top: 16px;
}

.gmq__track {
  display: flex;
  gap: 16px;
  width: max-content;
  padding: 8px 0;
  animation: glMarquee var(--mq-dur, 70s) linear infinite;
}

.gmq__row--right .gmq__track {
  animation-direction: reverse;
  --mq-dur: 80s;
}

.gmq__row:hover .gmq__track,
.gmq__row:focus-within .gmq__track {
  animation-play-state: paused;
}

/* the half-gap keeps the seam exactly one photo-step wide */
@keyframes glMarquee {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(calc(-50% - 8px), 0, 0);
  }
}

.gmq__item {
  position: relative;
  flex: none;
  width: clamp(240px, 22vw, 330px);
  aspect-ratio: 3 / 2;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 18px;
  background: #EFE6DA;
  cursor: zoom-in;
  box-shadow: 0 18px 36px -26px rgba(90, 45, 20, 0.55);
  transition: transform 0.5s var(--ease), box-shadow 0.5s ease;
}

.gmq__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1s var(--ease);
}

.gmq__item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(20, 14, 9, 0.7) 0%, rgba(20, 14, 9, 0) 50%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.gmq__cap {
  position: absolute;
  z-index: 1;
  left: 14px;
  right: 14px;
  bottom: 12px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-align: left;
  text-transform: uppercase;
  color: #FFFFFF;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s ease, transform 0.45s var(--ease);
}

.gmq__item:hover,
.gmq__item:focus-visible {
  transform: translateY(-6px);
  box-shadow: 0 28px 50px -28px rgba(90, 45, 20, 0.6);
  outline: none;
}

.gmq__item:hover img {
  transform: scale(1.06);
}

.gmq__item:hover::after,
.gmq__item:focus-visible::after,
.gmq__item:hover .gmq__cap,
.gmq__item:focus-visible .gmq__cap {
  opacity: 1;
  transform: none;
}

.gmq__item:focus-visible {
  box-shadow: 0 0 0 2px var(--accent), 0 28px 50px -28px rgba(90, 45, 20, 0.6);
}

@media (max-width: 760px) {
  .gmq__item {
    width: 220px;
    border-radius: 14px;
  }

  .gmq__track {
    gap: 12px;
  }

  .gmq__cap {
    opacity: 1;
    transform: none;
  }
}

/* reduced motion: still rows that swipe; the duplicate photos are dropped */
@media (prefers-reduced-motion: reduce) {
  .gmq__pulse {
    display: none;
  }

  .gmq__row {
    overflow-x: auto;
    -webkit-mask-image: none;
    mask-image: none;
    scrollbar-width: none;
  }

  .gmq__track {
    padding: 8px var(--gutter);
    animation: none;
  }

  .gmq__item[aria-hidden="true"] {
    display: none;
  }
}

/* ---------- photo popup (the shared lightbox, base.css) ----------
   on this page the photo sits on white instead of the dark backdrop,
   with a hairline above the caption */
.page-image-gallery .lightbox__media {
  padding: 25px 25px 0;
  background: #FFFFFF;
  border-bottom: 1px solid var(--line);
}

/* the frame hugs the photo (no white band above/below a wide photo on
   phones), up to the shared lightbox's height limit */
.page-image-gallery .lightbox__media img {
  height: auto;
  max-height: min(70vh, 640px);
}
