:root {
  color-scheme: light;
  --paper: #f5f4ee;
  --ink: #20221f;
  --subtle: #565b52;
  --rule: #d0d2c6;
  --accent: #23452e;
  --pale: #e6ebdf;
  font-family: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); }
.shell { width: min(1320px, calc(100% - 80px)); margin-inline: auto; }
.bar { border-bottom: 1px solid var(--rule); }
.bar-inner, .results, .footer, .cart-head, .preview-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.bar-inner { min-height: 69px; }
.brand { color: inherit; text-decoration: none; font-size: 1.25rem; letter-spacing: -.055em; font-weight: 750; }
.brand span { color: var(--subtle); }
button, input { font: inherit; }
button { cursor: pointer; color: inherit; border: 1px solid var(--rule); border-radius: 4px; background: transparent; padding: 9px 13px; }
button:hover:enabled { border-color: var(--accent); background: var(--pale); }
button:disabled { opacity: .45; cursor: default; }
:focus-visible { outline: 3px solid #567b4b; outline-offset: 3px; }
.cart-button { white-space: nowrap; }
.cart-button span { display: inline-block; min-width: 1.8em; margin-left: .2em; font-weight: 700; }
.heading { display: grid; grid-template-columns: 1.2fr minmax(250px, 430px); gap: 14px 40px; align-items: end; padding-block: 65px 49px; border-bottom: 1px solid var(--rule); }
.event-meta { grid-column: 1 / -1; margin: 0; font-size: .72rem; font-weight: 750; letter-spacing: .12em; color: var(--accent); }
.event-meta span { margin-inline: 4px; }
h1 { font-size: clamp(2.1rem, 5.6vw, 5.65rem); line-height: .99; letter-spacing: -.075em; margin: 0; }
#search-form { align-self: end; padding-bottom: 2px; }
#search-form label { display: block; font-weight: 700; margin-bottom: 8px; }
.search-row { display: flex; gap: 6px; }
input { background: #fffefa; color: var(--ink); border: 1px solid var(--rule); border-radius: 4px; padding: 13px 11px; min-width: 0; width: 100%; }
.primary { background: var(--accent); color: white; border: 1px solid var(--accent); font-weight: 650; }
.primary:hover:enabled { background: #315839; color: white; }
.examples { margin-top: 10px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; color: var(--subtle); font-size: .82rem; }
.examples button { padding: 4px 8px; }
.results { padding-block: 27px 17px; min-height: 90px; }
h2 { font-size: 1.2rem; margin: 0; letter-spacing: -.025em; }
.results p, .muted, .footer { color: var(--subtle); font-size: .9rem; }
.results p { margin: 4px 0 0; }
.link-button { border-color: transparent; text-decoration: underline; text-underline-offset: .2em; }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 19px 15px; }
.card { min-width: 0; }
.home-free { position:absolute; inset:7px 7px auto auto; min-width:20%; text-align:center;
  background:#227646; color:#fff; font-weight:750; font-size:clamp(.8rem, 1.1vw, 1.25rem);
  border-radius:4px; padding:.34em .56em; }
.cover-ribbons { position:absolute; inset:7px 7px auto; display:flex; justify-content:flex-end; flex-wrap:wrap; gap:5px; pointer-events:none; }
.cover-ribbons .home-free { position:static; min-width:0; }
.cover-ribbons .home-search { background:#f5cf48; color:#241f0b; }
.photo { width: 100%; display: block; overflow: hidden; padding: 0; border: 0; border-radius: 3px; background: var(--pale); }
.photo img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; transition: transform .2s ease-out; }
.photo:hover img { transform: scale(1.025); }
.card-bottom { display: flex; justify-content: space-between; gap: 4px; align-items: center; margin-top: 6px; font-size: .82rem; color: var(--subtle); }
.select { padding: 4px 7px; color: var(--ink); }
.select[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); background: var(--pale); }
.pages { display: flex; align-items: center; justify-content: center; gap: 13px; margin: 28px 0 32px; }
.footer { margin-top: 30px; min-height: 70px; border-top: 1px solid var(--rule); }
dialog { color: var(--ink); background: var(--paper); border: 0; border-radius: 6px; padding: 0; box-shadow: 0 20px 80px #17191355; width: min(1000px, calc(100% - 24px)); max-height: calc(100dvh - 26px); }
dialog::backdrop { background: #151a17c9; }
.preview-top, .preview-controls { padding: 8px 12px; }
.preview-top p { margin: 0; font-weight: 700; }
#preview-image { display: block; width: 100%; height: min(68dvh, 680px); object-fit: contain; background: #1e211e; }
.preview-controls { display: flex; justify-content: space-between; gap: 8px; }
.preview-icon { display: inline-grid; place-items: center; min-width: 54px; min-height: 50px; padding: 3px 10px; font-size: 32px; line-height: 1; }
#cart { width: min(850px, calc(100% - 24px)); }
.cart-inner { padding: 20px; }
#cart-list { padding: 0; list-style: none; max-height: min(55dvh, 520px); overflow-y: auto; }
#cart-list li { display:grid; grid-template-columns:110px minmax(0,1fr) auto auto; align-items:center;
  gap:14px; border-top:1px solid var(--rule); padding:12px 5px 12px 0; }
.cart-thumbnail { display:block; background:var(--rule); border-radius:4px; overflow:hidden; aspect-ratio:3/2; }
.cart-thumbnail img { display:block; width:100%; height:100%; object-fit:contain; }
.cart-item-details { display:grid; gap:5px; overflow-wrap:anywhere; }
.cart-item-details small { color:var(--subtle); white-space:pre-line; }
.cart-line-price { white-space:nowrap; font-variant-numeric:tabular-nums; }
.cart-tools { display:flex; justify-content:flex-end; }
#cart-total { font-weight:700; }
@media (max-width:580px) {
  #cart-list li { grid-template-columns:64px minmax(0,1fr) auto; gap:8px; }
  #cart-list li button { grid-column:2 / -1; justify-self:end; }
}
#cart-list button { padding: 4px 7px; }
#checkout-result { color: var(--accent); font-weight: 650; }
@media (max-width: 860px) {
  .shell { width: calc(100% - 42px); }
  .heading { grid-template-columns: 1fr; gap: 14px; padding-block: 42px 30px; }
  #search-form { max-width: 490px; margin-top: 12px; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 540px) {
  .shell { width: calc(100% - 26px); }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 9px; }
  .card-bottom { font-size: .75rem; }
  .select { padding: 4px; }
  .heading { padding-block: 34px 23px; }
  .footer { align-items: flex-start; padding-top: 16px; font-size: .76rem; }
}
@media (prefers-reduced-motion: reduce) { .photo img { transition: none; } }
.bar-actions { display: flex; align-items: center; gap: 14px; }
.bar a:not(.brand) { color: var(--accent); text-underline-offset: .2em; }
.upload-page { max-width: 720px; padding-block: 56px; }
.upload-page h1 { font-size: clamp(2.3rem, 7vw, 4.5rem); }
.upload-form { margin-top: 28px; display: grid; gap: 10px; }
.upload-form label { font-weight: 700; margin-top: 8px; }
.upload-form p { margin: 0; }
.upload-form select, #gallery-title, #upload-url { width: 100%; }
.drop-zone { display: grid; gap: 10px; padding: 16px; border: 1px dashed var(--rule); }
.drop-overlay { display: none; }
[data-file-drag] .drop-overlay {
  position: fixed; inset: 10px; z-index: 5; display: grid; place-items: center;
  pointer-events: none; border: 3px dashed var(--accent); border-radius: 10px;
  background: #151a17d9; color: #fff; font-size: clamp(1.4rem, 4vw, 2.5rem);
}
.upload-form button { justify-self: start; margin-top: 8px; }
.upload-progress { margin-top: 28px; border-top: 1px solid var(--rule); padding-top: 22px; }
.upload-progress > div { display: grid; gap: 6px; margin-block: 0 14px; }
.upload-progress progress { width: 100%; accent-color: var(--accent); }
.upload-link { display: inline-block; text-decoration: none; border-radius: 4px; padding: 10px 13px; }
#form-error { color: #7a2525; }
#download-list { list-style: none; padding: 0; }
#download-list li { border-top: 1px solid var(--rule); padding-block: 11px; overflow-wrap: anywhere; }
#download-list a { color: var(--accent); text-underline-offset: .2em; }

#upload-watermark-preview { width:min(100%,420px); height:auto; border-radius:5px; border:1px solid var(--rule); }
#upload-watermark-status:empty { display:none; }
#gallery-introduction-text { width:100%; max-width:none; overflow-wrap:anywhere; white-space:pre-wrap; line-height:1.65; margin-block:20px; }
.shop-dialog { background:var(--paper); color:var(--ink); border:1px solid var(--rule); border-radius:5px; }
.shop-dialog::backdrop { background:#000a; }
.standard-gallery .shop-dialog { background:#292929; color:#f0eeea; border-color:#393939; }
.shop-head { display:flex; justify-content:space-between; align-items:center; gap:14px; padding:18px 23px; }
.shop-head h2 { font-size:1.06rem; letter-spacing:normal; }
.shop-close { border:0; padding:2px 7px; font-size:1.3rem; line-height:1.25; }
#purchase-dialog { width:min(940px, calc(100% - 30px)); }
.purchase-layout { display:grid; grid-template-columns:minmax(0,4fr) minmax(0,5fr); gap:clamp(18px,5vw,48px); padding:0 23px 25px; align-items:start; }
#purchase-image { width:100%; height:auto; max-height:45dvh; object-fit:contain; background:var(--pale); }
.purchase-product { display:grid; gap:18px; }
.purchase-product p { margin:0; }
#purchase-description { display:grid; gap:10px; white-space:pre-wrap; line-height:1.6; overflow-wrap:anywhere; }
.purchase-copy-centered { text-align:center; }
#purchase-dimensions { opacity:.76; font-size:.86rem; margin-top:5px; }
.purchase-action { display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap; border-top:1px solid var(--rule); padding-top:15px; }
.purchase-action strong { font-size:1.35rem; }
@media (max-width:640px) { .purchase-layout { grid-template-columns:1fr; } #purchase-image { max-height:30dvh; } }

/* Inline album search follows the owner's localized introduction. */
#gallery-main > #search-form { width:100%; max-width:540px; margin:24px auto; padding:0; }
#search-form label { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0; }
#gallery-main > .heading:not(:has(> :not([hidden]))) { display:none; }

#gallery-introduction-text.rich-gallery-text { white-space:normal; }
#gallery-introduction-text.rich-gallery-text p, #gallery-introduction-text.rich-gallery-text div { margin:0 0 1em; }
#gallery-introduction-text.rich-gallery-text h2, #gallery-introduction-text.rich-gallery-text h3 { margin:1em 0 .5em; }
#gallery-introduction-text.rich-gallery-text a { color:inherit; text-decoration:underline; }

.gtext-align-left { text-align:left; }
.gtext-align-center { text-align:center; }
.gtext-align-right { text-align:right; }
.gtext-align-justify { text-align:justify; }
