* { box-sizing: border-box; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
:root {
  color-scheme: light dark;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}
html { min-width: 320px; }
body {
  margin: 0;
  min-height: 100vh;
  min-width: 320px;
  display: flex;
  flex-direction: column;
  background: #f6f4ef;
  color: #17212b;
}
main { flex: 1; width: 100%; max-width: 76rem; margin: 0 auto; padding: clamp(1rem, 3vw, 3rem); }
.site-header {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1rem;
  align-items: baseline;
  padding: 1rem 1.25rem;
  color: #fff;
  background: #17212b;
}
.site-header .subtitle { margin: 0; font-size: .9rem; color: #d8dee6; }
footer {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-top: 1px solid #98a2ae;
}
a { color: #7c4dff; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid #7c4dff;
  outline-offset: 2px;
}
h1, h2, h3, p, dt, dd, figcaption, strong, legend, label, button { overflow-wrap: anywhere; }
legend { max-width: 100%; }
button, .image-fields > * { min-width: 0; max-width: 100%; }
.empty-state { padding: 3rem 1rem; text-align: center; }
.hero { display: grid; gap: 1rem; }
.hero-image, .detail-image, .card-image {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  border-radius: .75rem;
  background: #d9d5cd;
}
.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 1.25rem;
}
.work-card {
  min-width: 0;
  display: grid;
  gap: .65rem;
  padding: .8rem;
  border: 1px solid #c9c3b8;
  border-radius: .75rem;
  background: #fff;
}
.secondary-action { font-weight: 700; }
.work-image { margin: 0 0 1.25rem; }
.work-image img { margin-bottom: .5rem; }
.tags, .checklist, .works-list, .image-items { display: grid; gap: .65rem; padding: 0; margin: 0; list-style: none; }
.tags li { display: inline-block; margin-right: .5rem; padding: .2rem .55rem; border-radius: 999px; background: #e5dff7; }
details { padding: .75rem; border: 1px solid #c9c3b8; border-radius: .5rem; background: #fff; }
dl { margin: 0; }
dl dl { margin-top: .5rem; }
dt { font-weight: 700; }
dd { margin: 0 0 .75rem; }
form, fieldset { min-width: 0; margin: 0; }
fieldset {
  display: grid;
  gap: .45rem;
  margin: 0 0 1.25rem;
  padding: 1rem;
  border: 1px solid #c9c3b8;
  border-radius: .65rem;
  background: #fff;
}
legend { font-weight: 800; }
label { font-weight: 650; }
input[type="text"], input[type="number"], input[type="file"], select, textarea {
  width: 100%;
  min-width: 0;
  padding: .55rem;
  border: 1px solid #808a96;
  border-radius: .35rem;
  font: inherit;
  color: inherit;
  background: #fff;
}
textarea { resize: vertical; }
button {
  min-height: 2.7rem;
  padding: .5rem .9rem;
  border: 1px solid #5c6874;
  border-radius: .4rem;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: #17212b;
  cursor: pointer;
}
button.danger { background: #a3232f; border-color: #7d1a24; }
button[disabled] { cursor: not-allowed; opacity: .55; }
.section-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
.section-heading h1, .section-heading h2 { margin: 0; }
.section-heading p { margin: 0; text-align: right; }
.actions { display: flex; flex-wrap: wrap; gap: .65rem; }
.works-list { margin: 1rem 0 2rem; }
.works-list li, .image-item {
  min-width: 0;
  padding: .75rem;
  border: 1px solid #c9c3b8;
  border-radius: .5rem;
  background: #fff;
}
.works-list button { margin-top: .5rem; }
.status-line { font-size: .9rem; color: #4d5763; }
.error { color: #a3232f; font-weight: 700; }
.hidden { display: none !important; }
.image-item {
  display: grid;
  grid-template-columns: minmax(0, 8rem) minmax(0, 1fr);
  gap: .75rem;
}
.image-item img { width: 100%; height: auto; border-radius: .35rem; background: #d9d5cd; }
#cover-preview { margin: 1rem 0; max-width: 36rem; }
#cover-preview-image { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: center; border-radius: .25rem; }
.image-fields { display: grid; gap: .35rem; }
.image-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.image-actions button { min-height: 2.2rem; font-size: .85rem; }
.image-fields input, .image-fields select, .image-fields textarea { padding: .35rem; font-size: .9rem; }
.image-fields textarea { min-height: 3rem; }
.checklist li { padding-left: 1.25rem; position: relative; }
.checklist li::before { position: absolute; left: 0; content: "•"; }
.checklist li.ok::before { content: "✓"; color: #19724a; }
.checklist li.missing::before { content: "!"; color: #a3232f; font-weight: 900; }
.public-links { display: flex; flex-wrap: wrap; gap: .75rem; }
@media (max-width: 40rem) {
  main { padding: .8rem; }
  .section-heading, .section-heading p { align-items: flex-start; text-align: left; }
  .section-heading { display: grid; }
  .image-item { grid-template-columns: minmax(0, 1fr); }
  fieldset { padding: .75rem; }
  .actions button { width: 100%; }
  .site-header { font-size: 1rem; }
}
@media (min-width: 50rem) {
  .image-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .image-fields .wide { grid-column: 1 / -1; }
}
@media (prefers-color-scheme: dark) {
  body { background: #10161d; color: #f2f4f7; }
  .work-card, fieldset, details, .works-list li, .image-item { background: #182231; border-color: #576475; }
  input[type="text"], input[type="file"], select, textarea { background: #10161d; color: #f2f4f7; border-color: #768496; }
  .tags li { background: #2c3444; }
  a { color: #b7a5ff; }
}

/* Glacier Frost gallery; admin and detail retain their independent functional styles. */
[hidden] { display: none !important; }
.gallery-page { color-scheme: light; background: #f9f9ff; color: #0e1c2f; }
.gallery-page main { max-width: 1320px; padding: 2.5rem max(20px, 3vw) 5rem; }
.gallery-page a { color: #006194; text-underline-offset: .22em; }
.gallery-page :focus-visible { outline-color: #006194; }
.gallery-page .site-header { background: #f9f9ff; color: #0e1c2f; border-bottom: 1px solid #bfc7d2; justify-content: space-between; padding: 1rem max(20px, 4vw); }
.gallery-page .site-header nav { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.gallery-page .site-header a { display: inline-flex; align-items: center; min-height: 44px; }
.skip-link { position: fixed; left: 20px; top: -10rem; background: #fff; padding: .75rem; z-index: 10; }
.skip-link:focus { top: 10px; }
.gallery-page .hero { grid-template-columns: minmax(0,.83fr) minmax(0,1.17fr); gap: clamp(2rem,5vw,5rem); align-items: center; padding: 2rem 0 4rem; }
.hero-copy { min-width: 0; }
.gallery-page h1 { font-size: clamp(2.25rem,4.4vw,3.5rem); line-height: 1.14; margin: .6em 0; }
.gallery-page h2 { font-size: 2rem; margin: 0 0 1.5rem; }
.gallery-page #hero-title { font-size: clamp(2.25rem,4.4vw,3.5rem); line-height: 1.14; margin: .6em 0; }
.gallery-page h3 { font-size: 1.25rem; line-height: 1.35; margin: .35rem 0; }
.gallery-page p { color: #3f4850; }
.gallery-page .eyebrow { font-size: .875rem; letter-spacing: .06em; }
.gallery-page .hero-image { aspect-ratio: 4 / 3; object-fit: cover; border-radius: .25rem; background: #f0f3ff; }
.gallery-section { border-top: 1px solid #bfc7d2; padding-top: 2.5rem; }
.collections-section { margin-top: 3rem; padding-top: 2.5rem; border-top: 1px solid #bfc7d2; }
.collection-list { display: grid; gap: 2.5rem; }
.collection-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem; align-items: center; }
.collection-card .card-image { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: .25rem; }
.collection-copy { min-width: 0; overflow-wrap: anywhere; }
.collection-copy h3 { font-size: 1.5rem; }
@media (max-width: 42rem) { .collection-card { grid-template-columns: minmax(0, 1fr); gap: 1rem; } }
.gallery-page .work-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 3rem 1.75rem; margin-top: 2rem; }
.gallery-page .work-card { display: flex; flex-direction: column; align-items: flex-start; padding: 0; gap: .5rem; border: 0; border-radius: 0; background: transparent; }
.gallery-page .card-image { aspect-ratio: 4 / 3; object-fit: cover; border-radius: .25rem; background: #f0f3ff; }
.gallery-page .work-card p { margin: 0 0 .5rem; }
.gallery-page .work-card .card-tags { font-size: .875rem; color: #3f4850; }
.detail-actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.prompt-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.lightbox { width: 100vw; height: 100dvh; max-width: 100vw; max-height: 100dvh; margin: 0; padding: 1rem; border: 0; background: #243145; color: #ebf1ff; }
.lightbox::backdrop { background: #243145; }
.lightbox[open] { display: flex; flex-direction: column; gap: .5rem; }
.lightbox > p { flex: none; margin: 0; color: #ebf1ff; }
.gallery-page .lightbox button { background: #243145; color: #ebf1ff; border-color: #bfc7d2; }
.lightbox button:focus-visible { outline-color: #93ccff; }
.lightbox-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; position: sticky; top: 0; z-index: 1; background: #243145; }
.lightbox-viewport { flex: 1; min-height: 0; overflow: auto; }
.lightbox-viewport img { display: block; width: 100%; height: 100%; object-fit: contain; }
.lightbox-viewport.actual-size img { width: auto; height: auto; max-width: none; }
.detail-page main { max-width: 1160px; }
.detail-page .detail-actions > a { display: inline-flex; min-height: 44px; align-items: center; }
.detail-page #work-detail > h1 { max-width: 22ch; margin-top: 2rem; }
.detail-page #work-detail > p { max-width: 70ch; }
.detail-page .work-image { margin: 2rem 0 3rem; }
.detail-page .detail-image { object-fit: contain; border-radius: .25rem; background: #f0f3ff; }
.detail-page .image-enlarge { display: block; text-decoration: none; }
.detail-page .image-enlarge span { display: inline-flex; min-height: 44px; align-items: center; text-decoration: underline; }
.detail-page figcaption { color: #3f4850; }
.detail-page #story-title + div { white-space: pre-wrap; line-height: 1.8; overflow-wrap: anywhere; }
.author-bio { white-space: pre-wrap; line-height: 1.8; overflow-wrap: anywhere; }
.detail-page section { margin: 2rem 0; }
.detail-page .tags { display: flex; flex-wrap: wrap; }
.detail-page .tags li { background: #f0f3ff; }
.detail-page .tags a { display: inline-flex; min-height: 44px; align-items: center; }
.detail-page details { margin-top: 2rem; background: #f0f3ff; border-color: #bfc7d2; padding: 1.25rem; }
.detail-page summary { min-height: 44px; cursor: pointer; }
.detail-page .next-work { border-top: 1px solid #bfc7d2; padding-top: 2rem; margin-top: 4rem; }
.detail-page .next-work .work-card:has(img) { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); column-gap: 2rem; }
.detail-page .next-work .card-image { grid-column: 1; grid-row: 1 / span 5; }
.detail-page .next-work .work-card > :not(img) { grid-column: 2; }
@media (max-width: 42rem) {
  .detail-page .next-work .work-card:has(img) { display: flex; }
}
.gallery-page .work-card h3 a { color: #0e1c2f; text-decoration: none; }
.gallery-page .work-card h3 a:hover { text-decoration: underline; }
.gallery-page .secondary-action { display: inline-flex; align-items: center; min-height: 44px; }
.gallery-page button, .gallery-section nav a { min-height: 44px; border-radius: 999px; border: 1px solid #bfc7d2; padding: .5rem 1rem; color: #0e1c2f; background: transparent; font-weight: 500; }
.gallery-page button[aria-pressed="true"], .gallery-section nav a[aria-current] { background: #0e1c2f; color: #fff; border-color: #0e1c2f; }
.gallery-section nav { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.gallery-section nav a { display: inline-flex; align-items: center; text-decoration: none; overflow-wrap: anywhere; max-width: 100%; }
#gallery-search { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin: 1rem 0; }
#gallery-q { flex: 1; min-width: 0; width: 12rem; min-height: 44px; font: inherit; padding: .55rem .75rem; border: 1px solid #707881; border-radius: .25rem; background: #fff; color: #0e1c2f; }
#gallery-next { display: table; margin: 3rem auto 0; min-height: 44px; padding: .75rem 1.5rem; border: 1px solid #bfc7d2; border-radius: 999px; }
.gallery-page footer { border-color: #bfc7d2; padding: 1.5rem max(20px,4vw); }
@media (max-width: 64rem) { .gallery-page .work-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 42rem) {
  .gallery-page .hero, .gallery-page .work-grid { grid-template-columns: minmax(0,1fr); }
  .gallery-page .hero { gap: 1.5rem; padding-top: 0; }
  #gallery-search label { flex-basis: 100%; }
  #gallery-q { flex-basis: 100%; width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .gallery-page *, .gallery-page *::before, .gallery-page *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
