/* ==========================================================
   Never Enough Paper — Home page styles
   File: /assets/css/home.css
   Updated: 2025-09-16
   - Meta under each image (title, 2-line description, Category › Sub)
   - Exact N-up rails (size comes from JS via --card-w)
   - Warm, uncluttered card look; good mobile defaults
   - Lightbox stack mirrors gallery
   ========================================================== */

:root{
  --nep-bg:    #f8f7f5;
  --nep-card:  #fff;
  --nep-ink:   #111827;
  --nep-muted: #6b7280;
  --nep-border:#e5e7eb;
  --nep-radius:14px;
}

body{ background:var(--nep-bg); color:var(--nep-ink); }

/* Sections */
.section-title{ font-size:22px; font-weight:700; margin:14px 0 8px; }
.card{ background:var(--nep-card); border:1px solid var(--nep-border); border-radius:var(--nep-radius); }
.pad{ padding:12px 14px; }

/* ---------- Rails (shared) ---------- */
.rail-wrap{ position:relative }
.rail{
  display:flex; gap:14px; overflow:auto; scroll-behavior:smooth;
  padding:6px 8px 12px; margin:0; list-style:none;
  -webkit-overflow-scrolling:touch;
}
.rail::-webkit-scrollbar{ height:8px }
.rail::-webkit-scrollbar-thumb{ background:#dadada; border-radius:999px }

/* Cards */
.rail > li{
  flex: 0 0 var(--card-w, 220px);   /* width set by JS for exact N-up */
  min-width:200px; max-width:280px;
  background:var(--nep-card); border:1px solid var(--nep-border);
  border-radius:12px; overflow:hidden;
  display:flex; flex-direction:column;
}

/* Image frame */
.rail .frame{ aspect-ratio:4/3; background:#f3f4f6; }
.rail .frame img{
  width:100%; height:100%;
  object-fit:contain; object-position:center; background:#fff;
}

/* Meta under the image */
.rail .meta{ padding:10px 12px 12px; }
.rail .meta .title{
  margin:0 0 2px; font-weight:600; font-size:14px; line-height:1.25;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.rail .meta .desc{
  margin:4px 0 6px; font-size:13px; line-height:1.35; color:var(--nep-ink);
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.rail .meta .small{
  margin:0; font-size:12px; color:var(--nep-muted);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}

/* Sneak vs. Recent (hints; exact width still from JS) */
.rail--sneak > li{ min-width:210px; max-width:240px; }
.rail--recent> li{ min-width:220px; max-width:260px; }

/* Pager buttons */
.rail-btn{
  position:absolute; top:50%; transform:translateY(-50%);
  width:34px; height:34px; border-radius:999px;
  border:1px solid var(--nep-border); background:#fff; color:var(--nep-ink);
  display:flex; align-items:center; justify-content:center; cursor:pointer; z-index:2;
  box-shadow:0 2px 6px rgba(0,0,0,.08);
}
.rail-prev{ left:-6px } .rail-next{ right:-6px }
.rail-btn[disabled]{ opacity:.35; pointer-events:none }

/* ---------- Categories dropdown ---------- */
.hero .menu { position: relative; display:inline-block; }
.hero .menu summary { list-style:none; }
.hero .menu summary::-webkit-details-marker { display:none; }
.hero .menu summary.btn { cursor:pointer; }
.hero .menu[open] summary.btn { box-shadow:0 2px 8px rgba(0,0,0,.08); }
.hero .menu-panel{
  position:absolute; z-index:20; margin-top:8px; min-width:280px; max-height:60vh;
  overflow:auto; background:#fff; border:1px solid var(--nep-border); border-radius:12px; box-shadow:0 8px 28px rgba(0,0,0,.12);
}
.menu-list{ padding:8px; margin:0; list-style:none; }
.menu-list > li{ padding:6px 8px; border-radius:10px; }
.menu-list > li:hover{ background:#f5f5f5; }
.menu-cat{ font-weight:600; display:block; margin-bottom:2px; text-decoration:none; color:var(--nep-ink); }
.menu-sub a{
  display:inline-block; margin:4px 6px 0 0; padding:4px 8px;
  border:1px solid var(--nep-border); border-radius:999px;
  text-decoration:none; color:var(--nep-ink); font-size:13px;
}
.menu-sub a:hover{ background:#f9fafb; }

/* ---------- Lightbox ---------- */
.lb{
  position:fixed; inset:0;
  background:rgba(0,0,0,.9);
  display:none;
  align-items:center; justify-content:center;
  z-index:9999;
}
.lb.show{ display:flex; }

.lb-inner{
  position:relative;
  max-width:96vw; max-height:92vh;
  display:flex; flex-direction:column;
}
.lb-media{
  position:relative; min-height:60vh;
  display:flex; align-items:center; justify-content:center;
}
.lb-media img{
  max-width:96vw; max-height:80vh;
  object-fit:contain;
  border-radius:8px;
  box-shadow:0 8px 30px rgba(0,0,0,.45);
}

.lb-close,.lb-prev,.lb-next{
  position:absolute; background:rgba(0,0,0,.55); color:#fff; border:none;
  width:44px; height:44px; border-radius:999px; cursor:pointer;
  display:flex; align-items:center; justify-content:center; font-size:24px; line-height:1;
}
.lb-close{ top:10px; right:10px; }
.lb-prev{ left:10px;  top:50%; transform:translateY(-50%); }
.lb-next{ right:10px; top:50%; transform:translateY(-50%); }
.lb-close:hover,.lb-prev:hover,.lb-next:hover{ background:rgba(0,0,0,.75); }

/* Lightbox meta */
.lb-meta{
  color:#fff;
  margin-top:10px;
  font-size:14px;
  line-height:1.4;
  display:flex; flex-direction:column; gap:4px;
  text-align:left;
}
.lb-title{ font-weight:700; margin:0; color:#fff; }
.lb-desc{ margin:0; color:#f3f4f6; }
.lb-tags{ margin:0; color:#d1d5db; }

/* ---------- Mobile ---------- */
@media (max-width:560px){
  .pad{ padding:10px 12px; }
  .rail > li{ min-width:210px; }
}

/* --- Home hero + chips: utilities override base .btn/.muted sizes/weights --- */
/* HERO subtitle (text under the H1) */
.hero .muted.size-S  { font-size: 12px; }
.hero .muted.size-M  { font-size: 14px; }
.hero .muted.size-L  { font-size: 16px; }
.hero .muted.size-XL { font-size: 18px; }

.hero .muted.w-regular { font-weight: 400; }
.hero .muted.w-bold    { font-weight: 700; }

/* CHIP buttons (quick links) */
.hero .chips .btn.size-S  { font-size: 12px; }
.hero .chips .btn.size-M  { font-size: 14px; }
.hero .chips .btn.size-L  { font-size: 16px; }
.hero .chips .btn.size-XL { font-size: 18px; }

.hero .chips .btn.w-regular { font-weight: 400; }
.hero .chips .btn.w-bold    { font-weight: 700; }


/* Home-only styles (no rail styles here) */

/* Dropdown in hero */
.hero .menu{position:relative;display:inline-block}
.hero .menu summary{list-style:none}
.hero .menu summary::-webkit-details-marker{display:none}
.hero .menu summary.btn{cursor:pointer}
.hero .menu[open] summary.btn{box-shadow:0 2px 8px rgba(0,0,0,.08)}
.hero .menu-panel{
  position:absolute;z-index:20;margin-top:8px;min-width:280px;max-height:60vh;overflow:auto;
  background:#fff;border:1px solid var(--nep-border);border-radius:12px;box-shadow:0 8px 28px rgba(0,0,0,.12)
}
.menu-list{padding:8px;margin:0;list-style:none}
.menu-list>li{padding:6px 8px;border-radius:10px}
.menu-list>li:hover{background:#f5f5f5}
.menu-cat{font-weight:600;display:block;margin-bottom:2px;text-decoration:none;color:inherit}
.menu-sub a{display:inline-block;margin:4px 6px 0 0;padding:4px 8px;border:1px solid var(--nep-border);border-radius:999px;text-decoration:none;color:inherit;font-size:13px}
.menu-sub a:hover{background:#f9fafb}

/* Lightbox (home page) */
.lb{position:fixed;inset:0;background:rgba(0,0,0,.9);display:none;align-items:center;justify-content:center;z-index:9999}
.lb.show{display:flex}
.lb-inner{position:relative;max-width:96vw;max-height:92vh;display:flex;flex-direction:column}
.lb-media{position:relative;min-height:60vh;display:flex;align-items:center;justify-content:center}
.lb-media img{max-width:96vw;max-height:80vh;object-fit:contain;border-radius:8px;box-shadow:0 8px 30px rgba(0,0,0,.45)}
.lb-close,.lb-prev,.lb-next{position:absolute;background:rgba(0,0,0,.55);color:#fff;border:none;width:44px;height:44px;border-radius:999px;cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:24px;line-height:1}
.lb-close{top:10px;right:10px}.lb-prev{left:10px;top:50%;transform:translateY(-50%)}.lb-next{right:10px;top:50%;transform:translateY(-50%)}
.lb-close:hover,.lb-prev:hover,.lb-next:hover{background:rgba(0,0,0,.75)}
.lb-meta{color:#fff;margin-top:10px;font-size:14px;line-height:1.4;display:flex;flex-direction:column;gap:4px;text-align:left}
.lb-title{font-weight:700;margin:0;color:#fff}
.lb-desc{margin:0;color:#f3f4f6}
.lb-tags{margin:0;color:#d1d5db}

/* Mobile tweaks */
@media (max-width:560px){
  .pad{padding:10px 12px}
}

/* --- Home hero + chips: force utilities to beat base .btn/.muted defaults --- */
.hero .muted.size-S  { font-size:12px }
.hero .muted.size-M  { font-size:14px }
.hero .muted.size-L  { font-size:16px }
.hero .muted.size-XL { font-size:18px }
.hero .muted.w-regular{font-weight:400}
.hero .muted.w-bold   {font-weight:700}

.hero .chips .btn.size-S  { font-size:12px }
.hero .chips .btn.size-M  { font-size:14px }
.hero .chips .btn.size-L  { font-size:16px }
.hero .chips .btn.size-XL { font-size:18px }
.hero .chips .btn.w-regular{font-weight:400}
.hero .chips .btn.w-bold   {font-weight:700}

