/* ===== SHELF VIEW for Past papers (browse.php) and Notes (notes.php): same wooden bookcase as the Books page =====
   shelf.js turns every .pc-grid into a cabinet of shelves; the cards (.pc) keep all their links and buttons. */
.pc-grid.sc{
  --g1:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='720' height='140'%3E%3Cfilter id='f' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.003 0.28' numOctaves='4' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .13 0 0 0 0 .06 0 0 0 0 .02 1.9 0 0 0 -.62'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
  --g3:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='120'%3E%3Cfilter id='f' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.0025 0.2' numOctaves='5' seed='11' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .16 0 0 0 0 .07 0 0 0 0 .02 2.8 0 0 0 -1.05'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
  --g2:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='520' height='520'%3E%3Cfilter id='f' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.6 0.012' numOctaves='3' seed='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .05 0 0 0 0 .02 0 0 0 0 .0 1.7 0 0 0 -.55'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
  display:block;position:relative;gap:0;padding:22px 22px 30px;margin:30px 16px 40px;border-radius:12px 12px 6px 6px;border:0;
  background:var(--g1),linear-gradient(90deg,rgba(0,0,0,.35),transparent 4%,transparent 96%,rgba(0,0,0,.35)),linear-gradient(180deg,#9a6535,#7b4b24 30%,#6a3f1e);
  box-shadow:0 28px 46px -20px rgba(0,0,0,.8),inset 0 3px 0 rgba(255,222,170,.35),inset 0 0 0 2px rgba(0,0,0,.35)}
.pc-grid.sc::before{content:"";position:absolute;left:-6px;right:-6px;top:-10px;height:16px;border-radius:8px 8px 3px 3px;background:var(--g1),linear-gradient(180deg,#b27a43,#8a5a2e 60%,#5e3819);box-shadow:0 5px 8px -2px rgba(0,0,0,.6),inset 0 2px 0 rgba(255,226,180,.45)}
.pc-grid.sc::after{content:"";position:absolute;left:-6px;right:-6px;bottom:-14px;height:20px;border-radius:2px 2px 6px 6px;background:var(--g1),linear-gradient(180deg,#6d4220,#4a2b12);box-shadow:0 12px 16px -6px rgba(0,0,0,.75),inset 0 2px 0 rgba(255,226,180,.25)}
/* one compartment: dark back panel + the plank */
.sc .sc-shelf{display:grid;gap:0;align-items:stretch;position:relative;padding:34px 0 0;overflow:hidden;
  background:repeating-linear-gradient(90deg,rgba(0,0,0,.42) 0 2px,rgba(255,200,140,.05) 2px 4px,transparent 4px 118px),var(--g2),linear-gradient(180deg,#1d1008,#33200f 45%,#3d2612);
  box-shadow:inset 0 26px 26px -14px rgba(0,0,0,.95),inset 14px 0 18px -8px rgba(0,0,0,.9),inset -14px 0 18px -8px rgba(0,0,0,.9)}
.sc .sc-shelf+.sc-shelf{margin-top:6px}
.sc .sc-shelf:first-child{border-radius:6px 6px 0 0}.sc .sc-shelf:last-child{border-radius:0 0 4px 4px}
.sc .sc-shelf::before,.sc .sc-shelf::after{content:"";position:absolute;top:0;bottom:0;width:18px;z-index:5;pointer-events:none}
.sc .sc-shelf::before{left:0;background:linear-gradient(90deg,rgba(0,0,0,.55),transparent)}.sc .sc-shelf::after{right:0;background:linear-gradient(270deg,rgba(0,0,0,.55),transparent)}
/* cells: the card loses its box and becomes "a book on the plank + a paper label" */
.sc .pc,.sc .sc-slot{display:flex;flex-direction:column;min-width:0;padding:0 15px;position:relative;margin:0;background:none;border:0;box-shadow:none;border-radius:0;overflow:visible;animation:none!important;transform:none}
.sc .pc:hover{transform:none;border:0;box-shadow:none}
.sc .pc-th,.sc .pc-th.nt-plain,.sc .sc-sp{flex:none;position:relative;display:block;width:100%;aspect-ratio:3/4;height:auto;margin:0;overflow:visible;background:none;border:0;border-bottom:0;z-index:2}
.sc .pc-th .pc-cv{position:absolute;left:0;top:0;width:100%;height:100%;object-fit:cover;object-position:top center;display:block;border-radius:2px 5px 5px 2px;background:#fff;z-index:1;transform-origin:50% 100%;
  box-shadow:0 0 0 1px rgba(0,0,0,.4),5px 4px 14px rgba(0,0,0,.6);transition:transform .35s cubic-bezier(.2,.8,.2,1),box-shadow .35s}
.sc .pc:hover .pc-th .pc-cv,.sc .pc:focus-within .pc-th .pc-cv{transform:translateY(-10px) rotate(-1.2deg);box-shadow:0 0 0 1px rgba(0,0,0,.4),10px 18px 24px rgba(0,0,0,.6)}
/* book spine highlight over the cover (replaces the old "Open full paper" pill) */
.sc .pc-th::after{content:"";display:block;position:absolute;inset:0;left:0;right:0;top:0;bottom:0;transform:none;opacity:1;padding:0;font-size:0;color:transparent;z-index:2;pointer-events:none;border-radius:2px 5px 5px 2px;
  background:linear-gradient(90deg,rgba(0,0,0,.34),rgba(255,255,255,.18) 3%,rgba(0,0,0,.12) 6%,transparent 12%),linear-gradient(0deg,rgba(0,0,0,.2),transparent 22%);transition:transform .35s cubic-bezier(.2,.8,.2,1)}
.sc .pc:hover .pc-th::after,.sc .pc-th:focus-visible::after{opacity:1;transform:translateY(-10px) rotate(-1.2deg)}
/* icon placeholders (lesson notes) look like a plain paper book */
.sc .pc-th .pc-ph{inset:0;border-radius:2px 5px 5px 2px;background:linear-gradient(135deg,#f7eed8,#e0cfa6);color:#7a5a2b;opacity:1;z-index:1;box-shadow:0 0 0 1px rgba(0,0,0,.4),5px 4px 14px rgba(0,0,0,.6)}
.sc .pc-th .pc-ph svg{width:46px;height:46px}
/* THE PLANK under each book (grain continues along the whole row: --px is set by shelf.js) */
.sc .pc-th::before,.sc .sc-sp::before{content:"";position:absolute;z-index:0;left:-15px;right:-15px;top:100%;height:20px;pointer-events:none;
  background-position:var(--px,0) 0,0 0,0 0,0 0;background-size:auto 100%,100% 2px,100% 3px,100% 100%;background-repeat:repeat-x,no-repeat,no-repeat,no-repeat;
  background-image:var(--g3),linear-gradient(rgba(255,238,200,.85),rgba(255,238,200,.85)),linear-gradient(rgba(255,255,255,.18),rgba(255,255,255,0)),linear-gradient(180deg,#d9a869 0,#c18a50 35%,#a2703b 75%,#7b4f27 100%);
  box-shadow:0 14px 16px -4px rgba(0,0,0,.85),0 2px 0 #2e1a0c}
/* download pill stays on the cover */
.sc .pc-dlf{top:10px;right:25px;z-index:4}
/* paper label under the plank (title, tags, buttons) */
.sc .pc-bd{flex:1;margin:34px 6px 0;padding:11px 11px 4px;position:relative;z-index:1;border-radius:3px 3px 0 0;color:#2e1f0f;
  background:linear-gradient(180deg,#fbf1dc,#efe0bd);box-shadow:inset 1px 0 0 rgba(120,80,30,.25),inset -1px 0 0 rgba(120,80,30,.25),inset 0 1px 0 rgba(120,80,30,.25)}
.sc .pc-bd::before{content:"";position:absolute;left:50%;top:-7px;width:8px;height:8px;margin-left:-4px;border-radius:50%;background:radial-gradient(circle at 35% 30%,#ffe9a8,#b98a2c 60%,#6b4a10);box-shadow:0 1px 2px rgba(0,0,0,.7)}
.sc .pc-tt{color:#2e1f0f;font-size:13.5px;line-height:1.3;-webkit-line-clamp:3}
.sc .pc-meta{color:#6b5436;font-size:12px;margin-top:7px}
.sc .pc-meta .tg{background:rgba(120,80,30,.12);border-color:rgba(120,80,30,.28);color:#5b4120}
.sc .pc-meta .tg.k{background:linear-gradient(90deg,#14532d,#16a34a);border-color:transparent;color:#fff}
.sc .pc-sh a{color:#166534}
.sc .pc-ft{margin:0 6px 16px;padding:8px 11px 10px;border-top:1px dashed rgba(120,80,30,.35);border-radius:0 0 3px 3px;color:#6b5436;background:#efe0bd;position:relative;z-index:1;
  box-shadow:inset 1px 0 0 rgba(120,80,30,.25),inset -1px 0 0 rgba(120,80,30,.25),inset 0 -1px 0 rgba(120,80,30,.25),0 6px 10px -2px rgba(0,0,0,.7)}
.sc .pc-dn{color:#6b5436;font-size:12px}
.sc .pc-act{display:flex;flex-wrap:wrap;gap:6px}
.sc .pc-btn{padding:6px 10px;font-size:12px;border-radius:8px}
.sc .pc-btn-o{background:#fff8e6;color:#3a2815;border-color:rgba(120,80,30,.4)}.sc .pc-btn-o:hover{background:#fff;border-color:#8a5a2e}
/* empty places on a shelf (room for new uploads) */
.sc .sc-sl-bd{margin:34px 6px 16px;min-height:80px;border-radius:3px;border:1.5px dashed rgba(255,225,180,.16);background:rgba(255,225,180,.03)}
.sc .sc-sp{aspect-ratio:3/4}
@media (max-width:600px){
  .pc-grid.sc{padding:14px 10px 24px;margin:24px 8px 34px}
  .sc .sc-shelf{padding-top:26px}.sc .pc,.sc .sc-slot{padding:0 9px}
  .sc .pc-th::before,.sc .sc-sp::before{left:-9px;right:-9px;height:14px}
  .sc .pc-bd,.sc .sc-sl-bd{margin-top:26px;margin-left:2px;margin-right:2px}.sc .pc-ft{margin-left:2px;margin-right:2px}
  .sc .pc-dlf{right:15px;top:6px}.sc .pc-btn-o span{display:none}.sc .pc-ai-l{display:none}
}
@media (prefers-reduced-motion:reduce){.sc .pc-th .pc-cv,.sc .pc-th::after{transition:none}}
