/* Preserve the parent layout, header and menus. Only gallery cards and viewer change. */
.hedwig-card .post-content { pointer-events:none; }
.hedwig-card .post-content a { pointer-events:auto; }
.hedwig-card .post-content h2 { color:#fff; }
.hedwig-card:focus-within .post-content { visibility:visible; top:21%; width:100%; }
.hedwig-card a:focus-visible { outline:3px solid #fff; outline-offset:-4px; }
body.hedwig-viewing { overflow:hidden; }
#hedwig-viewer { box-sizing:border-box; position:fixed; inset:0; width:100%; height:100%; max-width:none; max-height:none; margin:0; padding:0; border:0; background:#111113; color:#f5f5f5; overflow:hidden; overscroll-behavior:contain; }
#hedwig-viewer::backdrop { background:#111113; }
#hedwig-viewer[open] { display:grid; grid-template-columns:minmax(0,1fr); grid-template-rows:auto minmax(0,1fr) auto auto; }
#hedwig-viewer button { box-sizing:border-box; min-width:44px; min-height:44px; padding:8px 14px; border:1px solid #ffffff40; border-radius:5px; background:#222226; color:#fff; font:inherit; cursor:pointer; text-shadow:none; box-shadow:none; }
#hedwig-viewer button:hover { background:#3a3a40; }
#hedwig-viewer button:focus-visible { outline:3px solid #e6bf83; outline-offset:-3px; }
#hedwig-viewer button:disabled { opacity:.3; cursor:default; }
#hedwig-viewer .hedwig-toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 18px; }
#hedwig-viewer .hedwig-toolbar-actions { display:flex; gap:8px; }
#hedwig-viewer .hedwig-stage { position:relative; display:flex; align-items:center; justify-content:center; min-height:0; margin:0 12px; overflow:hidden; touch-action:pan-y pinch-zoom; }
#hedwig-viewer .hedwig-image { display:block; width:100%; height:100%; max-width:100%; max-height:100%; object-fit:contain; user-select:none; -webkit-user-drag:none; }
#hedwig-viewer .hedwig-image.hedwig-loading { opacity:.35; }
#hedwig-viewer .hedwig-arrow { position:absolute; top:50%; transform:translateY(-50%); z-index:2; font-size:32px; background:#111b; }
#hedwig-viewer .hedwig-prev { left:4px; }
#hedwig-viewer .hedwig-next { right:4px; }
#hedwig-viewer .hedwig-caption { min-height:28px; margin:0; padding:8px 20px; text-align:center; font-size:17px; color:#f5f5f5; }
#hedwig-viewer .hedwig-strip { display:flex; align-items:center; gap:8px; overflow-x:auto; overflow-y:hidden; padding:10px 18px 14px; background:#19191c; scrollbar-color:#777 #19191c; }
#hedwig-viewer .hedwig-strip[hidden] { display:none; }
#hedwig-viewer .hedwig-thumb { flex:0 0 96px; width:96px; height:65px; min-height:65px; padding:0; overflow:hidden; border:2px solid transparent; border-radius:3px; }
#hedwig-viewer .hedwig-thumb[aria-current="true"] { border-color:#e6bf83; }
#hedwig-viewer .hedwig-thumb img { width:100%; height:100%; object-fit:cover; }
#hedwig-viewer .hedwig-status { font-size:13px; color:#d0d0d3; }
#hedwig-viewer .hedwig-animate { animation:hedwig-enter .18s ease-out; }
@keyframes hedwig-enter { from { opacity:.45; transform:scale(.985); } to { opacity:1; transform:scale(1); } }
@media(max-width:600px) {
  #hedwig-viewer .hedwig-toolbar { padding:8px; gap:6px; }
  #hedwig-viewer .hedwig-toolbar button { padding:6px 9px; font-size:13px; }
  #hedwig-viewer .hedwig-status { max-width:35vw; font-size:11px; }
  #hedwig-viewer .hedwig-stage { margin:0; }
  #hedwig-viewer .hedwig-thumb { flex-basis:75px; width:75px; height:52px; min-height:52px; }
  #hedwig-viewer .hedwig-caption { font-size:14px; padding:6px; }
}
@media(prefers-reduced-motion:reduce) { #hedwig-viewer .hedwig-animate { animation:none; } }

/* Explicit grid placement and non-wrapping strip prevent intrinsic-width overflow. */
#hedwig-viewer > * { box-sizing:border-box; min-width:0; max-width:100%; grid-column:1; }
#hedwig-viewer > .hedwig-toolbar { grid-row:1; }
#hedwig-viewer > .hedwig-stage { grid-row:2; }
#hedwig-viewer > .hedwig-caption { grid-row:3; }
#hedwig-viewer[open] > .hedwig-strip {
    grid-row:4; display:flex; flex-direction:row; flex-wrap:nowrap; align-items:center;
    justify-content:flex-start; width:100%; min-width:0; max-width:100%;
    height:89px; margin:0; overflow-x:auto; overflow-y:hidden;
    position:relative; float:none; white-space:nowrap; -webkit-overflow-scrolling:touch;
}
#hedwig-viewer[open] > .hedwig-strip[hidden] { display:none; }
#hedwig-viewer .hedwig-strip > button.hedwig-thumb {
    display:block; flex:0 0 96px; width:96px; min-width:96px; max-width:96px;
    height:65px; margin:0; float:none; position:relative;
}
#hedwig-viewer .hedwig-thumb > img { display:block; margin:0; padding:0; }
#colophon .hedwig-footer { display:flex; flex-direction:column; align-items:center; text-align:center; }
#colophon .hedwig-footer > .footer-left,
#colophon .hedwig-footer > .footer-right { float:none; width:100%; text-align:center; }
#colophon .hedwig-footer-social ul { display:flex; flex-flow:row nowrap; justify-content:center; align-items:center; gap:8px; margin:10px 0 12px; padding:0; list-style:none; }
#colophon .hedwig-footer-social li { display:block; margin:0; padding:0; }
#colophon .hedwig-footer-social li a { margin:0; }
#colophon .hedwig-footer .copyright { text-align:center; }
#colophon .hedwig-footer .copyright a { color:inherit; text-decoration:underline; text-underline-offset:3px; }
#colophon .hedwig-footer-social a:focus-visible { outline:2px solid currentColor; outline-offset:4px; }
#colophon .hedwig-footer #footer-navigation ul { text-align:center; }
@media(max-width:600px) {
    #hedwig-viewer[open] > .hedwig-strip { height:76px; }
    #hedwig-viewer .hedwig-strip > button.hedwig-thumb { flex-basis:75px; width:75px; min-width:75px; max-width:75px; height:52px; }
}

/* One centered search form above the dark footer; original widget settings are retained. */
#footer-widgets.hedwig-search-only .inner-wrapper { display:flex; justify-content:center; align-items:center; }
#footer-widgets .hedwig-footer-search { display:flex; flex-flow:row nowrap; align-items:stretch; width:100%; max-width:560px; margin:0 auto; }
#footer-widgets .hedwig-footer-search .search-field { display:block; flex:1 1 0; min-width:0; width:auto; max-width:none; margin:0; box-sizing:border-box; }
#footer-widgets .hedwig-footer-search .search-submit { position:static; float:none; display:block; flex:0 0 auto; width:auto; margin:0; padding:10px 18px; }
