:root {
  --ink: #1d1714;
  --muted: #6e625c;
  --paper: #f7f1ea;
  --peach: #e4bfad;
  --sun: #e46f21;
  --gold: #f4a65f;
  --blue: #2e6f95;
  --green: #497b62;
  --line: #d8ccc2;
  --danger: #b4372f;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
textarea,
select {
  font: inherit;
}

.flash {
  position: fixed;
  z-index: 20;
  top: 16px;
  left: 50%;
  width: min(92vw, 520px);
  padding: 12px 16px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 12px 36px rgba(29, 23, 20, .12);
  transform: translateX(-50%);
}

.flash p {
  margin: 0;
}

.flash-success {
  border-color: var(--green);
}

.flash-error {
  border-color: var(--danger);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 1px 0 rgba(29, 23, 20, .04);
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.button:hover {
  border-color: #bfb2a8;
  box-shadow: 0 8px 20px rgba(29, 23, 20, .08);
  transform: translateY(-1px);
}

.button.primary {
  border-color: var(--sun);
  background: var(--sun);
  color: #fff;
  box-shadow: 0 10px 22px rgba(228, 111, 33, .18);
}

.button.primary:hover {
  border-color: #cf5e16;
  background: #cf5e16;
}

.button.danger {
  border-color: #f1c7c3;
  color: var(--danger);
}

.eyebrow {
  margin: 0 0 8px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--blue);
}

.empty {
  color: var(--muted);
}

.admin-page {
  background: #f5f7f4;
}

.admin-header {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 0 max(20px, calc((100vw - 1120px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(12px);
}

.brand {
  font-weight: 900;
}

.admin-header nav {
  display: flex;
  gap: 14px;
  font-weight: 700;
}

.admin-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 32px auto;
}

.admin-shell.narrow {
  width: min(760px, calc(100% - 32px));
}

.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.page-heading h1,
.auth-panel h1,
.code-panel h1 {
  margin: 0;
}

.admin-list {
  display: grid;
  gap: 12px;
}

.admin-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-card h2 {
  margin: 0 0 4px;
  font-size: 1.1rem;
}

.admin-card p {
  margin: 0;
  color: var(--muted);
}

.admin-code {
  margin-top: 8px;
}

.admin-code strong {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  letter-spacing: .08em;
}

.admin-code.missing {
  color: var(--danger);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.actions form {
  margin: 0;
}

.admin-form {
  display: grid;
  gap: 18px;
  padding: clamp(20px, 4vw, 30px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(29, 23, 20, .06);
}

.admin-form div {
  display: grid;
  gap: 8px;
}

.admin-form label {
  font-weight: 800;
  color: #342c27;
}

.admin-form input,
.admin-form textarea,
.admin-form select {
  width: 100%;
  min-height: 44px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fcfbf8;
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.admin-form textarea {
  resize: vertical;
}

.admin-form input:focus,
.admin-form textarea:focus,
.admin-form select:focus {
  outline: none;
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(46, 111, 149, .12);
}

.admin-form input[type="file"] {
  padding: 9px;
  background: #fff;
}

.admin-form button,
.admin-form input[type="submit"] {
  justify-self: start;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid var(--sun);
  border-radius: 8px;
  background: var(--sun);
  color: #fff;
  cursor: pointer;
  font-weight: 850;
  box-shadow: 0 10px 22px rgba(228, 111, 33, .18);
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.admin-form button:hover,
.admin-form input[type="submit"]:hover {
  border-color: #cf5e16;
  background: #cf5e16;
  box-shadow: 0 14px 28px rgba(228, 111, 33, .22);
  transform: translateY(-1px);
}

.admin-form button:focus-visible,
.admin-form input[type="submit"]:focus-visible,
.button:focus-visible {
  outline: 3px solid rgba(46, 111, 149, .28);
  outline-offset: 2px;
}

.auth-panel,
.code-panel {
  width: min(520px, calc(100% - 32px));
  margin: 12vh auto;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.login-form {
  margin-top: 18px;
  padding: 0;
  border: 0;
  box-shadow: none;
}

.form-error {
  padding: 10px 12px;
  border: 1px solid #f1c7c3;
  border-radius: 8px;
  background: #fff5f4;
  color: var(--danger);
  font-weight: 700;
}

.access-code {
  display: inline-flex;
  padding: 12px 18px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: clamp(2rem, 12vw, 4rem);
  font-weight: 900;
  letter-spacing: .1em;
}

.upload-panel {
  margin-bottom: 24px;
}

.upload-preview,
.photo-admin-grid,
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.upload-preview img,
.photo-admin-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
}

.photo-admin-card {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.photo-admin-card input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
}

.badge {
  position: absolute;
  top: 18px;
  left: 18px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-size: .8rem;
  font-weight: 800;
}

.public-page {
  background: var(--peach);
}

.public-home,
.access-shell,
.timeline-shell {
  width: min(1000px, calc(100% - 32px));
  margin: 0 auto;
}

.public-home {
  padding: 18vh 0;
  text-align: center;
}

.public-home h1,
.timeline-hero h1 {
  margin: 0;
  max-width: 900px;
  margin-inline: auto;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(3rem, 11vw, 6.8rem);
  font-weight: 950;
  line-height: .92;
}

.home-links {
  display: grid;
  gap: 10px;
  width: min(440px, 100%);
  margin: 32px auto 0;
}

.home-links a {
  padding: 14px;
  border-radius: 8px;
  background: #fff;
  font-weight: 800;
}

.access-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
}

.access-form {
  display: grid;
  gap: 16px;
  width: min(440px, 100%);
  padding: 24px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .88);
}

.access-form h1 {
  margin: 0;
}

.access-form input {
  min-height: 52px;
  padding: 0 14px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  font-size: 1.25rem;
  text-transform: uppercase;
}

.timeline-shell {
  padding: 72px 0 96px;
}

.timeline-hero {
  margin-bottom: 64px;
  text-align: center;
}

.travel-description {
  max-width: 640px;
  margin: 28px auto 0;
  padding-top: 18px;
  border-top: 1px solid rgba(29, 23, 20, .24);
  color: #4f4640;
  font-size: clamp(1rem, 2.4vw, 1.18rem);
  line-height: 1.65;
}

.timeline {
  position: relative;
  display: grid;
  gap: 48px;
}

.timeline::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  background: var(--sun);
  content: "";
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 96px;
  align-items: center;
}

.timeline-item:nth-child(even) .timeline-copy {
  grid-column: 2;
}

.timeline-item:nth-child(even) .timeline-image {
  grid-column: 1;
  grid-row: 1;
}

.timeline-dot {
  position: absolute;
  left: 50%;
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 50%;
  background: var(--sun);
  box-shadow: 0 0 0 6px rgba(228, 111, 33, .16);
  transform: translateX(-50%);
}

.timeline-copy h2 {
  margin: 8px 0;
  font-size: 1.25rem;
}

.timeline-copy p {
  margin: 6px 0;
}

.location,
.photo-count,
.timeline-copy time {
  color: var(--muted);
  font-weight: 700;
}

.timeline-image {
  overflow: hidden;
  border-radius: 28px;
  background: #f1d8cb;
  box-shadow: 0 18px 38px rgba(29, 23, 20, .12);
}

.timeline-image img,
.timeline-image span {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.timeline-image span {
  display: grid;
  place-items: center;
  padding: 16px;
  color: var(--muted);
  font-weight: 800;
}

.detail-page {
  background: #f1eee9;
}

.step-detail {
  width: min(920px, 100%);
  margin: 0 auto;
  background: #f1eee9;
}

.back-link {
  display: inline-flex;
  margin: 18px;
  font-weight: 800;
}

.detail-hero img {
  width: 100%;
  max-height: 52vh;
  object-fit: cover;
}

.detail-title-band {
  padding: clamp(28px, 7vw, 64px);
  background: var(--gold);
}

.detail-title-band p,
.detail-title-band h1,
.detail-title-band time {
  margin: 0;
}

.detail-title-band h1 {
  margin: 8px 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(2.8rem, 10vw, 5.8rem);
  font-weight: 950;
  line-height: .94;
}

.detail-title-band time {
  font-size: clamp(1.4rem, 5vw, 2.5rem);
}

.detail-content,
.gallery,
.step-nav {
  padding: clamp(24px, 6vw, 56px);
}

.detail-content h2,
.gallery h2 {
  margin: 0 0 18px;
  font-size: clamp(1.7rem, 5vw, 2.4rem);
}

.rich-text {
  font-size: 1.2rem;
  line-height: 1.65;
}

.gallery-button {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.gallery-button img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.step-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-weight: 900;
}

.lightbox {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, .82);
}

.lightbox figure {
  margin: 0;
  color: #fff;
  text-align: center;
}

.lightbox img {
  max-height: 82vh;
  width: auto;
}

.lightbox figcaption {
  margin-top: 12px;
  font-weight: 700;
}

.lightbox-count {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, .72);
  font-size: .95rem;
}

.lightbox-close {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  font-size: 1.8rem;
  cursor: pointer;
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  color: var(--ink);
  cursor: pointer;
  font-size: 2.6rem;
  line-height: 1;
  transform: translateY(-50%);
}

.lightbox-prev {
  left: 18px;
}

.lightbox-next {
  right: 18px;
}

@media (max-width: 760px) {
  .admin-header,
  .page-heading,
  .admin-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .timeline::before {
    left: 11px;
  }

  .timeline-item,
  .timeline-item:nth-child(even) {
    grid-template-columns: 1fr;
    gap: 18px;
    padding-left: 42px;
  }

  .timeline-item:nth-child(even) .timeline-copy,
  .timeline-item:nth-child(even) .timeline-image {
    grid-column: auto;
    grid-row: auto;
  }

  .timeline-dot {
    left: 11px;
  }

  .timeline-image {
    border-radius: 20px;
  }

  .step-nav {
    flex-direction: column;
  }

  .lightbox {
    padding: 56px 14px;
  }

  .lightbox img {
    max-height: 72vh;
  }

  .lightbox-nav {
    top: auto;
    bottom: 18px;
    width: 48px;
    height: 48px;
    transform: none;
  }
}
