/* ============ Тераса · Світязь ============ */

:root {
  --paper: #faf8f3;
  --paper-alt: #f2eee4;
  --card: #ffffff;
  --ink: #24282b;
  --ink-soft: #62686d;
  --line: #e5dfd0;
  --accent: #a8874f;        /* декоративний золотавий (рамки, орнамент) */
  --accent-dark: #8a6d3c;   /* фон кнопок: 4.85:1 з білим текстом (AA) */
  --accent-deep: #75592c;   /* hover кнопок і дрібний акцентний текст */
  --accent-tint: #f3ead9;
  --free: #3e7a4e;
  --few: #856016;           /* «мало місць»: читається і на білому, і на tint */
  --full: #b2503f;
  --shadow: 0 10px 40px rgba(36, 40, 43, 0.10);
  --radius: 10px;
  --header-h: 72px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, .logo-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 500;
  line-height: 1.15;
}

a { color: inherit; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

section { scroll-margin-top: calc(var(--header-h) + 8px); }

/* ---------- Кнопки ---------- */

.btn {
  display: inline-block;
  padding: 13px 28px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}

.btn:active { transform: translateY(1px); }

.btn-accent {
  background: var(--accent-dark);
  color: #fff;
}
.btn-accent:hover { background: var(--accent-deep); }

.btn-ghost {
  border-color: rgba(255, 255, 255, 0.75);
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(2px);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.18); }

.btn-ghost-dark {
  border-color: var(--ink);
  color: var(--ink);
  background: transparent;
}
.btn-ghost-dark:hover { background: var(--ink); color: #fff; }

.btn-lg { padding: 16px 34px; font-size: 0.98rem; }
.btn-block { width: 100%; }

.btn[disabled] { opacity: 0.55; cursor: wait; }

/* ---------- Шапка ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  transition: background 0.25s, box-shadow 0.25s;
  color: #fff;
}

.site-header.scrolled {
  background: rgba(250, 248, 243, 0.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--line);
  color: var(--ink);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 28px;
}

.logo {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  line-height: 1.1;
  margin-right: auto;
}
.logo-name { font-size: 1.65rem; letter-spacing: 0.02em; }
.logo-sub {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0.75;
}

.site-nav { display: flex; gap: 26px; }
.site-nav a {
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-decoration: none;
  opacity: 0.92;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s, opacity 0.2s;
}
.site-nav a:hover { opacity: 1; border-bottom-color: var(--accent); }

.header-cta { padding: 11px 22px; font-size: 0.8rem; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  padding: 8px;
  cursor: pointer;
}
.nav-toggle span {
  width: 24px; height: 2px;
  background: currentColor;
  transition: transform 0.2s, opacity 0.2s;
}

/* ---------- Головний екран ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 60%;
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(20, 24, 26, 0.42), rgba(20, 24, 26, 0.18) 40%, rgba(20, 24, 26, 0.5));
}

.hero-content {
  position: relative;
  padding: 120px 24px 80px;
  max-width: 820px;
}

.hero-kicker {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  opacity: 0.9;
  margin-bottom: 18px;
}

.hero h1 {
  font-size: clamp(3.4rem, 10vw, 6.2rem);
  font-weight: 500;
  letter-spacing: 0.01em;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.35);
}

.hero-tagline {
  margin: 22px auto 38px;
  font-size: clamp(1.05rem, 2.4vw, 1.3rem);
  font-weight: 400;
  opacity: 0.95;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.4);
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-scroll {
  position: absolute;
  bottom: 26px; left: 50%;
  transform: translateX(-50%);
  color: #fff;
  opacity: 0.8;
  animation: float 2.2s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 8px); }
}

/* ---------- Секції ---------- */

.section { padding: 96px 0; }
.section-alt { background: var(--paper-alt); }

.section-kicker {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin-bottom: 10px;
}

.section-title {
  font-size: clamp(2rem, 4.6vw, 2.8rem);
  margin-bottom: 18px;
}

.section-lead {
  max-width: 640px;
  color: var(--ink-soft);
  margin-bottom: 44px;
}

/* ---------- Про базу ---------- */

.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 60px;
  align-items: start;
  margin-top: 26px;
}

.about-text p + p { margin-top: 16px; }
.about-text { color: var(--ink-soft); font-size: 1.04rem; }

.facts { list-style: none; display: grid; gap: 22px; }
.facts li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 26px;
  display: flex;
  align-items: baseline;
  gap: 18px;
}
.fact-num {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  color: var(--accent-dark);
  min-width: 74px;
}
.fact-label { color: var(--ink-soft); font-size: 0.95rem; }

/* ---------- Бронювання ---------- */

.booking-layout {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 28px;
  align-items: start;
}

.calendar-card, .booking-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.calendar-card { padding: 26px 26px 20px; }

.steps-hint {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 1.02rem;
  margin-bottom: 20px;
}
.step-dot {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--accent-dark);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.calendar-nav {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.cal-arrow {
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 42px; height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink);
  margin-top: 2px;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.cal-arrow:hover:not([disabled]) { background: var(--accent-tint); border-color: var(--accent); }
.cal-arrow[disabled] { opacity: 0.3; cursor: default; }

.cal-months {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
}

.cal-month-title {
  text-align: center;
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 12px;
  text-transform: capitalize;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-wd {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 6px 0;
}

.cal-day {
  position: relative;
  border: 1px solid transparent;
  border-radius: 8px;
  background: none;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  min-height: 52px;
  padding: 6px 2px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.cal-day .d { font-weight: 600; line-height: 1; }
.cal-day .free-n {
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.free-n::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.cal-day[data-level="free"] .free-n { color: var(--free); }
.cal-day[data-level="few"] .free-n { color: var(--few); }
.cal-day[data-level="full"] .free-n { color: var(--full); }
.cal-day[data-level="full"] .free-n::before { background: var(--full); }

.cal-day:hover:not(.disabled):not(.empty) { border-color: var(--accent); background: var(--accent-tint); }

.cal-day.empty { visibility: hidden; }

.cal-day.disabled {
  color: #b9bdb9;
  cursor: default;
}
.cal-day.disabled .free-n { color: #c4c8c4; }
.cal-day.disabled .free-n::before { background: #c4c8c4; }

.cal-day.in-range { background: var(--accent-tint); border-radius: 0; }
.cal-day.sel-start, .cal-day.sel-end {
  background: var(--accent-dark);
  color: #fff;
}
.cal-day.sel-start { border-radius: 8px 0 0 8px; }
.cal-day.sel-end { border-radius: 0 8px 8px 0; }
.cal-day.sel-start.sel-end { border-radius: 8px; }
.cal-day.sel-start .free-n, .cal-day.sel-end .free-n { color: #fff; }
.cal-day.sel-start .free-n::before, .cal-day.sel-end .free-n::before { background: #fff; }

.cal-day:focus-visible, .btn:focus-visible, .cal-arrow:focus-visible {
  outline: 2px solid var(--accent-deep);
  outline-offset: 2px;
}

.cal-error {
  grid-column: 1 / -1;
  text-align: center;
  padding: 36px 16px;
  color: var(--ink-soft);
}
.cal-error p { margin-bottom: 10px; }
.cal-error strong { color: var(--ink); }
.cal-error .btn { margin-top: 8px; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--ink-soft);
}
.dot { width: 9px; height: 9px; border-radius: 50%; }
.dot-free { background: var(--free); }
.dot-few { background: var(--few); }
.dot-full { background: var(--full); }

/* Панель запиту */

.booking-panel {
  padding: 26px;
  position: sticky;
  top: calc(var(--header-h) + 20px);
}

.panel-title { font-size: 1.45rem; margin-bottom: 16px; }

.range-summary {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 18px;
  font-size: 0.95rem;
}
.range-empty { color: var(--ink-soft); text-align: center; font-size: 0.9rem; }
.range-summary .rs-dates {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 600;
  font-size: 1.02rem;
}
.range-summary .rs-nights {
  color: var(--ink-soft);
  font-size: 0.85rem;
  margin-top: 4px;
}

.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
}
.optional { font-weight: 400; color: var(--ink-soft); }

.field input, .field select, .field textarea {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(168, 135, 79, 0.18);
}

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.field-error {
  color: var(--full);
  font-size: 0.8rem;
  margin-top: 5px;
  display: none;
}
.field-error.visible { display: block; }
.field.invalid input, .field.invalid select { border-color: var(--full); }

.form-error {
  color: var(--full);
  font-size: 0.88rem;
  margin: 4px 0 12px;
  display: none;
}
.form-error.visible { display: block; }

.form-note {
  font-size: 0.8rem;
  color: var(--ink-soft);
  text-align: center;
  margin-top: 12px;
}

.btn-reset {
  display: block;
  margin: 14px auto 0;
  background: none;
  border: none;
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
}
.btn-reset:hover { color: var(--ink); }

.booking-success { text-align: center; padding: 18px 6px; }
.success-icon {
  width: 64px; height: 64px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--free);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.booking-success h3 { font-size: 1.5rem; margin-bottom: 10px; }
.booking-success p { color: var(--ink-soft); margin-bottom: 22px; font-size: 0.95rem; }

/* ---------- Номери ---------- */

.rooms-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  grid-template-rows: repeat(2, 260px);
  gap: 18px;
  margin-bottom: 44px;
}

.room-photo {
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}
.room-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.room-photo:hover img { transform: scale(1.04); }
.room-photo-main { grid-row: span 2; }

.amenities {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px 28px;
}
.amenities li {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 20px;
  font-size: 0.95rem;
  font-weight: 500;
}
.amenities svg { width: 26px; height: 26px; color: var(--accent-dark); flex-shrink: 0; }

/* ---------- Галерея ---------- */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 230px;
  gap: 14px;
}

.g-item {
  border: 0;
  padding: 0;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: zoom-in;
  background: var(--paper-alt);
}
.g-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease, filter 0.3s;
}
.g-item:hover img { transform: scale(1.05); filter: brightness(1.05); }
.g-wide { grid-column: span 2; }

/* ---------- Контакти ---------- */

.location-grid {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 48px;
  align-items: start;
}

.location-line { margin-bottom: 22px; color: var(--ink-soft); }
.location-line strong {
  display: block;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.phone-link {
  font-family: 'Playfair Display', serif;
  font-size: 1.7rem;
  color: var(--ink);
  text-decoration: none;
}
.phone-link:hover { color: var(--accent-dark); }

.location-note { color: var(--ink-soft); font-size: 0.92rem; margin-bottom: 28px; }
.location-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.map-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.map-wrap iframe {
  display: block;
  width: 100%;
  height: 420px;
  border: 0;
}

/* ---------- Підвал ---------- */

.site-footer {
  background: var(--ink);
  color: rgba(255, 255, 255, 0.75);
  padding: 34px 0;
  font-size: 0.88rem;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.site-footer .logo-name { color: #fff; font-size: 1.3rem; }

/* ---------- Мобільна CTA ---------- */

.mobile-cta {
  display: none;
  position: fixed;
  left: 16px; right: 16px; bottom: 16px;
  z-index: 40;
  background: var(--accent-dark);
  color: #fff;
  text-align: center;
  padding: 15px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: 0 8px 30px rgba(36, 40, 43, 0.3);
}

/* ---------- Лайтбокс ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(17, 19, 20, 0.93);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox[hidden] { display: none; }
.lightbox img {
  max-width: 92vw;
  max-height: 86vh;
  border-radius: 6px;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.5);
}
.lb-close, .lb-arrow {
  position: absolute;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.lb-close:hover, .lb-arrow:hover { background: rgba(255, 255, 255, 0.22); }
.lb-close { top: 22px; right: 22px; width: 46px; height: 46px; font-size: 1.1rem; }
.lb-arrow { top: 50%; transform: translateY(-50%); width: 52px; height: 52px; }
.lb-prev { left: 20px; }
.lb-next { right: 20px; }

/* ---------- Анімація появи ---------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-scroll { animation: none; }
}

/* ---------- Адаптив ---------- */

@media (max-width: 1024px) {
  .booking-layout { grid-template-columns: 1fr; }
  .booking-panel { position: static; }
  .rooms-grid { grid-template-rows: repeat(2, 220px); }
}

@media (max-width: 860px) {
  .site-nav {
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--paper);
    color: var(--ink);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    padding: 8px 0 14px;
    display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 13px 28px; font-size: 1rem; border-bottom: 0; }
  .nav-toggle { display: flex; }
  .header-cta { display: none; }

  .calendar-nav { display: block; position: relative; }
  .cal-arrow { position: absolute; top: -4px; z-index: 2; }
  #calPrev { left: 0; }
  #calNext { right: 0; }
  .cal-months { grid-template-columns: 1fr; }
  .cal-month + .cal-month { display: none; }

  .about-grid { grid-template-columns: 1fr; gap: 34px; }
  .amenities { grid-template-columns: 1fr 1fr; }
  .location-grid { grid-template-columns: 1fr; gap: 34px; }

  .rooms-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 220px 180px;
  }
  .room-photo-main { grid-row: auto; grid-column: span 2; }

  .gallery-grid { grid-template-columns: 1fr 1fr; grid-auto-rows: 180px; }

  .section { padding: 72px 0; }
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  .mobile-cta { display: block; }
  .site-footer { padding-bottom: 90px; }
  .hero-actions .btn { width: 100%; }
  .amenities { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .gallery-grid { grid-auto-rows: 150px; gap: 10px; }
  .calendar-card { padding: 18px 12px 14px; }
  .cal-day { min-height: 46px; }
  .map-wrap iframe { height: 320px; }
}
