/* Guest book: sand, sea and a little coral. Phone first. */
:root {
  --bg: #fbf7ef;
  --card: #ffffff;
  --ink: #1f3a44;
  --muted: #6f6656;
  --line: #e6dccb;
  --sea: #1b6f75;
  --sea-soft: #e3f1ef;
  --coral: #d9604a;
  --coral-soft: #fbe9e4;
  --shadow: 0 1px 2px rgba(31, 58, 68, .06), 0 4px 16px rgba(31, 58, 68, .06);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1c20;
    --card: #162a30;
    --ink: #e8eee9;
    --muted: #a5ad9f;
    --line: #2a4148;
    --sea: #5cc2c0;
    --sea-soft: #173a3d;
    --coral: #f08a74;
    --coral-soft: #3a2420;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.5 var(--sans);
}
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0 0 .4em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.15rem; }
a { color: var(--sea); }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.hidden { display: none !important; }

main { max-width: 760px; margin: 0 auto; padding: 0 16px 64px; }
main.narrow { max-width: 460px; padding-top: 48px; }

/* Top of the guest page: the house picture with the welcome over it. */
.hero { position: relative; background: var(--sea); color: #fff; overflow: hidden; }
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.05) 30%, rgba(0,0,0,.55)); }
.hero .inner { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; padding: 120px 16px 22px; }
.hero.plain .inner { padding-top: 40px; }
.hero .house { font-family: var(--serif); font-size: 1.05rem; opacity: .92; letter-spacing: .02em; }
.hero h1 { font-size: 2.1rem; margin: .1em 0 .15em; }
.hero .dates { opacity: .92; }

/* Tabs */
.tabs { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
.tabs .inner { max-width: 760px; margin: 0 auto; display: flex; gap: 4px; padding: 0 8px; overflow-x: auto; }
.tabs button {
  appearance: none; background: none; border: 0; border-bottom: 3px solid transparent;
  padding: 14px 12px 11px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap;
}
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--coral); }

section.tab { padding-top: 20px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card.soft { background: var(--sea-soft); border-color: transparent; box-shadow: none; }
.card.warn { background: var(--coral-soft); border-color: transparent; box-shadow: none; }

label { display: block; font-weight: 600; margin: 14px 0 6px; }
label .muted { font-weight: 400; }
input[type=text], input[type=date], input[type=password], textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px;
}
input:focus, textarea:focus { outline: 2px solid var(--sea); outline-offset: 1px; border-color: transparent; }
textarea { min-height: 150px; resize: vertical; }
textarea.short { min-height: 80px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1 1 140px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin-top: 14px; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--sea); flex: none; }

.btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  background: var(--sea); color: #fff; border: 0; border-radius: 999px; padding: 12px 20px; min-height: 46px;
}
.btn:disabled { opacity: .55; cursor: default; }
.btn.big { width: 100%; font-size: 1.1rem; min-height: 54px; }
.btn.coral { background: var(--coral); }
.btn.ghost { background: transparent; color: var(--sea); border: 1.5px solid var(--sea); }
.btn.quiet { background: transparent; color: var(--muted); padding: 8px 10px; min-height: 0; font-weight: 500; }
.btn.danger { background: transparent; color: var(--coral); border: 1.5px solid var(--coral); }
.btn.small { padding: 7px 14px; min-height: 36px; font-size: .92rem; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

.note { white-space: pre-wrap; overflow-wrap: anywhere; }
.byline { font-family: var(--serif); font-style: italic; color: var(--muted); margin-top: 6px; }
.tip { background: var(--sea-soft); border-radius: 10px; padding: 10px 12px; margin-top: 10px; overflow-wrap: anywhere; white-space: pre-wrap; }
.tip b { color: var(--sea); }
.chip { display: inline-block; font-size: .8rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--sea-soft); color: var(--sea); vertical-align: middle; }
.chip.coral { background: var(--coral-soft); color: var(--coral); }
.chip.grey { background: var(--line); color: var(--muted); }

/* Photo grids */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 12px; }
@media (min-width: 600px) { .grid { grid-template-columns: repeat(4, 1fr); } }
.grid .ph { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--line); cursor: zoom-in; border: 0; padding: 0; }
.grid .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.grid .ph.dim img { opacity: .35; }
.grid .ph .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: rgba(0,0,0,.25); }
.grid .ph .bar i { display: block; height: 100%; background: var(--coral); width: 0; transition: width .2s; }
.grid .ph .x {
  position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; border-radius: 50%; border: 0;
  background: rgba(0,0,0,.55); color: #fff; font-size: 18px; line-height: 30px; cursor: pointer;
}
.grid .more { display: flex; align-items: center; justify-content: center; font-weight: 600; color: var(--sea); background: var(--sea-soft); }
.grid .ph .tag { position: absolute; left: 4px; top: 4px; }

/* The book */
.year { font-family: var(--serif); font-size: 1.6rem; color: var(--coral); margin: 28px 0 10px; display: flex; align-items: center; gap: 12px; }
.year::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.stay h3 { margin-bottom: 2px; }
.stay .when { color: var(--muted); font-size: .92rem; margin-bottom: 10px; }
.stay .entry + .entry { border-top: 1px dashed var(--line); padding-top: 12px; margin-top: 12px; }
.stay .tools { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty .big { font-size: 2.4rem; }

/* Full-screen photo */
.lightbox { position: fixed; inset: 0; z-index: 50; background: #0b1316; display: flex; flex-direction: column; color: #fff; }
.lightbox .stage { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; touch-action: pan-y; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox .top, .lightbox .bottom { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.lightbox .top { justify-content: space-between; }
.lightbox .bottom { flex-wrap: wrap; justify-content: center; padding-bottom: max(14px, env(safe-area-inset-bottom)); }
.lightbox .cap { text-align: center; padding: 0 16px 6px; min-height: 1.5em; }
.lightbox button, .lightbox a, .lightbox .btn.quiet { color: #fff; }
.lightbox .nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.12); border: 0; width: 44px; height: 64px; font-size: 28px; cursor: pointer; border-radius: 8px; }
.lightbox .nav.prev { left: 8px; } .lightbox .nav.next { right: 8px; }
.lightbox .btn.ghost { color: #fff; border-color: rgba(255,255,255,.6); }

/* Little pop-up messages */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 999px; z-index: 60; font-weight: 600; max-width: calc(100% - 32px); text-align: center; }

/* Hosts' page */
.owner-head { max-width: 760px; margin: 0 auto; padding: 22px 16px 6px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.owner-head h1 { font-size: 1.6rem; margin: 0; }
.stay-row { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.stay-row .who { font-weight: 600; font-size: 1.05rem; }
.stay-row + .stay-row { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.qr { background: #fff; border-radius: 12px; padding: 12px; width: 220px; max-width: 100%; margin: 6px auto 0; }
.qr img { width: 100%; display: block; }
.linkbox { font-family: ui-monospace, Menlo, monospace; font-size: .9rem; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; overflow-wrap: anywhere; }
.modal { position: fixed; inset: 0; z-index: 40; background: rgba(5, 12, 14, .5); display: flex; align-items: flex-end; justify-content: center; }
.modal .sheet { background: var(--bg); width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; border-radius: 18px 18px 0 0; padding: 20px 16px max(20px, env(safe-area-inset-bottom)); }
@media (min-width: 600px) { .modal { align-items: center; } .modal .sheet { border-radius: 18px; } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.cover-preview { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 10px; background: var(--line); display: block; }
