/* =============================================================
   Aloevera DCamp — wabi-sabi / scandi stylesheet
   ============================================================= */

:root {
  --bg:        #F5F1EA;   /* тёплый бежевый */
  --bg-soft:   #ECE5DA;   /* песочный */
  --bg-card:   #FFFFFF;
  --paper:     #FAF6EF;
  --line:      #D9D1C2;
  --ink:       #2C2A28;   /* графит */
  --ink-soft:  #5A554F;
  --muted:     #908A82;
  --accent:    #B5705C;   /* терракота */
  --accent-2:  #6B7A5A;   /* приглушённый шалфей */
  --gold:      #B89060;
  --shadow:    0 8px 30px rgba(40, 32, 22, 0.08);

  --serif: "Cormorant Garamond", "Playfair Display", Georgia, serif;
  --sans:  "Inter", -apple-system, "Helvetica Neue", Arial, sans-serif;

  --radius: 4px;

  /* -------- Logo size --------
     Change this value to adjust the header / footer logo image height.
     Applies to <img class="brand-logo"> generated by /js/main.js when
     public/images/logo.(png|svg|jpg) exists. */
  --logo-height: 80px;
  --logo-height-scrolled: 68px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

a { color: var(--ink); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--accent); }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2.4rem, 5vw, 4.6rem); }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.8rem); }
h3 { font-size: 1.4rem; }

p { margin: 0 0 1em; color: var(--ink-soft); }

.eyebrow {
  display: inline-block;
  font-size: .72rem;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.2rem;
}

.container {
  width: min(1200px, 92%);
  margin: 0 auto;
}

.btn {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  padding: 14px 28px;
  font-family: var(--sans);
  font-size: .85rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  border: 1px solid var(--ink);
  border-radius: 0;
  cursor: pointer;
  transition: all .2s ease;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

.btn-ghost {
  background: transparent; color: var(--ink); border: 1px solid var(--ink);
}
.btn-ghost:hover { background: var(--ink); color: var(--paper); }

/* ----------- HEADER ----------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 18px 0;
  transition: background .3s ease, box-shadow .3s ease, padding .3s ease;
}
.site-header.scrolled {
  background: rgba(245, 241, 234, 0.95);
  backdrop-filter: blur(8px);
  padding: 12px 0;
  box-shadow: 0 1px 0 var(--line);
}
.site-header .row {
  display: flex; align-items: center; justify-content: space-between;
}
.brand {
  font-family: var(--serif);
  font-size: 1.6rem;
  letter-spacing: .04em;
  color: var(--paper);
}
.site-header.scrolled .brand { color: var(--ink); }
.brand small {
  display: block;
  font-family: var(--sans);
  font-size: .65rem;
  letter-spacing: .35em;
  text-transform: uppercase;
  margin-top: 2px;
  opacity: .7;
}

/* Image logo (rendered by /js/main.js when public/images/logo.* exists).
   Adjust --logo-height in :root above to resize. */
.brand-logo {
  height: var(--logo-height);
  width: auto;
  display: block;
  max-width: 100%;
  transition: height .3s ease;
}
.site-header.scrolled .brand-logo {
  height: var(--logo-height-scrolled);
}
.brand.brand-has-image {
  /* let the image size the brand block, ignore the serif font-size */
  font-size: 0;
  line-height: 0;
}
.nav { display: flex; gap: 28px; }
.nav a {
  color: var(--paper);
  font-size: .8rem;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.site-header.scrolled .nav a { color: var(--ink); }
.nav a:hover { color: var(--accent); }

/* ----------- HERO ----------- */
.hero {
  position: relative;
  height: 100vh;
  min-height: 620px;
  overflow: hidden;
  color: var(--paper);
}
.hero video,
.hero .hero-poster {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 0;
}
.hero::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,16,12,.35) 0%, rgba(20,16,12,.15) 35%, rgba(20,16,12,.65) 100%);
  z-index: 1;
}
.hero .container {
  position: relative; z-index: 2;
  height: 100%;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding-bottom: 90px;
}
.hero h1 {
  color: var(--paper);
  max-width: 900px;
}
.hero p.sub {
  color: rgba(250, 246, 239, 0.85);
  max-width: 540px;
  font-size: 1.05rem;
}
.hero .cta-row { display: flex; gap: 14px; margin-top: 30px; flex-wrap: wrap; }
.hero .btn { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.hero .btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.hero .btn-ghost { background: transparent; color: var(--paper); border-color: rgba(250,246,239,.7); }
.hero .btn-ghost:hover { background: var(--paper); color: var(--ink); }

.scroll-cue {
  position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
  z-index: 2;
  font-size: .65rem; letter-spacing: .35em; text-transform: uppercase;
  color: rgba(250,246,239,.7);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.scroll-cue::after {
  content: ''; width: 1px; height: 36px; background: rgba(250,246,239,.7);
  animation: cue 1.8s ease-in-out infinite;
}
@keyframes cue {
  0%, 100% { transform: scaleY(.4); transform-origin: top; }
  50% { transform: scaleY(1); }
}

/* ----------- SECTION ----------- */
section { padding: 110px 0; }
.section-head {
  display: grid; grid-template-columns: 1fr 1.4fr; gap: 60px;
  align-items: end;
  margin-bottom: 64px;
}
.section-head .lead p { font-size: 1.05rem; max-width: 540px; }

@media (max-width: 800px) {
  section { padding: 80px 0; }
  .section-head { grid-template-columns: 1fr; gap: 16px; }
}

/* ----------- ABOUT ----------- */
.about-grid {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 60px; align-items: start;
}
.about-grid .visual {
  position: relative;
  aspect-ratio: 4/5;
  overflow: hidden;
}
.about-grid .visual img { width: 100%; height: 100%; object-fit: cover; }
.about-grid .visual::after {
  content: ''; position: absolute; inset: 18px;
  border: 1px solid rgba(250,246,239,.4);
  pointer-events: none;
}
.about-grid .text p { font-size: 1.05rem; }
.about-grid .text .signature {
  margin-top: 30px;
  font-family: var(--serif); font-style: italic; font-size: 1.2rem;
  color: var(--accent);
}

@media (max-width: 800px) { .about-grid { grid-template-columns: 1fr; gap: 30px; } }

/* ----------- AMENITIES ----------- */
.amenities {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.amenity {
  background: var(--bg);
  padding: 36px 30px;
}
.amenity .icon {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
  color: var(--accent);
}
.amenity h3 { font-size: 1.15rem; }
.amenity p { font-size: .92rem; margin: 0; }

@media (max-width: 800px) { .amenities { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .amenities { grid-template-columns: 1fr; } }

/* ----------- CABINS ----------- */
#cabins { background: var(--bg-soft); }
.cabin-list {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px;
}
.cabin {
  background: var(--bg-card);
  padding: 30px;
  display: flex; flex-direction: column; gap: 16px;
  border: 1px solid var(--line);
  transition: transform .25s ease, box-shadow .25s ease;
}
.cabin:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.cabin .head {
  display: flex; align-items: baseline; justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}
.cabin .head h3 { margin: 0; }
.cabin .price {
  font-family: var(--serif); font-size: 1.4rem; color: var(--accent);
}
.cabin .price small { font-size: .7rem; color: var(--muted); letter-spacing: .15em; text-transform: uppercase; margin-left: 4px; }
.cabin .meta { display: flex; gap: 20px; font-size: .85rem; color: var(--muted); }
.cabin .meta span::before { content: '— '; color: var(--accent); }

.tag {
  display: inline-block; padding: 4px 10px;
  background: var(--bg);
  font-size: .65rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--accent); border: 1px solid var(--accent);
}

@media (max-width: 800px) { .cabin-list { grid-template-columns: 1fr; } }

/* ----------- GALLERY ----------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 200px;
  gap: 16px;
}
.gallery a {
  position: relative; overflow: hidden; display: block;
}
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.gallery a:hover img { transform: scale(1.05); }
.gallery .tall { grid-row: span 2; }
.gallery .wide { grid-column: span 2; }

@media (max-width: 800px) {
  .gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 160px; }
  .gallery .wide { grid-column: span 2; }
  .gallery .tall { grid-row: span 1; }
}

/* lightbox */
.lightbox {
  position: fixed; inset: 0; background: rgba(20,16,12,.9);
  display: none; align-items: center; justify-content: center;
  z-index: 100;
}
.lightbox.show { display: flex; }
.lightbox img { max-width: 90vw; max-height: 90vh; object-fit: contain; }
.lightbox .close {
  position: absolute; top: 30px; right: 30px;
  color: var(--paper); font-size: 1.4rem; cursor: pointer;
  background: none; border: 1px solid var(--paper);
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
}

/* ----------- BOOKING FORM ----------- */
#booking {
  background: var(--ink); color: var(--paper);
  background-image:
    linear-gradient(rgba(20,16,12,.8), rgba(20,16,12,.85)),
    url('https://images.unsplash.com/photo-1469854523086-cc02fe5d8800?w=2000&q=70');
  background-size: cover; background-position: center;
}
#booking h2, #booking .eyebrow { color: var(--paper); }
#booking p { color: rgba(250,246,239,.7); }
#booking .eyebrow { color: var(--gold); }

.booking-form {
  background: var(--paper); color: var(--ink);
  padding: 40px;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px 26px;
  border: 1px solid rgba(250,246,239,.15);
}
.booking-form .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted);
}
.field input, .field select, .field textarea {
  border: 0; border-bottom: 1px solid var(--line);
  padding: 10px 0;
  background: transparent;
  font-family: var(--sans); font-size: 1rem; color: var(--ink);
  outline: none;
  border-radius: 0;
}
.field input:focus, .field select:focus, .field textarea:focus { border-bottom-color: var(--accent); }
.field textarea { resize: vertical; min-height: 80px; }

.cabin-picker {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.cabin-picker label {
  display: flex; align-items: center; justify-content: center;
  padding: 10px 8px;
  border: 1px solid var(--line);
  font-size: .85rem; cursor: pointer;
  user-select: none;
  transition: all .15s ease;
}
.cabin-picker input { display: none; }
.cabin-picker label:has(input:checked) {
  background: var(--ink); color: var(--paper); border-color: var(--ink);
}
.cabin-picker label.busy {
  opacity: .35; cursor: not-allowed;
  text-decoration: line-through;
}
/* Disabled because the partner listing (Twin ↔ Cabin №6) is selected. */
.cabin-picker label.blocked {
  opacity: .4; cursor: not-allowed;
}
.cabin-picker label[data-twin="1"] {
  border-color: var(--accent);
}

.booking-summary {
  border-top: 1px dashed var(--line);
  padding-top: 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.booking-summary .price {
  font-family: var(--serif); font-size: 2rem; color: var(--accent);
}
.booking-summary .price small { font-size: .7rem; color: var(--muted); margin-left: 4px; letter-spacing: .15em; text-transform: uppercase; }

.form-msg { padding: 10px 0; font-size: .9rem; }
.form-msg.ok { color: var(--accent-2); }
.form-msg.err { color: #b34c4c; }

@media (max-width: 800px) {
  .booking-form { grid-template-columns: 1fr; padding: 26px; }
  .cabin-picker { grid-template-columns: repeat(3, 1fr); }
}

/* ----------- FOOTER ----------- */
.site-footer {
  background: var(--bg-soft);
  padding: 60px 0 24px;
  border-top: 1px solid var(--line);
}
.site-footer .row {
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px;
  margin-bottom: 30px;
}
.site-footer h4 {
  font-family: var(--sans); font-size: .72rem; letter-spacing: .25em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 14px;
}
.site-footer .legal {
  border-top: 1px solid var(--line); padding-top: 20px;
  display: flex; justify-content: space-between;
  font-size: .8rem; color: var(--muted);
}

@media (max-width: 700px) { .site-footer .row { grid-template-columns: 1fr; gap: 24px; } }

/* ----------- ADMIN ----------- */
.admin-body {
  background: var(--bg);
  min-height: 100vh;
  font-family: var(--sans);
}
.admin-login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background:
    linear-gradient(rgba(20,16,12,.55), rgba(20,16,12,.65)),
    url('https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=2000&q=70') center/cover;
}
.admin-login {
  background: var(--paper);
  padding: 40px;
  width: min(420px, 92%);
}
.admin-login h2 { margin-bottom: 6px; }
.admin-login p { font-size: .85rem; }
.admin-login .field { margin-top: 18px; }
.admin-login .btn { width: 100%; margin-top: 24px; }

.admin-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
.admin-side {
  background: var(--ink); color: var(--paper);
  padding: 30px 24px;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.admin-side .brand { color: var(--paper); margin-bottom: 40px; }
.admin-side nav { display: flex; flex-direction: column; gap: 4px; }
.admin-side nav a {
  color: rgba(250,246,239,.7);
  padding: 10px 12px;
  font-size: .85rem; letter-spacing: .12em; text-transform: uppercase;
  border-left: 2px solid transparent;
  cursor: pointer;
}
.admin-side nav a.active, .admin-side nav a:hover {
  color: var(--paper);
  border-left-color: var(--gold);
  background: rgba(255,255,255,.04);
}
.admin-side .logout {
  margin-top: auto;
  font-size: .75rem; letter-spacing: .2em; text-transform: uppercase;
  color: rgba(250,246,239,.5); cursor: pointer; background: none; border: 0; padding: 10px 12px; text-align: left;
}
.admin-side .logout:hover { color: var(--accent); }

.admin-main { padding: 36px 40px; }
.admin-main h1 { font-size: 2rem; margin-bottom: 6px; }
.admin-main .subtitle { color: var(--muted); margin-bottom: 30px; }

.kpi-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px;
  margin-bottom: 30px;
}
.kpi {
  background: var(--bg-card);
  padding: 22px 24px;
  border: 1px solid var(--line);
}
.kpi .label {
  font-size: .68rem; letter-spacing: .25em; text-transform: uppercase; color: var(--muted);
}
.kpi .value {
  font-family: var(--serif); font-size: 2rem; margin-top: 6px;
  color: var(--ink);
}
.kpi .value small { font-size: .7rem; color: var(--muted); margin-left: 4px; letter-spacing: .15em; text-transform: uppercase; }

@media (max-width: 800px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }

.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  padding: 28px;
  margin-bottom: 22px;
}
.card h3 { font-family: var(--sans); font-size: 1rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; }

table.bookings {
  width: 100%; border-collapse: collapse; font-size: .9rem;
}
table.bookings th, table.bookings td {
  text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line);
}
table.bookings th {
  font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted);
  font-weight: 500;
}
table.bookings tr:hover { background: var(--paper); }
.status {
  display: inline-block; padding: 3px 10px; font-size: .68rem; letter-spacing: .15em; text-transform: uppercase;
  border: 1px solid;
}
.status.new       { color: var(--gold);     border-color: var(--gold); }
.status.confirmed { color: var(--accent-2); border-color: var(--accent-2); }
.status.cancelled { color: #a3645f;         border-color: #a3645f; }

.row-actions { display: flex; gap: 6px; }
.row-actions button {
  font: inherit; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
  padding: 5px 10px; cursor: pointer; background: transparent;
  border: 1px solid var(--line); color: var(--ink-soft);
  transition: all .15s ease;
}
.row-actions button:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.row-actions button.danger:hover { background: #a3645f; border-color: #a3645f; color: #fff; }

.tabs { display: none; }
.tabs.active { display: block; }

/* admin calendar */
.calendar-wrap { overflow-x: auto; }
.calendar {
  display: grid;
  border-collapse: collapse;
  font-size: .72rem;
  min-width: 800px;
}
.calendar .row {
  display: grid;
  grid-auto-flow: column;
  align-items: stretch;
}
.calendar .head-row { background: var(--paper); border-bottom: 1px solid var(--line); }
.calendar .cell {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 6px 4px;
  min-height: 28px;
  position: relative;
  font-size: .7rem;
  color: var(--ink-soft);
  text-align: center;
}
.calendar .cell.label {
  text-align: left; font-weight: 500; padding-left: 12px;
  background: var(--paper);
  position: sticky; left: 0;
  border-right: 1px solid var(--line);
}
.calendar .cell.busy.confirmed { background: rgba(107,122,90,.4); }
.calendar .cell.busy.new       { background: rgba(184,144,96,.4); }
.calendar .cell.weekend        { background: rgba(217,209,194,.25); }
.calendar .cell.today          { box-shadow: inset 0 0 0 2px var(--accent); }

@media (max-width: 800px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: static; height: auto; }
  .admin-side nav { flex-direction: row; flex-wrap: wrap; }
  .admin-main { padding: 22px; }
}

/* helper utilities */
.flex { display: flex; }
.between { justify-content: space-between; }
.center { align-items: center; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-20 { gap: 20px; }
.mt-20 { margin-top: 20px; } .mt-30 { margin-top: 30px; }
.text-muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }


/* ============ MOBILE NAV / HAMBURGER ============ */
.nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  padding: 0;
  width: 36px;
  height: 36px;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  z-index: 60;
}
.nav-toggle span {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--paper);
  transition: transform .25s ease, opacity .2s ease, background .25s ease;
}
.site-header.scrolled .nav-toggle span { background: var(--ink); }

@media (max-width: 800px) {
  .site-header .row { position: relative; }
  /* Center the brand on mobile */
  .brand {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
  }
  .brand small { letter-spacing: .25em; }

  /* Show hamburger; hide nav by default */
  .nav-toggle { display: flex; margin-left: auto; }
  .nav {
    position: fixed;
    top: 0; right: 0;
    width: min(320px, 86vw);
    height: 100vh;
    background: rgba(20,16,12,.96);
    backdrop-filter: blur(10px);
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 6px;
    padding: 80px 36px 40px;
    transform: translateX(100%);
    transition: transform .3s ease;
    box-shadow: -10px 0 30px rgba(0,0,0,.25);
  }
  .nav a {
    color: var(--paper) !important;
    font-size: 1rem;
    padding: 14px 0;
    border-bottom: 1px solid rgba(250,246,239,.08);
    width: 100%;
  }
  .nav.open { transform: translateX(0); }

  /* Hamburger -> X when open */
  .nav-toggle.open span { background: var(--paper); }
  .nav-toggle.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .nav-toggle.open span:nth-child(2) { opacity: 0; }
  .nav-toggle.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

  /* Dim backdrop */
  body.nav-open { overflow: hidden; }
  body.nav-open::before {
    content: '';
    position: fixed; inset: 0;
    background: rgba(20,16,12,.45);
    z-index: 40;
    backdrop-filter: blur(2px);
  }
}
