/* ===========================================================
   Rainbow Dash · Art Gallery ("Flight Snapshots")
   Polaroids taped onto a page of Dash's drawing pad, with
   hoofmade crayon doodles. Pairs with style.css + app.js.
   =========================================================== */

.gallery {
  position: relative;
  padding: 14px 14px 20px;
  border: 2px solid #74b6ec;
  border-radius: 10px;
  background:
    radial-gradient(140% 80% at 50% -20%, rgba(255, 255, 255, .8), transparent 55%),
    linear-gradient(180deg, #e9f6ff, #d3ecff);
  box-shadow: 0 4px 14px var(--shadow), inset 0 0 0 2px rgba(255, 255, 255, .7);
}

/* ===========================================================
   THE DRAWING PAD PAGE — a real sheet taped to the sky panel
   =========================================================== */
.gallery__sheet { position: relative; padding-top: 8px; }

/* washi strips taping the page down */
.paper-tape {
  position: absolute;
  top: -2px;
  z-index: 3;
  width: 96px;
  height: 26px;
  background: rgba(168, 224, 255, .55);
  border-left: 1px dashed rgba(255, 255, 255, .85);
  border-right: 1px dashed rgba(255, 255, 255, .85);
  box-shadow: 0 1px 4px rgba(40, 90, 150, .22);
  pointer-events: none;
}
.paper-tape--l { left: 9%; transform: rotate(-5deg); }
.paper-tape--r { right: 9%; transform: rotate(4deg); background: rgba(255, 188, 230, .5); }

.gallery__paper {
  position: relative;
  /* generous side + bottom gutters: that's where the doodles live,
     clear of the polaroids */
  padding: 30px 64px 76px;
  border: 1px solid #e3d9bd;
  border-radius: 6px;
  /* warm sketch paper with a faint tooth/grain */
  background:
    radial-gradient(rgba(140, 120, 80, .055) 1px, transparent 1.3px),
    radial-gradient(rgba(140, 120, 80, .04) 1px, transparent 1.2px),
    linear-gradient(180deg, #fdfbf2, #f7f2e3);
  background-size: 11px 11px, 17px 17px, 100% 100%;
  background-position: 0 0, 6px 8px, 0 0;
  /* stacked sheets peeking out underneath */
  box-shadow:
    0 6px 16px rgba(60, 80, 130, .25),
    5px 7px 0 -2px #f3edd9,
    5px 7px 0 -1px #d9cfac,
    9px 13px 0 -5px #ece4cb,
    9px 13px 0 -4px #d3c8a4,
    inset 0 0 60px rgba(190, 170, 120, .14);
  transform: rotate(-.35deg);
  overflow: hidden;
}
/* folded corner, bottom-right */
.gallery__paper::after {
  content: "";
  position: absolute;
  right: 0; bottom: 0;
  width: 44px; height: 44px;
  background: linear-gradient(315deg, transparent 0 46%, #d8cda9 47% 52%, #fcf9ec 53% 60%, #f1ead5 100%);
  box-shadow: -2px -2px 5px rgba(120, 100, 60, .16);
  pointer-events: none;
}

/* the hoof-written sticker label (the album's title) */
.album-label {
  position: relative;
  z-index: 1;
  width: max-content;
  max-width: 94%;
  margin: 4px auto 18px;
  padding: 8px 26px 10px;
  text-align: center;
  background: #fffdf6;
  border: 2px solid #6fa3e0;
  border-radius: 8px;
  box-shadow:
    inset 0 0 0 3px #fffdf6,
    inset 0 0 0 4px #b7d4f2,
    0 3px 7px rgba(60, 80, 130, .2);
  transform: rotate(-1deg);
}
.album-label::before {
  content: "";
  position: absolute;
  left: -16px; top: -10px;
  width: 52px; height: 17px;
  transform: rotate(-32deg);
  background: rgba(255, 238, 150, .7);
  border-left: 1px dashed rgba(255, 255, 255, .8);
  border-right: 1px dashed rgba(255, 255, 255, .8);
  box-shadow: 0 1px 3px rgba(40, 90, 150, .25);
}
.album-label__title {
  margin: 0;
  color: #2b5fc7;
  font: 400 30px/1.05 "Gochi Hand", "Comic Sans MS", cursive;
  letter-spacing: .01em;
}
.album-label__sub {
  margin: 3px 0 0;
  color: #8a795c;
  font: 400 13px/1.3 "Gochi Hand", "Comic Sans MS", cursive;
}
.album-label__under {
  display: block;
  width: min(230px, 90%);
  margin: 4px auto 0;
  height: auto;
}
.album-label__under path { fill: none; stroke-linecap: round; }
/* sketchbook ring holes punched along the top */
.gallery__paper::before {
  content: "";
  position: absolute;
  left: 18px; right: 18px; top: 10px;
  height: 18px;
  background:
    radial-gradient(circle at 50% 50%, #aed9f8 0 5px, #b9ab85 5px 6.5px, transparent 7.5px);
  background-size: 52px 18px;
  background-repeat: repeat-x;
  pointer-events: none;
}

/* ===========================================================
   HOOFMADE DOODLES (crayon SVGs + handwriting)
   =========================================================== */
.doodle {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  opacity: .8;
}
.doodle--txt {
  color: #e2589f;
  font: 400 18px/1.15 "Gochi Hand", "Comic Sans MS", cursive;
  white-space: nowrap;
}
.doodle--txt small { font-size: 13px; }
.doodle--blue { color: #5a8fe8; }
.doodle--gold { color: #dfa92e; }

/* top strip */
.doodle--sun        { left: 8px;   top: 26px;  width: 62px; transform: rotate(-8deg); }
.doodle--cloud1     { left: 13%;   top: 44px;  width: 70px; transform: rotate(2deg); opacity: .6; }
.doodle--trophy     { left: 28%;   top: 40px;  width: 28px; transform: rotate(-6deg); }
.doodle--zoom       { right: 3%;   top: 62px;  width: 175px; transform: rotate(-3deg); }
.doodle--bestpony   { right: 30px; top: 28px;  width: 112px; transform: rotate(4deg); }
/* left gutter */
.doodle--rainbow    { left: 3px;   top: 30%;   width: 58px; transform: rotate(-4deg); }
.doodle--plane      { left: 14px;  top: 57%;   width: 32px; transform: rotate(-14deg); }
/* right gutter */
.doodle--bolt       { right: 11px; top: 24%;   width: 40px; transform: rotate(9deg); }
.doodle--zap        { right: 13px; top: calc(24% + 50px); transform: rotate(-5deg); }
.doodle--hearts     { right: 3px;  top: 53%;   width: 56px; transform: rotate(6deg); }
/* gutters, lower */
.doodle--wee        { left: 16px;  top: 44%;   transform: rotate(-7deg); }
.doodle--notes      { right: 18px; top: 40%;   font-size: 17px; transform: rotate(8deg); }
/* bottom strip */
.doodle--cooler     { left: 18px;  bottom: 16px; transform: rotate(-3deg); }
.doodle--boom {
  left: 50%; bottom: 4px;
  width: 96px;
  display: grid;
  justify-items: center;
  transform: translateX(-50%) rotate(-2deg);
}
.boom-txt { color: #5a8fe8; font: 400 13px/1 "Gochi Hand", "Comic Sans MS", cursive; margin-top: -4px; }
.doodle--ponee      { right: 34px; bottom: 6px;  width: 94px; transform: rotate(-2deg); }

/* flanking the Hangar Picks tape (positioned inside that section) */
.doodle--faves      { left: 13%;  top: 8px;  transform: rotate(-4deg); }
.doodle--tank {
  right: 11%; top: -8px;
  width: 76px;
  display: grid;
  justify-items: center;
  transform: rotate(4deg);
}
.tank-txt { color: #4f9a55; font: 400 13px/1 "Gochi Hand", "Comic Sans MS", cursive; margin-top: -6px; }

.doodle svg { display: block; width: 100%; height: auto; }
.doodle svg path,
.doodle svg circle,
.doodle svg ellipse {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ===========================================================
   SECTION HEADERS — washi tape
   =========================================================== */
.gallery__sec { position: relative; z-index: 1; }
.tape-head {
  position: relative;
  width: max-content;
  max-width: 92%;
  margin: 6px auto 16px;
  padding: 5px 24px;
  color: #14418f;
  font: 400 17px/1.2 "Special Elite", "Courier New", monospace;
  text-transform: uppercase;
  letter-spacing: .05em;
  background: rgba(255, 232, 130, .92);
  box-shadow: 0 2px 6px rgba(80, 90, 30, .25);
  transform: rotate(-1.6deg);
}
.tape-head--pink { background: rgba(255, 178, 226, .92); transform: rotate(1.2deg); }
.gallery__sec + .gallery__sec .tape-head { margin-top: 24px; }
.tape-head::before,
.tape-head::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #f9f5e8;
  box-shadow: inset 0 1px 2px rgba(60, 80, 120, .4);
  transform: translateY(-50%);
}
.tape-head::before { left: 8px; }
.tape-head::after { right: 8px; }

.tape-sub {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  text-align: center;
  margin: -10px 0 12px;
  color: #8a795c;
  font: 400 14px/1.3 "Gochi Hand", "Comic Sans MS", cursive;
}
.gallery__rescout {
  padding: 2px 10px;
  color: #2848b8;
  font: 700 11px/1.6 "Courier New", monospace;
  border: 2px solid #7eb8ea;
  border-radius: 10px;
  background: linear-gradient(#fff, #bceaff);
}
.gallery__rescout:hover,
.gallery__rescout:focus-visible { color: #fff; background: linear-gradient(#ff86d8, #8b63ff); }
.gallery__rescout:disabled { opacity: .5; cursor: default; }

/* ===========================================================
   THE POLAROIDS
   =========================================================== */
.snap-board {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px 12px;
  padding: 0 0 6px;
}

.snap {
  position: relative;
  display: block;
  padding: 7px 7px 30px;
  text-decoration: none;
  background: linear-gradient(172deg, #fffefb 60%, #f3f0e6);
  border-radius: 2px;
  box-shadow:
    0 1px 2px rgba(60, 70, 90, .25),
    0 7px 14px rgba(20, 80, 150, .3);
  transition: transform .15s ease, box-shadow .15s ease;
  /* polaroids "develop" in when the album opens */
  animation: snap-develop .8s ease backwards;
}
.snap-board .snap:nth-child(1)  { animation-delay: .05s; }
.snap-board .snap:nth-child(2)  { animation-delay: .11s; }
.snap-board .snap:nth-child(3)  { animation-delay: .17s; }
.snap-board .snap:nth-child(4)  { animation-delay: .23s; }
.snap-board .snap:nth-child(5)  { animation-delay: .29s; }
.snap-board .snap:nth-child(6)  { animation-delay: .35s; }
.snap-board .snap:nth-child(7)  { animation-delay: .41s; }
.snap-board .snap:nth-child(8)  { animation-delay: .47s; }
.snap-board .snap:nth-child(9)  { animation-delay: .53s; }
.snap-board .snap:nth-child(10) { animation-delay: .59s; }
@keyframes snap-develop {
  from { opacity: 0; filter: saturate(0) brightness(1.5) contrast(.65); }
}
.snap-board .snap:nth-child(4n+1) { transform: rotate(-3.2deg); }
.snap-board .snap:nth-child(4n+2) { transform: rotate(2.3deg) translateY(5px); }
.snap-board .snap:nth-child(4n+3) { transform: rotate(-1.5deg) translateY(-3px); }
.snap-board .snap:nth-child(4n)   { transform: rotate(3.4deg) translateY(3px); }
.snap:hover,
.snap:focus-visible {
  transform: rotate(0) scale(1.07);
  box-shadow: 0 16px 28px rgba(20, 80, 150, .45);
  z-index: 3;
}
/* tape strip holding each photo down */
.snap::before {
  content: "";
  position: absolute;
  left: 50%; top: -9px;
  width: 58px; height: 18px;
  transform: translateX(-50%) rotate(-3deg);
  background: rgba(168, 224, 255, .65);
  border-left: 1px dashed rgba(255, 255, 255, .8);
  border-right: 1px dashed rgba(255, 255, 255, .8);
  box-shadow: 0 1px 3px rgba(40, 90, 150, .25);
}
.snap:nth-child(3n)::before { background: rgba(255, 188, 230, .6); transform: translateX(-50%) rotate(2.5deg); }
.snap:nth-child(5n)::before { background: rgba(255, 238, 150, .65); }

/* the photo: dark inner frame, vignette + gloss */
.snap .photo {
  display: block;
  position: relative;
  background: #1a2030;
  box-shadow: inset 0 0 0 1px rgba(20, 25, 40, .65);
}
.snap .photo::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(118deg, rgba(255,255,255,.3) 0%, rgba(255,255,255,.08) 22%, transparent 38%),
    radial-gradient(ellipse at 50% 42%, transparent 58%, rgba(25, 25, 55, .26));
  box-shadow: inset 0 0 2px rgba(10, 15, 30, .7);
}
.snap img,
.snap .ph {
  display: block;
  width: 100%;
  height: 116px;
  object-fit: cover;
  filter: saturate(.94) contrast(1.04);
}
.snap .ph {
  display: grid;
  place-items: center;
  color: #5b9bd9;
  font-size: 32px;
  background: linear-gradient(135deg, #dff2ff, #b8e0fa);
}
.snap .ph--wait { animation: snap-developing 1.4s ease-in-out infinite; }
@keyframes snap-developing { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

/* handwriting on the chin */
.snap .cap {
  position: absolute;
  left: 8px; right: 8px; bottom: 5px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  color: #2c3c7e;
  font: 400 12.5px/1.2 "Gochi Hand", "Special Elite", "Comic Sans MS", cursive;
  white-space: nowrap;
  transform: rotate(-1deg);
}
.snap .cap .artist { overflow: hidden; text-overflow: ellipsis; }
.snap .cap .score { color: #c2348f; flex: 0 0 auto; font-size: 12px; }

.gallery__note {
  position: relative;
  z-index: 1;
  margin: 0 0 8px;
  text-align: center;
  color: #8a5e2c;
  font: 400 16px/1.4 "Gochi Hand", cursive;
}
.gallery__note:empty { display: none; }

/* ===========================================================
   RESPONSIVE
   =========================================================== */
@media (max-width: 1180px) {
  .snap-board { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .snap-board { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gallery__paper { padding: 30px 20px 70px; }
  .doodle--rainbow, .doodle--bolt, .doodle--zap,
  .doodle--hearts, .doodle--plane,
  .doodle--wee, .doodle--notes { display: none; }
}
@media (max-width: 640px) {
  .snap-board { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
  .gallery__paper { padding: 28px 14px 56px; }
  .album-label__title { font-size: 24px; }
  .doodle--ponee, .doodle--cloud1,
  .doodle--faves, .doodle--tank, .doodle--zoom { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .snap { transition: none; animation: none; }
  .snap .ph--wait { animation: none; }
}

/* ===========================================================
   Lightbox — click a snapshot to zoom it as a developing photo
   =========================================================== */
.rd-lb {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: radial-gradient(ellipse at center, rgba(22, 64, 142, .5), rgba(7, 26, 70, .85));
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: rd-lb-fade .22s ease;
}
.rd-lb[hidden] { display: none; }
@keyframes rd-lb-fade { from { opacity: 0; } to { opacity: 1; } }
body.rd-lb-open { overflow: hidden; }

.rd-lb__frame {
  position: relative;
  margin: 0;
  max-width: min(86vw, 760px);
  padding: 16px 16px 12px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 22px 60px rgba(6, 24, 66, .6), inset 0 0 0 1px rgba(255, 255, 255, .55);
  transform: scale(.86) rotate(-2deg);
  opacity: 0;
}
.rd-lb__frame.is-in { animation: rd-lb-pop .42s cubic-bezier(.2, .8, .2, 1.05) forwards; }
@keyframes rd-lb-pop {
  0%   { transform: scale(.86) rotate(-2deg); opacity: 0; }
  60%  { transform: scale(1.02) rotate(.5deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
/* rainbow strip along the top of the frame */
.rd-lb__frame::before {
  content: "";
  position: absolute;
  left: 16px; right: 16px; top: 7px;
  height: 4px;
  border-radius: 3px;
  background: linear-gradient(90deg, #ff5b5b, #ff9b34, #ffe65b, #66d978, #39e7ff, #8e55ff, #ff4fc8);
}
.rd-lb__photo {
  margin-top: 9px;
  overflow: hidden;
  border-radius: 5px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #eaf6ff, #cfe9ff);
}
.rd-lb__img {
  display: block;
  max-width: min(82vw, 720px);
  max-height: 70vh;
  width: auto;
  height: auto;
}
.rd-lb__cap {
  margin-top: 10px;
  text-align: center;
  font: 400 22px/1.2 "Gochi Hand", "Trebuchet MS", cursive;
  color: #1d4ea0;
}
.rd-lb__src {
  margin-left: 8px;
  font: 700 13px/1 "Courier New", monospace;
  color: #2448c9;
  vertical-align: 2px;
}
.rd-lb__src[hidden] { display: none; }

.rd-lb__close {
  position: absolute;
  top: 16px; right: 18px;
  z-index: 2;
  width: 42px; height: 42px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, .85);
  color: #fff;
  font: 900 22px/1 "Trebuchet MS", sans-serif;
  background: rgba(255, 79, 200, .42);
  transition: background .15s ease, transform .15s ease;
}
.rd-lb__close:hover { background: rgba(255, 79, 200, .75); transform: rotate(90deg); }
.rd-lb__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 46px; height: 62px;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, .7);
  border-radius: 12px;
  color: #fff;
  font: 900 26px/1 "Trebuchet MS", sans-serif;
  background: rgba(29, 78, 160, .35);
  transition: background .15s ease;
}
.rd-lb__nav:hover { background: rgba(29, 78, 160, .65); }
.rd-lb__prev { left: 20px; }
.rd-lb__next { right: 20px; }

@media (max-width: 600px) {
  .rd-lb { padding: 14px; }
  .rd-lb__nav { width: 38px; height: 50px; font-size: 22px; }
  .rd-lb__cap { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  .rd-lb { animation: none; }
  .rd-lb__frame, .rd-lb__frame.is-in { animation: none; transform: none; opacity: 1; }
}
