/* ============================================================
   Content pages — every card is its own page now.
   Same Metro DNA as the start screen (start.css supplies the
   colour variables and the .bg-* classes).
   ============================================================ */

body.doc {
  background: #1B1B1B;
  color: #fff;
  min-height: 100dvh;
  padding: 0 0 96px;
  display: flex;
  flex-direction: column;
  perspective: none;
  overflow-x: hidden;
}

.doc-accent { position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 5; }

/* ---------- header ---------- */
.doc-head {
  position: relative;
  padding: calc(env(safe-area-inset-top, 0px) + 26px) 24px 18px;
  flex-shrink: 0;
}
@media (min-width: 720px) { .doc-head { padding: 44px 56px 22px; max-width: 900px; width: 100%; align-self: center; } }

.doc-back {
  display: inline-flex; align-items: center; gap: 8px;
  color: rgba(255,255,255,0.7); text-decoration: none;
  font-size: 12px; letter-spacing: 1.6px; text-transform: uppercase;
  padding: 8px 12px 8px 0;
  transition: color 0.15s;
}
.doc-back:hover { color: #fff; }
.doc-back svg { width: 16px; height: 16px; fill: currentColor; }

.doc-titles { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.doc-eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: 2.5px; opacity: 0.55; }
.doc-title {
  font-size: 38px; font-weight: 200; letter-spacing: -0.8px; line-height: 1.05;
  overflow-wrap: break-word;
}
@media (min-width: 720px) { .doc-title { font-size: 56px; } }

.doc-icon {
  position: absolute; top: calc(env(safe-area-inset-top, 0px) + 22px); right: 20px;
  width: 56px; height: 56px; opacity: 0.14; pointer-events: none;
}
.doc-icon svg { width: 100%; height: 100%; fill: #fff; }
@media (min-width: 720px) { .doc-icon { width: 78px; height: 78px; right: 56px; top: 40px; } }

/* ---------- body ---------- */
.doc-body {
  padding: 6px 24px 40px;
  font-size: 16px; line-height: 1.65; font-weight: 300;
  flex: 1;
}
@media (min-width: 720px) {
  .doc-body { padding: 10px 56px 56px; max-width: 900px; width: 100%; align-self: center; font-size: 17px; }
}

.doc-intro > *:first-child { margin-top: 0; }
.doc-body p { margin-bottom: 14px; opacity: 0.9; }
.doc-body h2 { font-size: 24px; font-weight: 300; margin: 28px 0 12px; }
.doc-body h3 { font-size: 20px; font-weight: 400; margin: 26px 0 12px; letter-spacing: -0.2px; }
.doc-body h4 { font-size: 15px; font-weight: 600; margin: 20px 0 8px; letter-spacing: 0.4px; text-transform: uppercase; opacity: 0.75; }
.doc-body a { color: #4aa8ff; }
.doc-body strong { font-weight: 600; }
.doc-body hr { border: none; border-top: 1px solid rgba(255,255,255,0.12); margin: 24px 0; }
.doc-body img { max-width: 100%; height: auto; }
.doc-body table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 15px; }
.doc-body th, .doc-body td { text-align: left; padding: 10px 8px; border-bottom: 1px solid rgba(255,255,255,0.1); }

.doc-body ul:not(.doc-list) { padding-left: 20px; margin-bottom: 16px; }
.doc-body ul:not(.doc-list) li { margin-bottom: 6px; opacity: 0.9; }
.doc-body ol { padding-left: 20px; margin-bottom: 16px; }

/* rows of items — each row is a link to its own page */
ul.doc-list { list-style: none; padding: 0; margin: 8px 0 24px; }
ul.doc-list li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
ul.doc-list li:last-child { border-bottom: none; }
ul.doc-list li > a {
  flex: 1; min-width: 0;
  padding: 14px 0; color: #fff; text-decoration: none;
  transition: color 0.15s;
}
ul.doc-list li > a:hover { color: #4aa8ff; }
ul.doc-list li > span { padding: 14px 0; opacity: 0.55; font-size: 14px; white-space: nowrap; }
ul.doc-list .li-sub { opacity: 0.5; }
ul.doc-list .li-go { opacity: 0.4; }

.doc-empty { opacity: 0.5; }

/* gallery reuses the start-screen grid */
.doc-body .gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 12px 0 24px; }
.doc-body .gallery .ph { aspect-ratio: 1; background-size: cover; background-position: center; }
@media (min-width: 720px) { .doc-body .gallery { grid-template-columns: repeat(4, 1fr); } }

/* ---------- pieces used by item / place pages ---------- */
.doc-photo { width: 100%; max-height: 46vh; object-fit: cover; display: block; margin: 0 0 20px; }

.doc-facts { margin: 0 0 24px; }
.doc-facts > div { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
.doc-facts dt { font-size: 11px; text-transform: uppercase; letter-spacing: 1.8px; opacity: 0.45; min-width: 120px; padding-top: 3px; }
.doc-facts dd { flex: 1; min-width: 200px; }

.doc-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 8px; }

.doc-cta {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 4px 0 20px; padding: 15px 22px;
  background: #0078D4; color: #fff; text-decoration: none;
  font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: 1.5px;
  border: none; cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
}
.doc-actions .doc-cta { margin: 0; }
.doc-cta:hover { filter: brightness(1.15); }
.doc-cta:active { transform: scale(0.98); }
.doc-cta svg { width: 14px; height: 14px; fill: currentColor; }
.doc-cta.secondary { background: transparent; border: 2px solid rgba(255,255,255,0.35); }
.doc-cta.secondary:hover { border-color: #fff; }

.place-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px 7px 9px; margin-bottom: 18px;
  background: color-mix(in srgb, var(--chip) 22%, transparent);
  border: 1.5px solid var(--chip);
  font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase;
}
.place-chip-icon { font-size: 15px; }

/* ---------- sticky footer bar ---------- */
.doc-foot {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; gap: 8px;
  padding: 10px 16px calc(env(safe-area-inset-bottom, 0px) + 10px);
  background: rgba(18,18,18,0.94);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255,255,255,0.1);
}
.doc-btn {
  flex: 1; text-align: center; padding: 13px 10px;
  background: transparent; border: 1.5px solid rgba(255,255,255,0.28);
  color: #fff; text-decoration: none; font-family: inherit;
  font-size: 12px; font-weight: 500; letter-spacing: 1.4px; text-transform: uppercase;
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.doc-btn:hover { border-color: #fff; background: rgba(255,255,255,0.06); }
.doc-btn.copied { border-color: #7BB661; color: #7BB661; }
@media (min-width: 720px) {
  .doc-foot { justify-content: center; padding: 12px 56px calc(env(safe-area-inset-bottom, 0px) + 12px); }
  .doc-btn { flex: 0 0 auto; min-width: 200px; }
}

/* ---------- full-screen embed page ---------- */
.embed-page { margin: 0; background: #000; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.embed-page iframe { flex: 1; width: 100%; border: none; background: #fff; display: block; }

.embed-bar {
  flex-shrink: 0; display: flex; align-items: center; gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 8px) 14px 8px;
  color: #fff; font-family: 'Segoe UI', system-ui, sans-serif;
}
.embed-back {
  display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
  padding: 8px 14px 8px 10px; color: #fff; text-decoration: none;
  border: 1.5px solid rgba(255,255,255,0.55); border-radius: 40px;
  font-size: 11px; font-weight: 600; letter-spacing: 1.3px; text-transform: uppercase;
  -webkit-tap-highlight-color: transparent;
}
.embed-back:hover { border-color: #fff; background: rgba(255,255,255,0.14); }
.embed-back svg { width: 14px; height: 14px; fill: currentColor; }
.embed-title {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 13px; font-weight: 600; letter-spacing: 0.4px;
}
.embed-open {
  flex-shrink: 0; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  color: #fff; text-decoration: none; font-size: 15px;
  border: 1.5px solid rgba(255,255,255,0.35); border-radius: 50%;
}
.embed-open:hover { border-color: #fff; background: rgba(255,255,255,0.14); }

.float-back {
  position: fixed; z-index: 900;
  top: calc(env(safe-area-inset-top, 0px) + 12px); left: calc(env(safe-area-inset-left, 0px) + 12px);
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 16px 10px 12px;
  background: #1B1B1B; color: #fff; text-decoration: none;
  border: 2px solid rgba(255,255,255,0.9); border-radius: 40px;
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 12px; font-weight: 600; letter-spacing: 1.4px; text-transform: uppercase;
  box-shadow: 0 4px 16px rgba(0,0,0,0.45);
  -webkit-tap-highlight-color: transparent;
}
.float-back:hover { background: #000; }
.float-back svg { width: 15px; height: 15px; fill: currentColor; }

/* folded list of individual entries on text-first pages */
.doc-more { margin: 24px 0 8px; border-top: 1px solid rgba(255,255,255,0.12); }
.doc-more > summary {
  cursor: pointer; padding: 16px 0 12px; list-style: none;
  font-size: 11px; letter-spacing: 1.8px; text-transform: uppercase; opacity: 0.6;
}
.doc-more > summary::-webkit-details-marker { display: none; }
.doc-more > summary::after { content: ' ▾'; }
.doc-more[open] > summary::after { content: ' ▴'; }
.doc-more > summary:hover { opacity: 1; }

/* CTAs sit inside .doc-body, so beat the generic link colour */
.doc-body a.doc-cta, .doc-body a.doc-cta:visited { color: #fff; }
.doc-body a.doc-cta.secondary { color: #fff; }
