:root {
  color-scheme: light;
  --paper: #f6f3ed;
  --white: #fffcf6;
  --ink: #282821;
  --muted: #5d5a50;
  --line: #d9d3c8;
  --accent: #383e2e;
  font: 16px/1.55 system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body, figure { margin: 0; }
a { color: inherit; text-underline-offset: .22em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid #986131; outline-offset: 4px; }
.mast {
  min-height: 74px; padding: 1rem clamp(1rem, 5vw, 5rem); border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; gap: 1.5rem;
}
.mast a { text-decoration: none; }
.mast a:hover { text-decoration: underline; }
.brand { display: flex; gap: .65rem; align-items: center; font: 1.27rem Georgia, serif; }
.brand img { width: auto; max-width: 7rem; max-height: 2.5rem; }
main { padding: clamp(1.1rem, 4vw, 4rem); max-width: 1500px; margin: auto; }
h1, h2 { font-family: Georgia, serif; font-weight: 400; line-height: 1.07; overflow-wrap: anywhere; }
h1 { font-size: clamp(2.4rem, 5vw, 5rem); margin: .2em 0 .28em; }
h2 { font-size: clamp(1.55rem, 3vw, 2.2rem); margin: 0 0 .65rem; }
p { color: var(--muted); }
.access { max-width: 31rem; margin: clamp(1rem, 8vh, 7rem) auto; }
.access form { display: grid; gap: .85rem; margin-top: 1.5rem; }
label { display: grid; gap: .36rem; color: var(--muted); font-size: .94rem; min-width: 0; }
input, select, button { font: inherit; }
input:not([type=checkbox]):not([type=radio]):not([type=range]), select {
  width: 100%; min-height: 2.9rem; padding: .55rem .7rem; border: 1px solid var(--line);
  background: var(--white); color: var(--ink); border-radius: .25rem;
}
button, .button {
  display: inline-block; width: fit-content; padding: .7rem 1.05rem; border-radius: .25rem;
  background: var(--accent); border: 1px solid var(--accent); color: white; cursor: pointer;
  font: inherit; font-size: .93rem; text-decoration: none; text-align: center;
}
button:hover, .button:hover { box-shadow: 0 0 0 1px currentColor inset; }
button:disabled { opacity: .55; cursor: wait; }
.secondary { background: transparent; color: inherit; border-color: var(--line); }
.bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; }
.panel { padding: clamp(1rem, 2.5vw, 2rem); margin: 1rem 0; background: var(--white); border: 1px solid var(--line); }
.fields { display: flex; gap: .9rem; flex-wrap: wrap; align-items: end; margin: .7rem 0; }
.fields label { flex: 1 1 13rem; }
.fields .check { display: flex; align-items: center; padding: .65rem 0; flex: 0 1 auto; }
.list { list-style: none; padding: 0; }
.list li { display: flex; gap: 1rem; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding: .6rem 0; overflow-wrap: anywhere; }
#client-link { margin-bottom: .55rem; }
code { overflow-wrap: anywhere; }
.error { color: #922e24; }
.gallery-head { position: relative; margin: 0 0 1.5rem; overflow: hidden; }
.gallery-head.with-cover { display: grid; align-items: end; min-height: clamp(300px, 57vw, 680px); isolation: isolate; color: white; background: #352e27; }
.gallery-head.with-cover::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(transparent 25%, #151410da); }
.gallery-head.with-cover p { color: white; }
.gallery-head.with-cover > div { padding: clamp(1.1rem, 4vw, 4rem); }
.cover { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photos { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 1rem; }
.open-photo { display: block; }
.open-photo img { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; background: #e8e3d9; }
figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .3rem .7rem; padding: .4rem 0 .8rem; font-size: .88rem; overflow-wrap: anywhere; }
.lock { margin-top: 2rem; }
dialog { max-width: min(95vw, 85rem); max-height: 95vh; border: 0; padding: .75rem; background: #211f1b; color: white; }
dialog::backdrop { background: #141310e6; }
#large { display: block; width: auto; max-width: 100%; max-height: 72vh; margin: auto; object-fit: contain; }
.viewer-bar { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .35rem 0; overflow-wrap: anywhere; }
@media (max-width: 580px) {
  .photos { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
  .mast { min-height: 60px; }
  .mast > a:last-child { font-size: .85rem; }
}

/* Studio and client collections */
:root { --accent-text: #fff; }
button, .button { color: var(--accent-text); }
button.secondary, .button.secondary { color: inherit; }
summary { cursor: pointer; font-weight: 600; }
.dashboard-head { margin-bottom: 1.25rem; }
.tools, .album-nav { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem 1.1rem; }
.album-nav { padding: .85rem 0; margin-bottom: 1rem; border-bottom: 1px solid var(--line); }
.album-nav a { font-weight: 600; font-size: .9rem; }
.album-section { margin: 1.8rem 0; scroll-margin-top: 1rem; }
.gallery-tools { max-width: 36rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(100%,235px),1fr)); gap: 1rem; }
.gallery-card { border: 1px solid var(--line); border-radius: .4rem; overflow: hidden; background: var(--white); }
.card-cover { position: relative; display: block; aspect-ratio: 16/9; overflow: hidden; background: #e7e1d6; }
.card-cover img, .crop-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card-info { padding: .85rem 1rem 1rem; }
.card-info h3 { font: 1.4rem Georgia, serif; overflow-wrap: anywhere; margin: .3rem 0 .7rem; }
.status { font-size: .8rem; margin: 0; }
.crop-control { flex: 1 0 100%; border: 1px solid var(--line); padding: .85rem; min-width: 0; }
.crop-preview { aspect-ratio: 16/9; overflow: hidden; background: #e7e1d6; max-width: 42rem; }
.crop-control input[type=range] { min-height: 1.7rem; accent-color: var(--accent); }
.gallery-head.with-cover { aspect-ratio: 16/9; min-height: 0; }
.gallery-head.with-cover > div { position: relative; }
.list li { flex-wrap: wrap; }
.check { display: flex; align-items: center; }
@media (max-width: 580px) {
  .gallery-head.with-cover h1 { font-size: clamp(1.55rem, 7vw, 2.4rem); }
  .gallery-head.with-cover p { margin: .2rem 0; }
}
body { --heading: Georgia, serif; }
body[data-font=modern] { --heading: system-ui, sans-serif; }
body[data-font=editorial] { --heading: "Baskerville", "Times New Roman", serif; font-family: Georgia, serif; }
body[data-font=minimal] { --heading: "Helvetica Neue", Arial, sans-serif; font-family: "Helvetica Neue", Arial, sans-serif; }
h1, h2, .brand, .card-info h3 { font-family: var(--heading); }
.brand img { max-height: calc(2.5rem * var(--logo-scale, 1)); max-width: min(38vw, calc(7rem * var(--logo-scale, 1))); }
.crop-preview { cursor: grab; touch-action: none; }
.crop-preview:active { cursor: grabbing; }
.crop-preview img { pointer-events: none; }
.favorite { padding: .3rem .55rem; font-size: .78rem; }
.favorite[aria-pressed=true], #viewer-favorite[aria-pressed=true] { text-decoration: underline; }
.privacy-note { font-size: .83rem; margin: 0; }
.screen-reader { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.proof-list { margin: .6rem 0 1.2rem; }
.proof-list textarea { width: 100%; padding: .7rem; background: var(--white); color: var(--ink); border: 1px solid var(--line); font: inherit; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { border-bottom: 1px solid var(--line); text-align: left; padding: .6rem; }

body { font-family: var(--brand-body, system-ui, sans-serif); }
h1, h2, .brand, .card-info h3 { font-family: var(--brand-heading, var(--heading)); }
[data-design-text]:not([data-design-text=""]) p,
[data-design-text]:not([data-design-text=""]) label { color: var(--ink); }
[data-design-width=wide] main { max-width: 1850px; }
[data-design-width=full] main { max-width: none; }
[data-design-shape=cinema] .gallery-head.with-cover,
[data-design-shape=cinema] .crop-preview { aspect-ratio: 21/9; }
[data-design-shape=square] .gallery-head.with-cover,
[data-design-shape=square] .crop-preview { aspect-ratio: 1; }
[data-design-title=center] .gallery-head { text-align: center; }
.gallery-head.with-cover::before { background: linear-gradient(transparent 25%, rgb(15 14 13 / var(--cover-alpha, .7))); }
[data-design-title=below] .gallery-head.with-cover { aspect-ratio: auto; color: var(--ink); background: transparent; }
[data-design-title=below] .gallery-head.with-cover::before { display: none; }
[data-design-title=below] .gallery-head.with-cover .cover { position: static; aspect-ratio: 16/9; z-index: auto; }
[data-design-title=below][data-design-shape=cinema] .gallery-head .cover { aspect-ratio: 21/9; }
[data-design-title=below][data-design-shape=square] .gallery-head .cover { aspect-ratio: 1; }
[data-design-title=below] .gallery-head.with-cover > div { padding: .75rem 0 0; }
[data-design-title=below] .gallery-head.with-cover p { color: var(--ink); }
[data-design-title=below] .gallery-head.with-cover { display: block; }
[data-design-title=below] .gallery-head.with-cover > .cover-frame { position: relative; overflow: hidden; padding: 0; }
[data-design-grid=compact] .photos { grid-template-columns: repeat(auto-fit,minmax(min(100%,12rem),1fr)); gap: .55rem; }
[data-design-grid=spacious] .photos { grid-template-columns: repeat(auto-fit,minmax(min(100%,23rem),1fr)); gap: 1.5rem; }
[data-design-tiles=natural] .open-photo img { aspect-ratio: auto; object-fit: contain; }
[data-design-header=center] .mast { justify-content: center; flex-wrap: wrap; text-align: center; }
.design-controls { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; border: 1px solid var(--line); }
@media (max-width:580px) {
  [data-design-grid=compact] .photos { grid-template-columns: repeat(3,minmax(0,1fr)); }
  [data-design-grid=spacious] .photos { grid-template-columns: 1fr; }
}
.gallery-head.with-cover > .cover-frame {
  position: absolute; inset: 0; z-index: -2; padding: 0; overflow: hidden;
}
.gallery-head.with-cover > .cover-frame .cover { z-index: auto; }
[data-design-title=below] .gallery-head.with-cover > .cover-frame { z-index: auto; }

/* Client directory */
.client-page .mast {
  justify-content: center;
  padding: clamp(2.5rem, 9vw, 5.5rem) 1.25rem clamp(2rem, 6vw, 3.5rem);
  border-bottom: 0;
}
.client-page .brand:has(img) { font-size: 0; }
.client-page .brand img {
  display: block;
  max-height: clamp(6rem, calc(38vw * var(--logo-scale, 1)), 18rem);
  max-width: clamp(6rem, calc(38vw * var(--logo-scale, 1)), 18rem);
}
.client-page main:has(.gallery-directory) { padding: 0 0 4rem; }
.gallery-directory {
  width: min(100% - 2.5rem, 1120px);
  margin: 0 auto;
  padding-top: clamp(1.8rem, 7vw, 4rem);
  border-top: 1px solid var(--line);
}
.directory-grid { display: grid; gap: clamp(2.5rem, 7vw, 5rem) 2rem; }
.directory-card { width: min(100%, 33rem); margin-inline: auto; text-align: center; }
.directory-card a { display: block; text-decoration: none; }
.directory-cover { aspect-ratio: 3/2; overflow: hidden; background: var(--white); }
.directory-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.directory-card h2 {
  margin: 1rem 0 0;
  color: var(--accent);
  font: 500 clamp(.95rem, 2vw, 1.2rem)/1.45 var(--brand-body, system-ui, sans-serif);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.directory-card a:hover h2 { text-decoration: underline; }
.directory-access { width: min(100%, 27rem); margin: 2.25rem auto 0; }
.directory-lookup { display: grid; gap: .75rem; margin-block: 1rem; }
@media (max-width: 679px) {
  .directory-card { width: min(100%, 76vw); }
}
@media (min-width: 680px) {
  .directory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .directory-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.client-page[data-background=""]:has(.gallery-directory) { background: #fff; }
.client-page[data-accent=""] .directory-card h2 { color: #836342; }

/* Gallery welcome and sign-in */
.client-page:has(.gallery-welcome) .mast { display: none; }
.client-page main:has(.gallery-welcome) { max-width: none; padding: 0; }
.gallery-welcome {
  position: relative; isolation: isolate; display: flex; align-items: end;
  min-height: 100vh; min-height: 100svh; overflow: hidden; background: #272320; color: white;
}
.welcome-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.gallery-welcome::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(transparent 32%, rgb(12 10 9 / var(--cover-alpha, .76)));
}
.welcome-copy { width: min(100%, 80rem); margin-inline: auto; padding: clamp(1.5rem, 6vw, 5rem); }
.welcome-copy h1 { font-size: clamp(2rem, 5vw, 5rem); margin: .25rem 0 1.35rem; }
.welcome-copy p { color: white !important; margin: 0; letter-spacing: .14em; font-size: .85rem; text-transform: uppercase; }
.welcome-action {
  display: inline-flex; justify-content: center; align-items: center; min-height: 3.3rem; width: min(100%, 22rem);
  padding: .65rem 1.5rem; border: 1px solid white; border-radius: .45rem; background: #18161245;
  color: white; text-decoration: none;
}
.welcome-action:hover { background: #181612a8; }
.gallery-login { margin-top: 0; }
.gallery-login h1 { margin-top: 1.1rem; font-size: clamp(1.8rem, 5vw, 3.4rem); }
.gallery-login button { width: 100%; }
.welcome-back { font-size: .9rem; }
.cover-picker { flex: 1 0 100%; min-width: 0; border: 1px solid var(--line); padding: .85rem; }
.cover-options { display: grid; grid-template-columns: repeat(auto-fill,minmax(110px,1fr)); gap: .7rem; max-height: 28rem; overflow-y: auto; padding: .35rem; }
.cover-option { position: relative; cursor: pointer; border: 2px solid transparent; padding: .25rem; border-radius: .3rem; }
.cover-option:has(input:checked) { border-color: var(--accent); }
.cover-option input { position: absolute; top: .5rem; left: .5rem; accent-color: var(--accent); }
.cover-option img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.cover-option span { font-size: .75rem; overflow-wrap: anywhere; }

/* Admin gallery editor */
.gallery-editor { max-width: 1280px; margin-inline: auto; font-family: system-ui, sans-serif; }
.gallery-editor h1, .gallery-editor h2 { font-family: system-ui, sans-serif; letter-spacing: -.025em; }
.gallery-editor h1 { font-size: clamp(1.8rem, 3vw, 2.65rem); font-weight: 600; }
.gallery-editor h2 { font-size: 1.15rem; font-weight: 650; margin-bottom: 1.4rem; }
.gallery-editor .panel { border-radius: .65rem; padding: clamp(1rem, 2.5vw, 2rem); }
.editor-settings { display: grid; gap: 1.75rem; }
.settings-details { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1rem; }
.gallery-editor fieldset { margin: 0; min-width: 0; border: 0; padding: 0; }
.gallery-editor legend { font-weight: 600; font-size: .95rem; margin-bottom: .85rem; padding: 0; }
.access-settings { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem 2rem; }
.access-settings p { grid-column: 1 / -1; margin: 0; font-size: .85rem; }
.cover-workspace { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 2rem; padding-block: 1.5rem; border-block: 1px solid var(--line); }
.gallery-editor .cover-options { grid-template-columns: repeat(3,minmax(0,1fr)); gap: .65rem; max-height: 29rem; align-items: start; padding: .2rem; }
.gallery-editor .cover-option { display: block; padding: .25rem; border-radius: .4rem; border: 2px solid transparent; }
.gallery-editor .cover-option:has(input:checked) { border-color: var(--accent); background: var(--paper); }
.gallery-editor .cover-option input { width: 1rem; height: 1rem; min-height: 0; margin: 0; padding: 0; top: .6rem; left: .6rem; }
.gallery-editor .cover-option img { display: block; width: 100%; height: auto; aspect-ratio: 4/3; object-fit: contain; background: var(--paper); border-radius: .2rem; }
.gallery-editor .cover-option span { display: block; font-size: .7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: .4rem .1rem .1rem; }
.gallery-editor .crop-control p { margin-top: 0; font-size: .85rem; }
.gallery-editor .crop-control .fields { display: grid; grid-template-columns: 1fr; gap: .65rem; }
.gallery-editor .crop-preview { border-radius: .45rem; }
.delivery-settings { display: grid; gap: .8rem; }
.gallery-editor input[type=checkbox] { width: 1rem; height: 1rem; accent-color: var(--accent); }
.settings-save { display: flex; justify-content: flex-end; padding-top: .5rem; }
@media (max-width: 760px) {
  .settings-details, .access-settings, .cover-workspace { grid-template-columns: 1fr; }
  .gallery-editor .cover-options { grid-template-columns: repeat(3,minmax(0,1fr)); max-height: 23rem; }
}
