/* JM Suites, GuestOS v0
   A warm, plain hospitality surface: brick and brass against a paper ground,
   Fraunces for the voice and Karla for the working text. */

:root {
  color-scheme: light;

  --paper:    #fbf8f3;
  --surface:  #ffffff;
  --sunken:   #f3efe7;
  --ink:      #1b211e;
  --ink-soft: #5b645e;
  --ink-faint:#8a918b;
  --line:     #e3ddd2;
  --line-firm:#cfc6b7;

  --forest:   #2f4538;
  --forest-d: #233528;
  --brass:    #9c6b35;
  --brass-l:  #c89a5d;

  --good:     #2f6b4a;
  --good-bg:  #e6f1ea;
  --warn:     #8a5a12;
  --warn-bg:  #fbf0db;
  --bad:      #8c3230;
  --bad-bg:   #f8e7e5;

  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(27, 33, 30, .05), 0 8px 24px -16px rgba(27, 33, 30, .25);

  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --body: "Karla", "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper:    #151917;
    --surface:  #1d2321;
    --sunken:   #242b28;
    --ink:      #eef0ec;
    --ink-soft: #a8b1ab;
    --ink-faint:#7c857f;
    --line:     #2f3734;
    --line-firm:#414b46;
    --forest:   #88b89b;
    --forest-d: #a8d2b9;
    --brass:    #d6a568;
    --brass-l:  #e8c9a0;
    --good:     #7fc49c;  --good-bg: #1d2e26;
    --warn:     #d9ac63;  --warn-bg: #30271a;
    --bad:      #e49a95;  --bad-bg:  #33211f;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 28px -18px rgba(0,0,0,.8);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper:    #151917;
  --surface:  #1d2321;
  --sunken:   #242b28;
  --ink:      #eef0ec;
  --ink-soft: #a8b1ab;
  --ink-faint:#7c857f;
  --line:     #2f3734;
  --line-firm:#414b46;
  --forest:   #88b89b;
  --forest-d: #a8d2b9;
  --brass:    #d6a568;
  --brass-l:  #e8c9a0;
  --good:     #7fc49c;  --good-bg: #1d2e26;
  --warn:     #d9ac63;  --warn-bg: #30271a;
  --bad:      #e49a95;  --bad-bg:  #33211f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 var(--body);
  -webkit-text-size-adjust: 100%;
}

.wrap { width: 100%; max-width: 68rem; margin-inline: auto; padding-inline: 16px; }

a { color: var(--brass); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--ink); }

h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.15; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 50; background: var(--surface); padding: 8px 14px; border-radius: var(--radius); }

:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; border-radius: 4px; }

.eyebrow {
  font: 700 .72rem/1 var(--body); letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-faint); margin: 0 0 .7rem;
}

/* ---------- masthead ---------- */

.masthead { background: var(--forest-d); color: #f2ece1; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .masthead { background: #11201a; } }
:root[data-theme="dark"] .masthead { background: #11201a; }

.masthead-inner {
  display: flex; flex-wrap: wrap; gap: 10px 24px;
  align-items: baseline; justify-content: space-between;
  padding-block: 18px;
}
.brandmark { text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 2px; }
.brandname { font-family: var(--display); font-size: 1.45rem; font-weight: 600; letter-spacing: .01em; }
.brandsub { font-size: .8rem; color: #c6bca9; letter-spacing: .04em; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: .92rem; }
.nav a { color: #e8dfce; text-decoration: none; }
.nav a:hover { color: #fff; text-decoration: underline; }

/* ---------- hero ---------- */

.hero { padding-block: clamp(2.5rem, 7vw, 4.5rem) clamp(1.5rem, 4vw, 2.5rem); }
.hero .lede { font-size: clamp(1.05rem, 2.2vw, 1.25rem); color: var(--ink-soft); max-width: 42ch; margin-top: 1rem; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 10px; margin-top: 1.4rem; }

.pill {
  display: inline-block; padding: 5px 12px; border-radius: 999px;
  background: var(--sunken); border: 1px solid var(--line);
  font-size: .82rem; color: var(--ink-soft);
}

/* ---------- sections ---------- */

.section { padding-block: clamp(2rem, 5vw, 3.2rem); }
.section + .section { border-top: 1px solid var(--line); }

.cards { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); margin-top: 1.6rem; }

.card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow);
}
.card-photo {
  /* height:auto is load-bearing: the img carries width/height attributes for
     layout stability, and a specified height would beat aspect-ratio. */
  aspect-ratio: 4 / 3; width: 100%; height: auto; display: block; object-fit: cover;
  background: var(--sunken); border-bottom: 1px solid var(--line);
}
.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: .55rem; flex: 1; }
.card-body h3 { font-size: 1.25rem; }
.card-facts { font-size: .86rem; color: var(--ink-faint); }
.card-copy { font-size: .95rem; color: var(--ink-soft); flex: 1; }
.card-foot {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin-top: .4rem; padding-top: .8rem; border-top: 1px solid var(--line);
}
.price { font-family: var(--display); font-size: 1.35rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.price small { font-family: var(--body); font-size: .78rem; font-weight: 400; color: var(--ink-faint); }

/* ---------- buttons ---------- */

.btn {
  display: inline-block; border: 1px solid transparent; border-radius: var(--radius);
  padding: 11px 20px; font: 700 .92rem/1 var(--body); cursor: pointer;
  text-decoration: none; text-align: center;
  background: var(--forest); color: #f4f0e6;
}
.btn:hover { background: var(--forest-d); color: #fff; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn { color: #11201a; }
  :root:not([data-theme="light"]) .btn:hover { color: #0b1712; }
}
:root[data-theme="dark"] .btn { color: #11201a; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-firm); }
.btn-ghost:hover { background: var(--sunken); color: var(--ink); }
.btn-sm { padding: 7px 13px; font-size: .82rem; }
.btn-danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn-danger:hover { background: var(--bad-bg); color: var(--bad); }

/* ---------- room page ---------- */

.room-grid { display: grid; gap: 32px; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 860px) { .room-grid { grid-template-columns: 1fr; } }

/* One big shot and two stacked beside it. Falls back to a single column or a
   pair when a unit has fewer than three photographs, so swapping in two real
   images does not leave a hole in the grid. */
.gallery { display: grid; gap: 10px; grid-template-columns: 1fr; }
.gallery img { width: 100%; height: auto; object-fit: cover; aspect-ratio: 4/3; border-radius: var(--radius); border: 1px solid var(--line); background: var(--sunken); }
.gallery:has(img:nth-child(2)) { grid-template-columns: 1fr 1fr; }
.gallery:has(img:nth-child(3)) { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.gallery:has(img:nth-child(3)) img { height: 100%; aspect-ratio: auto; }
.gallery:has(img:nth-child(3)) img:first-child { grid-row: span 2; height: auto; aspect-ratio: 4/3; }
@media (max-width: 560px) { .gallery { grid-template-columns: 1fr; } .gallery img:first-child { grid-row: auto; } }

.amenities { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: 8px 20px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.amenities li { position: relative; padding-left: 22px; font-size: .95rem; color: var(--ink-soft); }
.amenities li::before {
  content: ""; position: absolute; left: 2px; top: .55em; width: 9px; height: 9px;
  border-radius: 2px; background: var(--brass);
}

.booker {
  position: sticky; top: 18px;
  background: var(--surface); border: 1px solid var(--line-firm);
  border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 20px;
}
@media (max-width: 860px) { .booker { position: static; } }
.booker h2 { font-size: 1.25rem; }

/* ---------- calendar ---------- */

.cal { margin-top: 1rem; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: .6rem; }
.cal-title { font-family: var(--display); font-weight: 600; font-size: 1.02rem; }
.cal-nav { display: flex; gap: 6px; }
.cal-nav button {
  border: 1px solid var(--line-firm); background: var(--surface); color: var(--ink);
  border-radius: 8px; width: 30px; height: 30px; cursor: pointer; font-size: 1rem; line-height: 1;
}
.cal-nav button:hover:not([disabled]) { background: var(--sunken); }
.cal-nav button[disabled] { opacity: .35; cursor: not-allowed; }

.cal-dow, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-dow span { text-align: center; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); padding-bottom: 4px; }
.cal-day {
  all: unset; box-sizing: border-box; display: flex; align-items: center; justify-content: center;
  aspect-ratio: 1; border-radius: 7px; font-size: .86rem; font-variant-numeric: tabular-nums;
  cursor: pointer; border: 1px solid transparent; color: var(--ink);
}
.cal-day:hover:not(.is-off) { background: var(--sunken); }
.cal-day.is-empty { cursor: default; }
.cal-day.is-off {
  color: var(--ink-faint); cursor: not-allowed; text-decoration: line-through;
  background: repeating-linear-gradient(135deg, transparent, transparent 3px, var(--line) 3px, var(--line) 4px);
}
.cal-day.is-end { background: var(--forest); color: #f4f0e6; font-weight: 700; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cal-day.is-end { color: #11201a; } }
:root[data-theme="dark"] .cal-day.is-end { color: #11201a; }
.cal-day.is-between { background: var(--sunken); border-color: var(--line-firm); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: .7rem; font-size: .76rem; color: var(--ink-faint); }

/* ---------- forms ---------- */

.field { display: block; margin-bottom: .85rem; }
.field > span { display: block; font-size: .78rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: .95rem; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line-firm);
  border-radius: var(--radius); padding: 10px 12px;
}
.field textarea { min-height: 76px; resize: vertical; }
.field-row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }

.quote { background: var(--sunken); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 1rem 0; font-size: .92rem; }
.quote dl { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; font-variant-numeric: tabular-nums; }
.quote dt { color: var(--ink-soft); }
.quote dd { margin: 0; text-align: right; }
.quote .total { border-top: 1px solid var(--line-firm); padding-top: 8px; margin-top: 2px; font-weight: 700; font-size: 1.02rem; }
.quote .total dt, .quote .total dd { font-weight: 700; }

.note { font-size: .83rem; color: var(--ink-faint); margin-top: .8rem; }

.flash { border-radius: var(--radius); padding: 11px 14px; margin-bottom: 1rem; font-size: .92rem; border: 1px solid; }
.flash.ok    { background: var(--good-bg); border-color: var(--good); color: var(--good); }
.flash.error { background: var(--bad-bg);  border-color: var(--bad);  color: var(--bad); }

/* ---------- status chips ---------- */

.chip {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font: 700 .72rem/1.5 var(--body); letter-spacing: .04em; text-transform: uppercase;
  border: 1px solid;
}
.chip.requested { background: var(--warn-bg); border-color: var(--warn); color: var(--warn); }
.chip.confirmed { background: var(--good-bg); border-color: var(--good); color: var(--good); }
.chip.cancelled,
.chip.declined  { background: var(--bad-bg);  border-color: var(--bad);  color: var(--bad); }

/* ---------- admin ---------- */

.admin-bar { background: var(--forest-d); color: #eee6d8; }
.admin-bar .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; padding-block: 12px; }
.admin-bar a { color: #e8dfce; text-decoration: none; font-size: .92rem; }
.admin-bar a:hover { text-decoration: underline; color: #fff; }
.admin-bar .admin-title { font-family: var(--display); font-weight: 600; font-size: 1.1rem; }
.admin-bar nav { display: flex; gap: 18px; align-items: center; }
.admin-bar form { margin: 0; }
.admin-bar button { background: none; border: none; color: #c6bca9; font: inherit; font-size: .9rem; cursor: pointer; text-decoration: underline; padding: 0; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 20px; margin-bottom: 24px; }
.panel > h2 { margin-bottom: .3rem; }

.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 1rem 0; }
.tabs a {
  text-decoration: none; font-size: .85rem; padding: 6px 13px; border-radius: 999px;
  border: 1px solid var(--line-firm); color: var(--ink-soft); background: var(--surface);
}
.tabs a.on { background: var(--forest); border-color: var(--forest); color: #f4f0e6; font-weight: 700; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tabs a.on { color: #11201a; } }
:root[data-theme="dark"] .tabs a.on { color: #11201a; }

.table-scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 720px; }
table.data th, table.data td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { font: 700 .72rem/1.4 var(--body); letter-spacing: .09em; text-transform: uppercase; color: var(--ink-faint); white-space: nowrap; }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data tr:last-child td { border-bottom: 0; }
.rowactions { display: flex; flex-wrap: wrap; gap: 6px; }
.rowactions form { margin: 0; }

.muted { color: var(--ink-faint); }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .02em; }

.admin-cals { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.admin-cal .cal-grid .cal-day { cursor: default; border: 1px solid var(--line); background: var(--surface); position: relative; }
.admin-cal .cal-day.is-off { background: var(--forest); color: #f4f0e6; border-color: var(--forest); text-decoration: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .admin-cal .cal-day.is-off { color: #11201a; } }
:root[data-theme="dark"] .admin-cal .cal-day.is-off { color: #11201a; }
.admin-cal .cal-day.is-empty { border-color: transparent; background: transparent; }
.unit-cal-title { font-family: var(--display); font-weight: 600; font-size: 1.05rem; margin-bottom: .5rem; }

/* ---------- footer ---------- */

.footer { margin-top: 3rem; border-top: 1px solid var(--line); background: var(--sunken); }
.footer-inner { padding-block: 28px 36px; font-size: .9rem; color: var(--ink-soft); }
.footer-brand { font-family: var(--display); font-weight: 600; font-size: 1.1rem; color: var(--ink); margin-bottom: .3rem; }
.fine { font-size: .8rem; color: var(--ink-faint); margin-top: .8rem; }

@media print {
  .masthead, .nav, .footer, .booker, .admin-bar, .rowactions { display: none !important; }
  body { background: #fff; color: #000; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
