/* This stylesheet is meant for custom styles, on top of The 8 Template */

/* ----------------------------------------------------- */
/* Spinning-record page loader                            */
/* Shows the TBCC logo spinning while the page loads,    */
/* fades out once the existing "preload" class is        */
/* removed by js/functions.js.                            */
/* ----------------------------------------------------- */

/* Keep body visible during preload so the loader can show */
body.preload { opacity: 1; }
/* But hide the actual page content until preload is removed */
body.preload .container-fluid,
body.preload aside { opacity: 0; }
.container-fluid, aside { transition: opacity 0.4s ease; }

/* The loader overlay */
#tbcc-loader {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  transition: opacity 0.4s ease;
}
body:not(.preload) #tbcc-loader {
  opacity: 0;
  pointer-events: none;
}
#tbcc-loader img {
  width: 140px;
  height: 140px;
  animation: tbcc-spin 2.5s linear infinite;
}
@keyframes tbcc-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ----------------------------------------------------- */
/* Hamburger menu scroll behavior                         */
/* The base template's #navigation is position:fixed but */
/* has no overflow rule on desktop, so when its contents */
/* exceed the viewport, scroll events fall through to    */
/* the body. We want the opposite: the menu scrolls,     */
/* the page underneath stays put.                        */
/* ----------------------------------------------------- */

/* Let the menu's own contents scroll internally */
#navigation { overflow-y: auto; }

/* Freeze the page behind the menu while it's open */
body.menu-active { overflow: hidden; }

/* ----------------------------------------------------- */
/* Footer auto-year shade fix                            */
/* elements.css fades the whole footer with `footer span */
/* { opacity:.3 }`. The dynamic-year <span class=        */
/* "tbcc-year"> is NESTED inside that span, so its        */
/* opacity compounds (~0.3 x 0.3 = 0.09) and the current */
/* year looks lighter than the "2021-" beside it. Reset  */
/* it to full so it matches the rest of the footer line. */
/* ----------------------------------------------------- */
footer .tbcc-year { opacity: 1; }

/* ----------------------------------------------------- */
/* Hover interaction only on real links  (2026-06-08)    */
/* elements.css applies a slide-in underline             */
/* (.item:hover .caption:after) and an image darken      */
/* (.item:hover .thumb:after) to EVERY card. Those cues  */
/* imply a card is clickable, so they should appear only */
/* on cards that are actually links. Two link shapes     */
/* exist on the site:                                     */
/*   1. anchor-as-item:  <a class="item ...">            */
/*   2. wrapped:         <a href...><div class="item">   */
/* Anything else is a bare <div class="item"> with no    */
/* link: greyed "detail page not built yet" variation    */
/* cards AND permanently static cards (books, films,     */
/* blog). Cancel the hover cues by default, then         */
/* re-enable them only for the two link shapes (higher   */
/* specificity wins). New pages inherit this automatically*/
/* since it lives in the shared stylesheet.              */
/* ----------------------------------------------------- */
.grid .item:hover .caption:after { right: 100%; }
.grid .item:hover .thumb:after   { opacity: 0; }
.grid a.item:hover .caption:after,
.grid a .item:hover .caption:after { right: 0; }
.grid a.item:hover .thumb:after,
.grid a .item:hover .thumb:after   { opacity: .2; }

/* ----------------------------------------------------- */
/* Even spacing for stacked .tag lines  (2026-06-08)     */
/* The default .tag has `margin:10px 0 20px` (desktop),  */
/* a 20px bottom meant as breathing room before the      */
/* card edge. When two tags stack (e.g. catalogue +      */
/* release date on the albums index, or artist +         */
/* catalogue on the Apple index), that 20px made the gap */
/* BELOW the upper tag wider than the gap above it. Zero  */
/* the bottom margin on any tag that is followed by       */
/* another tag, so the gaps match (~10px above and       */
/* below). The last tag in a card keeps its 20px.        */
/* ----------------------------------------------------- */
.grid .item .caption .tag:has(+ .tag) { margin-bottom: 0; }

/* ----------------------------------------------------- */
/* Floating "back to top" button (June 2026).             */
/* Markup lives on tile pages (level-2 indexes, level-3   */
/* listings, series/format pages): a <button id=          */
/* "back-to-top"> right after the tbcc-loader div. The    */
/* behavior is in js/functions.js; it adds .show after    */
/* the page scrolls past 300px. Same look as the master   */
/* checklist's own button.                                */
/* ----------------------------------------------------- */
#back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: #6f4e37;
  color: white;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .25s ease, transform .25s ease, visibility .25s;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
#back-to-top:hover { background: #5a3f2c; box-shadow: 0 6px 16px rgba(0,0,0,0.3); }
#back-to-top.show { opacity: 0.95; visibility: visible; transform: translateY(0); }
#back-to-top svg { width: 22px; height: 22px; fill: white; }

/* ----------------------------------------------------- */
/* Site search overlay (June 2026). The "Search" menu     */
/* item and this overlay are injected by js/functions.js; */
/* the index is assets/search-index.json (re-generate     */
/* with tools/generate_search_index.py after adding       */
/* pages).                                                */
/* ----------------------------------------------------- */
#tbcc-search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.97);
  z-index: 300;
  display: none;
  overflow-y: auto;
}
#tbcc-search-overlay.show { display: block; }
body.tbcc-search-active { overflow: hidden; }
.tbcc-search-box {
  max-width: 720px;
  margin: 8vh auto 0;
  padding: 0 20px 60px;
  position: relative;
}
.tbcc-search-box input {
  width: 100%;
  font-size: 22px;
  padding: 14px 18px;
  border: 2px solid #6f4e37;
  border-radius: 6px;
  outline: none;
  box-sizing: border-box;
}
.tbcc-search-close {
  position: absolute;
  top: -5vh;
  right: 16px;
  border: none;
  background: none;
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
  color: #6f4e37;
}
.tbcc-search-results { margin-top: 18px; }
.tbcc-search-hit {
  display: block;
  padding: 10px 14px;
  border-bottom: 1px solid #eee;
  text-decoration: none;
  color: inherit;
}
.tbcc-search-hit:hover { background: #f7f3f0; text-decoration: none; }
.tbcc-search-hit-title { font-weight: 600; color: #333; }
.tbcc-search-hit-desc { font-size: 13px; color: #888; margin-top: 2px; }
.tbcc-search-none { padding: 16px; color: #888; }
