/* styles.css — Rilski Terasi design system (mobile-first) */

/* ---------- Design tokens ---------- */
:root {
  --color-primary: #2f5d50;
  --color-primary-dark: #1f4036;
  --color-accent: #c1714a;
  --color-accent-dark: #a85c38;

  --color-bg: #faf8f4;
  --color-surface: #ffffff;
  --color-surface-alt: #f1ede4;
  --color-text: #2a2a28;
  --color-muted: #6b6b66;
  --color-border: #e6e1d8;
  --color-overlay: rgba(20, 36, 31, .55);

  --font-base: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --fs-300: .875rem;
  --fs-400: 1rem;
  --fs-500: 1.125rem;
  --fs-600: 1.375rem;
  --fs-700: 1.75rem;
  --fs-800: 2.25rem;

  --space-1: .5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 4rem;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 8px 24px rgba(31, 64, 54, .12);
  --maxw: 1120px;
  --header-h: 64px;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-base);
  font-size: var(--fs-400);
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  padding-bottom: 72px; /* space for sticky CTA on mobile */
}

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

a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-primary-dark); }

h1, h2, h3 { line-height: 1.2; color: var(--color-primary-dark); margin: 0 0 var(--space-2); }
h1 { font-size: var(--fs-800); }
h2 { font-size: var(--fs-700); }
h3 { font-size: var(--fs-600); }
p { margin: 0 0 var(--space-2); }

:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--color-primary-dark); color: #fff;
  padding: var(--space-1) var(--space-2); z-index: 200; border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; color: #fff; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--space-2); }
.narrow { max-width: 70ch; }
.section { padding-block: var(--space-5); }
.section-lead { color: var(--color-muted); margin-bottom: var(--space-3); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 var(--space-3);
  border-radius: 999px; font-weight: 600; font-size: var(--fs-400);
  cursor: pointer; transition: background .2s, transform .1s, color .2s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--color-accent); color: #fff; }
.btn-primary:hover { background: var(--color-accent-dark); color: #fff; }
.btn-ghost { background: transparent; color: var(--color-primary-dark); border: 2px solid var(--color-primary); }
.btn-ghost:hover { background: var(--color-primary); color: #fff; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250, 248, 244, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); }
.brand { display: flex; align-items: center; gap: var(--space-1); line-height: 1.1; }
.brand-logo { width: 38px; height: 38px; flex: none; display: block; }
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-weight: 700; font-size: var(--fs-500); color: var(--color-primary-dark); }
.brand-sub { font-size: var(--fs-300); color: var(--color-muted); letter-spacing: .04em; }

.nav-toggle {
  width: 44px; height: 44px; display: inline-flex; flex-direction: column;
  justify-content: center; gap: 5px; padding: 0 10px;
  background: none; border: 0; cursor: pointer;
}
.nav-toggle-bar { height: 2px; background: var(--color-primary-dark); border-radius: 2px; transition: transform .2s; }

.primary-nav {
  position: absolute; left: 0; right: 0; top: var(--header-h);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  max-height: 0; overflow: hidden; transition: max-height .25s ease;
}
.primary-nav.is-open { max-height: 360px; }
.primary-nav ul { list-style: none; margin: 0; padding: var(--space-1) 0; }
.primary-nav a {
  display: block; padding: var(--space-2); font-weight: 600; color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
}
.primary-nav a:hover, .primary-nav a[aria-current="page"] { color: var(--color-primary); }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 72vh; max-height: 780px; display: grid; align-items: end; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(20,36,31,.6), rgba(20,36,31,.2) 50%, transparent 75%), linear-gradient(180deg, transparent 45%, rgba(20,36,31,.7)); z-index: -1; }.hero-overlay { padding-block: var(--space-5); color: #fff; }
.hero-eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: var(--fs-300); margin-bottom: var(--space-1); opacity: .9; }
.hero h1 { color: #fff; font-size: clamp(2.25rem, 8vw, 3.5rem); margin-bottom: var(--space-2); }
.hero-lead { font-size: var(--fs-500); max-width: 46ch; margin-bottom: var(--space-3); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* Ghost бутон върху hero снимката — бял, за да се чете */
.hero-actions .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, .85); background: rgba(255, 255, 255, .08); }
.hero-actions .btn-ghost:hover { background: #fff; color: var(--color-primary-dark); border-color: #fff; }
/* ---------- Intro ---------- */
.intro { background: var(--color-surface); }

/* ---------- Amenities ---------- */
.amenities { background: var(--color-surface-alt); }
.amenity-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-2); }
.amenity {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-1);
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius); padding: var(--space-3) var(--space-2); font-weight: 600;
}
.amenity-icon { width: 34px; height: 34px; color: var(--color-primary); }

/* ---------- Price cards ---------- */
.price-cards { display: grid; gap: var(--space-2); margin-bottom: var(--space-3); }
.price-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: var(--space-3); box-shadow: var(--shadow); }
.price-card--muted { box-shadow: none; background: var(--color-surface-alt); }
.price-card-title { margin-bottom: var(--space-1); }
.price-card-capacity { color: var(--color-muted); margin-bottom: var(--space-2); }
.price-card-price { display: flex; flex-direction: column; margin: 0 0 var(--space-1); }
.price-card-price .amount { font-size: var(--fs-600); font-weight: 700; color: var(--color-accent-dark); }
.price-card-price .eur { font-size: var(--fs-300); color: var(--color-muted); }
.price-card-note { font-size: var(--fs-300); color: var(--color-muted); margin: 0; }

/* ---------- Gallery ---------- */
.gallery-teaser { background: var(--color-surface); }
.gallery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-1); margin-bottom: var(--space-3); }
.gallery-item { display: block; border-radius: var(--radius-sm); overflow: hidden; }
.gallery-item img { aspect-ratio: 4 / 3; object-fit: cover; transition: transform .3s; }
.gallery-item:hover img { transform: scale(1.05); }

/* ---------- Area / Contact ---------- */
.area-teaser { background: var(--color-surface-alt); }
.contact-lines { display: flex; flex-direction: column; gap: var(--space-1); margin-bottom: var(--space-3); }
.contact-link { font-size: var(--fs-500); font-weight: 600; }

/* ---------- Footer ---------- */
.site-footer { background: var(--color-primary-dark); color: #d7e0db; }
.footer-inner { display: grid; gap: var(--space-2); padding-block: var(--space-4); color: #d7e0db; }
.footer-name { font-weight: 700; font-size: var(--fs-500); color: #fff; margin: 0; }
.footer-addr { margin: 0; }
.footer-contact { display: flex; flex-direction: column; gap: 4px; }
.footer-contact a, .footer-nav a { color: #cdd9d3; }
.footer-contact a:hover, .footer-nav a:hover { color: #fff; }
.footer-copy { font-size: var(--fs-300); opacity: .8; margin: var(--space-2) 0 0; }

/* ---------- Sticky mobile CTA ---------- */
.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 110;
  display: flex; background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -4px 16px rgba(31, 64, 54, .1);
  padding-bottom: env(safe-area-inset-bottom);
}
.sticky-cta-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; min-height: 60px; font-size: var(--fs-300); font-weight: 600; color: var(--color-primary-dark);
}
.sticky-cta-btn svg { width: 22px; height: 22px; }
.sticky-cta-btn--accent { background: var(--color-accent); color: #fff; }
.sticky-cta-btn--accent:hover { background: var(--color-accent-dark); color: #fff; }

/* ---------- Tablet ---------- */
@media (min-width: 640px) {
  .amenity-grid { grid-template-columns: repeat(3, 1fr); }
  .price-cards { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid { grid-template-columns: repeat(4, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-copy { grid-column: 1 / -1; }
}

/* ---------- Desktop ---------- */
@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .sticky-cta { display: none; }

  .nav-toggle { display: none; }
  .primary-nav { position: static; max-height: none; overflow: visible; background: none; border: 0; }
  .primary-nav ul { display: flex; gap: var(--space-1); padding: 0; }
  .primary-nav a { border: 0; padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm); }
  .primary-nav a:hover { background: var(--color-surface-alt); }

  .amenity-grid { grid-template-columns: repeat(5, 1fr); }
.hero { min-height: 80vh; max-height: 840px; }}

/* ---------- Motion preference ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ---- Fix: невалиден hex в .site-footer ---- */

/* ---- Утилити ---- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- Page head ---- */
.page-head { background: var(--color-surface); padding-block: var(--space-4) var(--space-3); border-bottom: 1px solid var(--color-border); }
.page-head h1 { font-size: var(--fs-800); }
.page-lead { color: var(--color-muted); font-size: var(--fs-500); margin: 0; }

/* ---- Houses / Landmarks (споделен card layout) ---- */
.house-list, .landmark-list { display: grid; gap: var(--space-3); }
.house-card, .landmark {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.house-card img, .landmark img { aspect-ratio: 3 / 2; object-fit: cover; width: 100%; }
.house-body, .landmark-body { padding: var(--space-3); }
.house-body h3, .landmark-body h3 { margin-bottom: var(--space-1); }
.house-body p, .landmark-body p { margin: 0; color: var(--color-muted); }
.region-note { margin-top: var(--space-3); color: var(--color-muted); }

/* ---- Pricing extras ---- */
.pricing { background: var(--color-surface-alt); }
.price-card--feature { border-color: var(--color-accent); }
.price-card--feature .amount { color: var(--color-accent-dark); }
.price-notes { list-style: none; margin: var(--space-3) 0; padding: 0; display: grid; gap: var(--space-1); }
.price-notes li { padding-left: 1.5rem; position: relative; color: var(--color-muted); }
.price-notes li::before { content: "•"; position: absolute; left: .3rem; color: var(--color-accent); font-weight: 700; }
.pricing-cta { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.pricing-rules-link { margin-top: var(--space-3); }

/* ---- Contact ---- */
.contact-layout { display: grid; gap: var(--space-4); }
.contact-details { list-style: none; margin: 0 0 var(--space-3); padding: 0; display: grid; gap: var(--space-2); }
.contact-label { display: block; font-size: var(--fs-300); text-transform: uppercase; letter-spacing: .06em; color: var(--color-muted); }
.contact-link { font-size: var(--fs-500); font-weight: 600; }
.contact-address { font-style: normal; }
.contact-directions { color: var(--color-muted); }

.contact-form { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: var(--space-3); box-shadow: var(--shadow); }
.contact-form h2 { font-size: var(--fs-600); }
.field { margin-bottom: var(--space-2); }
.field label { display: block; font-weight: 600; margin-bottom: 4px; }
.field input, .field textarea {
  width: 100%; padding: 12px var(--space-2); font: inherit; color: var(--color-text);
  background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius-sm);
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(47, 93, 80, .15); }
.field textarea { resize: vertical; }

/* ---- Map ---- */
.map-section { background: var(--color-surface-alt); }
.map-link { position: relative; display: block; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.map-link img { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; }
.map-cta {
  position: absolute; left: 50%; bottom: var(--space-2); transform: translateX(-50%);
  background: var(--color-accent); color: #fff; font-weight: 600;
  padding: 10px var(--space-3); border-radius: 999px; box-shadow: var(--shadow);
}
.map-link:hover .map-cta { background: var(--color-accent-dark); }

/* ---- Events ---- */
.events { background: var(--color-surface); }
.event-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-1); }
.event {
  display: grid; gap: 2px; padding: var(--space-2);
  background: var(--color-surface-alt); border-radius: var(--radius-sm);
  border-left: 4px solid var(--color-accent);
}
.event-name { font-weight: 700; color: var(--color-primary-dark); }
.event-when { color: var(--color-muted); font-size: var(--fs-300); }

/* ---- Gallery full ---- */
.gallery-grid--full { grid-template-columns: repeat(2, 1fr); gap: var(--space-1); }
.gallery-grid--full .gallery-item { width: 100%; padding: 0; border: 0; background: none; cursor: pointer; border-radius: var(--radius-sm); overflow: hidden; }
.gallery-grid--full .gallery-item img { aspect-ratio: 4 / 3; object-fit: cover; transition: transform .3s; }
.gallery-grid--full .gallery-item:hover img { transform: scale(1.05); }

/* ---- Lightbox ---- */
.lightbox {
  position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center;
  background: rgba(15, 25, 21, .92); padding: var(--space-3);
}
.lightbox[hidden] { display: none; }
.lightbox-img { max-width: 100%; max-height: 85vh; border-radius: var(--radius-sm); }
.lightbox-close, .lightbox-nav {
  position: absolute; background: rgba(255, 255, 255, .12); color: #fff; border: 0;
  width: 48px; height: 48px; border-radius: 50%; font-size: 1.75rem; line-height: 1; cursor: pointer;
}
.lightbox-close { top: var(--space-2); right: var(--space-2); }
.lightbox-nav { top: 50%; transform: translateY(-50%); }
.lightbox-prev { left: var(--space-1); }
.lightbox-next { right: var(--space-1); }
.lightbox-close:hover, .lightbox-nav:hover { background: rgba(255, 255, 255, .28); }

/* ---- Rules: tabs + accordion ---- */
.lang-tabs { display: flex; gap: var(--space-1); margin-bottom: var(--space-3); }
.lang-tab {
  flex: 1; min-height: 44px; font: inherit; font-weight: 600; cursor: pointer;
  background: var(--color-surface-alt); color: var(--color-muted);
  border: 1px solid var(--color-border); border-radius: 999px;
}
.lang-tab.is-active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

.accordion { display: grid; gap: var(--space-1); }
.acc-item { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-sm); overflow: hidden; }
.acc-item summary {
  list-style: none; cursor: pointer; padding: var(--space-2); font-weight: 600; color: var(--color-primary-dark);
  display: flex; justify-content: space-between; align-items: center;
}
.acc-item summary::-webkit-details-marker { display: none; }
.acc-item summary::after { content: "+"; font-size: 1.5rem; color: var(--color-accent); line-height: 1; }
.acc-item[open] summary::after { content: "–"; }
.acc-body { padding: 0 var(--space-2) var(--space-2); color: var(--color-text); }
.acc-body ul, .acc-body ol { margin: 0; padding-left: 1.25rem; display: grid; gap: 6px; }
.rules-contact { margin-top: var(--space-3); color: var(--color-muted); }

/* ---- Tablet ---- */
@media (min-width: 640px) {
  .house-list, .landmark-list { grid-template-columns: repeat(2, 1fr); }
  .event-list { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid--full { grid-template-columns: repeat(3, 1fr); }
}

/* ---- Desktop ---- */
@media (min-width: 900px) {
  .house-list, .landmark-list { grid-template-columns: repeat(3, 1fr); }
  .contact-layout { grid-template-columns: 1fr 1.2fr; align-items: start; }
  .gallery-grid--full { grid-template-columns: repeat(4, 1fr); }
}

/* ---- Галерия по раздели (квадратни плочки + плейсхолдъри) ---- */
.gallery-group + .gallery-group { padding-top: 0; }
.gallery-group h2 { margin-bottom: var(--space-3); }

.g-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-1);
}

.g-cell {
  position: relative; display: block; width: 100%; aspect-ratio: 1 / 1;
  padding: 0; border: 1px dashed var(--color-border); background: var(--color-surface-alt);
  border-radius: var(--radius-sm); overflow: hidden; cursor: pointer;
}
.g-cell-name {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: 4px; text-align: center; font-size: var(--fs-300); font-weight: 600;
  color: var(--color-muted); word-break: break-all;
}
.g-cell img {
  position: absolute; inset: 0; z-index: 1;
  width: 100%; height: 100%; object-fit: cover; transition: transform .3s;
}
.g-cell img.is-missing { display: none; }      /* няма още снимка → показва името */
.g-cell:hover img { transform: scale(1.05); }

@media (min-width: 600px) {
  .g-grid { grid-template-columns: repeat(4, 1fr); gap: var(--space-2); }
}

/* ... rest of the code remains the same ... */

.map-embed {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius, 12px);
  box-shadow: var(--shadow-md, 0 6px 20px rgba(0, 0, 0, .12));
}

.map-embed iframe {
  display: block;
  width: 100%;
  height: 60vw;
  max-height: 500px;
}

.map-link-text {
  display: inline-block;
  margin-top: var(--space-3, .75rem);
  font-weight: 600;
  color: var(--color-primary, #2f5d50);
}	

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.form-status {
  margin-top: var(--space-3, .75rem);
  padding: .75rem 1rem;
  border-radius: var(--radius-sm, 8px);
  font-weight: 600;
}

.form-status--ok {
  color: #1d6b4f;
  background: #e6f4ee;
}

.form-status--err {
  color: #9b1c1c;
  background: #fdeaea;
}

.thankyou-inner {
  text-align: center;
  padding-block: var(--space-7, 4rem);
}

.thankyou-icon {
  width: 64px;
  height: 64px;
  color: var(--color-primary, #2f5d50);
  margin-bottom: var(--space-4, 1rem);
}

.thankyou-contact {
  margin-block: var(--space-3, .75rem) var(--space-5, 1.5rem);
  font-size: 1.125rem;
  font-weight: 600;
}


/* Anchor offset — секциите да не се крият под фиксираното меню */
.gallery-group { scroll-margin-top: 5rem; }

/* Етикет върху teaser картите на началната страница */
.gallery-item { position: relative; display: block; border-radius: var(--radius, 10px); overflow: hidden; }
.gallery-item-label {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  padding: .5rem .75rem;
  font-size: .85rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, .7));
}


/* Брояч на събитията */
.event-count {
  display: inline-block;
  margin-inline-start: .5rem;
  padding: .15rem .6rem;
  font-size: .78rem;
  font-weight: 600;
  border-radius: 999px;
  color: var(--accent, #2f5d50);
  background: var(--surface-2, #eef1ef);
  white-space: nowrap;
}
.event-count.is-soon { color: #fff; background: var(--accent, #2f5d50); }

.next-event {
  margin-bottom: 1.25rem;
  padding: .75rem 1rem;
  border-inline-start: 4px solid var(--accent, #2f5d50);
  background: var(--surface-2, #eef1ef);
  border-radius: var(--radius, 10px);
}
