@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700;900&family=EB+Garamond:ital,wght@0,400;0,500;1,400&display=swap");

@page {
  size: letter;
  margin: 0.5in;
}

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

html,
body {
  background: #f4efe6;
}

body {
  font-family: "EB Garamond", serif;
  color: #000;
  line-height: 1.45;
  font-size: 16px;
  padding: 0 14px env(safe-area-inset-bottom);
  max-width: 720px;
  margin: 0 auto;
}

.page {
  position: relative;
  display: flex;
  flex-direction: column;
}

.masthead {
  border-top: 3px solid #000;
  border-bottom: 1px solid #000;
  padding: 10px 0 6px 50px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
}
.masthead-btn {
  appearance: none;
  -webkit-appearance: none;
  position: absolute;
  top: 12px;
  width: 40px;
  height: 40px;
  background: #fff;
  border: 1.5px solid #000;
  border-radius: 4px;
  color: #000;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.12s ease,
    color 0.12s ease,
    transform 0.06s ease;
}
.masthead-btn:active {
  transform: translateY(1px);
}
.masthead-btn:hover {
  background: #000;
  color: #fff;
}
.masthead-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}
.back-btn {
  left: 0;
}

/* Important addresses sheet */
.sheet[hidden] {
  display: none;
}
.sheet {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: stretch;
  justify-content: center;
}
.sheet-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  animation: sheet-fade 0.18s ease;
}
.sheet-card {
  position: relative;
  background: #f4efe6;
  width: 100%;
  max-width: 520px;
  margin: auto;
  max-height: 92vh;
  overflow-y: auto;
  padding: 18px 18px 24px;
  border: 2px solid #000;
  animation: sheet-rise 0.2s ease;
}
@keyframes sheet-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes sheet-rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (max-width: 520px) {
  .sheet-card {
    max-width: none;
    margin: 0;
    max-height: 100%;
    height: 100%;
    border: none;
    padding: 16px 14px env(safe-area-inset-bottom);
  }
}
.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px double #000;
  padding-bottom: 8px;
  margin-bottom: 12px;
}
.sheet-header h2 {
  font-family: "Playfair Display", serif;
  font-weight: 900;
  font-size: 18pt;
  letter-spacing: -0.3px;
}
.sheet-close {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 1.5px solid #000;
  border-radius: 4px;
  width: 36px;
  height: 36px;
  font-family: "Playfair Display", serif;
  font-size: 18pt;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  color: #000;
}
body.sheet-open {
  overflow: hidden;
}

/* Photos sheet */
.photos-sub {
  font-family: "EB Garamond", serif;
  font-style: italic;
  font-size: 10.5pt;
  margin-bottom: 10px;
  color: #444;
}
.photos-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.add-photos-btn {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #000;
  color: #fff;
  border: 1.5px solid #000;
  border-radius: 4px;
  padding: 8px 14px;
  font-family: "Playfair Display", serif;
  font-size: 11pt;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}
.add-photos-btn:active {
  transform: translateY(1px);
}
.add-photos-btn svg {
  width: 16px;
  height: 16px;
}
.photos-status {
  font-family: "EB Garamond", serif;
  font-style: italic;
  font-size: 10.5pt;
  color: #444;
  flex: 1;
  text-align: right;
  min-width: 0;
}
.pin-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
}
.pin-blurb {
  font-style: italic;
  font-size: 10.5pt;
  color: #444;
}
.pin-input {
  font-family: "Playfair Display", serif;
  font-size: 24pt;
  font-weight: 700;
  letter-spacing: 10px;
  text-align: center;
  padding: 10px 8px 10px 18px;
  border: 1.5px solid #000;
  border-radius: 4px;
  background: #fff;
  color: #000;
  width: 100%;
  outline: none;
}
.pin-input:focus {
  box-shadow: 0 0 0 2px #b30000 inset;
}
.pin-error {
  color: #b30000;
  font-size: 10.5pt;
  font-style: italic;
  min-height: 1.2em;
}
.pin-submit {
  appearance: none;
  -webkit-appearance: none;
  background: #000;
  color: #fff;
  border: 1.5px solid #000;
  border-radius: 4px;
  padding: 10px 14px;
  font-family: "Playfair Display", serif;
  font-size: 12pt;
  font-weight: 700;
  cursor: pointer;
}
.pin-submit:active {
  transform: translateY(1px);
}
.photos-divider {
  border: 0;
  border-top: 1px solid #000;
  margin: 12px 0;
}
.photos-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.photo-slot {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  aspect-ratio: 1;
  border: 1px solid #000;
  border-radius: 12px;
  overflow: hidden;
  background: #ddd;
  padding: 0;
  cursor: pointer;
  display: block;
}
.photo-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-slot.is-empty {
  background: #fff;
  border: 1.5px dashed #888;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #555;
  font-family: "EB Garamond", serif;
  font-style: italic;
  font-size: 10.5pt;
}
.photo-slot.is-empty svg {
  width: 22px;
  height: 22px;
}
.photo-slot.is-empty:active {
  transform: translateY(1px);
}
.lightbox[hidden] {
  display: none;
}
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  cursor: zoom-out;
  animation: sheet-fade 0.15s ease;
}
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.lightbox-delete {
  appearance: none;
  -webkit-appearance: none;
  position: absolute;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #b30000;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 12px 18px;
  font-family: "Playfair Display", serif;
  font-size: 11pt;
  font-weight: 700;
  cursor: pointer;
}
.lightbox-delete[hidden] {
  display: none;
}
.lightbox-delete:disabled {
  opacity: 0.6;
}
.lightbox-delete svg {
  width: 16px;
  height: 16px;
}
.masthead .title {
  font-family: "Playfair Display", serif;
  font-weight: 900;
  font-size: 26pt;
  line-height: 1.05;
  letter-spacing: -0.5px;
}
.masthead .meta {
  font-family: "Playfair Display", serif;
  font-style: italic;
  font-size: 11pt;
}
.subhead {
  border-bottom: 3px double #000;
  padding: 4px 0;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 9pt;
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* Week strip */
.week {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #f4efe6;
  display: flex;
  gap: 6px;
  padding: 10px 0;
  border-bottom: 1px solid #000;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.week::-webkit-scrollbar {
  display: none;
}
.week-day {
  appearance: none;
  -webkit-appearance: none;
  background: #fff;
  border: 1.5px solid #000;
  border-radius: 0;
  padding: 8px 6px 6px;
  font-family: "Playfair Display", serif;
  color: #000;
  cursor: pointer;
  text-align: center;
  line-height: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 64px;
  flex: 1 1 0;
  min-width: 0;
  scroll-snap-align: start;
  transition:
    background 0.12s ease,
    color 0.12s ease,
    transform 0.06s ease;
}
/* Long trips (>5 days): fixed-width pills that scroll horizontally.
   trip.js adds .is-scroll based on the day count. */
.week.is-scroll .week-day {
  flex: 0 0 calc((100% - 50px) / 5);
}
.week-day:active {
  transform: translateY(1px);
}
.week-day .wd-weekday {
  font-size: 9pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: "EB Garamond", serif;
}
.week-day .wd-num {
  font-size: 20pt;
  font-weight: 900;
}
.week-day .wd-month {
  font-size: 8pt;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: "EB Garamond", serif;
}
.week-day[aria-selected="true"] {
  background: #000;
  color: #fff;
}
.week-day.is-today {
  box-shadow: inset 0 0 0 2px #b8000020;
  border-color: #000;
}
.week-day.is-today::after {
  content: "TODAY";
  display: block;
  font-family: "EB Garamond", serif;
  font-size: 7pt;
  font-weight: 700;
  letter-spacing: 1px;
  margin-top: 2px;
}

.days {
  display: block;
  margin-top: 12px;
}
.day {
  padding: 14px 4px 18px;
}

.day-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid #000;
  padding-bottom: 6px;
  margin-bottom: 10px;
  gap: 8px;
}
.day-num {
  font-family: "Playfair Display", serif;
  font-weight: 900;
  font-size: 24pt;
  line-height: 1;
}
.day-num span {
  font-size: 10pt;
  font-weight: 400;
  font-style: italic;
  margin-left: 6px;
}
.day-date {
  font-family: "Playfair Display", serif;
  font-size: 12pt;
  font-weight: 700;
  text-align: right;
}
.day-location {
  font-family: "Playfair Display", serif;
  font-style: italic;
  font-size: 13pt;
  margin-bottom: 4px;
}
.schedule {
  list-style: none;
  font-size: 12pt;
  display: grid;
  grid-template-columns: max-content 1fr;
}
.schedule li {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
  column-gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dotted #999;
  position: relative;
  min-height: 52px;
  align-items: start;
}
.schedule li.has-map {
  padding-right: 88px;
}
.schedule li:last-child {
  border-bottom: none;
}
.schedule .time {
  font-family: "Playfair Display", serif;
  font-weight: 700;
  font-size: 11pt;
  padding-top: 1px;
  padding-right: 4px;
}
.schedule .time .ap {
  font-size: calc(11pt - 1px);
  color: #777;
  margin-left: 0.25em;
}
.schedule .activity strong {
  font-weight: 700;
}
.schedule .activity .note-red {
  display: block;
  color: #b30000;
  font-size: 9.5pt;
  font-style: italic;
  font-weight: 700;
  margin-top: 3px;
}
.schedule .activity .addr {
  display: block;
  font-size: 10.5pt;
  font-style: italic;
  line-height: 1.3;
  margin-top: 4px;
}
.schedule .activity .addr-text {
  display: inline;
}
.map-btn {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 1.5px solid #000;
  border-radius: 4px;
  padding: 0;
  cursor: pointer;
  color: #000;
  text-decoration: none;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
  position: absolute;
  right: 0;
  top: 8px;
  transition:
    background 0.12s ease,
    color 0.12s ease,
    transform 0.06s ease;
}
.map-btn:active {
  transform: translateY(1px);
}
.map-btn:hover {
  background: #000;
  color: #fff;
}
.map-btn svg {
  width: 16px;
  height: 16px;
  display: block;
}
.schedule li.has-map .map-btn {
  right: 0;
  top: 8px;
}

.camera-btn {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 1.5px solid #000;
  border-radius: 4px;
  padding: 0;
  cursor: pointer;
  color: #000;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 8px;
  right: 0;
  font-style: normal;
  transition:
    background 0.12s ease,
    color 0.12s ease,
    transform 0.06s ease;
}
.camera-btn:active {
  transform: translateY(1px);
}
.camera-btn:hover {
  background: #000;
  color: #fff;
}
.camera-btn svg {
  width: 16px;
  height: 16px;
  display: block;
}
.schedule li.has-map .camera-btn {
  right: 44px;
}
.camera-btn .photo-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: #b30000;
  color: #fff;
  border-radius: 8px;
  font-family: "EB Garamond", serif;
  font-size: 9pt;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
}
.schedule .activity a {
  color: #000;
  text-decoration: underline;
}
.schedule .activity a.book-link {
  position: absolute;
  top: 52px;
  right: 0;
  width: 80px;
  padding: 6px 0;
  text-align: center;
  border: 1.5px solid #000;
  border-radius: 4px;
  background: #fff;
  color: #000;
  font-family: "Playfair Display", serif;
  font-size: 10.5pt;
  font-weight: 700;
  font-style: normal;
  text-decoration: none;
}
.schedule .book-link:active {
  transform: translateY(1px);
}
.schedule .book-link:hover {
  background: #000;
  color: #fff;
}
.schedule li:has(.book-link) {
  min-height: 96px;
}

.tbd {
  color: #777;
  font-style: italic;
}

.day-note {
  margin-top: 10px;
  padding-top: 6px;
  border-top: 1px solid #000;
  font-style: italic;
  font-size: 11pt;
}

.footer {
  border-top: 3px solid #000;
  padding-top: 6px;
  margin-top: 16px;
  font-size: 9pt;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  text-align: center;
}

/* Screen: hide non-active days */
@media screen {
  .day {
    display: none;
  }
  .day.is-active {
    display: block;
  }
}

/* Print: show all days, hide the toggle strip */
@media print {
  html,
  body {
    background: #fff;
  }
  body {
    font-size: 10.5pt;
    padding: 0;
    max-width: none;
  }
  .week {
    display: none;
  }
  .map-btn,
  .camera-btn {
    display: none;
  }
  .masthead-btn,
  .sheet {
    display: none !important;
  }
  .schedule li.has-map {
    padding-right: 0;
  }
  .schedule li {
    padding-right: 0;
  }
  .day {
    display: block !important;
    page-break-inside: avoid;
  }
  .page {
    width: 7.5in;
  }
}
