:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f2f1ee;
  color: #1f2421;
  font-synthesis: none;
  --ink: #1f2421;
  --forest: #1d2c28;
  --moss: #a9bd45;
  --clay: #b56c5f;
  --paper: #fbfaf7;
  --line: #d9d6cf;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: #f2f1ee; }
button, input, select { font: inherit; letter-spacing: 0; }
button, select { cursor: pointer; }

.app-header {
  min-height: clamp(230px, 34vh, 330px);
  padding: calc(26px + env(safe-area-inset-top)) clamp(20px, 5vw, 70px) 26px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(12, 18, 16, 0.86) 0%, rgba(12, 18, 16, 0.58) 42%, rgba(12, 18, 16, 0.12) 100%),
    linear-gradient(0deg, rgba(12, 18, 16, 0.78) 0%, rgba(12, 18, 16, 0.08) 58%),
    url("assets/photo-025.jpg") center 38% / cover no-repeat;
  color: white;
  border-bottom: 5px solid var(--moss);
}

.owner-header { background: #22272a; border-bottom-color: #c36557; }
.hero-copy { max-width: 760px; position: relative; z-index: 1; }
.brand { margin: 0 0 9px; color: #dce8a8; font-size: 12px; font-weight: 800; letter-spacing: 1.7px; }
.owner-header .brand { color: #f1b6ad; }
h1 { margin: 0; max-width: 760px; font-size: clamp(38px, 5.8vw, 72px); line-height: .95; letter-spacing: 0; }
.hero-line { max-width: 620px; margin: 14px 0 0; color: #edf1ed; font-size: clamp(16px, 1.8vw, 21px); line-height: 1.35; }
.hero-meta {
  position: relative;
  z-index: 1;
  min-width: 190px;
  padding-bottom: 6px;
  text-align: right;
}
.result-count { margin: 0; color: white; font-size: 30px; font-weight: 850; }
#active-filter-summary { margin: 4px 0 0; color: #dce8a8; font-size: 13px; font-weight: 750; text-transform: uppercase; }
.offline-status {
  display: inline-flex;
  margin-top: 12px!important;
  padding: 6px 9px;
  border: 1px solid rgba(220, 232, 168, .55);
  border-radius: 999px;
  background: rgba(9, 14, 12, .32);
  color: #f1f5dc!important;
  font-size: 11px!important;
}
.offline-status[data-ready="true"] {
  border-color: rgba(169, 189, 69, .9);
  background: rgba(169, 189, 69, .18);
}

main { padding: 0 clamp(16px, 3.5vw, 54px) 54px; }
.room-rail {
  display: flex;
  gap: 9px;
  margin: 14px 0 0;
  padding-bottom: 2px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.room-rail button {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid #c8c7bf;
  border-radius: 999px;
  background: var(--paper);
  color: #39433d;
  font-size: 14px;
  font-weight: 760;
  box-shadow: 0 1px 2px rgba(25, 31, 28, 0.08);
}
.room-rail button span {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 22px;
  height: 22px;
  margin-left: 7px;
  border-radius: 999px;
  background: #ecebe5;
  color: #566057;
  font-size: 12px;
}
.room-rail button.active {
  border-color: var(--forest);
  background: var(--forest);
  color: white;
}
.room-rail button.active span { background: var(--moss); color: #1f271b; }
.filters {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) repeat(4, minmax(130px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  margin: 12px calc(clamp(16px, 3.5vw, 54px) * -1) 0;
  padding: 14px clamp(16px, 3.5vw, 54px);
  background: rgba(248, 247, 243, 0.96);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.owner-filters { grid-template-columns: minmax(210px, 1.6fr) repeat(5, minmax(120px, 1fr)) auto; }
.filters label { display: grid; gap: 6px; min-width: 0; }
.filters label > span { font-size: 11px; font-weight: 750; text-transform: uppercase; color: #5b645f; }
.filters input, .filters select {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid #bcb9b0;
  border-radius: 4px;
  background: white;
  color: var(--ink);
}
.filters input:focus, .filters select:focus { outline: 3px solid rgba(169, 189, 69, 0.35); border-color: #718124; }
.reset-button { min-height: 46px; padding: 0 16px; border: 1px solid #5b645f; border-radius: 4px; background: transparent; color: #2f3833; font-weight: 760; }

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 22px;
  padding: 24px 0 16px;
}
.section-heading p { margin: 0; color: #656d66; }
.section-heading .eyebrow { margin-bottom: 5px; color: #8f473d; font-size: 12px; font-weight: 850; letter-spacing: 1.2px; text-transform: uppercase; }
.section-heading h2 { margin: 0; font-size: clamp(26px, 3vw, 42px); line-height: 1.04; letter-spacing: 0; }
#gallery-note { font-size: 14px; font-weight: 700; text-align: right; }
.gallery { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; }
.photo-card { appearance: none; display: grid; grid-template-rows: auto 1fr; align-content: start; grid-column: span 4; min-width: 0; border: 1px solid rgba(44, 54, 48, 0.08); border-radius: 7px; overflow: hidden; background: var(--paper); box-shadow: 0 10px 24px rgba(23, 31, 27, 0.10); color: inherit; text-align: left; padding: 0; }
.photo-card:first-child { grid-column: span 6; grid-row: span 2; }
.photo-card:focus-visible { outline: 4px solid #9aad35; outline-offset: 3px; }
.photo-card:hover .card-image, .photo-card:focus-visible .card-image { transform: scale(1.018); }
.card-image-wrap { aspect-ratio: 4 / 3; overflow: hidden; background: #e3e1dc; }
.photo-card:first-child .card-image-wrap { aspect-ratio: 16 / 10; }
.card-image { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 180ms ease; }
.card-copy { min-height: 146px; padding: 16px 17px 17px; display: grid; align-content: start; gap: 7px; }
.card-room { margin: 0; color: #7d453e; font-size: 12px; font-weight: 850; text-transform: uppercase; }
.card-copy h2 { margin: 0; font-size: 21px; line-height: 1.16; letter-spacing: 0; }
.photo-card:first-child .card-copy h2 { font-size: clamp(25px, 2.6vw, 36px); }
.card-caption { margin: 0; color: #4f5853; font-size: 14px; line-height: 1.35; }
.feature-strip { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; }
.feature-strip span { padding: 4px 7px; border-radius: 999px; background: #ecebe5; color: #555f57; font-size: 11px; font-weight: 760; }
.owner-card .card-copy { min-height: 134px; }
.owner-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.status { padding: 3px 7px; border-radius: 3px; font-size: 11px; font-weight: 800; background: #e4e8e5; color: #44504a; }
.status.approved { background: #e5edbd; color: #46531a; }
.status.flagged { background: #f4d3ce; color: #773a31; }
.status.review { background: #eee0ba; color: #6c5316; }
.empty-state { margin: 70px 0; text-align: center; color: #66706a; }

.viewer { width: min(1260px, calc(100vw - 28px)); height: min(900px, calc(100dvh - 28px)); padding: 0; border: 0; border-radius: 7px; overflow: hidden; background: #111714; color: white; }
.viewer::backdrop { background: rgba(7, 11, 9, 0.88); }
.viewer figure { margin: 0; height: 100%; display: grid; grid-template-columns: minmax(0, 2.35fr) minmax(310px, 0.75fr); }
.viewer figure > img { width: 100%; height: 100%; min-height: 0; object-fit: contain; background: #090d0b; }
.viewer figcaption { padding: 74px 32px 34px; overflow-y: auto; background: #1f2c28; border-left: 1px solid rgba(255,255,255,.08); }
.owner-viewer figcaption { background: #22272a; }
.viewer-room { color: #dce8a8; font-size: 12px; font-weight: 800; text-transform: uppercase; }
.owner-viewer .viewer-room { color: #f1b6ad; }
.viewer h2 { margin: 8px 0 18px; font-size: clamp(30px, 3vw, 44px); line-height: 1.02; letter-spacing: 0; }
.viewer figcaption > p:not(.viewer-room) { color: #dfe5e1; line-height: 1.55; }
.viewer-counter { margin-top: 22px!important; color: #aeb8b1!important; font-size: 13px; font-weight: 800; text-transform: uppercase; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.tag { border: 1px solid #728079; border-radius: 3px; padding: 6px 9px; color: #eef2ef; font-size: 12px; }
.icon-button { position: absolute; z-index: 2; width: 46px; height: 46px; border: 0; border-radius: 50%; background: rgba(19, 27, 23, 0.82); color: white; font-size: 28px; line-height: 1; }
.close-button { top: 16px; right: 16px; }
.previous-button { left: 14px; top: calc(50% - 23px); }
.next-button { right: calc(28% + 14px); top: calc(50% - 23px); }

@media (max-width: 1050px) {
  .filters, .owner-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .search-field { grid-column: span 2; }
  .photo-card { grid-column: span 6; }
  .photo-card:first-child { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .app-header { min-height: 360px; align-items: flex-end; flex-direction: column; justify-content: flex-end; text-align: left; }
  .hero-copy, .hero-meta { width: 100%; }
  .hero-meta { text-align: left; }
  h1 { font-size: clamp(42px, 13vw, 64px); }
  .hero-line { font-size: 17px; }
  .filters, .owner-filters { position: static; grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
  .reset-button { width: 100%; }
  .section-heading { align-items: start; display: block; padding-top: 26px; }
  #gallery-note { margin-top: 8px; text-align: left; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .photo-card, .photo-card:first-child { grid-column: span 1; }
  .photo-card:first-child { grid-column: 1 / -1; }
  .card-copy { min-height: 118px; padding: 12px; }
  .card-copy h2 { font-size: 17px; }
  .photo-card:first-child .card-copy h2 { font-size: 25px; }
  .card-caption { font-size: 13px; }
  .feature-strip { display: none; }
  .viewer { width: 100vw; height: 100dvh; max-width: none; max-height: none; border-radius: 0; }
  .viewer figure { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .viewer figcaption { max-height: 42dvh; padding: 22px 22px 28px; }
  .next-button { right: 14px; }
}

@media (max-width: 440px) {
  .gallery { grid-template-columns: 1fr; }
  .photo-card, .photo-card:first-child { grid-column: 1 / -1; }
  .filters, .owner-filters { grid-template-columns: 1fr; }
  .search-field { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) { .card-image { transition: none; } }
