/* StayFlow public design system — the shared base that sits on top of Bootstrap.
 * It reads the per-property Theme (the :root custom properties the shell injects:
 * --primary, --accent, --font, --bg-page, --bg-card, --border-card, --text-main,
 * --text-muted, --header-bg, --header-border, --brand-color, --title-color) and
 * gives every site a solid, modern default. Each Template then layers a signature
 * look on top via assets/templates/<template_id>.css (selected by body.tpl-<id>).
 */

:root {
  --sf-radius: 14px;
  --sf-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --sf-shadow-sm: 0 4px 16px rgba(15, 23, 42, 0.06);
  --sf-section-y: clamp(48px, 7vw, 96px);
  --sf-container: 1180px;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text-main);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }

.sf-container {
  width: min(var(--sf-container), calc(100% - 2 * clamp(16px, 4vw, 48px)));
  margin-inline: auto;
}

/* ---- Header / nav (Bootstrap navbar as a base, restyled to the Theme) ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  box-shadow: var(--sf-shadow-sm);
}
.site-header .navbar { padding-block: 14px; }
.brand-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--brand-color);
  letter-spacing: -0.01em;
  text-decoration: none;
}
.brand-logo { max-height: 52px; width: auto; display: block; }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px 22px; align-items: center; }
.site-nav a {
  text-decoration: none;
  color: var(--brand-color);
  opacity: 0.82;
  font-weight: 600;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}
.site-nav a:hover,
.site-nav a.is-current { color: var(--accent); opacity: 1; border-bottom-color: var(--accent); }
.header-action-btn {
  display: inline-block;
  padding: 11px 24px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.header-action-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18); color: #fff; }
/* TH / EN switch: next to the menu button on phones, after the nav on desktop. */
.lang-switch {
  display: inline-flex; gap: 2px; padding: 2px; margin-left: auto; margin-right: 10px;
  border: 1px solid color-mix(in srgb, var(--brand-color) 35%, transparent); border-radius: 999px;
  font-size: 0.8rem; line-height: 1;
}
.lang-switch a {
  padding: 6px 10px; border-radius: 999px; text-decoration: none; font-weight: 700;
  color: var(--brand-color); opacity: 0.75;
}
.lang-switch a:hover { opacity: 1; }
.lang-switch a.is-current { background: var(--accent); color: #fff; opacity: 1; }
@media (min-width: 992px) { .lang-switch { order: 3; margin-left: 16px; margin-right: 0; } }
.preview-flag {
  font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: #fff; background: var(--accent); padding: 6px 12px; border-radius: 999px;
}

/* ---- Main / sections ---- */
.site-main { width: min(var(--sf-container), calc(100% - 2 * clamp(16px, 4vw, 48px))); margin: 0 auto; padding-bottom: 40px; }
.page-message {
  margin: 20px 0 0; padding: 12px 16px; border-radius: 12px;
  background: var(--bg-card); border: 1px solid var(--accent); color: var(--text-main);
}
.block { padding-block: var(--sf-section-y); }

/* ---- Hero (structure lives in blocks.js; look lives here + per template) ---- */
.block-hero { color: #fff; position: relative; padding-inline: clamp(20px, 4vw, 56px); overflow: hidden; background-size: cover; background-position: center; }
.block-hero .hero-inner { position: relative; z-index: 2; }
.hero-kicker {
  display: inline-block; margin-bottom: 16px; padding: 6px 16px;
  border: 1px solid rgba(255, 255, 255, 0.5); border-radius: 999px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
}
.hero-title { margin: 0; font-size: clamp(2.1rem, 5.2vw, 3.8rem); line-height: 1.08; letter-spacing: -0.02em; }
.hero-sub { margin: 18px 0 0; font-size: 1.15rem; line-height: 1.6; opacity: 0.92; max-width: 56ch; }
.hero-cta {
  display: inline-block; margin-top: 26px; padding: 14px 34px;
  background: var(--accent); color: #fff; text-decoration: none; border-radius: 999px;
  font-weight: 700; transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.hero-cta:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28); color: #fff; }

/* centered */
.block-hero-centered { padding-block: clamp(72px, 12vw, 150px); text-align: center; }
.block-hero-centered .hero-inner { max-width: 940px; margin-inline: auto; display: flex; flex-direction: column; align-items: center; }
.block-hero-centered .hero-sub { margin-inline: auto; }

/* split */
.block-hero-split { color: var(--text-main); background: var(--bg-page); }
.block-hero-split .hero-inner { display: flex; flex-wrap: wrap; gap: clamp(24px, 4vw, 52px); align-items: center; }
.block-hero-split .hero-text { flex: 1 1 360px; color: var(--title-color); }
.block-hero-split .hero-sub { color: var(--text-muted); opacity: 1; }
.block-hero-split .hero-media { flex: 1 1 340px; align-self: stretch; min-height: 340px; border-radius: 18px; background-size: cover; background-position: center; box-shadow: var(--sf-shadow); }

/* overlay-left */
.block-hero-overlay-left { padding-block: clamp(80px, 12vw, 160px); }
.block-hero-overlay-left .hero-inner { max-width: 480px; padding: clamp(28px, 4vw, 46px); background: rgba(15, 23, 42, 0.55); backdrop-filter: blur(4px); border-left: 4px solid var(--accent); border-radius: 8px; }

/* booking-bar */
.block-hero-booking-bar { padding-block: clamp(64px, 11vw, 140px); text-align: center; }
.block-hero-booking-bar .hero-inner { max-width: 960px; margin-inline: auto; display: flex; flex-direction: column; align-items: center; }
.hero-booking-bar {
  margin: 42px auto 0; padding: 22px 26px; width: 100%; max-width: 940px;
  background: #fff; color: #1e293b; border-radius: 10px; box-shadow: 0 18px 46px rgba(0, 0, 0, 0.24);
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; text-align: left;
}
.hero-booking-bar .field { flex: 1; min-width: 140px; }
.hero-booking-bar label { display: block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; color: #64748b; margin-bottom: 6px; letter-spacing: 0.04em; }
.hero-booking-bar input, .hero-booking-bar select { width: 100%; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 6px; font: inherit; font-size: 0.9rem; color: #1e293b; background: #fff; }
.hero-booking-bar .book-btn { flex: 1.2; min-width: 160px; display: block; text-align: center; padding: 12px 18px; background: var(--accent); color: #fff; text-decoration: none; border-radius: 6px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }

.hero-overlay { position: absolute; inset: 0; z-index: 1; background: linear-gradient(rgba(0,0,0,0.42), rgba(0,0,0,0.42)); }

/* ---- Content blocks (room grid, offers, facilities, gallery, contact, …) ---- */
.block-title {
  margin: 0 0 28px; font-size: clamp(1.6rem, 3vw, 2.4rem); letter-spacing: -0.02em;
  color: var(--title-color, var(--primary));
}
.sf-empty { margin: 0; color: var(--text-muted); }

.card-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

.sf-card {
  border: 1px solid var(--border-card); border-radius: var(--sf-radius);
  background: var(--bg-card); overflow: hidden; display: flex; flex-direction: column;
  box-shadow: var(--sf-shadow-sm); transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.sf-card:hover { transform: translateY(-4px); box-shadow: var(--sf-shadow); }
.sf-card-media { width: 100%; height: 215px; overflow: hidden; background: #1a1a1a; }
.sf-card-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sf-card-body { padding: 22px; flex: 1; display: flex; flex-direction: column; }
.sf-card-title { margin: 0 0 8px; font-size: 1.2rem; color: var(--title-color, var(--primary)); }
.sf-card-text { margin: 0; color: var(--text-muted); line-height: 1.55; flex: 1; }
.sf-card-terms { margin: 10px 0 0; color: var(--text-muted); font-size: 0.85rem; opacity: 0.85; }

.sf-pill {
  display: inline-block; margin-bottom: 10px; padding: 4px 12px; border-radius: 999px;
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.03em; align-self: flex-start;
}
.sf-pill-accent { background: var(--accent); color: #fff; }
.sf-pill-muted { background: color-mix(in srgb, var(--primary) 10%, transparent); color: var(--primary); }

.sf-price {
  align-self: flex-start; margin-bottom: 10px; padding: 4px 12px; border-radius: 4px;
  background: var(--primary); color: #fff; font-size: 0.8rem; font-weight: 700;
  text-transform: uppercase; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}
.sf-specs {
  display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--border-card); font-size: 0.8rem; color: var(--accent); font-weight: 600;
}

/* Room list layout */
.sf-room-list { display: flex; flex-direction: column; gap: 20px; }
.sf-room-row { flex-direction: row; flex-wrap: wrap; }
.sf-room-row .sf-room-media { flex: 1 1 260px; min-height: 220px; background: #1a1a1a; }
.sf-room-row .sf-room-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sf-room-row .sf-card-body { flex: 2 1 320px; }

/* Shared themed button/link */
.sf-btn {
  align-self: flex-start; display: inline-block; margin-top: 16px;
  padding: 11px 24px; background: var(--accent); color: #fff; text-decoration: none;
  border: none; border-radius: 999px; font-weight: 700; font-size: 0.9rem; cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.sf-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16); color: #fff; }

/* Gallery */
.sf-photo { margin: 0; border: 1px solid var(--border-card); border-radius: var(--sf-radius); overflow: hidden; background: var(--bg-card); box-shadow: var(--sf-shadow-sm); }
.sf-photo img { display: block; width: 100%; height: 220px; object-fit: cover; }
.sf-masonry { column-count: 3; column-gap: 16px; }
.sf-masonry .sf-photo { margin: 0 0 16px; break-inside: avoid; }
.sf-photo-tall img { height: auto; }

/* Location / contact */
.sf-address { font-style: normal; color: var(--text-main); line-height: 1.7; }
.sf-contact-list { list-style: none; padding: 0; margin: 0 0 24px; color: var(--text-main); line-height: 1.9; }
.sf-contact-list a { color: var(--primary); }
.sf-form { display: grid; gap: 14px; max-width: 520px; }
.sf-field { display: grid; gap: 6px; font-weight: 600; color: var(--text-main); }
.sf-input { padding: 11px 13px; border: 1px solid var(--border-card); border-radius: 10px; font: inherit; background: var(--bg-card); color: var(--text-main); }
.sf-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.sf-form .sf-btn { justify-self: start; }

/* Booking request form: paired fields side by side, stacked on narrow phones. */
.sf-form-row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); }
.sf-booking-form .sf-input { width: 100%; min-width: 0; }
.sf-booking-lead { color: var(--text-main); max-width: 640px; }
/* Links jump to #booking-form / #inquiry-form; keep the first fields clear of the sticky header. */
#booking-form, #inquiry-form { scroll-margin-top: 140px; }
.sf-card-action { align-self: flex-start; margin-top: auto; }
.hero-booking-bar button.book-btn { border: 0; cursor: pointer; font: inherit; font-weight: 700; }

/* Testimonials */
.sf-quote { padding: 28px; gap: 18px; }
.sf-quote-head { display: flex; align-items: center; justify-content: space-between; }
.sf-stars { color: var(--accent); font-size: 1.15rem; letter-spacing: 2px; }
.sf-quote-date { font-size: 0.8rem; color: var(--text-muted); }
.sf-quote-text { margin: 14px 0 0; font-style: italic; color: var(--text-main); line-height: 1.6; }
.sf-quote-author { display: flex; align-items: center; gap: 14px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border-card); }
.sf-avatar { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent); flex-shrink: 0; }
.sf-avatar-initial { display: flex; align-items: center; justify-content: center; background: var(--primary); color: #fff; font-weight: 700; font-size: 1.1rem; border: none; }
.sf-quote-name { display: block; font-weight: 700; color: var(--primary); }
.sf-quote-title { display: block; font-size: 0.8rem; color: var(--text-muted); }

@media (max-width: 640px) {
  .sf-masonry { column-count: 2; }
}

/* ---- Interactions (progressive enhancement; see assets/site/interactions.js) ---- */
/* The .reveal class is added by JS, so a no-JS page never hides anything. */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in-view { opacity: 1; transform: none; }

.block-gallery img { cursor: zoom-in; }

/* Gallery lightbox (Bootstrap modal, restyled) */
.sf-lightbox .modal-content { background: transparent; border: none; align-items: center; }
.sf-lightbox .lb-img { max-width: 100%; max-height: 80vh; width: auto; border-radius: 8px; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6); }
.sf-lightbox .lb-caption { margin: 12px 0 0; color: #e8eaed; font-size: 0.9rem; text-align: center; }
.sf-lightbox .lb-close { position: absolute; top: -6px; right: -6px; z-index: 3; }
.sf-lightbox .lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 46px; height: 46px; border: none; border-radius: 50%;
  background: rgba(255, 255, 255, 0.9); color: #111; font-size: 1.8rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: background 0.2s ease;
}
.sf-lightbox .lb-nav:hover { background: #fff; }
.sf-lightbox .lb-prev { left: -22px; }
.sf-lightbox .lb-next { right: -22px; }

/* Floating "Book a room" button (revealed on scroll past the hero) */
.book-fab {
  position: fixed; right: clamp(16px, 3vw, 28px); bottom: clamp(16px, 3vw, 28px); z-index: 1040;
  padding: 13px 26px; background: var(--accent); color: #fff; text-decoration: none;
  border-radius: 999px; font-weight: 700; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
  opacity: 0; visibility: hidden; transform: translateY(16px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}
.book-fab.show { opacity: 1; visibility: visible; transform: none; }
.book-fab:hover { color: #fff; transform: translateY(-2px); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .book-fab { transition: opacity 0.2s ease, visibility 0.2s ease; }
}
@media (max-width: 640px) {
  .sf-lightbox .lb-prev { left: 6px; }
  .sf-lightbox .lb-next { right: 6px; }
}

/* ---- Footer ---- */
.site-footer {
  margin-top: 72px; padding: 40px clamp(16px, 4vw, 48px);
  border-top: 1px solid var(--border-card); color: var(--text-muted); font-size: 0.9rem;
  background: var(--header-bg);
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px;
}
.site-footer .brand-name { font-size: 1rem; }

@media (max-width: 720px) {
  .site-nav { gap: 4px 14px; }
  .block-hero-overlay-left .hero-inner { max-width: 100%; }
}
