/* Soidinpolun mökki – one small stylesheet, no build step. */

:root {
  --bg: #f4f2ee;
  --surface: #ffffff;
  --fg: #1d2421;
  --muted: #66706b;
  --line: #e4e1da;
  --accent: #1f4d40;
  --accent-hover: #173b31;
  --accent-soft: #e3eee9;
  --free: #dcefe3;
  --free-fg: #1f4d40;
  --booked: #ebe8e2;
  --booked-fg: #a19c92;
  --pending: #fbe7bf;
  --hd: #d98c1f;
  --error: #a33a32;
  --error-soft: #fbe9e7;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 30, 25, .05), 0 4px 16px rgba(20, 30, 25, .06);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font: 16px/1.6 var(--font);
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
}
main { max-width: 1040px; margin: 0 auto; padding: 24px 16px 64px; }
.hero + main { padding-top: 28px; }
a { color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(28px, 4vw, 40px); margin: 0 0 16px; }
h2 { font-size: 20px; margin: 0 0 12px; }
h3 { font-size: 17px; }
section { margin: 0 0 20px; }
[hidden] { display: none !important; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; justify-content: space-between;
  padding: 12px max(16px, calc((100% - 1040px) / 2 + 16px));
  background: rgba(255, 255, 255, .85);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.top .brand { font-weight: 700; font-size: 17px; text-decoration: none; color: var(--fg); }
.top nav { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.top nav a, .top nav button.link {
  padding: 6px 12px; border-radius: 8px; text-decoration: none; color: var(--fg); font-size: 15px;
}
.top nav a:hover, .top nav button.link:hover { background: var(--accent-soft); }
.subnav {
  display: flex; gap: 6px; flex-wrap: wrap; overflow-x: auto;
  padding: 8px max(16px, calc((100% - 1040px) / 2 + 16px));
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.subnav a { padding: 5px 12px; border-radius: 8px; text-decoration: none; color: var(--muted); font-size: 14px; white-space: nowrap; }
.subnav a:hover { background: var(--accent-soft); color: var(--accent); }
.badge { background: var(--error); color: #fff; border-radius: 999px; padding: 1px 7px; font-size: 12px; font-weight: 600; }

/* Building blocks */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 20px; margin: 12px 0; box-shadow: var(--shadow);
}
.panel h3 { margin-top: 0; }
.hint { color: var(--muted); font-size: 14px; }
.center { text-align: center; }
.plain { list-style: none; padding: 0; margin: 0; }
.plain li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.plain li:last-child { border-bottom: 0; }
.flash { padding: 12px 16px; border-radius: var(--radius-sm); margin: 0 0 20px; border: 1px solid transparent; }
.flash.ok { background: var(--accent-soft); border-color: #c6ddd3; }
.flash.error { background: var(--error-soft); color: var(--error); border-color: #f0cdc8; }
.notice { background: var(--pending); padding: 10px 14px; border-radius: var(--radius-sm); }
code { background: var(--bg); padding: 2px 6px; border-radius: 6px; font-size: 14px; }
details { border-top: 1px solid var(--line); padding: 10px 0; }
details summary { cursor: pointer; font-weight: 600; }
details ul { margin: 8px 0 0; }

/* Forms */
label { display: block; margin: 0 0 12px; font-size: 14px; font-weight: 600; color: var(--muted); }
input, select {
  display: block; width: 100%; margin-top: 4px; padding: 10px 12px;
  font: 16px var(--font); color: var(--fg);
  background: var(--surface); border: 1px solid #d3cfc6; border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: normal; color: var(--fg); font-size: 15px; }
label.check input { width: auto; margin-top: 4px; accent-color: var(--accent); }
button, .button {
  display: inline-block; font: 600 15px var(--font); padding: 11px 20px; border: 0; border-radius: var(--radius-sm);
  background: var(--accent); color: #fff; cursor: pointer; text-decoration: none;
  transition: background .15s, transform .05s;
}
button:hover, .button:hover { background: var(--accent-hover); }
button:active, .button:active { transform: translateY(1px); }
button:focus-visible, a:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; }
button:disabled { opacity: .45; cursor: default; }
button.danger { background: var(--error); }
button.link { background: none; border: 0; color: var(--accent); font-weight: normal; cursor: pointer; }
form.inline { display: inline; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; }
.form-actions { grid-column: 1 / -1; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form input { flex: 1 1 200px; margin: 0; }

/* Hero */
/* Full-bleed hero: edge to edge, text aligned with the content column. */
.hero { position: relative; }
.hero img { display: block; width: 100%; height: min(72vh, 640px); min-height: 380px; object-fit: cover; }
.hero-text {
  position: absolute; inset: auto 0 0 0; color: #fff;
  padding: 120px max(16px, calc((100% - 1040px) / 2 + 16px)) 48px;
  background: linear-gradient(to top, rgba(10, 20, 16, .8), rgba(10, 20, 16, .4) 55%, transparent);
}
.hero-text h1 { margin: 0 0 6px; color: #fff; font-size: clamp(32px, 5vw, 56px); }
.hero-text p { margin: 0 0 16px; font-size: 18px; max-width: 520px; }
.hero-text .eyebrow { margin: 0 0 6px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.hero-text .button { background: #fff; color: var(--accent); }
.hero-text .button:hover { background: var(--accent-soft); }

.info-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.info-cards .card p { margin: 0 0 8px; }
.info-cards h2 { display: flex; align-items: center; gap: 10px; font-size: 18px; }
.dot { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.dot.free { background: var(--free); border: 1px solid #b9dcc6; }
.dot.hd { background: var(--free); box-shadow: inset 0 -4px 0 var(--hd); }
.two-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.two-cols > section { margin: 0; }

/* Photos */
.photos { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 16px 0; }
.photos img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block;
  border-radius: var(--radius-sm); transition: transform .2s;
}
.photos a:hover img { transform: scale(1.02); }

/* Calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cal-head h2 { margin: 0; }
.nav-months { display: flex; gap: 6px; }
.icon-button {
  display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
  border-radius: var(--radius-sm); border: 1px solid var(--line); text-decoration: none; color: var(--fg); font-size: 22px; line-height: 1;
}
.icon-button:hover { background: var(--accent-soft); }
.months { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 12px 24px; }
.month { border-collapse: separate; border-spacing: 3px; width: 100%; table-layout: fixed; }
.month caption { font-weight: 700; text-align: left; padding: 4px 3px 6px; }
.month th { font-size: 12px; color: var(--muted); font-weight: 600; padding-bottom: 2px; }
.month td { padding: 0; text-align: center; }
.day {
  display: flex; align-items: center; justify-content: center; aspect-ratio: 1;
  border-radius: 9px; text-decoration: none; color: var(--fg); font-size: 14px; font-variant-numeric: tabular-nums;
  transition: transform .08s, box-shadow .12s;
}
.day.free { background: var(--free); color: var(--free-fg); font-weight: 600; }
.day.booked { background: var(--booked); color: var(--booked-fg); }
.day.pending { background: var(--pending); }
.day.closed, .day.past { color: #b8b3a9; }
.day.hd { box-shadow: inset 0 -4px 0 var(--hd); }
a.day:hover { transform: scale(1.08); box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
a.day.hd:hover { box-shadow: inset 0 -4px 0 var(--hd), 0 2px 8px rgba(0, 0, 0, .12); }
.day.cand { outline: 2px dashed var(--accent); outline-offset: -2px; }
.day.sel { background: var(--accent); color: #fff; }
/* Arrival and departure days are half filled: you arrive in the afternoon
   and leave in the morning. */
.day.arr { background: linear-gradient(135deg, var(--free) 60%, var(--accent) 60%); color: var(--fg); }
.day.dep { background: linear-gradient(135deg, var(--accent) 40%, var(--free) 40%); color: var(--fg); }
.day.arr, .day.dep { font-weight: 700; box-shadow: inset 0 0 0 2px var(--accent); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; list-style: none; padding: 12px 0 0; margin: 12px 0 0; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.legend li { display: flex; align-items: center; gap: 6px; }
.swatch { width: 16px; height: 16px; border-radius: 5px; display: inline-block; }
.swatch.free { background: var(--free); }
.swatch.booked { background: var(--booked); }
.swatch.pending { background: var(--pending); }
.swatch.closed { background: transparent; border: 1px solid var(--line); }
.swatch.hd { box-shadow: inset 0 -4px 0 var(--hd); }

.booking { border: 2px solid var(--accent); }
.booking .summary { font-size: 18px; font-weight: 600; }
.login.highlight { box-shadow: 0 0 0 4px var(--pending), var(--shadow); }

/* Lists and admin */
.bookings { list-style: none; padding: 0; margin: 0; }
.bookings li { padding: 14px 16px; margin-bottom: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.actions { display: inline-flex; gap: 14px; margin-left: 8px; }
.status {
  display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px;
  background: var(--booked); color: var(--muted); margin-left: 4px; vertical-align: 1px;
}
.status.confirmed, .status.paid { background: var(--free); color: var(--free-fg); }
.status.requested, .status.unpaid { background: var(--pending); color: #7a5410; }
table.list {
  border-collapse: separate; border-spacing: 0; width: 100%; font-size: 15px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden;
}
table.list th { background: #faf9f6; font-size: 13px; color: var(--muted); font-weight: 600; }
table.list th, table.list td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list tr:last-child td { border-bottom: 0; }
table.list.compact td { padding: 6px 12px; font-size: 14px; }
.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.panels .panel { margin: 0; }

@media (max-width: 640px) {
  main { padding-top: 12px; }
  .hero-text { padding: 80px 16px 28px; background: linear-gradient(to top, rgba(10, 20, 16, .85), rgba(10, 20, 16, .55) 70%, transparent); }
  .hero-text p { font-size: 16px; }
  .card { padding: 16px; }
  table.list thead { display: none; }
  table.list td { display: block; border: 0; padding: 2px 12px; }
  table.list tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; }
}
