/* Overlay the share control without changing the approved card dimensions. */
.story-thumbnail { position: relative; }
.story-cover-link { display: block; }
.story-share { position: absolute; top: 0; right: 0; width: 44px; height: 44px; display: grid; place-items: start end; padding: 5px; border: 0; background: transparent; color: #405626; cursor: pointer; }
.story-share .icon, .library-card .story-share .icon { width: 26px; height: 26px; padding: 5px; border-radius: 6px; background: #fff8e8e8; }
.story-share:focus-visible { outline: 3px solid #405626; outline-offset: -4px; }
.story-share[data-copied] .icon { visibility: hidden; }
.story-share[data-copied]::after { content: '✓'; position: absolute; top: 5px; right: 5px; width: 26px; height: 26px; display: grid; place-items: center; background: #fff8e8e8; border-radius: 6px; }
.site-footer { padding-bottom: 8px; }
.site-footer .footer-navigation {
  border: 0;
  padding: 0;
  gap: clamp(8px, 2.1vw, 32px);
  text-align: center;
}
.footer-copyright { font-size: 1.15rem; }
.site-footer .footer-brand {
  display: block;
  position: relative;
  z-index: 1;
  margin: 14px auto 0;
  width: clamp(250px, 34vw, 480px);
}
.site-footer .footer-brand img { display: block; }
.site-footer .footer-corner { width: 32%; }

@media (max-width: 700px) {
  .site-footer .footer-navigation { column-gap: clamp(5px, 2vw, 12px); }
  .footer-copyright { font-size: clamp(.78rem, 3.9vw, 1rem); }
  .site-footer .footer-brand { width: clamp(120px, 40vw, 250px); }
}
.woodland-dialog.viewer-mode { width: min(1440px, calc(100% - 16px)); height: calc(100dvh - 16px); max-height: none; }
.viewer-mode .modal-header { position: absolute; top: 4px; right: 6px; padding: 0; border: 0; background: transparent; }
.viewer-mode .modal-header h2, .viewer-mode .modal-viewer h3 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.viewer-mode .modal-content { display: flex; flex-direction: column; height: 100%; padding: 4px 8px 8px; }
.viewer-mode :is(.modal-story-summary, .modal-draft-notice) { display: none; }
.viewer-mode .modal-close { width: 36px; height: 36px; background: #fffbefe8; }
.viewer-mode .modal-close .icon { width: 18px; height: 18px; }
.viewer-mode .modal-viewer:not([hidden]) { display: flex; flex-direction: column; flex: 1; min-height: 0; margin-top: 0; }
.viewer-mode .modal-viewer [role="status"]:empty { display: none; }
.viewer-mode .modal-viewer > [role="status"] { margin: 2px 0; }
.viewer-mode .modal-viewer { position: relative; }
.viewer-mode #modal-read > [data-status]:not(:empty) { position: absolute; z-index: 3; bottom: 8px; left: 8px; right: 8px; padding: 8px; background: #fff3db; pointer-events: none; }
.viewer-mode #modal-watch .video-frame:not([hidden]) { flex: 1; min-height: 0; aspect-ratio: auto; }
.story-title-link { color: inherit; text-decoration: none; }
.story-title-link:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.woodland-dialog {
  width: min(960px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 2px solid #bb9452;
  border-radius: 22px;
  color: #3e2817;
  background: #fff3db;
  box-shadow: 0 16px 70px #18200fc0, inset 0 0 0 4px #fff9e9;
}
.woodland-dialog::backdrop { background: #18200f99; }
.modal-header {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid #d8bb83;
  background: #fff3db;
}
.modal-header h2 { margin: 0; font-size: clamp(1.4rem, 3vw, 2rem); line-height: 1.15; text-wrap: balance; }
.modal-header h2:focus { outline: none; } /* Initial reading focus; interactive controls keep visible focus rings. */
.modal-close { flex: 0 0 44px; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 1px solid #b99d69; border-radius: 50%; background: #fffbef; }
.modal-content { padding: 24px; }
.modal-story-summary { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 24px; align-items: center; }
.modal-cover { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border: 2px solid #d6b36a; border-radius: 12px; }
.modal-description { margin: 0 0 20px; line-height: 1.65; white-space: pre-line; }
.modal-view-controls { display: flex; flex-wrap: wrap; gap: 12px; }
.modal-view-controls button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 46px; padding: 10px 18px; border: 1px solid #ad8d52; border-radius: 10px; background: #fffaf0; font-weight: 600; }
.modal-view-controls button[aria-pressed="true"] { background: #405626; color: #fff9e9; border-color: #405626; }
.modal-view-controls button:hover { box-shadow: inset 0 0 0 2px #b99d69; }
.modal-draft-notice { border: 2px dashed #946d2c; padding: 12px; }
.modal-viewer { margin-top: 24px; scroll-margin-top: 100px; }
.modal-viewer h3 { font-size: 1.25rem; margin: 0 0 12px; }
.modal-viewer [role="status"] { line-height: 1.5; }
.woodland-dialog .video-frame { width: 100%; aspect-ratio: 16 / 9; background: #18220f; border-radius: 10px; overflow: hidden; }
.woodland-dialog .video-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.woodland-dialog .reader-toolbar { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-bottom: 6px; padding-right: 42px; }
.woodland-dialog .reader-toolbar button, .woodland-dialog .reader-toolbar a { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; border: 1px solid #b4ab86; border-radius: 7px; color: #253412; background: #fffdf3; text-decoration: none; }
.woodland-dialog .reader-toolbar .icon { width: 19px; height: 19px; }
.woodland-dialog .reader-toolbar button[aria-pressed="true"] { background: #405626; color: #fff9e9; }
.woodland-dialog .reader-toolbar button:disabled { opacity: .45; cursor: default; }
.woodland-dialog :is([data-page], [data-zoom]) { min-width: 42px; text-align: center; font-size: .8rem; }
.woodland-dialog .pdf-surface { max-height: 70dvh; overflow: auto; scrollbar-gutter: stable; padding: 12px; background: #ded8ca; border-radius: 6px; overscroll-behavior: contain; touch-action: pan-x pan-y pinch-zoom; }
.woodland-dialog .pdf-surface:empty { min-height: 150px; }
.woodland-dialog .pdf-sheet { position: relative; margin: auto; background: white; box-shadow: 0 2px 8px #0003; }
.woodland-dialog .pdf-sheet canvas { display: block; max-width: none; }
.woodland-dialog .textLayer { position: absolute; inset: 0; overflow: clip; opacity: 1; line-height: 1; text-align: initial; text-size-adjust: none; forced-color-adjust: none; transform-origin: 0 0; z-index: 2; --min-font-size: 1; --text-scale-factor: calc(var(--total-scale-factor) * var(--min-font-size)); --min-font-size-inv: calc(1 / var(--min-font-size)); }
.woodland-dialog .textLayer :is(span,br) { color: transparent; position: absolute; white-space: pre; cursor: text; transform-origin: 0 0; }
.woodland-dialog .textLayer span { --font-height: 0; --rotate: 0deg; --scale-x: 1; height: 1em; font-size: calc(var(--font-height) * var(--text-scale-factor)); transform: rotate(var(--rotate)) scaleX(var(--scale-x)) scale(var(--min-font-size-inv)); }
.woodland-dialog .textLayer ::selection { background: #4477ff66; }
.woodland-dialog .modal-viewer:fullscreen, .woodland-dialog .reader-expanded { background: #fff3db; width: 100%; height: 100%; margin: 0; padding: 20px; overflow: auto; }
.woodland-dialog .reader-expanded { position: fixed; inset: 0; z-index: 5; }
.woodland-dialog.viewer-mode .reader-expanded:not([hidden]) { margin: 0; }
.woodland-dialog.viewer-mode .pdf-surface { flex: 1; min-height: 0; max-height: none; }
.about-modal { max-width: 800px; }
.modal-about-copy { max-width: 64ch; margin: auto; font-size: 1.075rem; line-height: 1.75; }
.modal-about-copy h3 { font-size: 1.3rem; line-height: 1.35; color: #405626; margin: 1.5em 0 .6em; }
.modal-about-copy h3:first-child { margin-top: 0; font-style: italic; }
.modal-about-copy p { margin: 0 0 1em; }
.modal-about-copy p:last-child { margin-bottom: 0; }
@media (max-width: 700px) {
  .woodland-dialog { width: calc(100% - 20px); max-height: calc(100dvh - 20px); border-radius: 16px; }
  .modal-header { padding: 12px 14px; gap: 10px; }
  .modal-content { padding: 16px; }
  .modal-story-summary { grid-template-columns: 1fr; gap: 16px; }
  .modal-cover { max-width: 270px; justify-self: center; }
  .modal-view-controls button { flex: 1; padding-inline: 12px; }
  .woodland-dialog .pdf-surface { padding: 8px; }
}

.protected-reading [data-download] { display:none!important; }
.protected-reading .pdf-surface > img { display:block; margin:auto; object-fit:contain; flex-shrink:0; }

/* Immersive, online-only protected reader. No changes to the woodland composition. */
.woodland-dialog.reading-mode{width:100%;height:100dvh;max-width:none;max-height:none;margin:0;border:0;border-radius:0;}
.woodland-dialog.reading-mode .modal-header{display:none;}
.woodland-dialog.reading-mode .modal-content{padding:0;}
.woodland-dialog .protected-reading,.woodland-dialog .protected-reading:fullscreen{position:relative;background:#1d2319;padding:0;overflow:hidden;width:100%;height:100%;}
.woodland-dialog .protected-reading .pdf-surface{padding:0;border-radius:0;scrollbar-gutter:auto;background:#1d2319;touch-action:pan-y pinch-zoom;}
.woodland-dialog .protected-reading .reader-toolbar{position:absolute;z-index:5;top:max(8px,env(safe-area-inset-top));right:8px;left:8px;width:max-content;max-width:calc(100% - 16px);margin:auto;padding:4px;gap:2px;border-radius:12px;background:#fff8ebeF;box-shadow:0 2px 12px #0005;opacity:0;pointer-events:none;}
.woodland-dialog .protected-reading.controls-visible .reader-toolbar,.woodland-dialog .protected-reading .reader-toolbar:focus-within{opacity:1;pointer-events:auto;}
.woodland-dialog .protected-reading .reader-toolbar button{width:44px;height:44px;font:1.5rem system-ui;}
.woodland-dialog .protected-reading [data-zoom]:empty{display:none;}
.woodland-dialog.viewer-mode #modal-read>[data-status]:not(:empty){pointer-events:auto;bottom:16px;padding:16px;border-radius:10px;text-align:center;}
.unlock-story{display:inline-block;min-height:44px;padding:10px 16px;color:#fff;background:#405626;border-radius:8px;}
.rotation-prompt{position:absolute;z-index:4;bottom:8px;left:8px;right:8px;padding:8px;background:#fff8ebed;color:#27361d;text-align:center;font:0.8rem/1.5 system-ui;}
.rotation-prompt button{min-width:44px;min-height:44px;background:transparent;}
.rotation-prompt[hidden]{display:none;}

.woodland-dialog .protected-reading .pdf-surface{display:flex;flex-direction:column;user-select:none;}
.woodland-dialog .protected-reading .pdf-surface .sr-only{user-select:text;}
.protected-reading:has([data-status]:not(:empty)) .rotation-prompt{display:none;}
