:root{
  --accent:#1f4e79;
  --accent-2:#123553;
  --ink:#17202c;
  --muted:#5f6d7a;
  --line:#dde4ea;
  --panel:#ffffff;
  --soft:#f4f7fa;
  --radius:20px;
  --radius-sm:14px;
  --shadow:0 12px 38px rgba(14,28,45,.08);
  --max:1200px;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  background:linear-gradient(180deg,#f8fafc 0%,#f4f7fa 100%);
  color:var(--ink);
  font-family:Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height:1.6;
}
a{color:var(--accent);text-decoration:none}
a:hover{text-decoration:none;color:var(--accent-2)}
img{max-width:100%;display:block}
.container{width:min(var(--max),92%);margin-inline:auto}
.screen-reader-text{position:absolute;left:-9999px}

.site-header{
  position:sticky;top:0;z-index:50;
  backdrop-filter:blur(10px);
  background:rgba(255,255,255,.88);
  border-bottom:1px solid rgba(221,228,234,.85);
}
.topbar{display:flex;align-items:center;justify-content:space-between;gap:2rem;padding:1rem 0}
.brand-wrap{display:flex;align-items:center}
.brand{display:flex;align-items:center;gap:.9rem;color:var(--ink);font-weight:800;font-size:1rem}
.brand img{height:46px;width:auto;border-radius:12px}
.nav-tools{display:flex;align-items:center;justify-content:flex-end;gap:1rem;flex-wrap:nowrap;flex:1}
.menu-toggle{
  display:none;align-items:center;justify-content:center;flex:0 0 auto;
  width:52px;height:52px;padding:0;border:1px solid #d5dde6;border-radius:16px;
  background:rgba(255,255,255,.94);color:var(--ink);box-shadow:var(--shadow);cursor:pointer
}
.menu-toggle-box{display:grid;gap:5px}
.menu-toggle-box span{
  display:block;width:22px;height:2px;border-radius:999px;background:currentColor;transition:transform .25s ease,opacity .2s ease
}
.menu-toggle[aria-expanded="true"] .menu-toggle-box span:nth-child(1){transform:translateY(7px) rotate(45deg)}
.menu-toggle[aria-expanded="true"] .menu-toggle-box span:nth-child(2){opacity:0}
.menu-toggle[aria-expanded="true"] .menu-toggle-box span:nth-child(3){transform:translateY(-7px) rotate(-45deg)}
.brand-mark{
  width:42px;height:42px;border-radius:13px;display:grid;place-items:center;
  background:linear-gradient(135deg,var(--accent),#5a84a8);color:#fff;font-weight:800;
}
.brand-text{letter-spacing:.01em}
.main-nav ul{display:flex;flex-wrap:nowrap;gap:.75rem;list-style:none;margin:0;padding:0}
.main-nav{margin-left:auto;flex:0 1 auto}
.nav-search{flex:0 0 auto}
.main-nav a{
  display:inline-flex;align-items:center;justify-content:center;
  padding:.7rem 1rem;border-radius:999px;color:var(--ink);font-weight:600;
}
.main-nav a:hover,.main-nav .current a{background:#eef3f7}
.nav-search{
  display:grid;grid-template-columns:minmax(200px,280px) auto;gap:.6rem;align-items:center;
  padding:.28rem .32rem .28rem .6rem;border:1px solid #d5dde6;border-radius:999px;background:#f7f9fb;
  box-shadow:0 1px 0 rgba(255,255,255,.85) inset
}
.nav-search input{
  min-width:0;padding:.45rem .35rem;border:0;border-radius:999px;background:transparent;color:#5d6975;
  font-size:.92rem;font-weight:500;outline:0
}
.nav-search button{
  min-height:38px;padding:0 .95rem;border:1px solid transparent;border-radius:999px;background:#245686;color:#fff;font-size:.88rem;font-weight:700;cursor:pointer
}
.nav-search button:hover{background:#1b476f}
.nav-search button svg{width:18px;height:18px;display:block;stroke:currentColor;stroke-width:2.2;fill:none;stroke-linecap:round;stroke-linejoin:round}
.nav-search input::placeholder{color:#7a8590;opacity:1;font-size:.92rem;font-weight:500}

.site-main{min-height:70vh}
.hero{padding:4.5rem 0 2.75rem}
.hero-home{padding-top:3.5rem}
.hero-grid,.item-grid,.detail-grid,.browse-hero-inner,.collection-hero-inner{
  display:grid;grid-template-columns:1.1fr .9fr;gap:2rem;align-items:center;
}
.hero-badge,.section-kicker,.record-type{
  display:inline-flex;align-items:center;gap:.4rem;
  padding:.38rem .75rem;border:1px solid #d5e1ec;border-radius:999px;
  background:#fff;color:var(--accent);font-size:.78rem;font-weight:800;letter-spacing:.06em;text-transform:uppercase;
}
.hero h1,.item-hero h1,.collection-hero h1{font-size:clamp(2.2rem,4vw,4rem);line-height:1.05;letter-spacing:-.03em;margin:.85rem 0 1rem}
.hero-lead{font-size:1.08rem;color:var(--muted);max-width:60ch}
.hero-panel img{
  width:100%;min-height:420px;object-fit:cover;border-radius:28px;box-shadow:var(--shadow);border:1px solid #e4ebf0;
}
.hero-actions{display:flex;flex-wrap:wrap;gap:.9rem;margin-top:1.25rem}
.button-primary,.button-ghost,.search-shell button{
  display:inline-flex;align-items:center;justify-content:center;border-radius:999px;
  padding:.9rem 1.2rem;font-weight:700;border:1px solid transparent;cursor:pointer;
}
.button-primary,.search-shell button{background:var(--accent);color:#fff}
.button-primary:hover,.search-shell button:hover{background:var(--accent-2);color:#fff}
.button-ghost{background:#fff;border-color:#d7e0e7;color:var(--ink)}
.button-ghost:hover{background:#f2f6f9}

.search-shell{
  display:grid;grid-template-columns:1fr auto;gap:.75rem;
  margin-top:1.4rem;padding:.7rem;background:#fff;border:1px solid #dce5eb;border-radius:22px;box-shadow:var(--shadow);max-width:720px;
}
.search-shell-inline{min-width:min(460px,100%);margin-top:0}
.search-shell input,.search-shell select{
  min-width:0;border:0;outline:0;background:transparent;padding:.75rem 1rem;font-size:1rem;color:var(--ink)
}
.search-advanced-box{
  background:#fff;padding:1.2rem;border:1px solid #dce5eb;border-radius:22px;box-shadow:var(--shadow)
}
.search-advanced-box form{display:grid;gap:.8rem}
.search-advanced-box input[type="text"],
.search-advanced-box input[type="search"],
.search-advanced-box select,
.search-advanced-box textarea{
  width:100%;padding:.85rem 1rem;border:1px solid #d6dee5;border-radius:14px;background:#fbfdff
}

.section-wrap{padding:1rem 0 3.2rem}
.section-soft{background:linear-gradient(180deg,rgba(255,255,255,.55),rgba(244,247,250,.2))}
.section-head{display:flex;align-items:end;justify-content:space-between;gap:1rem;margin-bottom:1.2rem}
.section-head h2{margin:.3rem 0 0;font-size:clamp(1.5rem,2vw,2rem);letter-spacing:-.02em}
.section-head h1{margin:.3rem 0 0;font-size:clamp(1.8rem,2.6vw,2.6rem);letter-spacing:-.02em}
.section-actions,.archive-toolbar-actions{display:flex;align-items:center;justify-content:flex-end;gap:.85rem;flex-wrap:wrap}
.text-link{font-weight:700}
.card-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1.25rem}
.card-grid-collections{grid-template-columns:repeat(4,minmax(0,1fr))}
.record-layout-list{grid-template-columns:1fr}
.record-card{
  display:flex;flex-direction:column;overflow:hidden;background:rgba(255,255,255,.92);
  border:1px solid #dfE6ec;border-radius:24px;box-shadow:var(--shadow);min-height:100%;
}
.record-layout-list .record-card{flex-direction:row;align-items:stretch}
.record-thumb{display:block;aspect-ratio:1.2/1;background:#edf2f6;overflow:hidden}
.record-layout-list .record-thumb{flex:0 0 min(34%,260px);aspect-ratio:auto}
.record-layout-list .record-body{flex:1}
.record-thumb img{width:100%;height:100%;object-fit:cover;transition:transform .4s ease}
.record-card:hover .record-thumb img{transform:scale(1.03)}
.record-body{padding:1.05rem 1.05rem 1.2rem}
.record-body h3{margin:.7rem 0 .55rem;font-size:1.12rem;line-height:1.3}
.record-body h2{margin:.7rem 0 .55rem;font-size:1.3rem;line-height:1.3}
.record-body p:last-child{margin:0;color:var(--muted)}
.description p:first-child{margin-top:0}
.description p:last-child{margin-bottom:0}
.thumb-fallback{
  width:100%;height:100%;display:grid;place-items:center;background:linear-gradient(135deg,#dfe9f0,#f7fafc);color:var(--muted);font-weight:700
}
.layout-switcher{
  display:inline-flex;align-items:center;gap:.25rem;padding:.28rem;background:#fff;border:1px solid #d7e0e7;border-radius:999px;box-shadow:var(--shadow)
}
.layout-switcher-button{
  min-width:70px;padding:.55rem .95rem;border:0;border-radius:999px;background:transparent;color:var(--muted);font-size:.88rem;font-weight:700;cursor:pointer
}
.layout-switcher-button.is-active{background:var(--accent);color:#fff}

.info-band{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1rem}
.info-box{background:#fff;border:1px solid #dde5eb;border-radius:22px;padding:1.2rem;box-shadow:var(--shadow)}
.info-box h3{margin:.15rem 0 .55rem}
.info-box p{margin:0;color:var(--muted)}

.browse-hero{padding-top:2.8rem;padding-bottom:1.6rem}
.archive-toolbar,.pagination-bottom{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:1rem}
.archive-toolbar-compact{margin-top:1rem}

.viewer-panel,.meta-panel,.detail-card{
  background:#fff;border:1px solid #dde5eb;border-radius:24px;box-shadow:var(--shadow)
}
.viewer-panel{padding:1rem}
.meta-panel{padding:1.3rem 1.3rem 1.1rem}
.meta-list{display:grid;gap:.2rem;margin-top:1rem}
.meta-row{
  display:grid;grid-template-columns:120px 1fr;gap:1rem;padding:.85rem 0;border-top:1px solid #edf1f4
}
.meta-row span{color:var(--muted);font-weight:600}
.meta-row strong{font-weight:700}
.wrap-anywhere{overflow-wrap:anywhere;word-break:break-word}
.cta-stack{display:flex;flex-wrap:wrap;gap:1rem;margin-top:1.2rem}
.iiif-shell{border-radius:18px;overflow:hidden;background:#f2f6f9}
.iiif-frame{width:100%;min-height:72vh;border:0;background:#fff}
.viewer-fallback img{border-radius:18px}
.detail-grid{align-items:start}
.detail-card{padding:1.25rem 1.3rem;margin-bottom:1rem}
.detail-card h2,.detail-card h3{margin:.1rem 0 .8rem}
.side-card p:last-child{margin-bottom:0}
.prose{color:#263342}
.prose p:first-child{margin-top:0}
.prose p:last-child{margin-bottom:0}
.simple-page-shell{max-width:920px}
.simple-page-card{margin-bottom:0;padding:1.6rem 1.7rem}
.simple-page-header{margin-bottom:1.2rem}
.simple-page-header h1{margin:.75rem 0 0;font-size:clamp(2rem,3vw,3rem);line-height:1.08;letter-spacing:-.03em}
.simple-page-content > *:first-child{margin-top:0}
.simple-page-content > *:last-child{margin-bottom:0}

.site-footer{margin-top:2rem;border-top:1px solid #dde4ea;background:#fff}
.footer-grid{display:grid;grid-template-columns:1.4fr .8fr;gap:2rem;padding:2rem 0}
.footer-grid h2{margin:0 0 .5rem}
.footer-grid p{margin:.25rem 0;color:var(--muted)}

form ul, .element-set{padding-left:0}
.element-set{list-style:none}
.element{padding:.9rem 0;border-top:1px solid #edf1f4}
.element:first-child{border-top:0}
.element h3,.element h4{margin:.1rem 0 .4rem}

@media (max-width: 1080px){
  .card-grid-collections{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width: 960px){
  .hero-grid,.item-grid,.detail-grid,.browse-hero-inner,.collection-hero-inner,.footer-grid,.info-band{grid-template-columns:1fr}
  .card-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .hero-panel img{min-height:320px}
  .iiif-frame{min-height:60vh}
}
@media (max-width: 680px){
  .topbar,.section-head,.archive-toolbar,.pagination-bottom{display:block}
  .topbar{position:relative}
  .menu-toggle{display:inline-flex;position:absolute;top:1rem;right:0}
  .nav-tools{
    display:none;flex-direction:column;align-items:stretch;gap:.85rem;flex:auto;
    margin-top:1rem;padding:1rem;border:1px solid #dce5eb;border-radius:22px;background:rgba(255,255,255,.96)
  }
  .nav-tools.is-open{display:flex}
  .main-nav{margin-top:0}
  .main-nav ul{flex-wrap:wrap;gap:.45rem;flex-direction:column}
  .main-nav a{justify-content:flex-start;width:100%;padding:.9rem 1rem;border-radius:16px;background:#f7fafc}
  .nav-search{
    width:100%;grid-template-columns:1fr;gap:.65rem;margin-top:0;padding:.75rem;border-radius:18px
  }
  .nav-search input{
    width:100%;padding:.9rem 1rem;border:1px solid #d6dee5;border-radius:14px;background:#fff
  }
  .nav-search button{
    width:100%;min-height:46px;padding:.8rem 1rem;border-radius:14px
  }
  .search-shell,.search-shell-inline{grid-template-columns:1fr}
  .card-grid,.card-grid-collections{grid-template-columns:1fr}
  .section-actions,.archive-toolbar-actions{justify-content:flex-start;margin-top:.9rem}
  .layout-switcher{width:100%;justify-content:space-between}
  .layout-switcher-button{flex:1}
  .record-layout-list .record-card{flex-direction:column}
  .record-layout-list .record-thumb{flex-basis:auto;aspect-ratio:1.2/1}
  .meta-row{grid-template-columns:1fr;gap:.3rem}
  .hero h1,.item-hero h1,.collection-hero h1{font-size:2rem}
}
