:root {
  color-scheme: light;
  --ink: #171a18;
  --muted: #717773;
  --green: #55a51c;
  --line: #e9ebe9;
  --paper: #fff;
  --gutter: clamp(16px, 2.4vw, 36px);
}
* { box-sizing: border-box; }
html { background: var(--paper); }
body { margin: 0; color: var(--ink); background: var(--paper); font: 15px/1.5 Arial, Helvetica, sans-serif; }
a { color: inherit; }
.wrap { width: min(calc(100% - (var(--gutter) * 2)), 1800px); margin: 0 auto; }
.masthead { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 var(--gutter); border-bottom: 1px solid var(--line); }
.wordmark { display: inline-flex; align-items: center; text-decoration: none; }
.site-logo { display: block; width: auto; height: 30px; max-width: min(34vw, 180px); object-fit: contain; }
@media (max-width: 520px) { .site-logo { height: 25px; } }
.top-nav { display: flex; gap: 26px; color: #505651; font-size: 13px; }
.top-nav a { text-decoration: none; }
.top-nav a:hover, .back-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.directory { padding-top: clamp(42px, 7vw, 92px); }
.page-intro { max-width: 720px; padding-bottom: clamp(32px, 5vw, 64px); }
.eyebrow { margin: 0 0 12px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(32px, 5vw, 58px); font-weight: 400; letter-spacing: -.045em; line-height: 1.05; }
.lede { max-width: 620px; margin: 14px 0 0; color: var(--muted); font-size: 16px; }
.directory-bar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.count { margin: 0; color: var(--muted); font-size: 12px; }
.search-box input { width: min(38vw, 260px); min-height: 38px; padding: 8px 0; border: 0; border-bottom: 1px solid #cdd1ce; border-radius: 0; background: transparent; color: var(--ink); font: inherit; font-size: 13px; outline: none; }
.search-box input:focus { border-bottom-color: var(--ink); }
.album-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: clamp(14px, 2vw, 26px); }
.album-card { display: block; color: inherit; text-decoration: none; }
.album-card:hover .album-cover { opacity: .88; }
.album-cover { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #f0f1ef; transition: opacity .18s ease; }
.album-copy { padding: 12px 0 8px; }
.album-meta { margin: 0 0 4px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.album-title { margin: 0; font-size: 17px; font-weight: 500; line-height: 1.3; }
.album-description { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.empty { grid-column: 1 / -1; padding: 60px 0; color: var(--muted); text-align: center; }
.album { padding-top: 26px; }
.back-link { display: inline-block; margin: 0 0 42px; color: #555c57; font-size: 12px; text-decoration: none; }
.album-heading { padding-bottom: 30px; }
.album-heading h1 { font-size: clamp(30px, 4vw, 46px); }
.album-heading .lede { margin-top: 10px; font-size: 14px; }
.album-heading .count { margin-top: 14px; }
.masonry { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; align-items: start; }
.masonry-column { display: grid; min-width: 0; align-content: start; gap: 10px; }
.photo { display: block; width: 100%; margin: 0 0 10px; padding: 0; overflow: hidden; border: 0; background: transparent; break-inside: avoid; cursor: zoom-in; }
.photo img { display: block; width: 100%; height: auto; object-fit: initial; transition: opacity .18s ease; }
.photo:hover img { opacity: .9; }
.footer { display: flex; justify-content: space-between; gap: 20px; margin-top: clamp(52px, 8vw, 100px); padding: 18px 0 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
dialog { width: min(96vw, 1600px); max-width: none; max-height: 96vh; padding: 0; overflow: hidden; border: 0; background: #111; color: #fff; }
dialog::backdrop { background: rgb(0 0 0 / .92); }
.viewer { display: grid; grid-template-rows: 48px minmax(0, 1fr) 44px; height: min(94vh, 1100px); }
.viewer-bar, .viewer-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 0 15px; }
.viewer-bar button, .viewer-footer button { min-width: 42px; min-height: 34px; border: 1px solid #666; background: #191b19; color: #fff; font: inherit; cursor: pointer; }
.viewer-bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#viewer-image { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; background: #080908; }
.viewer-footer { color: #d8ded9; font-size: 12px; }
.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; }
@media (max-width: 1100px) { .masonry { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .masonry { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .masonry-column { gap: 8px; } .directory { padding-top: 42px; } }
@media (max-width: 460px) { .masonry { grid-template-columns: repeat(2, minmax(0, 1fr)); } .album-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } .album-title { font-size: 15px; } .album-description { font-size: 12px; } .top-nav { gap: 15px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; } }
.admin { width: min(calc(100% - (var(--gutter) * 2)), 720px); padding-top: clamp(42px, 7vw, 86px); }
.admin h1 { font-size: clamp(32px, 5vw, 48px); }
.admin-form { display: grid; gap: 20px; margin-top: 36px; }
.admin-form > label:not(.drop-zone) { display: grid; gap: 7px; font-size: 13px; font-weight: 600; }
.admin-form input:not([type="file"]), .admin-form textarea { width: 100%; padding: 11px 12px; border: 1px solid #d5d9d6; border-radius: 2px; background: white; color: var(--ink); font: inherit; font-weight: 400; }
.admin-form textarea { resize: vertical; }
.field-help, .admin-note { color: var(--muted); font-size: 12px; font-weight: 400; }
.drop-zone { display: grid; justify-items: center; gap: 8px; min-height: 168px; padding: 28px; border: 1px dashed #aab1ac; color: var(--muted); text-align: center; cursor: pointer; }
.drop-zone strong { color: var(--ink); font-size: 16px; font-weight: 500; }
.drop-zone input { max-width: 100%; margin-top: 7px; font: inherit; font-size: 12px; }
.drop-zone.dragging { border-color: var(--green); background: #f7fbf4; }
.primary-button, .copy-button { min-height: 44px; padding: 0 18px; border: 0; background: var(--ink); color: white; font: inherit; font-size: 13px; cursor: pointer; }
.primary-button { justify-self: start; }
.primary-button:disabled { opacity: .55; cursor: wait; }
.copy-button { min-height: 34px; background: #f0f1ef; color: var(--ink); }
.upload-status { margin-top: 26px; padding: 18px; border: 1px solid var(--line); font-size: 13px; }
.upload-status progress { width: 100%; height: 8px; accent-color: var(--green); }
#upload-link { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.admin-note { margin-top: 38px; padding-top: 18px; border-top: 1px solid var(--line); }
.photo-search { display: inline-block; margin-top: 12px; }
.photo-search input { width: min(100%, 260px); }
@media (max-width: 520px) { .drop-zone { min-height: 140px; padding: 20px; } }

.manager-section { margin-top: 64px; padding-top: 30px; border-top: 1px solid var(--line); }
.manager-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.manager-heading h2 { margin: 0; font-size: 22px; font-weight: 500; }
.manager-heading .field-help { margin: 7px 0 0; }
.manager-message { min-height: 22px; color: var(--muted); font-size: 13px; }
.gallery-list { display: grid; gap: 16px; }
.managed-album { padding: 20px; border: 1px solid var(--line); background: #fff; }
.managed-album-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.managed-album-title { margin: 0; font-size: 18px; font-weight: 500; }
.managed-album-meta { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.managed-album-link { display: inline-block; margin-top: 7px; color: #414a43; font-size: 12px; overflow-wrap: anywhere; }
.managed-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.managed-actions button, .photo-row button { min-height: 34px; padding: 0 12px; border: 1px solid #d5d9d6; background: #fff; color: var(--ink); font: inherit; font-size: 12px; cursor: pointer; }
.managed-actions button:hover, .photo-row button:hover { background: #f5f6f5; }
.managed-actions .danger-button, .photo-row .danger-button { border-color: #d9bcbc; color: #8b2929; }
.album-editor { display: grid; gap: 14px; margin-top: 18px; padding: 18px; background: #f7f8f7; }
.album-editor[hidden] { display: none; }
.album-editor label { display: grid; gap: 6px; font-size: 12px; font-weight: 600; }
.album-editor input, .album-editor textarea { width: 100%; padding: 9px 10px; border: 1px solid #d5d9d6; background: #fff; color: var(--ink); font: inherit; font-weight: 400; }
.album-editor textarea { resize: vertical; }
.photo-manager { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.photo-manager summary { color: #414a43; font-size: 13px; cursor: pointer; }
.photo-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-top: 14px; }
.photo-row { display: grid; align-content: start; gap: 7px; padding: 8px; border: 1px solid var(--line); }
.photo-row img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #f0f1ef; }
.photo-filename { margin: 0; overflow-wrap: anywhere; color: #505651; font-size: 11px; }
.photo-row button { justify-self: start; }
.album-action-status { min-height: 18px; margin: 10px 0 0; color: var(--muted); font-size: 12px; }
.unmanaged-note { margin: 16px 0 0; color: var(--muted); font-size: 12px; }
@media (max-width: 650px) {
  .manager-heading, .managed-album-header { display: grid; }
  .managed-actions { justify-content: flex-start; }
  .managed-album { padding: 15px; }
}


/* Standalone album page: centered brand and no internal gallery navigation. */
.album-page .gallery-masthead { justify-content: center; }
.album-page .album { padding-top: 30px; }
.album-page .viewer-bar { justify-content: flex-end; }



