/* ============================================================
   dom33 — site-specific additions on top of styles.css (design tokens).
   styles.css is a 1:1 copy of new-design/src/styles.css; keep overrides here.
   ============================================================ */

/* ---------- Base ---------- */
main { display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }

/* ---------- Topbar ---------- */
.brand em { font-style: italic; color: var(--accent); }
.lang-switch a {
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--text-muted);
  transition: all 0.2s var(--ease);
}
.lang-switch a:hover { color: var(--text-strong); }
.lang-switch a.active { background: var(--text-strong); color: var(--bg); }

.theme-tog .ico-moon { display: none; }
[data-theme="light"] .theme-tog .ico-sun { display: none; }
[data-theme="light"] .theme-tog .ico-moon { display: inline-flex; }
.theme-tog span { display: inline-flex; }

.menu-tog { display: none; }
.menu-tog .ico-close { display: none; }
.menu-tog[aria-expanded="true"] .ico-open { display: none; }
.menu-tog[aria-expanded="true"] .ico-close { display: inline-flex; }
.menu-tog span { display: inline-flex; }

/* ---------- Hero ---------- */
.hero { padding: 32px 0 0; }
.hero-eyebrow { margin-bottom: 24px; }
.hero-photo::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 45%; background: linear-gradient(180deg, transparent, rgba(0,0,0,0.65)); pointer-events: none; }
.hero-photo-meta { z-index: 1; }
.search-bar--links { grid-template-columns: 1fr 1fr 1.2fr auto; }
.search-bar--links .search-cell:hover .val { color: var(--accent); }
.search-bar--links .search-submit { justify-content: center; padding: 16px 24px; }

/* ---------- Sections ---------- */
.section-collection { padding-top: 64px; }
.section-browse { padding-top: 48px; }
.section-agency { padding-top: 0; }

/* ---------- Cards (whole card is a link) ---------- */
.card-link { display: flex; flex-direction: column; gap: 16px; color: inherit; }
.card-link:hover .card-title { color: var(--accent); }
.card-title { transition: color 0.2s var(--ease); }
.card-pics {
  position: absolute; right: 14px; bottom: 14px;
  background: color-mix(in oklab, #0e1414 70%, transparent);
  backdrop-filter: blur(8px);
  color: #f4ecd9;
  padding: 5px 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.card-sold {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in oklab, #0e1414 55%, transparent);
  color: #f4ecd9;
  font-family: var(--font-display);
  font-size: 32px;
  font-style: italic;
}
.card.is-sold .card-price { color: var(--text-muted); text-decoration: line-through; text-decoration-thickness: 1px; }

/* ---------- Featured ---------- */
.featured-big > * { min-width: 0; }
.featured-big .photo { display: block; }
.featured-big h3 a:hover { color: var(--accent); }
.featured-eyebrow { display: flex; justify-content: space-between; gap: 16px; }
.featured-foot { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; }
.featured-foot .mono { margin-bottom: 6px; }
.featured-price { font-family: var(--font-display); font-size: 44px; color: var(--text-strong); line-height: 1; }

/* ---------- Browse ---------- */
.cats--2 { grid-template-columns: repeat(2, 1fr); }
.cats--2 .cat { aspect-ratio: 16 / 10; }
.section-geo { padding-top: 48px; }
.cats--n1 { grid-template-columns: 1fr; }
.cats--n1 .cat { aspect-ratio: 21 / 9; }
.cats--n2 { grid-template-columns: repeat(2, 1fr); }
.cats--n2 .cat { aspect-ratio: 16 / 10; }
.cats--n3 { grid-template-columns: repeat(3, 1fr); }
.cat { display: block; }

/* ---------- Agency strip ---------- */
.agent-strip .eyebrow { color: var(--text-muted); }
.agent-actions { display: flex; gap: 12px; margin-top: 32px; flex-wrap: wrap; }

/* ---------- Listing ---------- */
.list-head h1 em { font-size: 0.5em; vertical-align: middle; }
.crumb a { border-bottom: 1px solid transparent; }
.crumb a:hover { color: var(--accent); border-color: var(--accent); }
.region-tabs { margin-top: 0; overflow-x: auto; scrollbar-width: none; }
.region-tabs::-webkit-scrollbar { display: none; }
.region-tab { white-space: nowrap; }
.region-tab:hover { color: var(--text-strong); }
.list-section { padding: 48px 0 32px; }
.empty-state { padding: 64px 0; text-align: center; color: var(--text-muted); }
.empty-state .btn { margin-top: 16px; }

/* ---------- Detail ---------- */
.detail-sold {
  display: inline-block; margin-top: 16px;
  padding: 6px 14px; border-radius: 999px;
  background: var(--danger); color: #f4ecd9;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
}
.gallery > a { background: var(--surface); overflow: hidden; position: relative; display: block; }
.gallery > a:first-child { grid-row: span 2; }
.gallery > a:hover img { transform: scale(1.03); }
.gallery--n1 { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.gallery--n1 > a:first-child { grid-row: auto; }
.gallery--n2 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr; }
.gallery--n2 > a:first-child { grid-row: auto; }
.gallery--n3 { grid-template-columns: 2fr 1fr; }
.gallery--n4 { grid-template-columns: 2fr 1fr 1fr; }
.gallery--n4 > a:nth-child(4) { grid-column: 2 / span 2; }
.specs-grid .item .val.val-sm { font-size: 22px; }
.price-breakdown { margin: 16px 0 0; display: flex; flex-direction: column; gap: 8px; }
.price-breakdown div { display: flex; justify-content: space-between; gap: 16px; font-size: 14px; }
.price-breakdown dt { color: var(--text-muted); }
.price-breakdown dd { margin: 0; color: var(--text-strong); }
.booking-card .btn-primary { width: 100%; }
.booking-card .btn-primary[disabled] { opacity: 0.6; pointer-events: none; }
.form-status { margin: 4px 0 0; font-size: 14px; line-height: 1.5; color: var(--text-strong); white-space: pre-line; }
.form-status.is-error { color: var(--danger); }
.request-form.is-sent .field, .request-form.is-sent button { display: none; }
.request-form.is-sent .form-status {
  padding: 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--accent);
}
.agent-mini .ph { display: inline-flex; width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--border); align-items: center; justify-content: center; }
.agent-mini .ph:hover { border-color: var(--accent); }
.location-block { aspect-ratio: 16 / 9; }
.location-map { position: absolute; inset: 0; }
.location-open {
  position: absolute; top: 16px; right: 16px; z-index: 1;
  padding: 8px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-strong);
}
.location-open:hover { border-color: var(--accent); }
.similar { padding: 96px 0 0; }

/* Rich text coming from the DB (descriptions, CMS pages) */
.prose { color: var(--text); line-height: 1.7; font-size: 16px; max-width: 680px; }
.prose p, .prose ul, .prose ol { margin: 0 0 1em; }
.prose a { color: var(--accent); border-bottom: 1px solid color-mix(in oklab, var(--accent) 40%, transparent); }
.prose h1, .prose h2, .prose h3, .prose h4 { font-family: var(--font-display); font-weight: 400; color: var(--text-strong); line-height: 1.1; margin: 1.4em 0 0.5em; }
.prose img { height: auto; border-radius: var(--radius); }
.prose table { border-collapse: collapse; width: 100%; }
.prose td, .prose th { border-bottom: 1px solid var(--border); padding: 8px 4px; text-align: left; }
.prose * { background-color: transparent !important; color: inherit !important; font-family: inherit !important; }
.prose a, .prose a * { color: var(--accent) !important; }

/* ---------- Page (contacts / about) ---------- */
.page-eyebrow { margin-bottom: 24px; }
.contact-item .val.val-hours { font-family: var(--font-body); font-size: 15px; }
.contact-item .val.val-hours p, .contact-item .val.val-hours .time { margin: 0 0 4px; }
.contact-item .val.val-mono { font-size: 14px; font-family: var(--font-mono); letter-spacing: 0.05em; }
.contact-form-card .agent-actions { margin-top: 40px; }

/* ---------- Footer ---------- */
footer .brand { margin-bottom: 16px; }
.footer-blurb { max-width: 320px; font-size: 14px; line-height: 1.6; }
.footer-hours { font-size: 14px; color: var(--text); line-height: 1.6; }
.footer-hours p, .footer-hours .time { margin: 0 0 6px; }
.footer-grid span { font-size: 14px; color: var(--text); }
.footer-legal, .footer-copy { font-size: 12px; line-height: 1.6; color: var(--text-dim); max-width: 900px; margin: 0 0 24px; }
.footer-legal p { margin: 0 0 6px; }
.footer-legal a { color: var(--text-muted); }

/* ---------- Light theme contrast fixes (design uses dark text on the dark-green accent) ---------- */
[data-theme="light"] .btn-primary,
[data-theme="light"] .search-submit,
[data-theme="light"] .agent-mini .avatar,
[data-theme="light"] .agent-card-inline .avatar,
[data-theme="light"] .location-pin,
[data-theme="light"] .success-state .check { color: #f4ecd9; }
[data-theme="light"] .card-tag.tag-buy { color: #f4ecd9; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(8, 12, 12, 0.94);
  display: flex; align-items: center; justify-content: center;
  padding: 56px 72px;
}
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--radius); }
.lightbox button {
  position: absolute;
  width: 48px; height: 48px; border-radius: 999px;
  border: 1px solid rgba(244,236,217,0.25); color: #f4ecd9;
  display: inline-flex; align-items: center; justify-content: center;
}
.lightbox button:hover { border-color: #d4b896; color: #d4b896; }
.lightbox-close { top: 16px; right: 16px; }
.lightbox-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 16px; top: 50%; transform: translateY(-50%); }
body.no-scroll { overflow: hidden; }

/* ---------- Snow ---------- */
.snowflake {
  position: fixed; top: -10px; left: 0;
  color: #fff; user-select: none; pointer-events: none; z-index: 60;
  animation-name: snow-fall; animation-timing-function: linear; animation-iteration-count: 1;
}
[data-theme="light"] .snowflake { color: #b8c6cc; }
@keyframes snow-fall {
  0%   { transform: translate3d(var(--x-start), -10px, 0) rotate(0deg); opacity: 1; }
  100% { transform: translate3d(var(--x-end), 110vh, 0) rotate(360deg); opacity: 0.2; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .search-bar--links { grid-template-columns: 1fr; }
  .featured-big .body { padding: 0; }
  .detail-head { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .menu-tog { display: inline-flex; }
  .nav {
    display: none;
    position: absolute; top: 72px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 8px 32px 16px;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 14px 0; font-size: 16px; border-bottom: 1px solid var(--border); }
  .nav a.active::after { display: none; }
  .topbar-inner { position: static; }
  .topbar { position: sticky; }
}
@media (max-width: 700px) {
  .container, .container-tight { padding: 0 16px; }
  .nav { padding: 8px 16px 16px; }
  .topbar-inner { gap: 12px; height: 64px; }
  .nav { top: 64px; }
  .topbar-right { gap: 8px; }
  .topbar-cta { display: none; }
  .lang-switch a { padding: 5px 7px; }
  .brand { font-size: 24px; }
  section { padding: 64px 0; }
  .hero-grid { min-height: 0; }
  .hero-meta { gap: 24px; }
  .grid-cards, .cats, .cats--2, .cats--n2, .cats--n3 { grid-template-columns: 1fr; }
  .cats .cat { aspect-ratio: 16 / 10; }
  .featured-big { padding: 16px; gap: 24px; }
  .featured-price { font-size: 34px; }
  .agent-strip { padding: 28px 20px; }
  .agent-card-inline { flex-direction: column; align-items: flex-start; }
  .gallery, .gallery--n2, .gallery--n3, .gallery--n4 { grid-template-columns: 1fr 1fr; grid-template-rows: 2fr 1fr; height: 360px; }
  .gallery > a:first-child { grid-column: 1 / -1; grid-row: auto; }
  .gallery > a:nth-child(n+4) { display: none; }
  .gallery--n4 > a:nth-child(4) { grid-column: auto; }
  .gallery--n1 { grid-template-rows: 1fr; }
  .specs-grid { grid-template-columns: 1fr 1fr; }
  .amenities { grid-template-columns: 1fr; }
  .fld-row { grid-template-columns: 1fr; }
  .contact-item { grid-template-columns: 1fr; gap: 6px; }
  .contact-form-card { padding: 24px; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; gap: 8px; align-items: flex-start; }
  .lightbox { padding: 64px 8px; }
  .lightbox-prev, .lightbox-next { top: auto; bottom: 8px; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Missing photo placeholder (class set by the script in layout.twig) ---------- */
.no-photo {
  position: relative;
  background: var(--surface-2);
}
.no-photo > img.img-missing { opacity: 0; }
.no-photo::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 56px;
  height: 56px;
  background: var(--text-dim);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10.5 12 3l9 7.5'/%3E%3Cpath d='M5 9v11h14V9'/%3E%3Cpath d='M10 20v-6h4v6'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10.5 12 3l9 7.5'/%3E%3Cpath d='M5 9v11h14V9'/%3E%3Cpath d='M10 20v-6h4v6'/%3E%3C/svg%3E") center / contain no-repeat;
  pointer-events: none;
}
.gallery > a.no-photo { background: var(--surface-2); cursor: default; }
