/* ── The gallery presentation (portfolio-presentation.js): the story, the map
   and the slideshow in a full-screen overlay, in the look of the classroom
   presentations (presentations/shared/presentation.css) ── */

/* The link on the gallery page */
.pp-launch {
  margin: 0 auto 3.5rem;
  text-align: center;
}
.pp-launch[hidden] { display: none; }
.pp-launch-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  background: none;
  border: 0;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0;
  -webkit-tap-highlight-color: transparent;
  color: #2a1e12;
  font: 0.9rem Georgia, 'Times New Roman', serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}
.pp-launch-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.3rem;
  height: 2.3rem;
  padding-left: 0.15rem;
  box-sizing: border-box;
  flex: none;
  border-radius: 50%;
  background: #1e130a;
  color: #f2ece0;
  font-size: 0.8rem;
  letter-spacing: 0;
  box-shadow: 0 0 0 0 rgba(192, 112, 60, 0.55);
  transition: background 0.3s, transform 0.3s;
  animation: ppLaunchPulse 2.8s ease-out 1s 3;
}
.pp-launch-btn:hover .pp-launch-play { background: #c0703c; transform: scale(1.08); }
@keyframes ppLaunchPulse {
  70%  { box-shadow: 0 0 0 12px rgba(192, 112, 60, 0); }
  100% { box-shadow: 0 0 0 0 rgba(192, 112, 60, 0); }
}
.pp-launch-parts {
  margin-top: 0.7rem;
  font: italic 0.85rem Georgia, 'Times New Roman', serif;
  color: #7a5530;
}
.pp-launch-parts a {
  color: #7a5530;
  text-decoration: none;
  border-bottom: 1px solid rgba(122, 85, 48, 0.3);
  transition: color 0.2s, border-color 0.2s;
}
.pp-launch-parts a:hover { color: #2a1e12; border-color: #c0703c; }
.pp-launch-sep { margin: 0 0.6rem; opacity: 0.6; }

/* The overlay */
.pp {
  --film: #1a0f05;
  --paper: #ede4d3;
  --rust: #c0703c;
  --muted: rgba(237, 228, 211, 0.72);
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans: 'Lato', 'Helvetica Neue', Arial, sans-serif;
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: #000;
  color: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  opacity: 0;
  transition: opacity 0.5s ease;
  overflow: hidden;
}
.pp[hidden] { display: none; }
.pp.shown { opacity: 1; }
.pp.idle { cursor: none; }
.pp *, .pp *::before, .pp *::after { box-sizing: border-box; }
.pp button { font-family: inherit; -webkit-appearance: none; appearance: none; -webkit-tap-highlight-color: transparent; }
.pp a { -webkit-tap-highlight-color: transparent; }

.pp-slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity 0.8s ease, visibility 0s linear 0.8s; }
.pp-slide.active { opacity: 1; visibility: visible; transition: opacity 0.8s ease; }
.pp-eyebrow { font-size: clamp(0.75rem, 1.2vw, 1rem); letter-spacing: 0.35em; text-transform: uppercase; color: var(--rust); margin: 0 0 1.5vh; }

/* Title */
.pp-title { background: var(--film) center / cover no-repeat; }
.pp-title::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10, 6, 2, 0.93) 0%, rgba(10, 6, 2, 0.72) 45%, rgba(10, 6, 2, 0.12) 82%); }
.pp-title-inner { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: center; padding: 8vh 7vw 14vh; max-width: 64rem; overflow-y: auto; }
.pp-title h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(2.8rem, 7.5vw, 7rem); line-height: 0.98; margin: 0; color: var(--paper); }
.pp-meaning { font-family: var(--serif); font-style: italic; font-size: clamp(1.25rem, 2.3vw, 2rem); line-height: 1.35; color: var(--paper); max-width: 30em; margin: 2.5vh 0 0; }
.pp-facts { display: flex; flex-wrap: wrap; gap: 1.2rem; margin-top: 4.5vh; }
.pp-fact { background: rgba(237, 228, 211, 0.09); border-radius: 0.5rem; padding: 1.1vh 1.2rem; min-width: 8rem; }
.pp-fact[hidden] { display: none; }
.pp-fact b { display: block; font-family: var(--serif); font-size: clamp(1.4rem, 2.4vw, 2.1rem); font-weight: 600; color: var(--paper); }
.pp-fact span { font-size: clamp(0.78rem, 1vw, 0.92rem); color: var(--muted); }
.pp-byline { margin: 4.5vh 0 0; font-size: clamp(0.9rem, 1.4vw, 1.2rem); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.pp-start {
  align-self: flex-start;
  margin-top: 3.5vh;
  background: var(--paper);
  color: var(--film);
  border: 0;
  border-radius: 2rem;
  padding: 0.75rem 1.7rem;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.25s;
}
.pp-start:hover { background: #fff; }

/* Words on the left, photos or the map on the right */
.pp-split { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(22rem, 42%) 1fr; background: var(--film); }
.pp-words { padding: 8vh 3.5vw 13vh 5.5vw; display: flex; flex-direction: column; justify-content: safe center; overflow-y: auto; }
.pp-words h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(2rem, 3.6vw, 3.4rem); line-height: 1.02; margin: 0; color: var(--paper); }
.pp-gloss { font-family: var(--serif); font-style: italic; font-size: clamp(1.2rem, 2vw, 1.8rem); margin: 0.8vh 0 0; color: var(--paper); }
.pp-gloss:empty { display: none; }
.pp-lead { font-family: var(--serif); font-size: clamp(1.5rem, 2.5vw, 2.3rem); line-height: 1.22; margin: 0; color: var(--paper); }
.pp-body { font-size: clamp(1rem, 1.35vw, 1.25rem); line-height: 1.62; margin: 2.2vh 0 0; color: rgba(237, 228, 211, 0.9); max-width: 36em; }
.pp-eyebrow + .pp-body { margin-top: 0; }
.pp-words.dense .pp-lead { font-size: clamp(1.35rem, 2.1vw, 1.95rem); }
.pp-words.dense .pp-body { font-size: clamp(0.95rem, 1.15vw, 1.1rem); line-height: 1.6; }

.pp-pics { position: relative; background: #000; }
.pp-pics .pp-frame { padding: 5vh 3vw 16vh; }
.pp-pics .pp-frame img { box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.7); }
.pp-pic-caption { position: absolute; left: 3vw; right: 3vw; bottom: 11vh; margin: 0; text-align: center; font-size: clamp(0.85rem, 1.2vw, 1.05rem); color: var(--muted); }
.pp-pic-dots { position: absolute; left: 0; right: 0; bottom: 8vh; display: flex; justify-content: center; gap: 0.6rem; }
.pp-pic-dots button { width: 0.65rem; height: 0.65rem; padding: 0; border-radius: 50%; border: 1px solid var(--paper); background: transparent; cursor: pointer; }
.pp-pic-dots button.current { background: var(--paper); }

/* Photos crossfade */
.pp-frame { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 1.4s ease; }
.pp-frame.on { opacity: 1; }
.pp-frame img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }

/* The map */
.pp-map-stage { position: relative; height: 100%; }
.pp-map { position: absolute; inset: 0; background: #d9cdb6; }
.pp-map .leaflet-tile-pane { filter: sepia(0.45) saturate(1.3) hue-rotate(-6deg) brightness(0.96) contrast(1.05); }
.pp-map .leaflet-control-attribution { font-size: 10px; background: rgba(237, 228, 211, 0.7); }
.pp-map-hint.gone { opacity: 0; }
.pp-map-hint { transition: opacity 0.6s ease; position: absolute; top: 2.5vh; left: 50%; transform: translateX(-50%); z-index: 500; background: rgba(26, 15, 5, 0.85); color: var(--paper); padding: 0.5em 1.1em; border-radius: 2em; font-size: clamp(0.8rem, 1.1vw, 1rem); pointer-events: none; white-space: nowrap; }
.pp-place-list { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 3vh; }
.pp-place { display: inline-flex; align-items: center; gap: 0.55em; background: rgba(237, 228, 211, 0.08); color: var(--paper); border: 1px solid rgba(237, 228, 211, 0.16); border-radius: 2em; padding: 0.4em 0.95em; font-size: clamp(0.82rem, 1vw, 0.95rem); cursor: pointer; transition: background 0.2s, border-color 0.2s; text-align: left; }
.pp-place:hover { background: rgba(192, 112, 60, 0.25); border-color: var(--rust); }
.pp-place em { font-style: normal; font-size: 0.8em; color: var(--film); background: var(--rust); border-radius: 1em; padding: 0.05em 0.55em; }

/* The slideshow */
.pp-show { background: #000; cursor: pointer; }
.pp-show .pp-frame.on img { animation: ppDrift var(--hold, 9s) linear forwards; }
@keyframes ppDrift { from { transform: scale(1); } to { transform: scale(1.04); } }
.pp-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 10vh 5vw 11vh; background: linear-gradient(transparent, rgba(0, 0, 0, 0.8)); pointer-events: none; transition: opacity 0.6s ease; }
.pp-caption[hidden] { display: none; }
.pp-caption h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(1.5rem, 3vw, 2.6rem); color: var(--paper); }
.pp-where { margin: 0.2em 0 0; font-size: clamp(0.9rem, 1.4vw, 1.2rem); letter-spacing: 0.06em; color: var(--muted); }
.pp-story-text { margin: 0.7em 0 0; max-width: 46em; font-size: clamp(0.95rem, 1.5vw, 1.25rem); line-height: 1.45; display: none; }
.pp.stories .pp-story-text { display: block; }
.pp.no-captions .pp-caption { opacity: 0; }
.pp-intro { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 0 6vw; background: #000; transition: opacity 1.2s ease; z-index: 2; }
.pp-intro.gone { opacity: 0; pointer-events: none; }
.pp-intro h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(2.4rem, 6vw, 5.4rem); line-height: 1.02; margin: 0; color: var(--paper); }
.pp-intro p:last-child { color: var(--muted); font-size: clamp(1rem, 1.8vw, 1.4rem); margin: 0.7em 0 0; }

/* The end */
.pp-end { background: var(--film) center / cover no-repeat; }
.pp-end::before { content: ''; position: absolute; inset: 0; background: rgba(10, 6, 2, 0.76); }
.pp-end-inner { position: relative; height: 100%; overflow-y: auto; display: flex; flex-direction: column; align-items: center; justify-content: safe center; text-align: center; padding: 8vh 6vw 14vh; }
.pp-end h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(2.6rem, 6.5vw, 5.6rem); line-height: 1.02; margin: 0; color: var(--paper); }
.pp-end-by { margin: 1.5vh 0 0; color: var(--muted); font-size: clamp(0.95rem, 1.5vw, 1.25rem); }
.pp-end-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.8rem; margin: 4.5vh 0 0; }
.pp-end-btn { display: inline-block; background: transparent; color: var(--paper); border: 1px solid rgba(237, 228, 211, 0.4); border-radius: 2rem; padding: 0.7rem 1.5rem; font-size: 0.92rem; letter-spacing: 0.08em; text-decoration: none; cursor: pointer; transition: background 0.2s; }
.pp-end-btn:hover { background: rgba(237, 228, 211, 0.14); }
.pp-end-btn.primary { background: var(--paper); color: var(--film); border-color: var(--paper); }
.pp-end-btn.primary:hover { background: #fff; }
.pp-credits { width: 100%; max-width: 50rem; margin-top: 5vh; background: rgba(26, 15, 5, 0.75); border-radius: 0.6rem; padding: 2vh 2.4vw; text-align: left; }
.pp-credits[hidden] { display: none; }
.pp-credits h3 { margin: 0 0 0.7em; font-size: 0.85rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--rust); font-weight: 700; }
.pp-credits ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4em; }
.pp-credits li { font-size: clamp(0.82rem, 1.1vw, 1rem); color: var(--muted); line-height: 1.35; }
.pp-credits li b { color: var(--paper); }
.pp-credits li.playing b::before { content: '♪ '; color: var(--rust); }

/* Controls: they fade while the slideshow plays and come back when the mouse moves */
.pp-controls { position: absolute; left: 50%; bottom: max(2vh, env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); width: max-content; display: flex; align-items: center; gap: 0.3rem; padding: 0.35rem 0.55rem; background: rgba(20, 12, 4, 0.88); border: 1px solid rgba(237, 228, 211, 0.15); border-radius: 2rem; z-index: 1000; transition: opacity 0.5s ease; max-width: calc(100vw - 1.5rem); flex-wrap: wrap; justify-content: center; }
.pp.idle .pp-controls, .pp.idle .pp-close, .pp.idle .pp-playing { opacity: 0; pointer-events: none; }
.pp-controls button { font-size: 0.85rem; color: var(--paper); background: transparent; border: 0; border-radius: 1rem; padding: 0.45rem 0.75rem; cursor: pointer; }
.pp-controls button:hover { background: rgba(237, 228, 211, 0.12); }
.pp-controls button[aria-pressed="false"] { opacity: 0.5; }
.pp-controls button[hidden] { display: none; }
.pp.on-first [data-act="prev"], .pp.on-last [data-act="next"] { opacity: 0.3; pointer-events: none; }
.pp-dots { display: flex; gap: 0.15rem; padding: 0 0.2rem; }
.pp-dots button { min-width: 1.85rem; padding: 0.45rem 0; }
.pp-dots button.current { background: var(--paper); color: var(--film); }
.pp-dots button.current:hover { background: var(--paper); }
.pp-pageno { display: none; font-size: 0.85rem; color: var(--muted); padding: 0 0.4rem; }
.pp-count { font-size: 0.85rem; color: var(--muted); padding: 0 0.4rem; min-width: 4.2em; text-align: center; }
.pp-sep { width: 1px; height: 1.2rem; background: rgba(237, 228, 211, 0.2); }
.pp .show-only { display: none; }
.pp.on-show .show-only { display: inline-block; }
.pp-close { position: absolute; top: max(1.6vh, env(safe-area-inset-top, 0px)); right: 1.4vw; z-index: 1001; width: 2.8rem; height: 2.8rem; border-radius: 50%; border: 1px solid rgba(237, 228, 211, 0.25); background: rgba(20, 12, 4, 0.75); color: var(--paper); font-size: 1.7rem; line-height: 1; cursor: pointer; transition: opacity 0.5s, background 0.2s; }
.pp-close:hover { background: rgba(192, 112, 60, 0.6); }
.pp-playing { position: absolute; top: 2.6vh; right: calc(1.4vw + 3.6rem); margin: 0; z-index: 1001; font-size: clamp(0.7rem, 0.95vw, 0.85rem); color: rgba(237, 228, 211, 0.6); text-align: right; transition: opacity 0.6s ease; display: none; }
.pp.music-playing .pp-playing { display: block; }
.pp-playing[hidden] { display: none !important; }

/* Phones and narrow windows: the words scroll under the photos or the map */
@media (max-width: 760px) {
  .pp-split { grid-template-columns: 1fr; grid-template-rows: auto auto; overflow-y: auto; bottom: 0; }
  .pp-pics, .pp-map-stage { order: -1; min-height: 46vh; height: 46vh; }
  .pp-map-stage { min-height: 56vh; height: 56vh; }
  .pp-words { padding: 3.5vh 6vw 16vh; overflow: visible; justify-content: flex-start; }
  .pp-pics .pp-frame { padding: 2vh 3vw 8vh; }
  .pp-pic-caption { bottom: 3.6vh; }
  .pp-pic-dots { bottom: 1.4vh; }
  .pp-title-inner { padding: 10vh 7vw 16vh; }
  .pp-title::before { background: linear-gradient(180deg, rgba(10, 6, 2, 0.6) 0%, rgba(10, 6, 2, 0.86) 55%, rgba(10, 6, 2, 0.92) 100%); }
  .pp-dots { display: none; }
  .pp-pageno { display: inline-block; }
  .pp-controls { gap: 0.1rem; }
  .pp-controls button { padding: 0.45rem 0.55rem; }
  .pp-controls [data-act="full"] { display: none; }
  .pp-caption { padding-bottom: 14vh; }
  .pp-playing { display: none !important; }
}
@media (max-width: 760px) and (orientation: landscape) {
  .pp-pics, .pp-map-stage { height: 80vh; }
}

/* Map markers and their popups (portfolio-map.js) */
.map-highlight-shape {
  animation: mapHighlightPulse 2.4s ease-in-out infinite;
}

@keyframes mapHighlightPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}

/* Where the photos were taken: a marker per place, sized by its number of photos */
.gallery-map-marker { background: none; border: 0; }
.gm-dot {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border-radius: 50%;
  background: #c0703c;
  border: 3px solid #f2ece0;
  color: #fff;
  font: 700 0.7rem 'Lato', 'Helvetica Neue', Arial, sans-serif;
  box-shadow: 0 0 0 0 rgba(192, 112, 60, 0.7);
  animation: gmPulse 2.4s infinite;
  cursor: pointer;
}
.gallery-map-marker:hover .gm-dot { background: #8a4a1c; }
@keyframes gmPulse {
  70%  { box-shadow: 0 0 0 12px rgba(192, 112, 60, 0); }
  100% { box-shadow: 0 0 0 0 rgba(192, 112, 60, 0); }
}

.gallery-map-popup .leaflet-popup-content-wrapper {
  background: #1e130a;
  color: #f2ece0;
  border-radius: 8px;
}
.gallery-map-popup .leaflet-popup-tip { background: #1e130a; }
.gallery-map-popup .leaflet-popup-content { margin: 10px; width: 270px !important; font-family: 'Lato', 'Helvetica Neue', Arial, sans-serif; }
.gallery-map-popup a.leaflet-popup-close-button { color: #f2ece0; }
.gm-pop .gm-main { width: 100%; height: 175px; object-fit: cover; display: block; border-radius: 4px; cursor: zoom-in; }
.gm-pop h4 { font-size: 1.1rem; font-weight: 400; margin: 0.55em 0 0.1em; color: #f2ece0; }
.gm-pop p { margin: 0; }
.gm-pop .gm-where { font-size: 0.78rem; letter-spacing: 0.04em; color: #c9b08a; }
.gm-pop .gm-teaser { font-size: 0.85rem; font-style: italic; line-height: 1.4; margin-top: 0.35em; color: #e4d8c3; }
.gm-pop .gm-thumbs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 0.6em; align-items: center; }
.gm-pop .gm-thumbs img { width: 40px; height: 40px; object-fit: cover; border-radius: 3px; opacity: 0.6; cursor: pointer; border: 2px solid transparent; }
.gm-pop .gm-thumbs img:hover, .gm-pop .gm-thumbs img.active { opacity: 1; border-color: #c0703c; }
.gm-pop .gm-thumbs span { font-size: 0.75rem; color: #c9b08a; padding-left: 4px; }
.gm-pop .gm-count { font-size: 0.72rem; color: #c9b08a; margin-top: 0.4em; }
.gm-pop .gm-open {
  margin-top: 0.6em;
  background: none;
  border: 1px solid rgba(242, 236, 224, 0.4);
  color: #f2ece0;
  border-radius: 14px;
  padding: 0.3em 0.9em;
  font: 0.78rem 'Lato', 'Helvetica Neue', Arial, sans-serif;
  letter-spacing: 0.06em;
  cursor: pointer;
}
.gm-pop .gm-open:hover { background: rgba(242, 236, 224, 0.12); }

.gm-pop h4 { font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 600; font-size: 1.3rem; }

@media (max-width: 600px) {
  .gallery-map-popup .leaflet-popup-content { width: 230px !important; }
  .gm-pop .gm-main { height: 120px; }
  .gm-pop .gm-teaser { display: none; }
}
