:root {
  color-scheme: light;
  --bg: #fcfbf8;
  --surface: #ffffff;
  --surface-strong: #f2eee8;
  --text: #292622;
  --muted: #766f67;
  --accent: #a26446;
  --accent-soft: #f3e5d9;
  --border: #e9e3dc;
  --shadow: 0 16px 40px rgba(62, 45, 31, 0.07);
  --radius: 8px;
}

body.dark {
  color-scheme: dark;
  --bg: #1b1a18;
  --surface: #24221f;
  --surface-strong: #302d29;
  --text: #f4f0eb;
  --muted: #b9b0a7;
  --accent: #dfaa87;
  --accent-soft: #3a2d25;
  --border: #3a3631;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body, input, textarea, button { font: inherit; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
img { display: block; max-width: 100%; border-radius: var(--radius); }

.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  padding: 1.25rem max(1.5rem, calc((100vw - 1160px) / 2));
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: .65rem; font-size: .78rem; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; }
.site-logo { width: 2rem; height: 2rem; object-fit: contain; border-radius: 4px; }
.nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.25rem; align-items: center; }
.nav-links a, .site-footer a { color: var(--muted); text-decoration: none; }
.nav-links a:hover, .nav-links a:focus-visible, .site-footer a:hover { color: var(--accent); }
.theme-toggle { display: inline-grid; width: 2.25rem; height: 2.25rem; padding: 0; place-items: center; background: transparent; border: 1px solid var(--border); border-radius: 50%; color: var(--text); cursor: pointer; }
.theme-toggle:hover, .theme-toggle:focus-visible { border-color: var(--accent); color: var(--accent); outline: none; }
.theme-toggle svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }

main { max-width: 1160px; margin: 0 auto; padding: 2rem 1.5rem 5rem; }
.section { margin-top: 6rem; }
.hero { display: grid; grid-template-columns: 1fr .9fr; align-items: center; gap: clamp(2rem, 6vw, 6rem); padding: 4rem 0 1rem; }
.hero-copy { max-width: 42rem; }
.eyebrow { margin: 0 0 1rem; color: var(--accent); font-size: .7rem; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; }
h1, h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-weight: 400; letter-spacing: -.045em; line-height: 1.04; }
.hero h1 { font-size: clamp(3.2rem, 6vw, 5.8rem); }
.section-header h1, .section-header h2, .hero h2 { font-size: clamp(2.5rem, 4.5vw, 4.2rem); }
.lede, .section p { max-width: 43rem; color: var(--muted); line-height: 1.75; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.button { display: inline-flex; justify-content: center; align-items: center; padding: .9rem 1.35rem; background: var(--text); color: var(--bg); border: 1px solid var(--text); border-radius: 2px; text-decoration: none; cursor: pointer; transition: opacity .2s ease; }
.button:hover, .button:focus-visible { opacity: .78; }
.button-secondary { background: transparent; color: var(--text); }

.hero-visual { display: grid; gap: .75rem; }
.hero-image-wrapper { overflow: hidden; border-radius: var(--radius); }
.hero-image-wrapper img { width: 100%; min-height: 410px; object-fit: cover; }
.gallery-placeholder { grid-column: 1 / -1; padding: .8rem; color: var(--muted); font-size: .8rem; text-align: center; background: var(--surface-strong); }

.section-header { max-width: 42rem; margin-bottom: 2.5rem; }
.gallery-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1rem; }
.gallery-item { grid-column: span 4; margin: 0; }
.gallery-item-large { grid-column: span 5; grid-row: span 2; }
.gallery-item-wide { grid-column: span 7; }
.gallery-item img { width: 100%; height: 100%; min-height: 270px; object-fit: cover; transition: transform .5s ease; }
.gallery-item-large img { min-height: 560px; }
.gallery-item:hover img { transform: scale(1.025); }
.gallery-item figcaption { padding: .75rem 0 0; color: var(--muted); font-size: .78rem; }
.gallery-media { position: relative; height: 100%; overflow: hidden; border-radius: var(--radius); background: var(--surface-strong); }
.gallery-item-dynamic .gallery-media { min-height: 270px; }
.gallery-item-dynamic img { position: absolute; inset: 0; min-height: 100%; }
.gallery-item-dynamic figcaption { position: absolute; right: .75rem; bottom: .75rem; left: .75rem; margin: 0; padding: .7rem .8rem; border: 1px solid rgba(255, 255, 255, .22); border-radius: 2px; background: rgba(25, 22, 18, .66); backdrop-filter: blur(8px); color: #fff; font-size: .74rem; font-weight: 650; letter-spacing: .03em; }
.gallery-grid-custom .gallery-item-dynamic:first-child { grid-column: span 7; grid-row: span 2; }
.gallery-grid-custom .gallery-item-dynamic:first-child .gallery-media { min-height: 560px; }
.gallery-grid-custom .gallery-item-dynamic:nth-child(2), .gallery-grid-custom .gallery-item-dynamic:nth-child(3) { grid-column: span 5; }
.gallery-grid-custom .gallery-item-dynamic:nth-child(4) { grid-column: span 12; }
.gallery-grid-custom .gallery-item-dynamic:nth-child(4) .gallery-media { min-height: 330px; }
.gallery-grid-custom .gallery-item-dynamic:nth-child(n + 5) { grid-column: span 4; }
.gallery-grid-count-1 .gallery-item-dynamic:first-child { grid-column: 1 / -1; grid-row: auto; }
.gallery-grid-count-1 .gallery-item-dynamic:first-child .gallery-media { min-height: clamp(340px, 42vw, 540px); }
.gallery-grid-count-2 .gallery-item-dynamic:first-child { grid-column: span 7; grid-row: auto; }
.gallery-grid-count-2 .gallery-item-dynamic:first-child .gallery-media, .gallery-grid-count-2 .gallery-item-dynamic:nth-child(2) .gallery-media { min-height: 440px; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; }
.card, .preview-card, .admin-card, .query-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.admin-panel { margin-top: 1rem; }
.admin-panel > .section-header { margin-bottom: 1.5rem; }
.admin-login-form { display: grid; gap: 1rem; max-width: 38rem; }
.admin-login-form .button { justify-self: start; }
.card img, .preview-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.post-details { margin-top: 1rem; color: var(--muted); line-height: 1.7; }
.post-details summary { color: var(--accent); cursor: pointer; }
.preview-card { min-height: 210px; }
.section-split { display: grid; grid-template-columns: 1.3fr 1fr; gap: 5rem; align-items: start; }
.section-split.no-blog-preview { grid-template-columns: 1fr; }
.contact-cta, .contact-panel { display: grid; gap: 2rem; padding: clamp(1.5rem, 4vw, 3rem); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.contact-cta { grid-template-columns: 1fr auto; align-items: center; }
.form-grid { display: grid; gap: 1rem; }
label { display: grid; gap: .5rem; }
.checkbox-label { display: flex; align-items: center; gap: .7rem; cursor: pointer; }
.checkbox-label input { width: auto; accent-color: var(--accent); }
input, textarea, select { width: 100%; padding: .8rem; background: transparent; color: var(--text); border: 1px solid var(--border); border-radius: 2px; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
.status-message { margin: 0; color: var(--muted); }
.query-list { display: grid; gap: 1rem; }
.query-card h3 { margin: 0 0 .5rem; font-size: 1rem; }
.query-card p { margin: .35rem 0; color: var(--muted); }
.query-card.unread { border-left: 3px solid var(--accent); }
.query-meta { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; }
.query-status { color: var(--accent); font-size: .72rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.button-small { padding: .5rem .75rem; font-size: .78rem; }
.admin-image-card { display: grid; gap: 1rem; }
.admin-content { display: grid; gap: 2.5rem; }
.admin-section { display: grid; gap: 1.5rem; }
.admin-tabs { display: flex; flex-wrap: wrap; gap: .5rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--border); }
.admin-tab { padding: .65rem .85rem; background: transparent; border: 1px solid transparent; border-radius: 2px; color: var(--muted); cursor: pointer; }
.admin-tab:hover, .admin-tab.is-active { border-color: var(--border); background: var(--surface); color: var(--text); }
.admin-workspace-panel { display: none; }
.admin-workspace-panel.is-active { display: grid; }
.admin-section-heading { max-width: 44rem; }
.admin-section-heading h2 { font-size: clamp(2rem, 3vw, 3rem); }
.admin-section-heading p:last-child { margin-bottom: 0; }
.starter-gallery-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; padding: 1.25rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.starter-gallery-actions > div { flex: 1 1 20rem; }
.starter-gallery-actions h3 { margin: 0 0 .35rem; font-size: 1rem; }
.starter-gallery-actions p { margin: 0; color: var(--muted); }
.starter-gallery-actions .status-message { flex-basis: 100%; }
.current-images { display: grid; gap: 1.25rem; padding: 1.5rem; background: var(--surface-strong); border: 1px solid var(--border); border-radius: var(--radius); }
.current-images h3 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.6rem; font-weight: 400; }
.current-images > div > p:last-child { margin-bottom: 0; color: var(--muted); }
.current-image-card { padding: .85rem; box-shadow: none; }
.current-image-frame { overflow: hidden; border-radius: calc(var(--radius) - 2px); background: var(--bg); }
.current-image-frame img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.current-image-card h4 { margin: .35rem 0; font-size: 1rem; }
.current-image-card p { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.current-image-card .image-location { color: var(--accent); font-size: .68rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.site-visuals { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 1rem 0; }
.site-visuals summary { color: var(--accent); cursor: pointer; }
.site-visuals .form-grid { margin-top: 1rem; }
.reorder-controls { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: .75rem; }
.reorder-controls .button { flex: 1 1 120px; }
.hidden { display: none; }
.site-footer { padding: 2rem 1.5rem 3rem; color: var(--muted); font-size: .82rem; text-align: center; }

@media (max-width: 860px) {
  .site-header { align-items: flex-start; flex-wrap: wrap; }
  .nav-links { order: 3; width: 100%; justify-content: flex-start; }
  .hero, .section-split, .contact-cta { grid-template-columns: 1fr; }
  .gallery-item, .gallery-item-large, .gallery-item-wide { grid-column: span 6; grid-row: auto; }
  .gallery-item-large img { min-height: 350px; }
  .gallery-grid-custom .gallery-item-dynamic:first-child, .gallery-grid-custom .gallery-item-dynamic:nth-child(2), .gallery-grid-custom .gallery-item-dynamic:nth-child(3), .gallery-grid-custom .gallery-item-dynamic:nth-child(4), .gallery-grid-custom .gallery-item-dynamic:nth-child(n + 5) { grid-column: span 6; grid-row: auto; }
  .gallery-grid-custom .gallery-item-dynamic:first-child .gallery-media, .gallery-grid-count-2 .gallery-item-dynamic:first-child .gallery-media, .gallery-grid-count-2 .gallery-item-dynamic:nth-child(2) .gallery-media { min-height: 340px; }
}
@media (max-width: 560px) {
  main { padding: 1rem 1rem 4rem; }
  .site-header { padding: 1rem; gap: 1rem; }
  .nav-links { gap: .8rem 1rem; font-size: .9rem; }
  .section { margin-top: 4rem; }
  .hero { padding-top: 2.5rem; }
  .hero h1 { font-size: clamp(2.9rem, 15vw, 4rem); }
  .gallery-grid { gap: .75rem; }
  .gallery-item, .gallery-item-large, .gallery-item-wide { grid-column: span 12; }
  .gallery-item img, .gallery-item-large img { min-height: 300px; }
  .gallery-grid-custom .gallery-item-dynamic:first-child, .gallery-grid-custom .gallery-item-dynamic:nth-child(2), .gallery-grid-custom .gallery-item-dynamic:nth-child(3), .gallery-grid-custom .gallery-item-dynamic:nth-child(4), .gallery-grid-custom .gallery-item-dynamic:nth-child(n + 5) { grid-column: 1 / -1; }
  .gallery-grid-custom .gallery-item-dynamic .gallery-media, .gallery-grid-custom .gallery-item-dynamic:first-child .gallery-media { min-height: 300px; }
}
