:root{--paper:#faf8f4;--ink:#292c2d;--muted:#666b6c;--line:#dad7d0;--accent:#536b62;--panel:#fff;--soft:#f2eee7}
*{box-sizing:border-box}body{margin:0;background:var(--paper);color:var(--ink);font:16px/1.65 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
a{color:inherit}a:focus-visible,button:focus-visible,input:focus-visible,textarea:focus-visible{outline:3px solid #557869;outline-offset:3px}
.shell{width:min(1160px,calc(100% - 44px));margin:auto}.site-header{border-bottom:1px solid var(--line);background:#fff}.masthead{min-height:86px;display:flex;align-items:center;justify-content:space-between;gap:22px}
.brand{text-decoration:none;font-family:Georgia,serif;font-size:25px;line-height:1.15;font-weight:600}.brand small{display:block;color:var(--muted);font:11px/1.9 sans-serif;letter-spacing:.12em;text-transform:uppercase;margin-top:3px}.masthead nav{display:flex;gap:30px;white-space:nowrap}.masthead nav a{text-decoration:none;font-size:14px;color:var(--accent)}.masthead nav a:hover{text-decoration:underline}
h1,h2,h3{font-family:Georgia,"Times New Roman",serif;line-height:1.2;font-weight:500}h1{font-size:clamp(34px,4vw,53px);letter-spacing:-.025em;margin:.22em 0}h2{font-size:25px}h3{font-size:21px}
p{margin:.5em 0 1.15em}.intro{max-width:780px;margin:55px 0 38px}.intro>p{max-width:690px;color:var(--muted);font-size:18px}.eyebrow{color:var(--accent);text-transform:uppercase;letter-spacing:.16em;font-size:12px;font-weight:600}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:28px 22px;margin:28px 0 70px}.quilt-card{background:var(--panel);border:1px solid var(--line);box-shadow:0 3px 12px #00000008}.quilt-card>a,.photo-card>a{display:block;text-decoration:none}.quilt-card:hover,.photo-card:hover{box-shadow:0 8px 26px #00000018}.picture-frame{height:270px;background:var(--soft);display:flex;align-items:center;justify-content:center;padding:12px;overflow:hidden}.picture-frame img{display:block;width:auto;height:auto;max-width:100%;max-height:100%;min-width:0;min-height:0;object-fit:contain}.card-description{padding:16px 18px 18px}.card-description .date{font-size:13px;color:var(--accent)}.card-description h2{font-size:19px;margin:5px 0 6px}.card-description p{color:var(--muted);font-size:13px;margin:0 0 8px}.count{color:var(--accent);font-size:12px}
.empty{padding:30px 28px;border:1px solid var(--line);background:white;margin:30px 0 80px;max-width:680px}.back{display:inline-block;margin-top:33px;text-decoration:none;color:var(--accent);font-size:14px}.back:hover{text-decoration:underline}.quilt-heading{margin:28px 0 36px;max-width:760px}.dimensions,.small{color:var(--muted)}.small{font-size:14px}.narrative{font-size:17px;max-width:760px;margin-top:24px}.narrative.large{font-size:19px}
.photo-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(310px,1fr));gap:26px;margin-bottom:65px}.photo-card{border:1px solid var(--line);background:white}.image-contain{height:340px;padding:18px;background:var(--soft);display:flex;align-items:center;justify-content:center}.image-contain img{max-width:100%;max-height:100%;object-fit:contain}.photo-meta{padding:17px}.photo-meta strong{font-size:16px}.photo-meta p{font-size:14px;color:var(--muted);margin:.2em 0 1em}.photo-meta span{font-size:13px;color:var(--accent)}
.photo-title{margin:18px 0 22px}.photo-full{margin:0;max-width:100%;text-align:center}.photo-full a{display:block;padding:18px;background:var(--soft);border:1px solid var(--line)}.photo-full img{max-width:100%;width:auto;height:auto;max-height:min(83vh,1150px);object-fit:contain}.photo-full figcaption{margin:16px auto 35px;max-width:760px;text-align:left;color:var(--muted)}.photo-navigation{display:flex;justify-content:space-between;margin:25px 0 50px}.photo-navigation a{color:var(--accent);text-decoration:none}
.comments{max-width:760px;padding-top:20px;border-top:1px solid var(--line);margin-bottom:70px}.comment{padding:17px 0;border-bottom:1px solid var(--line)}.comment-byline{display:flex;justify-content:space-between;gap:12px}.comment-byline time{font-size:12px;color:var(--muted)}.comment p{white-space:normal;overflow-wrap:anywhere}.muted{color:var(--muted)}form{display:flex;flex-direction:column;align-items:flex-start;gap:8px}form label{font-weight:600;margin-top:12px}form input,form textarea{width:100%;padding:12px;border:1px solid #acaeaa;border-radius:3px;background:white;font:inherit;color:var(--ink)}form input{max-width:420px}form button{background:var(--accent);color:#fff;font-weight:600;border:0;padding:12px 22px;margin:14px 0;cursor:pointer}form button:hover{background:#3c554c}.errorlist{color:#9d3030}.messages{margin-top:20px;padding:12px 18px;background:#e7eee9;color:#234735}.footer{padding:24px 0 45px;border-top:1px solid var(--line);font-size:13px;color:var(--muted)}
@media(max-width:640px){.masthead{flex-direction:column;align-items:flex-start;justify-content:center;padding:16px 0;gap:10px}.masthead nav{gap:20px}.shell{width:min(100% - 28px,1160px)}.intro{margin-top:35px}.grid{grid-template-columns:repeat(auto-fit,minmax(165px,1fr));gap:13px}.picture-frame{height:210px}.card-description{padding:12px}.card-description h2{font-size:17px}.photo-grid{grid-template-columns:1fr}}

/* Keep navigation controls in consistent positions when crossing quilt boundaries. */
.photo-navigation { gap: 24px; }
.navigation-slot { flex: 1 1 0; min-width: 0; }
.next-slot { text-align: right; }
.photo-navigation a { display: inline-block; font-weight: 600; line-height: 1.5; }
.photo-navigation a:hover { text-decoration: underline; }
.nav-quilt-label { display: block; font-weight: 400; font-size: 0.87em; color: var(--muted); overflow-wrap: anywhere; }


/* Continuous photograph navigation. Keep controls in exactly the same place. */
.photo-navigation--top { position:sticky;top:0;z-index:10;align-items:center;
    margin:0 -6px 12px;padding:11px 12px;min-height:60px;
    background:rgba(250,248,244,.97);border-bottom:1px solid var(--line);
    box-shadow:0 2px 10px #0000000d;backdrop-filter:blur(6px) }
.photo-navigation--top a { display:inline-block;min-height:36px;padding:5px 7px; }
.navigation-center {flex:0 1 210px;text-align:center;white-space:nowrap;font-size:13px;color:var(--muted)}
.navigation-center a {font-size:13px}
.nav-unavailable {color:#969996;font-size:14px}
.photo-breadcrumbs {margin:17px 0 0;font-size:13px;color:var(--muted)}
.photo-breadcrumbs a {color:var(--accent);text-decoration:none}
.photo-breadcrumbs a:hover {text-decoration:underline}
.photo-viewer-hint {font-size:13px;color:var(--accent);margin:-8px 0 12px}
.photo-viewer-hint a {text-decoration:underline}
@media(max-width:640px) {
  .photo-navigation--top {gap:6px;padding:7px 5px;min-height:64px}
  .navigation-center {flex:0 1 auto;font-size:11px;white-space:normal}
  .navigation-center a {font-size:11px}
  .photo-navigation--top a {font-size:12px;line-height:1.4}
  .nav-unavailable {font-size:12px}
}

/* Dedicated full-size image browser: navigation stays above the photo at all times. */
.image-viewer-page {margin:0;background:#202422;color:#f8f8f5;min-height:100vh;}
.viewer-toolbar {position:sticky;top:0;z-index:50;background:#252a28;
  border-bottom:1px solid #515955;box-shadow:0 3px 14px #0008;padding:8px max(12px,calc((100vw - 1480px)/2));}
.viewer-photo-nav {display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);
  align-items:center;gap:12px;min-height:38px}
.viewer-prev {text-align:left}.viewer-next{text-align:right}
.viewer-photo-nav a {display:inline-block;border:1px solid #8f9f96;border-radius:5px;
  padding:7px 12px;color:#fff;text-decoration:none;font-weight:600;line-height:1.3;font-size:14px}
.viewer-photo-nav a:hover {background:#3d4c43}
.viewer-disabled {color:#8f9b95;font-size:13px}
.viewer-counter {text-align:center;color:#e3e8e2;font-size:13px;white-space:nowrap}
.viewer-secondary {display:flex;justify-content:space-between;align-items:center;gap:12px;
  margin-top:6px;color:#d2dbd5;font-size:12px;}
.viewer-identity {min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.viewer-links {display:flex;gap:17px;flex-shrink:0;white-space:nowrap}
.viewer-links a {color:#e4ebe5;text-decoration:underline;text-underline-offset:2px}
.viewer-main {display:flex;align-items:center;justify-content:center;padding:12px 16px;
  min-height:calc(100vh - 100px)}
.viewer-image {max-width:100%;max-height:calc(100vh - 125px);
  max-height:calc(100dvh - 125px);width:auto;height:auto;object-fit:contain;display:block}
.viewer-caption {max-width:1000px;margin:0 auto;padding:0 16px 15px;font-size:13px;color:#bfc9c3;text-align:center}
@media(max-width:640px) {
  .viewer-toolbar {padding:7px 10px}
  .viewer-photo-nav {gap:5px}
  .viewer-photo-nav a {padding:8px 7px;font-size:12px}
  .viewer-counter {font-size:11px}
  .viewer-secondary {align-items:flex-start;flex-direction:column;gap:5px}
  .viewer-identity {max-width:100%}
  .viewer-links {gap:14px;font-size:11px}
  .viewer-main {min-height:calc(100dvh - 130px);padding:8px}
  .viewer-image {max-height:calc(100dvh - 140px)}
}

/* Home always occupies the far-left slot in full-size and detail navigation. */
.viewer-photo-nav {grid-template-columns:auto minmax(0,1fr) auto minmax(0,1fr);}
.viewer-photo-nav .viewer-home {white-space:nowrap;}
.photo-navigation--top {display:grid;grid-template-columns:auto minmax(0,1fr) auto minmax(0,1fr);}
.navigation-home {white-space:nowrap;color:var(--accent);font-size:14px;}
.previous-slot {text-align:left;}
.viewer-photo-nav button {display:inline-block;border:1px solid #8f9f96;border-radius:5px;
  padding:7px 12px;color:#fff;background:transparent;font:inherit;font-weight:600;line-height:1.3;font-size:14px;cursor:pointer;}
.viewer-photo-nav button:hover {background:#3d4c43;}
.slideshow-links {display:flex;align-items:center;flex-wrap:wrap;justify-content:flex-end;gap:8px 16px;}
.slideshow-links button {padding:4px 12px;border:1px solid #b4c3bb;border-radius:4px;color:#fff;
  background:transparent;cursor:pointer;font:inherit;}
.slideshow-links button:hover {background:#3d4c43;}
.slideshow-mode {color:#b9c8be;white-space:nowrap;}
.slideshow-page .viewer-caption {min-height:20px;}
@media (max-width:640px) {
  .viewer-photo-nav {grid-template-columns:auto minmax(0,1fr) auto minmax(0,1fr);gap:4px;}
  .viewer-photo-nav .viewer-home,.viewer-photo-nav button {font-size:12px;padding:8px 6px;}
  .photo-navigation--top {grid-template-columns:auto minmax(0,1fr) auto minmax(0,1fr);gap:4px;}
  .navigation-home {font-size:12px;}
  .slideshow-secondary {gap:8px;}
  .slideshow-links {justify-content:flex-start;}
  .slideshow-main {min-height:calc(100dvh - 158px);}
  .slideshow-main .viewer-image {max-height:calc(100dvh - 172px);}
}

/* The home-page slideshow launcher stays compact and in the header only.
   The quilt detail and full-image headers are unchanged. */
.home-slideshow-bar {display:flex;justify-content:flex-end;align-items:center;padding:0 0 10px;}
.home-slideshow-form {display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;
  gap:6px 13px;margin:0;color:var(--muted);font-size:12px;line-height:1.4;}
.home-slideshow-label {font-weight:700;color:var(--accent);white-space:nowrap;}
.home-slideshow-form label {display:inline-flex;flex-direction:row;gap:5px;align-items:center;
  margin:0;font-size:12px;font-weight:400;white-space:nowrap;}
.home-slideshow-form input,.home-slideshow-form select {width:auto;max-width:none;
  margin:0;border:1px solid #bec6be;border-radius:4px;background:white;color:var(--ink);
  font:inherit;padding:4px 6px;height:29px;}
.home-slideshow-form input {width:53px;text-align:center;}
.home-slideshow-form select {max-width:185px;}
.home-slideshow-form button {margin:0;padding:5px 12px;border:1px solid var(--accent);
  border-radius:4px;background:transparent;color:var(--accent);font:inherit;font-weight:700;
  min-height:29px;line-height:1.3;}
.home-slideshow-form button:hover {background:#ecf1ed;color:#294d3d;}
.home-slideshow-form button:disabled {opacity:.5;cursor:not-allowed;}
.intro .gallery-instruction {color:var(--ink);font-size:16px;margin-top:12px;}
.gallery-instruction strong {font-weight:650;}
@media(max-width:640px) {
  .home-slideshow-bar {justify-content:flex-start;padding:0 0 11px;}
  .home-slideshow-form {gap:6px 11px;}
  .home-slideshow-form select {max-width:168px;}
}


/* Full-size viewer and slideshow: reserve on-screen space for photo captions.
   The image always fits the remaining area without cropping or distortion.
   A very long caption can be scrolled inside its own area. */
.image-viewer-page {
  display:flex;
  flex-direction:column;
  height:100vh;
  height:100dvh;
  min-height:0;
  overflow:hidden;
}
.image-viewer-page .viewer-toolbar {
  position:relative;
  flex:0 0 auto;
}
.image-viewer-page .viewer-main,
.image-viewer-page .slideshow-main {
  flex:1 1 0;
  min-height:0;
  overflow:hidden;
  padding:8px 12px;
}
.image-viewer-page .viewer-image,
.image-viewer-page .slideshow-main .viewer-image {
  display:block;
  width:auto;
  height:auto;
  max-width:100%;
  max-height:100%;
  min-height:0;
  object-fit:contain;
}
.image-viewer-page .viewer-caption,
.image-viewer-page.slideshow-page .viewer-caption {
  flex:0 1 auto;
  width:100%;
  max-width:1000px;
  max-height:35vh;
  max-height:35dvh;
  min-height:0;
  padding:6px 16px 12px;
  margin:0 auto;
  overflow-y:auto;
  overflow-x:hidden;
  font-size:14px;
  line-height:1.45;
  color:#e0e7e1;
  text-align:center;
  white-space:pre-line;
  overflow-wrap:anywhere;
}
.image-viewer-page .viewer-caption:empty {
  display:none;
  padding:0;
}

/* Caption visibility controls in the full-size viewer and slideshow.
   The caption uses only the space it needs; hiding it restores the image area. */
.image-viewer-page .viewer-caption[hidden] {display:none !important;padding:0;margin:0;}
.viewer-caption-toggle {border:1px solid #b4c3bb;border-radius:4px;color:#f5faf7;
  background:transparent;cursor:pointer;font:inherit;font-size:12px;line-height:1.3;
  min-height:27px;padding:3px 9px;white-space:nowrap;}
.viewer-caption-toggle:hover:not(:disabled) {background:#3d4c43;}
.viewer-caption-toggle:disabled {opacity:.42;cursor:not-allowed;}
.viewer-links {min-width:0;flex-wrap:wrap;align-items:center;justify-content:flex-end;row-gap:7px;}
@media(max-width:640px){.viewer-links{justify-content:flex-start;gap:7px 12px;}}

/* Home-page caption preference is an action, not a second Start control. */
.home-slideshow-form .home-caption-toggle {
  border-color:#b9c5bc; color:var(--accent); background:#f7f9f6;
  font-weight:500; white-space:nowrap;
}
.home-slideshow-form .home-caption-toggle:hover {background:#e8eee9;}
