/**
 * WO-394 / WO-394A / WO-394D — Evergreen Journal Experience (presentation only)
 * Extends Experience Layer tokens + location-page gear styles.
 * WO-394A: FROM THE MAP TO YOU journal identity stamp.
 * WO-394D: Atlas-only map bridge (preview card + pin deep link; no OSM/Google embeds).
 * Not a second design system. Fail-closed sections stay omitted in HTML.
 */

@import url("../../assets/experience/experience-tokens.css");
@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&family=Outfit:wght@400;500;600;700&display=swap");

:root {
  --ej-parchment: #f3ebe0;
  --ej-parchment-deep: #e8dccb;
  --ej-canvas: var(--exp-canvas, #f8f5f0);
  --ej-ink: var(--exp-navy, #061a33);
  --ej-ink-soft: #243447;
  --ej-muted: #5c6570;
  --ej-red: var(--exp-red, #b91c1c);
  --ej-gold: var(--exp-gold, #f5b301);
  --ej-sunset: #c9852a;
  --ej-wood: #6b5344;
  --ej-leather: #4a3428;
  --ej-frame: #d4c4ae;
  --ej-shadow: 0 10px 28px rgba(36, 28, 20, 0.1);
  --ej-shadow-soft: 0 4px 14px rgba(36, 28, 20, 0.07);
  --ej-radius: 0.55rem;
  --ej-font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", serif;
  --ej-font-body: "Outfit", "Segoe UI", sans-serif;
  --ej-measure: 42rem;
  --ej-page-max: 48rem;
}

body.loc-journal {
  margin: 0;
  color: var(--ej-ink);
  font-family: var(--ej-font-body);
  line-height: 1.55;
  background:
    radial-gradient(900px 420px at 8% -8%, rgba(201, 133, 42, 0.08), transparent 55%),
    radial-gradient(700px 380px at 92% 0%, rgba(6, 26, 51, 0.05), transparent 50%),
    linear-gradient(180deg, var(--ej-canvas), var(--ej-parchment) 48%, var(--ej-canvas));
}

.ej-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.65rem 1rem;
  background: var(--ej-ink);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}
.ej-skip:focus {
  left: 0.75rem;
  top: 0.75rem;
}

.loc-journal a:focus-visible,
.loc-journal button:focus-visible {
  outline: 3px solid var(--ej-gold);
  outline-offset: 2px;
}

/* —— Chrome / nav —— */
.ej-chrome {
  background: var(--ej-ink);
  color: #f8fafc;
  border-bottom: 3px solid var(--ej-red);
}
.ej-chrome__inner {
  max-width: 56rem;
  margin: 0 auto;
  padding: 0.85rem 1.15rem 1rem;
}
.ej-chrome .site-nav-desktop a,
.ej-chrome a {
  color: var(--ej-gold);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.88rem;
}
.ej-chrome a:hover {
  color: #fff;
}
.ej-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  align-items: center;
  font-size: 0.8rem;
  margin: 0 0 0.65rem;
  color: rgba(248, 250, 252, 0.75);
}
.ej-breadcrumb a {
  color: var(--ej-gold);
}
.ej-breadcrumb [aria-current="page"] {
  color: #fff;
  font-weight: 600;
}

/* —— Journal page shell —— */
.ej-main {
  max-width: var(--ej-page-max);
  margin: 0 auto;
  padding: 1.25rem 1rem 2.5rem;
}

.ej-spread {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.96), rgba(243, 235, 224, 0.98));
  border: 1px solid var(--ej-frame);
  border-radius: 0.35rem 0.85rem 0.85rem 0.35rem;
  box-shadow: var(--ej-shadow);
  padding: 1.35rem 1.15rem 1.75rem;
}
.ej-spread::before {
  content: "";
  position: absolute;
  inset: 0.45rem auto 0.45rem 0;
  width: 0.35rem;
  border-radius: 0.15rem;
  background: linear-gradient(180deg, var(--ej-leather), var(--ej-wood));
  opacity: 0.55;
  pointer-events: none;
}
@media (min-width: 720px) {
  .ej-spread {
    padding: 1.85rem 1.85rem 2.15rem 2.1rem;
  }
}

.ej-corner {
  position: absolute;
  width: 0.7rem;
  height: 0.7rem;
  border: 1.5px solid rgba(107, 83, 68, 0.35);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.55;
}
.ej-corner--tl { top: 0.55rem; left: 0.55rem; }
.ej-corner--tr { top: 0.55rem; right: 0.55rem; }
.ej-corner--bl { bottom: 0.55rem; left: 0.55rem; }
.ej-corner--br { bottom: 0.55rem; right: 0.55rem; }

.ej-section {
  margin: 0 0 1.75rem;
  padding: 0;
  border: 0;
  background: transparent;
}
.ej-section:last-child {
  margin-bottom: 0;
}

.ej-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ej-sunset);
}

/* WO-394A — FROM THE MAP TO YOU (warm journal stamp / section mark) */
.ej-stamp {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.55rem;
  padding: 0.28rem 0.65rem 0.28rem 0.45rem;
  max-width: 100%;
  border: 1.5px solid rgba(185, 28, 28, 0.45);
  border-radius: 0.2rem;
  background:
    linear-gradient(135deg, rgba(255, 252, 247, 0.55), rgba(243, 235, 224, 0.35));
  box-shadow: inset 0 0 0 1px rgba(201, 133, 42, 0.12);
  color: var(--ej-red);
  transform: rotate(-0.6deg);
}
.ej-stamp__mark {
  flex: 0 0 auto;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  border: 1.5px solid rgba(185, 28, 28, 0.55);
  background: radial-gradient(circle at 35% 30%, rgba(245, 179, 1, 0.55), transparent 55%),
    rgba(185, 28, 28, 0.12);
}
.ej-stamp__text {
  font-family: var(--ej-font-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  line-height: 1.2;
  color: var(--ej-red);
}
@media (prefers-reduced-motion: reduce) {
  .ej-stamp {
    transform: none;
  }
}

.ej-title {
  margin: 0 0 0.65rem;
  font-family: var(--ej-font-display);
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  font-weight: 700;
  color: var(--ej-ink);
  line-height: 1.25;
}
.ej-prose {
  margin: 0;
  max-width: var(--ej-measure);
  color: var(--ej-ink-soft);
  font-size: 1rem;
  line-height: 1.65;
}
.ej-prose + .ej-prose {
  margin-top: 0.75rem;
}
.ej-meta {
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
  color: var(--ej-muted);
}

/* —— Hero title plate —— */
.ej-hero {
  margin-bottom: 1.85rem;
  padding-bottom: 1.35rem;
  border-bottom: 1px solid rgba(107, 83, 68, 0.22);
}
.ej-hero__plate {
  position: relative;
  padding: 0.35rem 0 0.85rem;
}
.ej-hero__name {
  margin: 0;
  font-family: var(--ej-font-display);
  font-size: clamp(1.75rem, 5vw, 2.45rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--ej-ink);
  letter-spacing: -0.01em;
}
.ej-hero__where {
  margin: 0.45rem 0 0;
  font-size: 1rem;
  color: var(--ej-muted);
  font-weight: 500;
}
.ej-hero__intro {
  margin: 0.9rem 0 0;
  max-width: var(--ej-measure);
  font-size: 1.05rem;
  color: var(--ej-ink-soft);
  line-height: 1.55;
}
.ej-hero__media {
  margin: 1.1rem 0 0;
}
.ej-hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
}
.ej-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2.6rem;
  padding: 0.55rem 1rem;
  border-radius: 0.4rem;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  border: 2px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.ej-btn--primary {
  background: var(--ej-gold);
  color: var(--ej-ink);
  border-color: #d4a008;
}
.ej-btn--primary:hover {
  background: #ffc933;
  color: var(--ej-ink);
}
.ej-btn--secondary {
  background: transparent;
  color: var(--ej-ink);
  border-color: rgba(6, 26, 51, 0.35);
}
.ej-btn--secondary:hover {
  border-color: var(--ej-ink);
  background: rgba(255, 255, 255, 0.45);
}

/* —— Photo mounts —— */
.ej-mounts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 0.85rem;
}
@media (min-width: 640px) {
  .ej-mounts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.ej-mount {
  margin: 0;
  padding: 0.55rem 0.55rem 0.75rem;
  background: #fffdf8;
  border: 1px solid var(--ej-frame);
  box-shadow: var(--ej-shadow-soft);
  border-radius: 0.2rem;
  transform: rotate(0deg);
}
.ej-mount:nth-child(even) {
  transform: rotate(0.4deg);
}
.ej-mount:nth-child(3n) {
  transform: rotate(-0.35deg);
}
.ej-mount__frame {
  display: block;
  overflow: hidden;
  background: #1e293b;
  aspect-ratio: 16 / 9;
}
.ej-mount__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ej-mount figcaption {
  display: none; /* no fake captions */
}

@media (prefers-reduced-motion: reduce) {
  .ej-mount,
  .ej-mount:nth-child(even),
  .ej-mount:nth-child(3n) {
    transform: none;
  }
  .ej-btn {
    transition: none;
  }
}

/* —— Know before / facts —— */
.ej-facts {
  list-style: none;
  margin: 0.65rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.ej-facts li {
  display: grid;
  grid-template-columns: minmax(5.5rem, 7.5rem) 1fr;
  gap: 0.5rem 0.85rem;
  padding: 0.55rem 0.65rem;
  background: rgba(255, 253, 248, 0.7);
  border: 1px solid rgba(212, 196, 174, 0.7);
  border-radius: var(--ej-radius);
  font-size: 0.92rem;
}
.ej-facts dt,
.ej-facts .ej-fact-label {
  font-weight: 700;
  color: var(--ej-wood);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.ej-facts a {
  color: #1e3a8a;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* —— Atlas map bridge (WO-394D) — no competing public map embeds —— */
.ej-atlas-pin {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: start;
  margin-top: 0.85rem;
  padding: 1.1rem 1.15rem;
  text-decoration: none;
  color: inherit;
  background:
    linear-gradient(165deg, rgba(243, 235, 224, 0.98), rgba(232, 220, 203, 0.95)),
    linear-gradient(145deg, #5c4033, #3d2a22);
  border: 1px solid var(--ej-frame);
  border-radius: var(--ej-radius);
  box-shadow: var(--ej-shadow-soft);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.ej-atlas-pin:hover {
  transform: translateY(-2px);
  box-shadow: var(--ej-shadow);
}
.ej-atlas-pin:focus-visible {
  outline: 3px solid var(--ej-gold);
  outline-offset: 3px;
}
.ej-atlas-pin__mark {
  width: 2.6rem;
  height: 2.6rem;
  margin-top: 0.15rem;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background:
    radial-gradient(circle at 35% 35%, #fff7e6 0 28%, transparent 30%),
    linear-gradient(145deg, var(--ej-red), #7f1d1d);
  box-shadow: inset 0 0 0 2px rgba(255, 247, 230, 0.35);
  flex-shrink: 0;
}
.ej-atlas-pin__body {
  min-width: 0;
}
.ej-atlas-pin__brand {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ej-wood);
}
.ej-atlas-pin__label {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  color: var(--ej-muted);
}
.ej-atlas-pin__name {
  margin: 0.35rem 0 0;
  font-family: var(--ej-font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ej-ink);
  line-height: 1.25;
}
.ej-atlas-pin__where {
  margin: 0.35rem 0 0;
  font-size: 0.92rem;
  color: var(--ej-ink-soft);
}
.ej-atlas-pin__cta {
  display: inline-block;
  margin-top: 0.85rem;
  padding: 0.45rem 0.85rem;
  border-radius: 0.35rem;
  background: var(--ej-ink);
  color: #f8f5f0;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.35;
}
.ej-atlas-pin:hover .ej-atlas-pin__cta {
  background: #0b2748;
}
/* WO-394E — secondary supporting copy beneath Atlas CTA */
.ej-atlas-pin__support {
  margin: 0.65rem 0 0;
  max-width: 36rem;
  font-size: 0.84rem;
  line-height: 1.45;
  font-weight: 500;
  color: var(--ej-ink-soft);
}
.ej-map-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin-top: 0.75rem;
  font-size: 0.9rem;
}
.ej-map-actions a {
  color: #1e3a8a;
  font-weight: 700;
}
@media (max-width: 520px) {
  .ej-atlas-pin {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }
  .ej-atlas-pin__mark {
    width: 2.1rem;
    height: 2.1rem;
  }
}

/* —— Video stories —— */
.ej-video-primary {
  margin-top: 0.75rem;
  position: relative;
  overflow: hidden;
  border-radius: 0.35rem;
  background: #0f172a;
  box-shadow: var(--ej-shadow-soft);
  aspect-ratio: 16 / 9;
}
.ej-video-primary iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.ej-video-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}
@media (min-width: 640px) {
  .ej-video-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.ej-video-entry {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.75rem;
  align-items: center;
  padding: 0.45rem;
  background: #fffdf8;
  border: 1px solid var(--ej-frame);
  border-radius: var(--ej-radius);
  text-decoration: none;
  color: inherit;
  min-height: 4.5rem;
}
.ej-video-entry:hover {
  border-color: var(--ej-sunset);
}
.ej-video-entry__thumb {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 0.2rem;
  background: #1e293b;
}
.ej-video-entry__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ej-video-entry__label {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ej-ink);
  line-height: 1.3;
}
.ej-video-entry__hint {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  color: var(--ej-muted);
}

/* —— Gear (journal chrome around WO-350 cards) —— */
.loc-journal .loc-gear-section {
  margin: 0 0 1.75rem;
  padding: 0.85rem 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.loc-journal .loc-gear-section h2 {
  font-family: var(--ej-font-display);
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  color: var(--ej-ink);
}
.loc-journal .loc-gear-card {
  background: #fffdf8;
  border-color: var(--ej-frame);
  box-shadow: var(--ej-shadow-soft);
}
.loc-journal .loc-gear-btn {
  background: var(--ej-sunset);
}
.loc-journal .loc-gear-btn-secondary {
  background: var(--ej-ink);
}

/* —— Nearby / continue —— */
.ej-nearby {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}
.ej-nearby a {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  padding: 0.7rem 0.85rem;
  background: #fffdf8;
  border: 1px solid var(--ej-frame);
  border-radius: var(--ej-radius);
  text-decoration: none;
  color: var(--ej-ink);
  font-weight: 700;
}
.ej-nearby a:hover {
  border-color: var(--ej-sunset);
}
.ej-nearby .ej-km {
  font-weight: 500;
  color: var(--ej-muted);
  font-size: 0.85rem;
}

.ej-continue {
  margin-top: 0.5rem;
  padding: 1rem 1rem 1.1rem;
  background: var(--ej-ink);
  border: 1px solid rgba(245, 179, 1, 0.45);
  border-radius: var(--ej-radius);
  color: #f8fafc;
}
.ej-continue .ej-kicker {
  color: var(--ej-gold);
}
.ej-continue .ej-title {
  color: #fff;
}
.ej-continue .ej-prose {
  color: rgba(248, 250, 252, 0.88);
}
.ej-continue ul {
  list-style: none;
  margin: 0.85rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.85rem;
}
.ej-continue a {
  color: var(--ej-gold);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ej-continue a:hover {
  color: #fff;
}

.ej-footer {
  max-width: var(--ej-page-max);
  margin: 0 auto;
  padding: 0.5rem 1rem 2rem;
  font-size: 0.78rem;
  color: var(--ej-muted);
}
.ej-footer a {
  color: #1e3a8a;
}

/* Mobile: single-column reading — never force two-page book */
@media (max-width: 639px) {
  .ej-main {
    padding: 0.85rem 0.65rem 2rem;
  }
  .ej-spread {
    border-radius: 0.45rem;
    padding: 1.1rem 0.9rem 1.35rem;
  }
  .ej-spread::before {
    display: none;
  }
  .ej-facts li {
    grid-template-columns: 1fr;
  }
  .ej-video-entry {
    grid-template-columns: 5.5rem 1fr;
  }
  .ej-corner {
    display: none;
  }
}
