/* Modern additions layered over the legacy application.css (carousel, lightbox,
   search, a11y). Kept separate so the faithful look is preserved until the CSS refresh. */

/* --- accessibility --- */
.skip-link { position: absolute; left: -9999px; top: 0; background: #5c4a3a; color: #fff; padding: 8px 14px; z-index: 1000; }
.skip-link:focus { left: 8px; top: 8px; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid #5c4a3a; outline-offset: 2px; }
.article-card .description { color: #555; } /* slightly stronger contrast */

/* --- CSS scroll-snap carousel (replaces jQuery slick) --- */
.scroller { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.scroller::-webkit-scrollbar { display: none; }
.scroller .slide { flex: 0 0 100%; scroll-snap-align: center; }
.scroller .slide .image img { width: 100%; height: auto; display: block; }
.carousel-dots { text-align: center; margin: 8px 0 0; }
.carousel-dots button { width: 9px; height: 9px; border-radius: 50%; border: 0; margin: 0 4px; padding: 0; background: #cbb9a6; cursor: pointer; }
.carousel-dots button[aria-current="true"] { background: #5c4a3a; }

/* --- lightbox for article images --- */
.lb-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.85); display: flex; align-items: center; justify-content: center; z-index: 2000; cursor: zoom-out; }
.lb-overlay[hidden] { display: none; }
.lb-overlay img { max-width: 92vw; max-height: 92vh; box-shadow: 0 4px 30px rgba(0,0,0,.5); }

/* --- inline PDF reader (full content width, below the article/sidebar row) --- */
.pdf-reader { clear: both; margin: 24px 0; padding-top: 16px; border-top: 1px solid #e3dccf; }
.pdf-toolbar { display: flex; align-items: center; gap: 14px; padding: 8px 0; margin-bottom: 14px; border-bottom: 1px solid #e3dccf; font-size: 14px; }
.pdf-pageinfo { color: #777; }
.pdf-zoom { margin-left: auto; display: inline-flex; gap: 6px; }
.pdf-zoom button { width: 28px; height: 28px; padding: 0; border: 1px solid #cbb9a6; background: #fff; border-radius: 4px; cursor: pointer; font-size: 16px; line-height: 1; }
.pdf-download { color: #7a5230; white-space: nowrap; }
.pdf-pages { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.pdf-page { width: 100%; display: flex; justify-content: center; }
.pdf-page canvas { max-width: 100%; height: auto; background: #fff; box-shadow: 0 1px 8px rgba(0,0,0,.15); }

/* book / document pages: single column so the PDF reader gets full content
   width; the legacy float sidebar (categories) becomes a horizontal footer row */
body.has-pdf .article,
body.has-pdf .sidebar { float: none; width: auto; margin-right: 0; }
body.has-pdf .sidebar { clear: both; margin-top: 24px; padding-top: 14px; border-top: 1px solid #e3dccf; }
body.has-pdf .sidebar .sidebar--menu { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0; padding: 0; list-style: none; }
body.has-pdf .sidebar .sidebar--menu li { margin: 0; }

/* responsive video embeds (YouTube) — normal-flow block so it clears the
   floated cover image instead of overlapping it */
.video { margin: 20px 0; clear: both; }
.video iframe { display: block; width: 100%; max-width: 680px; aspect-ratio: 16 / 9; height: auto; border: 0; }

/* --- related + search --- */
.related { clear: both; margin: 30px 0 0; padding-top: 15px; border-top: 1px solid #e3dccf; }
.related h3 { margin: 0 0 8px; font-size: 15px; }
.related ul { margin: 0; padding-left: 18px; }
/* sidebar-less pages (search, 404): the legacy .items-list grid assumes a
   preceding sidebar and yanks the column off-screen; neutralize the float.
   clear:both is essential — #header/#menu are float:left, so without it this
   non-floated block renders at top:0 and overlays (and blocks clicks on) the menu. */
.items-list.search-wrap,
.items-list.standalone { clear: both; float: none; width: auto; max-width: 760px; margin: 0 auto; padding: 10px 20px 40px; }

@media (prefers-reduced-motion: reduce) { *, ::before, ::after { scroll-behavior: auto !important; } }
