/* Ireland memory page — scrollytelling layout
 * Extends ireland.css for the forest+sunset theme. */

/* ── Hero ─────────────────────────────────────────────────── */
.m-hero {
  text-align: center;
  padding: 3.4rem 1rem 2.2rem;
  position: relative;
}
.m-hero .trip-flag {
  font-size: 2.4rem;
  display: inline-block;
  margin-bottom: .6rem;
}
.m-hero-title {
  font-family: "Fraunces", serif;
  font-weight: 700;
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  margin: 0 0 .35rem;
  color: #f0e8d4;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.m-hero-dates {
  color: #c4cfba;
  font-size: 1rem;
  margin: 0 0 1.4rem;
}
.m-hero-nav {
  display: inline-flex;
  flex-wrap: wrap;
  gap: .6rem;
  justify-content: center;
  margin-bottom: 1rem;
}
.m-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .6rem 1rem;
  font: inherit;
  font-size: .92rem;
  font-weight: 500;
  background: rgba(20, 32, 26, 0.85);
  border: 1px solid rgba(140, 200, 170, 0.3);
  border-radius: 999px;
  color: #f4eedd;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .15s;
}
.m-nav-btn:hover {
  background: rgba(45, 70, 55, 0.85);
  border-color: #6ab896;
  transform: translateY(-1px);
}
.m-nav-btn--primary {
  background: linear-gradient(135deg, #e87722, #c4540e);
  border-color: transparent;
  color: #fff;
}
.m-nav-btn--primary:hover {
  background: linear-gradient(135deg, #f08838, #d05f15);
  border-color: transparent;
}
.m-hero-cue {
  margin-top: 1rem;
  font-size: .85rem;
  color: #8aa298;
  letter-spacing: .08em;
  text-transform: lowercase;
  opacity: .8;
  animation: bob 2.6s ease-in-out infinite;
}
@keyframes bob { 0%,100%{transform:translateY(0)} 50%{transform:translateY(6px)} }


/* ── Split view: sticky map + scrolling timeline ─────────── */
.m-split {
  display: grid;
  grid-template-columns: 1fr;
}
@media (min-width: 980px) {
  .m-split { grid-template-columns: 1fr 1fr; }
}

.m-map-wrap {
  position: sticky;
  top: 0;
  height: 60vh;
  z-index: 5;
}
@media (min-width: 980px) {
  .m-map-wrap { height: 100vh; }
}
#leafletMap {
  width: 100%; height: 100%;
  background: #0f1b14;
}
/* Slightly darken the OSM tiles to match the page theme */
.leaflet-tile { filter: brightness(0.78) saturate(0.85); }
.leaflet-container { background: #0f1b14; }

/* ── Animated stop markers (DivIcon-based) ─────────────────────── */
.leaflet-div-icon.m-stop-marker {
  background: transparent;
  border: 0;
  width: 22px !important; height: 22px !important;
  position: relative;
}
.m-stop-marker .stop-core {
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: #e87722;
  border: 2px solid #ffffff;
  box-shadow: 0 0 6px rgba(0,0,0,0.6);
  z-index: 2;
}
.m-stop-marker .stop-pulse {
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: #e87722;
  opacity: 0;
  z-index: 1;
}
/* Active stop: throb the pulse halo */
.m-stop-marker.is-active .stop-pulse {
  animation: stop-throb 1.4s ease-out infinite;
}
.m-stop-marker.is-active .stop-core {
  /* Slight scale + brighten on the core to draw the eye */
  transform: scale(1.15);
  transition: transform .25s ease-out;
}
@keyframes stop-throb {
  0%   { transform: scale(1);   opacity: 0.7; }
  100% { transform: scale(3.4); opacity: 0;   }
}

.m-map-overlay {
  position: absolute;
  left: .8rem; bottom: .8rem;
  background: rgba(8, 16, 12, 0.85);
  padding: .55rem .85rem;
  border-radius: 10px;
  border: 1px solid rgba(140, 200, 170, 0.25);
  pointer-events: none;
  z-index: 1000;
  max-width: 80%;
  backdrop-filter: blur(4px);
}
.m-map-day {
  font-family: "Fraunces", serif;
  font-weight: 600;
  color: #f4eedd;
  font-size: .98rem;
  line-height: 1.2;
}
.m-map-sub { font-size: .78rem; color: #9eb09e; margin-top: .15rem; }


/* ── Timeline column ─────────────────────────────────────── */
.m-timeline {
  padding: 1rem;
  max-width: 760px;
  margin: 0 auto;
}

/* Day section */
.m-day {
  padding: 2.4rem 0 3rem;
  border-bottom: 1px solid rgba(140, 200, 170, 0.08);
}
.m-day:last-of-type { border-bottom: none; }
.m-day-head { margin-bottom: 1.4rem; }
.m-day-num {
  display: inline-block;
  font-family: "Fraunces", serif;
  font-weight: 700;
  font-size: .72rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: #e87722;
  background: rgba(232, 119, 34, 0.12);
  padding: .25rem .65rem;
  border-radius: 4px;
  margin-bottom: .55rem;
}
.m-day-title {
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: clamp(1.6rem, 3.2vw, 2.2rem);
  color: #f0e8d4;
  margin: 0 0 .25rem;
  line-height: 1.15;
}
.m-day-date { font-size: .85rem; color: #8aa298; margin: 0 0 .55rem; }
.m-day-sub  { font-size: 1rem; color: #c4cfba; font-style: italic; margin: 0 0 .8rem; }
.m-day-summary {
  font-size: 1rem;
  color: #d4dcca;
  line-height: 1.55;
  margin: .8rem 0 0;
}


/* Stop section */
.m-stop {
  margin: 1.6rem 0 0;
  padding: 1rem 0 .4rem;
}
.m-stop-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .5rem .85rem;
  align-items: baseline;
  margin-bottom: .8rem;
}
.m-stop-icon { font-size: 1.5rem; line-height: 1; }
.m-stop-name {
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: 1.2rem;
  color: #f4eedd;
  margin: 0;
}
.m-stop-note {
  grid-column: 2 / -1;
  font-size: .85rem;
  color: #9eb09e;
  margin: .2rem 0 0;
  font-style: italic;
}
.m-stop--unplaced {
  background: rgba(40, 28, 28, 0.4);
  border: 1px dashed rgba(220, 100, 100, 0.25);
  border-radius: 12px;
  padding: 1rem 1.1rem .6rem;
}


/* Photo collage — CSS columns give a masonry-like flow that respects each
   photo's natural aspect ratio (portraits stay portrait, landscapes wide). */
.m-photos {
  column-count: 3;
  column-gap: .5rem;
}
@media (max-width: 980px) { .m-photos { column-count: 3; } }
@media (max-width: 640px) { .m-photos { column-count: 2; } }
@media (max-width: 380px) { .m-photos { column-count: 2; } }

.m-tile {
  position: relative;
  margin: 0 0 .5rem;            /* gap between tiles within a column */
  background: #14201a;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  display: block;
  break-inside: avoid;          /* don't split a tile across columns */
  /* Fade-in transition */
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .6s ease, transform .6s ease;
}
.m-tile.in-view { opacity: 1; transform: translateY(0); }
.m-tile img {
  width: 100%; height: auto;
  display: block;
  transition: transform .35s;
}
.m-tile:hover img { transform: scale(1.04); }
/* Fallback (no thumbnail yet) still gets a square so columns look tidy */
.m-tile-fallback { aspect-ratio: 1 / 1; }
.m-tile-fallback {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  width: 100%; height: 100%;
  font-size: 2rem;
  color: #6ab896;
  padding: .4rem;
  text-align: center;
}
.m-tile-fallback span {
  display: block;
  font-size: .65rem; color: #889a89;
  margin-top: .3rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 95%;
}
.m-tile-vid {
  position: absolute;
  top: .35rem; right: .4rem;
  background: rgba(0,0,0,0.7);
  color: white;
  font-size: .75rem;
  padding: .15rem .45rem;
  border-radius: 4px;
  pointer-events: none;
}
.m-tile--video { border: 1px solid rgba(106, 184, 150, 0.25); }


/* End-of-timeline footer */
.m-end {
  text-align: center;
  padding: 3rem 1rem 4rem;
  color: #c4cfba;
}
.m-end p {
  font-family: "Fraunces", serif;
  font-weight: 500;
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: #f0e8d4;
}
.m-end-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: .6rem;
  justify-content: center;
}


/* ── Lightbox ────────────────────────────────────────────── */
/* The [hidden] override below MUST come before .m-lightbox so the
   CSS-set display value doesn't defeat the HTML hidden attribute. */
.m-lightbox[hidden], .m-locedit[hidden] { display: none !important; }

.m-lightbox {
  position: fixed; inset: 0;
  background: rgba(5, 10, 8, 0.96);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.lb-viewport {
  flex: 1;
  width: 100%;
  max-width: 1400px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  overflow: hidden;
}
.lb-img, .lb-video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
}
.lb-close, .lb-nav {
  position: absolute;
  background: rgba(20, 32, 26, 0.85);
  border: 1px solid rgba(140, 200, 170, 0.3);
  color: #f4eedd;
  width: 44px; height: 44px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.6rem;
  display: flex; align-items: center; justify-content: center;
  z-index: 1;
  user-select: none;
  transition: background .15s;
}
.lb-close:hover, .lb-nav:hover { background: rgba(60, 100, 80, 0.9); }
.lb-close { top: 1rem; right: 1rem; font-size: 1.2rem; }
.lb-prev  { left:  1rem; top: 50%; transform: translateY(-50%); }
.lb-next  { right: 1rem; top: 50%; transform: translateY(-50%); }

.lb-meta {
  width: 100%;
  max-width: 1400px;
  margin-top: 1rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
  padding-top: .8rem;
  border-top: 1px solid rgba(140, 200, 170, 0.15);
}
.lb-name {
  margin: 0 0 .25rem;
  font-family: "Fraunces", serif;
  font-weight: 600;
  color: #f4eedd;
  font-size: 1.05rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lb-info {
  margin: 0;
  color: #c4cfba;
  font-size: .88rem;
}
.lb-actions {
  display: flex;
  gap: .5rem;
  flex-shrink: 0;
}


/* ── Location editor ─────────────────────────────────────── */
.m-locedit {
  position: fixed; inset: 0;
  background: rgba(5, 10, 8, 0.85);
  z-index: 10001;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.le-card {
  background: #14201a;
  border: 1px solid rgba(140, 200, 170, 0.3);
  border-radius: 14px;
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
}
.le-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.2rem .8rem;
  border-bottom: 1px solid rgba(140, 200, 170, 0.15);
}
.le-head h3 {
  margin: 0;
  font-family: "Fraunces", serif;
  font-weight: 600;
  color: #f4eedd;
  font-size: 1.2rem;
}
.le-close {
  background: none; border: none; color: #c4cfba;
  font-size: 1.4rem; cursor: pointer; padding: 0 .4rem;
}
.le-help {
  margin: 0;
  padding: .7rem 1.2rem;
  font-size: .85rem;
  color: #9eb09e;
  background: rgba(20, 32, 26, 0.5);
}

/* Stop chips inside the location editor */
.le-stops {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  padding: .7rem 1.2rem .5rem;
  max-height: 130px;
  overflow-y: auto;
  background: rgba(8, 16, 12, 0.4);
  border-bottom: 1px solid rgba(140, 200, 170, 0.12);
}
.le-stop-chip {
  font: inherit;
  font-size: .75rem;
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .25rem .55rem;
  background: rgba(8, 16, 12, 0.6);
  color: #c4cfba;
  border: 1px solid rgba(140, 200, 170, 0.2);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.le-stop-chip:hover { color: #f4eedd; border-color: #6ab896; background: rgba(60, 100, 80, 0.4); }
.le-stop-chip--today { border-color: rgba(232, 119, 34, 0.5); color: #f4eedd; }
.le-chip-icon { font-size: .9rem; }
.le-chip-day { font-weight: 600; color: #e87722; }
.le-chip-name {}

.le-map {
  width: 100%;
  height: 320px;
  background: #0f1b14;
}
.le-current {
  margin: 0;
  padding: .55rem 1.2rem;
  font-size: .82rem;
  color: #6ab896;
  font-family: monospace;
  background: rgba(8, 16, 12, 0.7);
  border-top: 1px solid rgba(140, 200, 170, 0.1);
}
.le-pw {
  padding: .8rem 1.2rem .4rem;
}
.le-pw label {
  display: block;
  font-size: .82rem;
  color: #c4cfba;
}
.le-pw input {
  width: 100%;
  margin-top: .3rem;
  padding: .55rem .7rem;
  background: rgba(8, 16, 12, 0.5);
  color: #f4eedd;
  border: 1px solid rgba(140, 200, 170, 0.25);
  border-radius: 8px;
  font: inherit;
  font-size: .95rem;
}
.le-actions {
  display: flex;
  justify-content: flex-end;
  gap: .6rem;
  padding: .8rem 1.2rem 1.2rem;
  flex-wrap: wrap;
}

/* Date editor (extends location editor styles) */
.de-card { max-width: 520px; }
.de-inputwrap { padding: .9rem 1.2rem .4rem; }
.de-label { display: block; font-size: .85rem; color: #c4cfba; }
.de-label input[type="datetime-local"] {
  display: block;
  width: 100%;
  margin-top: .4rem;
  padding: .65rem .8rem;
  font: inherit; font-size: 1rem;
  background: rgba(8, 16, 12, 0.5);
  color: #f4eedd;
  border: 1px solid rgba(140, 200, 170, 0.25);
  border-radius: 10px;
  /* Make the native date-picker icon visible on dark theme */
  color-scheme: dark;
}
.de-quickrow {
  margin-top: .85rem;
  display: flex; flex-wrap: wrap;
  gap: .35rem; align-items: center;
}
.de-quicklabel { font-size: .78rem; color: #8aa298; margin-right: .25rem; }
.de-chip {
  font: inherit;
  font-size: .78rem;
  padding: .3rem .65rem;
  background: rgba(8, 16, 12, 0.6);
  color: #c4cfba;
  border: 1px solid rgba(140, 200, 170, 0.2);
  border-radius: 999px;
  cursor: pointer;
}
.de-chip:hover { color: #f4eedd; border-color: #6ab896; }


/* ── Toast ──────────────────────────────────────────────── */
.m-toast {
  position: fixed;
  bottom: 2rem; left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: #14201a;
  border: 1px solid #6ab896;
  color: #f4eedd;
  padding: .7rem 1.2rem;
  border-radius: 10px;
  font-size: .9rem;
  box-shadow: 0 12px 28px rgba(0,0,0,0.45);
  z-index: 10002;
  transition: transform .35s ease;
  max-width: 90%;
  text-align: center;
}
.m-toast.show { transform: translateX(-50%) translateY(0); }


/* ── Mobile tweaks ────────────────────────────────────── */
@media (max-width: 640px) {
  .m-timeline { padding: .6rem; }
  .m-day { padding: 1.6rem 0 2rem; }
  .m-photos { grid-template-columns: repeat(auto-fill, minmax(95px, 1fr)); }
  .lb-meta { grid-template-columns: 1fr; }
  .lb-actions { justify-content: flex-start; }
}
