*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:       #f7f3ec;
  --text:     #1e1c1a;
  --text-2:   #5a554e;
  --text-3:   #9a9590;
  --accent:   #2a5c8f;
  --border:   #ddd8cf;
  --card-bg:  #fff;
}

html {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
}

body {
  min-height: 100vh;
}

.page {
  max-width: 620px;
  margin: 0 auto;
  padding: 60px 24px 80px;
}

/* ── Header ── */

header {
  margin-bottom: 28px;
}

h1 {
  font-family: 'Lora', Georgia, serif;
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: -0.5px;
  color: var(--text);
}

.tagline {
  color: var(--text-2);
  margin-top: 4px;
  font-size: 0.95rem;
}

/* ── Dividers ── */

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 36px 0;
}

/* ── Sections ── */

section {
  margin-bottom: 36px;
}

h2 {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 14px;
  color: var(--text);
}

p {
  color: var(--text-2);
}

.muted {
  color: var(--text-3);
  font-style: italic;
}

/* ── Crew list ── */

.crew {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.crew li {
  color: var(--text-2);
}

.crew .name {
  font-weight: 500;
  color: var(--text);
}

/* ── Adventure cards ── */

.card-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.card:not(.card-static):hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.card-static {
  cursor: default;
}

.card-img {
  width: 90px;
  height: 90px;
  flex-shrink: 0;
  border-radius: 6px;
  object-fit: cover;
  background: var(--border);
}

.card-img-placeholder {
  background: var(--border);
  border-radius: 6px;
}

.card-body {
  flex: 1;
  min-width: 0;
}

.card-meta {
  font-size: 0.78rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.card-title {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
}

.card-desc {
  font-size: 0.88rem;
  color: var(--text-2);
  line-height: 1.5;
}

/* ── Footer ── */

footer {
  margin-top: 60px;
  color: var(--text-3);
  font-size: 0.82rem;
}

/* ── PDF Modal ── */

.pdf-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 100;
  opacity: 0;
  transition: opacity 0.2s;
}

.pdf-backdrop.open {
  display: block;
  opacity: 1;
}

.pdf-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 101;
  flex-direction: column;
  background: var(--bg);
  transform: translateY(12px);
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
}

.pdf-modal.open {
  display: flex;
  opacity: 1;
  transform: translateY(0);
  position: fixed; /* ensure relative context for nav */
}

.pdf-modal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}

.pdf-modal-title {
  font-family: 'Lora', Georgia, serif;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdf-modal-nav {
  display: none;
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  align-items: center;
  gap: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
  overflow: hidden;
  z-index: 10;
}

.pdf-modal.open .pdf-modal-nav {
  display: flex;
}

.pdf-nav-btn {
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
  padding: 4px 10px;
  transition: background 0.15s, color 0.15s;
}

.pdf-nav-btn:hover:not(:disabled) {
  background: var(--border);
  color: var(--text);
}

.pdf-nav-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.pdf-page-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
  color: var(--text-2);
  padding: 0 8px;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.pdf-page-input {
  width: 1ch;
  min-width: 1ch;
  text-align: center;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.82rem;
  font-family: inherit;
  padding: 0;
  -moz-appearance: textfield;
}

.pdf-page-input:focus {
  outline: none;
}

.pdf-page-input::-webkit-outer-spin-button,
.pdf-page-input::-webkit-inner-spin-button { -webkit-appearance: none; }

.pdf-page-total {
  color: var(--text-3);
  white-space: nowrap;
}

.pdf-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-3);
  cursor: pointer;
  padding: 4px 8px;
  margin-left: 8px;
  border-radius: 4px;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
}

.pdf-modal-close:hover {
  color: var(--text);
  background: var(--border);
}

.pdf-modal-pages {
  flex: 1;
  overflow-y: auto;
  background: #e8e8e8;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 24px 90px;
}

.pdf-page-canvas {
  display: block;
  max-width: 100%;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  border-radius: 2px;
}

.pdf-loading {
  color: var(--text-3);
  font-size: 0.9rem;
  margin-top: 40px;
}

/* ── Mobile ── */

@media (max-width: 480px) {
  .page {
    padding: 40px 20px 60px;
  }

  h1 {
    font-size: 1.7rem;
  }
}
