/* Gallery: photo piles per place (front page) and one album per place (place page). Colours come from design-system.css. */
.page-gallery main { overflow-x: clip; }

/* ---------- Front page ---------- */
.gal-sky {
  position: relative;
  overflow: hidden;
  min-height: 70vh;
  background:
    radial-gradient(1200px 500px at 20% -10%, #fff 0, transparent 60%),
    radial-gradient(900px 500px at 90% 0, #cfeaff 0, transparent 60%),
    linear-gradient(#d9efff, #eaf6ff 45%, #f7fcff);
}
.gal-path { position: absolute; left: 0; top: 90px; width: 100%; height: 260px; pointer-events: none; }
.gal-path path {
  fill: none; stroke: var(--ds-teal-400, #2b9fe6); stroke-width: 2.5; stroke-dasharray: 3 11; stroke-linecap: round;
  opacity: 0.55; animation: gal-fly 40s linear infinite;
}
.gal-plane {
  position: absolute; top: 128px; left: 6%; width: 30px; height: 30px; color: var(--ds-teal-600, #0b5ed7);
  transform: rotate(98deg); animation: gal-glide 11s ease-in-out infinite alternate; pointer-events: none;
}
.gal-plane svg { width: 100%; height: 100%; fill: currentColor; display: block; }
@keyframes gal-fly { to { stroke-dashoffset: -400; } }
@keyframes gal-glide { to { left: 88%; transform: rotate(82deg) translateY(-26px); } }

.gal-hero { position: relative; text-align: center; padding: 46px 16px 8px; }
.gal-hero small {
  display: inline-block; background: var(--ds-gold-500, #e9a83a); color: #4a3000; font-weight: 800; font-size: 12px;
  letter-spacing: 0.14em; text-transform: uppercase; padding: 6px 14px; border-radius: 999px; transform: rotate(-2deg);
}
.gal-hero h1 {
  margin: 12px 0 8px; font: 800 clamp(34px, 6vw, 60px) / 1.05 var(--ds-font, "Plus Jakarta Sans", Inter, system-ui, sans-serif);
  color: var(--ds-ocean-900, #002550);
}
.gal-hero p { margin: 0 auto; max-width: 560px; color: var(--ds-muted, #3f5f7d); font-size: 1.05rem; }
.gal-empty { text-align: center; padding: 60px 16px; color: var(--ds-muted, #3f5f7d); }

.gal-stacks {
  max-width: 1180px; margin: 0 auto; padding: 46px 20px 80px;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 56px 34px;
}
.gal-stack {
  display: block; position: relative; aspect-ratio: 1 / 1.02; flex: 0 1 340px; min-width: 0;
  color: inherit; text-decoration: none; outline-offset: 10px;
  opacity: 0; transform: translateY(24px); animation: gal-rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: calc(var(--n, 0) * 0.09s);
}
@keyframes gal-rise { to { opacity: 1; transform: none; } }
.gal-card {
  position: absolute; inset: 6% 6% 16% 6%; background: #fff; padding: 9px 9px 34px; border-radius: 6px;
  box-shadow: 0 14px 30px rgba(0, 37, 80, 0.2); transition: transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.gal-card img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 2px; filter: saturate(1.14) contrast(1.04); }
.gal-card.c1 { transform: rotate(-8deg) translate(-4%, 2%); }
.gal-card.c2 { transform: rotate(6deg) translate(5%, 1%); }
.gal-card.c3 { transform: rotate(-1.5deg); }
.gal-stack:hover .c1, .gal-stack:focus-visible .c1 { transform: rotate(-15deg) translate(-16%, 0); }
.gal-stack:hover .c2, .gal-stack:focus-visible .c2 { transform: rotate(13deg) translate(17%, -1%); }
.gal-stack:hover .c3, .gal-stack:focus-visible .c3 { transform: rotate(0) translateY(-6%) scale(1.04); }
.gal-tag {
  position: absolute; left: 50%; bottom: 2%; transform: translateX(-50%) rotate(-2deg); min-width: 72%; max-width: 96%;
  background: #fffdf3; border: 2px dashed #d9b45a; border-radius: 6px; padding: 9px 16px 8px; text-align: center;
  box-shadow: 0 8px 18px rgba(0, 37, 80, 0.18); transition: transform 0.4s;
}
.gal-stack:hover .gal-tag, .gal-stack:focus-visible .gal-tag { transform: translateX(-50%) rotate(0) translateY(-4px); }
.gal-tag::before {
  content: ""; position: absolute; left: 50%; top: -10px; width: 56px; height: 18px; border-radius: 3px;
  background: rgba(233, 168, 58, 0.75); transform: translateX(-50%) rotate(3deg);
}
.gal-tag b { display: block; font: 800 19px / 1.2 var(--ds-font, "Plus Jakarta Sans", Inter, system-ui, sans-serif); color: var(--ds-ocean-900, #002550); overflow-wrap: anywhere; }
.gal-tag span { font-size: 13px; color: var(--ds-coral-600, #c8441f); font-weight: 700; }

/* ---------- Place page ---------- */
.gal-banner { position: relative; min-height: 46vh; display: flex; align-items: flex-end; color: #fff; overflow: hidden; background: var(--ds-ocean-900, #002550); }
.gal-banner > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(1.15); }
.gal-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(0, 37, 80, 0.1), rgba(0, 37, 80, 0.78)); }
.gal-banner-in { position: relative; z-index: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px 34px; }
.gal-back {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; margin-bottom: 14px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.22); color: #fff; font-weight: 700; text-decoration: none; backdrop-filter: blur(6px);
}
.gal-back--dark { background: var(--ds-teal-600, #0b5ed7); margin-top: 18px; }
body.layout-journeyempires.page-gallery .gal-banner h1 {
  margin: 0; color: #fff; font: 800 clamp(38px, 7vw, 76px) / 1 var(--ds-font, "Plus Jakarta Sans", Inter, system-ui, sans-serif);
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.35); overflow-wrap: anywhere;
}
body.layout-journeyempires.page-gallery .gal-banner p { margin: 10px 0 0; max-width: 620px; color: #fff; opacity: 0.95; }
.gal-count { display: inline-block; margin-top: 12px; padding: 5px 14px; border-radius: 999px; background: var(--ds-gold-500, #e9a83a); color: #3d2800; font-weight: 800; font-size: 13px; }

/* Photos: a big first photo with the others fitted around it, and no empty space for any number of photos.
   PC: 6 narrow columns. A normal photo is 2 wide; the first photo is 4 wide and 2 tall, with two photos beside it.
   The rows after that hold 3 photos, and photos left over in the last row are made wider so the row is full.
   Phones and tablets: 2 columns, the first photo across the top, and a single photo left over is made wide. */
.gal-wall {
  max-width: 1180px; margin: 0 auto; padding: 30px 16px 80px;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px;
}
.gal-wall figure {
  position: relative; margin: 0; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; cursor: pointer;
  background: var(--ds-sand-100, #d8effd); box-shadow: 0 10px 26px rgba(11, 94, 215, 0.15); outline-offset: 4px;
}
.gal-wall img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(1.12) contrast(1.04); transition: transform 0.5s; }
.gal-wall figure:hover img, .gal-wall figure:focus-visible img { transform: scale(1.05); }
.gal-wall figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 14px 10px; color: #fff; font-size: 13.5px; background: linear-gradient(transparent, rgba(0, 37, 80, 0.78)); }
@media (max-width: 899px) {
  .gal-wall figure:first-child:nth-last-child(n + 3), .gal-wall figure:only-child { grid-column: 1 / -1; aspect-ratio: 16 / 10; }
  .gal-wall figure:last-child:nth-child(even):not(:nth-child(2)) { grid-column: 1 / -1; aspect-ratio: 16 / 10; }
}
@media (min-width: 900px) {
  .gal-wall { grid-template-columns: repeat(6, 1fr); }
  .gal-wall figure { grid-column: span 2; aspect-ratio: 4 / 3; }
  .gal-wall figure:first-child:nth-last-child(n + 3) { grid-column: span 4; grid-row: span 2; aspect-ratio: auto; }
  .gal-wall figure:only-child { grid-column: 2 / span 4; aspect-ratio: 4 / 3; }
  .gal-wall figure:first-child:nth-last-child(2), .gal-wall figure:nth-child(2):last-child { grid-column: span 3; }
  .gal-wall figure:last-child:nth-child(3n + 1):not(:first-child) { grid-column: span 6; aspect-ratio: 21 / 9; }
  .gal-wall figure:nth-last-child(2):nth-child(3n + 1):not(:first-child),
  .gal-wall figure:last-child:nth-child(3n + 2):not(:nth-child(2)) { grid-column: span 3; }
}

/* ---------- Big photo viewer ---------- */
.gal-lightbox {
  position: fixed; inset: 0; margin: auto; height: fit-content; /* the site's reset removes the browser's centring, so centre it here */
  border: 0; padding: 0; background: transparent; width: calc(100% - 24px); max-width: min(92vw, 1000px); max-height: 92vh; overflow: visible;
}
.gal-lightbox::backdrop { background: rgba(0, 20, 45, 0.86); }
/* The box is exactly as big as the photo: no black bars, no stretching. Big photos are only shrunk, with the same shape. */
.gal-box { width: fit-content; max-width: 100%; margin: 0 auto; background: #fff; border-radius: 20px; overflow: hidden; }
.gal-box img { display: block; width: auto; height: auto; max-width: min(92vw, 1000px); max-height: 74vh; }
.gal-box div { padding: 14px 18px; }
.gal-box b { font-size: 17px; color: var(--ds-ocean-900, #002550); }
.gal-box p { margin: 4px 0 0; color: var(--ds-muted, #3f5f7d); }
.gal-box p:empty { display: none; }
.gal-nav, .gal-x { position: fixed; width: 48px; height: 48px; border-radius: 50%; border: 0; background: #fff; color: var(--ds-ocean-900, #002550); font-size: 24px; line-height: 1; cursor: pointer; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3); }
.gal-nav { top: 50%; transform: translateY(-50%); }
.gal-prev { left: 12px; }
.gal-next { right: 12px; }
.gal-x { top: 14px; right: 14px; font-size: 20px; }

@media (max-width: 600px) {
  .gal-plane { display: none; }
  .gal-stacks { gap: 44px; padding-top: 30px; }
  .gal-wall { gap: 10px; padding-inline: 12px; }
  .gal-wall figcaption { font-size: 12px; padding: 22px 10px 8px; }
  .gal-banner { min-height: 40vh; }
}
/* Touch screens: no arrow buttons. The photo is moved with a finger (see js/gallery.js). */
.gal-pos { display: none; }
@media (max-width: 600px), (pointer: coarse) {
  .gal-nav { display: none; }
  .gal-pos {
    display: block; position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); min-width: 64px; padding: 8px 16px;
    border-radius: 999px; background: rgba(255, 255, 255, 0.95); color: var(--ds-ocean-900, #002550); font-weight: 800; font-size: 14px; text-align: center;
  }
  .gal-pos:empty { display: none; }
}
.gal-box { touch-action: pan-y; will-change: transform; }
@media (prefers-reduced-motion: reduce) {
  .gal-path path, .gal-plane { animation: none; }
  .gal-stack { opacity: 1; transform: none; animation: none; }
  .gal-card, .gal-tag, .gal-wall img { transition: none; }
}

/* ---------- Customers send a photo: the small option and the form ---------- */
.gal-addbar { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; margin: 16px auto 0; max-width: 760px; padding: 0 12px; }
.gal-banner .gal-addbar { justify-content: flex-start; margin: 14px 0 0; padding: 0; }
.gal-addpill {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 18px 0 12px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--ds-teal-600, #0b5ed7); background: #fff; color: var(--ds-teal-600, #0b5ed7); font: 800 14.5px/1 var(--ds-font, system-ui, sans-serif);
}
.gal-addpill svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.gal-addpill:hover, .gal-addpill:focus-visible { background: var(--ds-teal-600, #0b5ed7); color: #fff; }
.gal-addtext { font-size: 14px; color: var(--ds-muted, #3f5f7d); max-width: 430px; text-align: left; }
.gal-banner .gal-addtext { color: #fff; }
@media (max-width: 600px) { .gal-addtext { text-align: center; } .gal-banner .gal-addtext { text-align: left; } }

.gal-add { position: fixed; inset: 0; margin: auto; height: fit-content; max-height: 94vh; overflow: auto; border: 0; padding: 0; background: transparent; width: calc(100% - 24px); max-width: 520px; }
.gal-add::backdrop { background: rgba(0, 20, 45, 0.8); }
.gal-add-form { position: relative; background: #fff; border-radius: 22px; padding: 24px 24px 22px; }
.gal-add-form h3 { margin: 0 0 4px; font: 800 24px/1.2 var(--ds-font, system-ui, sans-serif); color: var(--ds-ocean-900, #002550); }
.gal-add-sub { margin: 0 0 14px; color: var(--ds-muted, #3f5f7d); font-size: 14.5px; }
.gal-add-x { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: #eef8ff; font-size: 18px; cursor: pointer; color: var(--ds-ocean-900, #002550); }
.gal-add-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 150px; border: 2.5px dashed #9fd2f2; border-radius: 16px;
  background: #f3faff; color: var(--ds-ocean-900, #002550); font-weight: 700; text-align: center; cursor: pointer; overflow: hidden; position: relative;
}
.gal-add-drop small { font-weight: 500; color: var(--ds-muted, #3f5f7d); }
.gal-add-drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: none; }
.gal-add-l { display: block; margin: 14px 0 4px; font-weight: 700; font-size: 14px; color: #0d2a4a; }
.gal-add-i { width: 100%; min-height: 46px; border-radius: 12px; border: 1.5px solid #bfe3f8; padding: 0 14px; font: 16px var(--ds-font-body, Inter, system-ui, sans-serif); color: #0d2a4a; background: #fff; }
.gal-add-bot { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.gal-add-priv { font-size: 13px; color: var(--ds-muted, #3f5f7d); margin: 10px 0 12px; }
.gal-add-priv b { color: var(--ds-ocean-900, #002550); }
.gal-add-err { display: none; color: #b3261e; font-size: 13.5px; margin: 0 0 10px; }
.gal-add-send { width: 100%; min-height: 50px; border: 0; border-radius: 999px; background: var(--ds-teal-600, #0b5ed7); color: #fff; font: 800 16px var(--ds-font, system-ui, sans-serif); cursor: pointer; box-shadow: 0 8px 20px rgba(11, 94, 215, 0.3); }
.gal-add-send:disabled { opacity: 0.65; cursor: progress; }
.gal-add-ok { text-align: center; padding: 18px 6px; }
.gal-add-ok[hidden] { display: none; }
.gal-add-tick { font-size: 46px; color: #1a9b5a; }
.gal-add-priv a { color: #0b4fb3; font-weight: 700; }
