/* ============ Hobbyclub — основні стилі (Mobile First) ============ */
:root {
  --green: #2e7d4f;
  --green-dark: #1f5c38;
  --green-light: #e8f3ec;
  --blue: #1a6fb5;
  --warn: #c98a1b;
  --danger: #c0392b;
  --text: #22303a;
  --muted: #64707a;
  --bg: #f6f8f6;
  --card: #ffffff;
  --border: #e2e8e2;
  --radius: 14px;
  --shadow: 0 2px 12px rgba(31, 60, 43, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }

.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.section { padding: 40px 0; }
.section-alt { background: #eef4ef; }
.section-title { font-size: 1.5rem; margin-bottom: .3em; }
.section-sub { color: var(--muted); margin: 0 0 1.2em; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  padding: 10px 18px; border: 1px solid transparent; border-radius: 10px;
  background: var(--green); color: #fff; font-size: .95rem; font-weight: 600;
  cursor: pointer; transition: .2s; text-align: center;
}
.btn:hover { background: var(--green-dark); color: #fff; }
.btn-primary { background: var(--green); color: #fff; }
.btn-outline { background: transparent; border-color: rgba(255,255,255,.7); color: #fff; }
.btn-outline:hover { background: rgba(255,255,255,.15); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: #eef; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #a93226; }
.btn-ok { background: var(--green); }
.btn-sm { padding: 6px 12px; font-size: .85rem; border-radius: 8px; }
.btn-lg { padding: 14px 26px; font-size: 1.05rem; }
.filter-btn { border-color: var(--border); color: var(--text); background: #fff; }
.filter-btn.active, .filter-btn:hover { background: var(--green); color: #fff; border-color: var(--green); }

/* ---------- Шапка ---------- */
.site-header { background: var(--green); color: #fff; position: sticky; top: 0; z-index: 50; box-shadow: var(--shadow); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 62px; gap: 12px; }
.logo { display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 800; font-size: 1.2rem; }
.logo-mark { font-size: 1.4rem; }
.main-nav { display: flex; align-items: center; gap: 6px; }
.main-nav a { color: rgba(255,255,255,.9); padding: 8px 12px; border-radius: 8px; font-size: .95rem; }
.main-nav a:hover, .main-nav a.active { background: rgba(255,255,255,.14); color: #fff; }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 6px; }
.nav-toggle span { display: block; width: 24px; height: 3px; background: #fff; margin: 5px 0; border-radius: 3px; }
.nav-account { margin-left: 8px; }
.avatar-sm { width: 22px; height: 22px; border-radius: 50%; display: inline-block; vertical-align: middle; margin-right: 4px; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--green-dark), var(--green)), url(../img/hero-bg.jpg) center/cover;
  color: #fff; text-align: center; padding: 70px 16px 80px;
}
.hero h1 { font-size: clamp(1.7rem, 5vw, 2.8rem); }
.hero-sub { font-size: 1.15rem; opacity: .9; margin: .5em 0 1.5em; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.about-text { font-size: 1.05rem; max-width: 860px; margin: 0 auto; text-align: center; }

/* ---------- Hero Slider ---------- */
.hero-slider { position: relative; width: 100%; max-height: 520px; overflow: hidden; background: #111; }
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .8s ease; }
.hero-slide.active { opacity: 1; position: relative; }
.hero-slide img { width: 100%; height: 520px; object-fit: cover; display: block; }
.hero-slide a { display: block; position: relative; }
.hero-slide-caption { position: absolute; bottom: 0; left: 0; right: 0; padding: 40px 24px 20px; background: linear-gradient(transparent, rgba(0,0,0,.7)); color: #fff; font-size: 1.3rem; font-weight: 700; }
.hs-prev, .hs-next { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,.45); color: #fff; border: 0; font-size: 2.2rem; width: 48px; height: 48px; border-radius: 50%; cursor: pointer; z-index: 5; transition: .2s; }
.hs-prev:hover, .hs-next:hover { background: rgba(0,0,0,.7); }
.hs-prev { left: 14px; }
.hs-next { right: 14px; }
.hs-dots { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 5; }
.hs-dot { width: 12px; height: 12px; border-radius: 50%; background: rgba(255,255,255,.4); cursor: pointer; transition: .2s; }
.hs-dot.active { background: #fff; }

/* ---------- News on Home ---------- */
.news-grid-home { display: grid; gap: 20px; }
.news-card-home { display: block; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); color: var(--text); transition: .2s; }
.news-card-home:hover { box-shadow: 0 6px 22px rgba(31,60,43,.14); }
.news-card-img { width: 100%; height: 260px; object-fit: cover; display: block; }
.news-card-placeholder { background: var(--green-light); color: var(--green); display: flex; align-items: center; justify-content: center; font-size: 2.6rem; }
.news-card-body { padding: 16px 20px 20px; }
.news-card-title { font-size: 1.2rem; margin: 4px 0 6px; }
.news-card-text { color: var(--muted); font-size: .95rem; margin: 0; }

/* ---------- Слайдер ---------- */
.slider { overflow-x: auto; scroll-snap-type: x mandatory; display: flex; gap: 14px; padding-bottom: 8px; }
.slider .slide { flex: 0 0 85%; scroll-snap-align: start; position: relative; border-radius: var(--radius); overflow: hidden; }
.slide img { width: 100%; height: 240px; object-fit: cover; }
.slide-caption { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(transparent, rgba(0,0,0,.7)); color: #fff; padding: 40px 16px 12px; font-weight: 700; }

/* ---------- Картки ---------- */
.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: block; color: var(--text); }
.card:hover { box-shadow: 0 6px 22px rgba(31,60,43,.14); }
.card-img { width: 100%; height: 200px; object-fit: cover; }
.card-img-placeholder { background: var(--green-light); color: var(--green); display: flex; align-items: center; justify-content: center; font-size: 2.6rem; }
.card-body { padding: 14px 16px; }
.card-title { font-size: 1.1rem; margin: 0 0 .3em; }
.card-date { color: var(--muted); font-size: .85rem; margin-bottom: .3em; }
.card-text { color: var(--muted); font-size: .92rem; margin: 0; }
.price { margin-top: .6em; font-weight: 600; color: var(--green); }
.price strong { font-size: 1.15rem; }

/* ---------- Значки ---------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: .78rem; font-weight: 700; }
.badge-info { background: #e6f1fa; color: var(--blue); }
.badge-warn { background: #fdf3e0; color: var(--warn); }
.badge-ok { background: var(--green-light); color: var(--green); }
.badge-danger { background: #fbeae7; color: var(--danger); }

/* ---------- Бронювання ---------- */
.booking-widget { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.booking-dates { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.booking-dates .field { flex: 1 1 180px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; margin-bottom: 5px; font-size: .92rem; }
.field label small { font-weight: 400; color: var(--muted); }
.field input, .field textarea, .field select, .field [type="date"], .field [type="month"] {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  font: inherit; background: #fff; color: var(--text);
}
.field textarea { resize: vertical; }
.houses-select { display: grid; gap: 10px; margin: 12px 0; }
.house-option { display: flex; align-items: center; gap: 12px; padding: 10px; border: 2px solid var(--border); border-radius: 12px; cursor: pointer; transition: .15s; }
.house-option:hover { border-color: var(--green); }
.house-option.selected { border-color: var(--green); background: var(--green-light); }
.house-option img { width: 64px; height: 48px; object-fit: cover; border-radius: 8px; }
.house-option .ho-info { flex: 1; }
.house-option .ho-title { font-weight: 700; }
.house-option .ho-busy { color: var(--danger); font-weight: 600; }
.house-option .ho-free { color: var(--green); font-weight: 600; }
.house-option.disabled { opacity: .55; cursor: not-allowed; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; margin-bottom: 8px; font-size: .95rem; }
.check input { width: 18px; height: 18px; accent-color: var(--green); }
.booking-options { background: var(--green-light); border-radius: 10px; padding: 12px 14px; margin: 12px 0; }
.price-table { width: 100%; border-collapse: collapse; }
.price-table td { padding: 6px 4px; border-bottom: 1px dashed var(--border); }
.price-total td { border: 0; font-size: 1.15rem; font-weight: 800; color: var(--green); }
.booking-status { margin-top: 12px; font-weight: 600; }
.booking-status.ok { color: var(--green); }
.booking-status.err { color: var(--danger); }
.booking-rules { font-size: .85rem; color: var(--muted); background: #f7f8f7; border-radius: 8px; padding: 10px; margin-bottom: 12px; }

/* ---------- Сторінка будинку ---------- */
.breadcrumbs { color: var(--muted); font-size: .9rem; margin-bottom: 14px; }
.house-layout { display: grid; grid-template-columns: 1fr; gap: 24px; }
.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gallery-item { border-radius: 10px; overflow: hidden; }
.gallery-main { grid-column: 1 / -1; }
.gallery-item img { width: 100%; height: 140px; object-fit: cover; }
.gallery-main img { height: 300px; }
.house-title { font-size: 1.8rem; margin-top: .4em; }
.house-meta { color: var(--muted); display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 14px; }
.house-prices { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.price-box { background: var(--green-light); border-radius: 12px; padding: 12px 18px; flex: 1 1 200px; }
.price-box span { display: block; color: var(--muted); font-size: .85rem; }
.price-box strong { font-size: 1.2rem; color: var(--green); }
.house-description { white-space: normal; }
.house-description, .article-content { font-size: 1.02rem; }
.house-side { display: flex; flex-direction: column; gap: 18px; }
.side-block { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.side-block h3 { margin-top: 0; font-size: 1.05rem; }

/* ---------- Календар (хв. будинку / шахматка) ---------- */
.mini-calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; font-size: .8rem; }
.mini-calendar .mc-head { text-align: center; font-weight: 700; color: var(--muted); padding: 2px; }
.mini-calendar .mc-day { text-align: center; padding: 5px 2px; border-radius: 6px; background: #f2f5f2; }
.mc-day.out { opacity: .4; }
.mc-day.free { background: #dff0e4; color: var(--green-dark); }
.mc-day.busy { background: #fbe3de; color: var(--danger); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.dot-free { background: #2ecc71; }
.dot-busy { background: #e74c3c; }
.hint { color: var(--muted); font-size: .85rem; }

/* ---------- Шахматка адміна ---------- */
.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); }
.table th, .table td { padding: 9px 10px; border-bottom: 1px solid var(--border); font-size: .9rem; text-align: left; vertical-align: top; }
.table th { background: #f2f6f2; font-size: .85rem; }
.table-chess .chess-day { padding: 3px; text-align: center; min-width: 26px; font-size: .75rem; }
.table-chess .wknd { color: var(--danger); }
.cell { display: inline-block; width: 100%; min-width: 18px; height: 22px; border-radius: 4px; }
.cell-free { background: #dff0e4; }
.cell-reserved { background: #fbe3de; }
.cell-busy { background: #f8d7c0; }
.legend { display: flex; gap: 16px; align-items: center; margin-top: 14px; font-size: .9rem; color: var(--muted); }
.legend .cell { width: 16px; height: 16px; }
.table-actions a { margin-right: 8px; font-size: .85rem; }
.table-actions .danger { color: var(--danger); }
.table-actions form { display: inline; }
.table-scroll { overflow-x: auto; }

/* ---------- Відео ---------- */
.video-embed { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: 12px; background: #000; }
.video-embed iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }
.video-filter { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.video-thumb { position: relative; display: block; }
.video-thumb img { width: 100%; height: 200px; object-fit: cover; }
.video-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 3rem; background: rgba(0,0,0,.25); color: #fff; }
.video-card .video-embed { margin: 0; border-radius: 0; }

/* ---------- Відгуки ---------- */
.review-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.avatar-ph { display: flex; align-items: center; justify-content: center; background: var(--green); color: #fff; font-weight: 700; }
.review-name { font-weight: 700; }
.review-house { color: var(--muted); font-size: .85rem; }
.review-text { margin: 6px 0; }
.review-reply { background: #f4f7f4; border-left: 3px solid var(--green); padding: 8px 12px; border-radius: 6px; font-size: .9rem; margin-top: 8px; }
.stars { color: #f1b928; letter-spacing: 2px; font-size: .95rem; }

/* ---------- Зірковий ввід ---------- */
.star-input { display: flex; flex-direction: row-reverse; justify-content: flex-start; gap: 2px; }
.star-input input { display: none; }
.star-input label { font-size: 1.6rem; color: #d4dad4; cursor: pointer; }
.star-input label:hover, .star-input label:hover ~ label,
.star-input input:checked ~ label { color: #f1b928; }

/* ---------- Кабінет ---------- */
.account-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.booking-card { padding: 16px; margin-bottom: 14px; }
.booking-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.booking-card-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: .9rem; margin: 8px 0; }
.booking-card-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.review-form { background: var(--green-light); border-radius: 10px; padding: 14px; margin-top: 12px; }
.thumb { display: inline-block; margin: 4px; }
.thumb img { width: 90px; height: 70px; object-fit: cover; border-radius: 8px; }
.thumb-grid { display: flex; flex-wrap: wrap; }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.9); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.lightbox[hidden] { display: none !important; }
.lightbox img { max-width: 100%; max-height: 90vh; border-radius: 8px; }
.lb-close { position: absolute; top: 14px; right: 22px; font-size: 2.4rem; color: #fff; background: none; border: 0; cursor: pointer; }

/* ---------- Flash ---------- */
.flash-wrap { margin-top: 14px; }
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 10px; font-weight: 600; }
.flash-ok { background: var(--green-light); color: var(--green-dark); border: 1px solid var(--green); }
.flash-err { background: #fbeae7; color: var(--danger); border: 1px solid var(--danger); }

/* ---------- Футер ---------- */
.site-footer { background: #173326; color: #cfd9d2; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 24px; padding: 34px 16px; }
.footer-brand { font-size: 1.2rem; font-weight: 800; color: #fff; margin-bottom: 8px; }
.footer-title { font-weight: 700; color: #fff; margin-bottom: 8px; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 6px; }
.footer-links a { color: #cfd9d2; }
.footer-links a:hover { color: #fff; }
.footer-social { display: flex; gap: 8px; margin-top: 10px; }
.soc { padding: 6px 12px; border-radius: 8px; font-size: .85rem; background: rgba(255,255,255,.1); color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 14px 0; font-size: .85rem; text-align: center; }
.floating-contacts { position: fixed; right: 14px; bottom: 14px; display: flex; flex-direction: column; gap: 10px; z-index: 60; }
.fab { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; box-shadow: var(--shadow); color: #fff; }
.fab-wa { background: #25d366; }
.fab-vb { background: #7360f2; }

/* ---------- Стаття ---------- */
.article { max-width: 860px; }
.article-img { border-radius: 12px; margin-bottom: 16px; max-height: 420px; object-fit: cover; width: 100%; }
.article-content { white-space: normal; }

/* ---------- Адмін ---------- */
.admin-body { background: #eef1ee; }
.admin-layout { display: flex; min-height: 100vh; }
.admin-side { width: 230px; background: #1d2b23; color: #cfd9d2; padding: 16px 0; flex-shrink: 0; }
.admin-logo { padding: 0 18px 16px; font-weight: 800; color: #fff; font-size: 1.1rem; }
.admin-logo span { display: block; font-size: .75rem; color: #8ba896; font-weight: 400; }
.admin-nav { display: flex; flex-direction: column; }
.admin-nav a { padding: 10px 18px; color: #cfd9d2; font-size: .92rem; }
.admin-nav a:hover, .admin-nav a.active { background: rgba(255,255,255,.1); color: #fff; }
.admin-main { flex: 1; padding: 20px; min-width: 0; }
.admin-head h1 { font-size: 1.4rem; margin: 0 0 16px; }
.admin-login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--green-dark); padding: 16px; }
.admin-login { width: 100%; max-width: 380px; }
.admin-login .card { padding: 24px; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 24px; }
.stat { background: #fff; border-radius: 12px; padding: 16px; box-shadow: var(--shadow); border-top: 4px solid var(--green); }
.stat-num { font-size: 1.8rem; font-weight: 800; }
.stat-label { color: var(--muted); font-size: .85rem; }
.stat-ok { border-top-color: var(--green); }
.stat-warn { border-top-color: var(--warn); }
.stat-info { border-top-color: var(--blue); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
.form-col { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
.form-col h3 { margin-top: 0; font-size: 1rem; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check-group { display: flex; flex-direction: column; gap: 6px; }
.review-admin-list { display: grid; gap: 14px; }
.review-pending { border-left: 4px solid var(--warn); }
.reply-form { margin-top: 10px; }
.type-row { align-items: center; margin-bottom: 6px; }

/* ---------- Адаптив (>=768px) ---------- */
@media (min-width: 768px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .slider .slide { flex: 0 0 45%; }
  .house-layout { grid-template-columns: 1.7fr 1fr; }
  .footer-grid { grid-template-columns: 1.4fr 1fr; }
  .stat-grid { grid-template-columns: repeat(5, 1fr); }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .admin-main { padding: 28px; }
  .news-grid-home { grid-template-columns: repeat(3, 1fr); }
  .news-card-img { height: 220px; }
}
@media (min-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .slider .slide { flex: 0 0 30%; }
  .gallery-item img { height: 180px; }
}
@media (max-width: 767px) {
  .nav-toggle { display: block; }
  .main-nav {
    display: none; position: absolute; top: 62px; left: 0; right: 0;
    flex-direction: column; background: var(--green-dark); padding: 12px; gap: 4px; box-shadow: var(--shadow);
  }
  .main-nav.open { display: flex; }
  .main-nav a { display: block; width: 100%; }
  .nav-account { margin-left: 0; }
  .admin-layout { flex-direction: column; }
  .admin-side { width: 100%; }
  .admin-nav { flex-direction: row; flex-wrap: wrap; }
}
