/* =====================================================================
   THE STAYSTYLES QUARTERLY: the platform's default look, for booking
   pages and the admin alike. Same family as staystyles.com: a 1950s
   travel magazine with cream stock, an ink "primary" and two spot inks
   (accent, highlight), slightly out of register.

   Loaded after app.css, which keeps the structure (and Green Valley's
   classic look, which skips this file; see LOOKS in js/tenant.js).
   A property's palette (one of THEME_PALETTES in js/tenant.js) sets:
     --forest     primary ink: headers, buttons, selected things
     --q-accent   offset shadows, rules, small flourishes
     --q-high     stars, numbers, highlights on dark grounds
   ===================================================================== */
:root {
  --forest: #1d2433; --forest-deep: #141a26; --forest-soft: #3a4254;
  --brand-mid: #4d5260; --brand-bright: #1d2433; --brand-accent: #d4472f;
  --q-accent: #d4472f; --q-high: #e4a530;
  --paper: #f4ead3; --paper-2: #ebdcbc; --card: #fbf5e6; --field: #fffcf3;
  --ink: #1d2433; --ink-2: #4d5260; --rule: #9a8f78; --line: #d6c7a4; --mist: #f1e5c8;
  --display: "DM Serif Display", "Playfair Display", Georgia, serif;
  --script: "Yellowtail", "Brush Script MT", cursive;
  --serif: "Source Serif 4", Georgia, serif;
  --sans: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  --tint: color-mix(in srgb, var(--forest) 9%, var(--card));
  --tint-2: color-mix(in srgb, var(--forest) 18%, var(--card));
  --dots: radial-gradient(circle, rgba(29, 36, 51, .2) 1px, transparent 1.6px);
}

html { background: var(--paper); }
body { font-family: var(--serif); background: var(--paper); color: var(--ink); line-height: 1.55; -webkit-font-smoothing: antialiased; }
/* paper grain on guest pages only (the admin scrolls a lot; keep it light) */
body:not(.admin-mode)::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 300; opacity: .06; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
h1, h2, h3 { font-family: var(--display); font-weight: 400; color: var(--ink); letter-spacing: -.01em; line-height: 1.12; }
h4 { font-family: var(--sans); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-size: .78rem; }
.muted { color: var(--ink-2); }
a { color: inherit; text-decoration-color: color-mix(in srgb, var(--q-accent) 70%, transparent); text-underline-offset: 2px; }
a:hover { color: var(--q-accent); }
::selection { background: color-mix(in srgb, var(--q-high) 55%, transparent); }

/* ---------- masthead ---------- */
.site-header { background: var(--paper); color: var(--ink); padding: 10px 0; border-top: 6px solid var(--q-accent); border-bottom: 2px solid var(--ink); box-shadow: none; }
.brand-name { font-family: var(--display); font-style: italic; font-weight: 400; font-size: 1.6rem; color: var(--ink); letter-spacing: -.01em; }
.site-logo { border-radius: 0; }
.header-contact { font-family: var(--sans); font-weight: 700; font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); }
.site-header .btn-ghost { border-color: var(--ink); color: var(--ink); }
.site-header .btn-ghost:hover { background: var(--ink); color: var(--paper); }

/* ---------- the cover (guest hero) ---------- */
.hero { background: var(--forest) center / cover; color: var(--paper); padding: 40px 16px 44px; border-bottom: 2px solid var(--ink); overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0; background-image: var(--dots); background-size: 9px 9px; opacity: .5; pointer-events: none;
  -webkit-mask-image: linear-gradient(115deg, transparent 50%, #000 85%); mask-image: linear-gradient(115deg, transparent 50%, #000 85%); }
.hero::after { content: none; }
.hero.has-photo { padding: 64px 16px 64px; }
.hero-inner { position: relative; }
.hero-box { border: 0; padding: 0; }
.hero h1 { color: var(--paper); font-family: var(--display); font-weight: 400; font-size: clamp(2.4rem, 7.5vw, 4.6rem); letter-spacing: -.03em; line-height: .95;
  text-shadow: 3px 3px 0 var(--q-accent); }
.hero-tag { font-family: var(--sans); font-weight: 800; font-size: .74rem; letter-spacing: .22em; text-transform: uppercase; margin: 18px auto 0; opacity: 1;
  display: block; width: fit-content; max-width: 100%; border-top: 2px solid currentColor; border-bottom: 2px solid currentColor; padding: 6px 14px; }

/* ---------- buttons ---------- */
.btn { background: var(--forest); color: var(--paper); border: 2px solid var(--ink); border-radius: 999px; font-family: var(--sans); font-weight: 800; font-size: .78rem;
  letter-spacing: .12em; text-transform: uppercase; padding: 10px 18px; box-shadow: 3px 3px 0 var(--q-accent); transition: transform .12s, box-shadow .12s, background .15s; }
.btn:hover { background: var(--forest); transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--q-accent); }
.btn:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--q-accent); }
.btn:disabled, .btn:disabled:hover { background: #b9ad93; border-color: #8c826c; color: var(--paper); box-shadow: none; transform: none; }
.btn-ghost, .btn-ghost:hover { background: transparent; color: var(--ink); border: 2px solid var(--ink); box-shadow: none; }
.btn-ghost:hover { background: var(--ink); color: var(--paper); transform: none; }
.btn-small { padding: 6px 12px; font-size: .7rem; box-shadow: 2px 2px 0 var(--q-accent); }
.btn-small.btn-ghost { box-shadow: none; border-width: 1.5px; }
.btn-big { padding: 14px; font-size: .86rem; }
.btn-danger, .btn-danger:hover { background: #a2321f; border-color: #5c1a0f; box-shadow: 3px 3px 0 var(--ink); }
:focus-visible { outline: 3px solid var(--q-high); outline-offset: 2px; }

/* ---------- forms ---------- */
input, select, textarea { background: var(--field); border: 1px solid var(--rule); border-radius: 2px; color: var(--ink); font-family: var(--serif); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--q-accent); outline-offset: 0; border-color: var(--ink); }
.form-grid label, .form-inline label, .avail-inputs label, .tpl-fieldset label { font-family: var(--sans); font-weight: 700; font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.form-grid label input, .form-grid label select, .form-grid label textarea, .form-inline label input, .form-inline label select,
.avail-inputs label input, .avail-inputs label select, .tpl-fieldset label input, .tpl-fieldset label textarea { font-size: 1rem; letter-spacing: 0; text-transform: none; font-weight: 400; color: var(--ink); }
.form-grid label.check { text-transform: none; letter-spacing: 0; font-size: .95rem; font-weight: 600; color: var(--ink); font-family: var(--serif); }
.form-grid fieldset, .tpl-fieldset { border: 1px solid var(--line); border-radius: 0; background: var(--card); }

/* ---------- cards, set like magazine panels ---------- */
.avail-box, .unit-layout, .unit-book, .unit-missing, .signin-view, .cabin-card, .modal-card, .guest-detail, .shared-card, .ptile, .insight {
  background: var(--card); border: 2px solid var(--ink); border-radius: 0; box-shadow: 6px 6px 0 rgba(29, 36, 51, .14); }
.avail-box { border-top: 2px solid var(--ink); }
.avail-head h2, .unit-info h2, .unit-book h2, .modal-card h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
.season-note { font-family: var(--display); font-style: italic; font-weight: 400; font-size: 1.3rem; color: var(--ink); }
.banner { background: color-mix(in srgb, var(--q-high) 22%, var(--card)); border: 2px solid var(--ink); border-radius: 0; }

/* availability calendar */
.cal-nav #cal-title { font-family: var(--display); font-size: 1.4rem; color: var(--ink); }
.cal-dow span { font-family: var(--sans); font-weight: 800; font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.cal-cell { background: var(--field); border: 1px solid var(--line); border-radius: 0; }
.cal-cell .cal-d { font-family: var(--sans); font-weight: 700; }
.cal-cell .cal-n { color: var(--ink-2); font-family: var(--sans); }
.cal-cell:not(.cal-past):not(.cal-empty):hover { background: var(--tint); transform: translateY(-1px); }
.cal-cell.cal-full { background: repeating-linear-gradient(135deg, var(--paper-2) 0 4px, var(--paper) 4px 8px); border-color: var(--line); }
.cal-cell.cal-full .cal-n { color: #a2321f; }
.cal-cell.cal-range { background: var(--tint-2); }
.cal-cell.cal-edge { background: var(--forest); color: var(--paper); border-color: var(--ink); }
.cal-cell.cal-edge .cal-n { color: var(--paper); opacity: .85; }

/* unit cards */
.cabin-grid { gap: 28px; }
.cabin-card img.cover { filter: saturate(.9) contrast(.97) sepia(.08); border-bottom: 2px solid var(--ink); }
.cabin-card .no-photo { background: var(--paper-2); color: var(--ink-2); }
.cabin-body h3 { font-size: 1.6rem; }
.cabin-meta { font-family: var(--sans); font-weight: 700; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.cabin-rate { color: var(--ink); font-family: var(--display); font-weight: 400; font-size: 1.25rem; border-top: 1px dashed var(--rule); }
.unit-status { border-top: 1px dashed var(--rule); }
.unit-open { color: #23683a; }
.gal-stage { border-radius: 0; background: var(--paper-2); }
.gal-caption { font-style: italic; color: var(--ink-2); }
.gal-thumbs img.active { border-color: var(--q-accent); }

/* "Good to know": the dark contents page */
.policies { background: var(--ink); color: #e9dfc6; border: 0; border-radius: 0; padding: 28px 32px; box-shadow: 8px 8px 0 var(--q-accent); }
.policies h2 { color: var(--paper); font-size: clamp(1.8rem, 4vw, 2.6rem); }
.policies h2::before { content: "the fine print"; display: block; font-family: var(--script); color: var(--q-high); font-size: .6em; transform: rotate(-3deg); transform-origin: left; margin-bottom: .1em; }
.policies a { color: var(--paper); }

.site-footer { background: var(--ink); color: #d9d0bb; border-top: 6px solid var(--q-accent); font-family: var(--sans); font-weight: 600; font-size: .8rem; letter-spacing: .04em; }
.site-footer .muted { color: #d9d0bb; }

/* booking dialog */
.modal { background: rgba(29, 36, 51, .6); }
.modal-close { color: var(--ink); }
.price-box { background: var(--paper); border: 1px dashed var(--rule); border-radius: 0; color: var(--ink); }
.price-box .total td { border-top: 2px solid var(--ink); font-family: var(--sans); }
.boat-row { background: var(--field); border-color: var(--line); border-radius: 0; }

/* skeletons in paper tones */
.skel { background: linear-gradient(90deg, var(--paper-2) 25%, var(--paper) 50%, var(--paper-2) 75%); background-size: 200% 100%; }

/* =====================================================================
   The admin: the same paper and inks, set for long working sessions.
   ===================================================================== */
.admin-mode .site-header { background: var(--forest); color: var(--paper); border-top: 0; border-bottom: 3px solid var(--q-accent); }
.admin-mode .brand-name { color: var(--paper); }
.admin-mode .header-contact { color: color-mix(in srgb, var(--paper) 80%, transparent); }
.admin-mode .site-header .btn-ghost { border-color: color-mix(in srgb, var(--paper) 60%, transparent); color: var(--paper); }
.admin-mode .site-header .btn-ghost:hover { background: var(--paper); color: var(--ink); }
.admin-head h2 { font-size: 1.9rem; }

.tabs { gap: 4px; border-bottom: 2px solid var(--ink); padding-bottom: 8px; }
.tab { background: transparent; border: 1.5px solid transparent; border-radius: 999px; font-family: var(--sans); font-weight: 800; font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink); padding: 8px 14px; }
.tab:hover { background: var(--tint); }
.tab.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.subnav { border-bottom: 1px solid var(--line); }
.subtab { font-family: var(--sans); font-weight: 700; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.subtab:hover { color: var(--ink); }
.subtab.active { color: var(--ink); border-bottom-color: var(--q-accent); background: transparent; }
.chip { background: var(--field); border: 1.5px solid var(--ink); font-family: var(--sans); font-weight: 700; font-size: .78rem; }
.chip.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.settings-card { background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--ink); border-radius: 0; }
.settings-card h3 { font-size: 1.5rem; }
.card-save { border-top: 1px dashed var(--rule); }
.detail-card { background: var(--paper); border: 1px solid var(--line); border-radius: 0; }
.detail-card h4 { color: var(--ink-2); }

table.list { background: var(--card); border: 1px solid var(--line); border-radius: 0; }
table.list th { background: var(--paper-2); font-family: var(--sans); font-weight: 800; font-size: .68rem; letter-spacing: .12em; color: var(--ink); }
table.list th, table.list td { border-bottom-color: color-mix(in srgb, var(--line) 70%, transparent); }
tr.clickable:hover td, .clickable-row:hover, a.card-link:hover { background: var(--tint); }
tr.total-row td { background: var(--paper-2); }

.an-card { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--q-accent); border-radius: 0; }
.an-card-label { font-family: var(--sans); font-weight: 800; letter-spacing: .12em; font-size: .66rem; color: var(--ink-2); }
.an-card-val { font-family: var(--display); font-weight: 400; font-size: 1.7rem; }
.bar-track { background: var(--paper-2); border-radius: 0; }
.bar-fill { background: var(--forest); }
.bar-fill.bar-future { background: repeating-linear-gradient(45deg, var(--forest), var(--forest) 6px, var(--tint-2) 6px, var(--tint-2) 12px); }
.insight h4 { font-family: var(--display); font-weight: 400; color: var(--ink); text-transform: none; letter-spacing: 0; font-size: 1.25rem; }

.pos-item { background: var(--field); border: 1px solid var(--line); border-radius: 0; }
.pos-item:hover { background: var(--tint); }
.pos-bar { background: var(--forest); color: var(--paper); }

.timeline { background: var(--card); border-color: var(--line); border-radius: 0; }
.tl-unit { background: var(--card); }
.tl-wknd { background: color-mix(in srgb, var(--paper-2) 45%, var(--card)); }
th.tl-today { background: color-mix(in srgb, var(--q-high) 35%, var(--card)); }
td.tl-today { box-shadow: inset 2px 0 0 var(--q-accent); }
.tl-open:hover { background: var(--tint); }
.tl-booking { background: var(--forest); }

.ptile { box-shadow: 4px 4px 0 rgba(29, 36, 51, .12); border-width: 1.5px; }
.ptile-badge { background: color-mix(in srgb, var(--ink) 88%, transparent); }
.ptile-badge.cover { background: var(--q-accent); }
.upload-zone { background: var(--field); border-color: var(--rule); border-radius: 0; }
.photo-item img, .brand-preview { border-radius: 0; }
.feed-row code { background: var(--paper-2); border-radius: 0; }
.signin-view h2 { font-size: 2.2rem; }
.billing-banner { border-radius: 0; border-width: 2px; }

@media (max-width: 600px) {
  .brand-name { font-size: 1.25rem; }
  .policies { padding: 22px; box-shadow: 5px 5px 0 var(--q-accent); }
  .avail-box, .unit-layout, .unit-book, .cabin-card { box-shadow: 4px 4px 0 rgba(29, 36, 51, .14); }
}
@media (prefers-reduced-motion: reduce) { .btn, .cal-cell { transition: none; } .btn:hover, .cal-cell:hover { transform: none !important; } }

/* ---------- the cover's kicker, and a single place's page ---------- */
.hero h1[data-kicker]::before { content: attr(data-kicker); display: block; font-family: var(--sans); font-weight: 800; font-size: .72rem; letter-spacing: .24em; text-transform: uppercase; color: var(--q-high); text-shadow: none; margin-bottom: 14px; }
.unit-layout { padding: clamp(14px, 2.5vw, 26px); gap: clamp(18px, 3vw, 34px); }
.unit-info h2 { font-size: clamp(2rem, 4vw, 2.8rem); line-height: 1; margin-bottom: 8px; }
.unit-info > p { font-size: 1.06rem; }
.unit-facts { list-style: none; padding: 0; margin: 16px 0; border-top: 2px solid var(--ink); }
.unit-facts li { position: relative; padding: 7px 0 7px 1.6em; border-bottom: 1px dashed var(--rule); margin: 0; }
.unit-facts li::before { content: "★"; position: absolute; left: 0; color: var(--q-accent); }
.unit-rates { width: 100%; border-top: 2px solid var(--ink); }
.unit-rates td { padding: 7px 8px 7px 0; border-bottom: 1px dashed var(--rule); }
.unit-rates td:nth-child(2) { font-family: var(--display); font-size: 1.15rem; white-space: nowrap; }
.unit-gallery .gal-main { filter: saturate(.92) contrast(.97); }
.unit-book { border-top: 6px solid var(--q-accent); }
.unit-book h2 { font-size: clamp(1.8rem, 3.5vw, 2.4rem); }
.unit-open { font-family: var(--sans); font-weight: 800; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; }
.cal-legend { font-size: .9rem; color: var(--ink-2); }
.site-missing h2 { font-size: clamp(2rem, 5vw, 3rem); }
.cabin-body > p { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 600px) { .modal { padding: 0; align-items: flex-end; } .modal-card { border-width: 2px 0 0; max-height: 92vh; overflow-y: auto; box-shadow: none; } }
@media (min-width: 801px) { .unit-layout > .unit-gallery { position: sticky; top: 16px; } }
