/* ============================================================================
   HUB UI — shared design rules for the section INDEX pages and hub chrome.
   Applies to ARTICLES / RESEARCH / CODE / VIDEO LIBRARY / Resources indexes,
   and to navigation + buttons across the whole hub.
   Law: rounded borders, BLACK surfaces, depth from stacked shadows on
   borders / margins / separators. Never a grey slab, never a flat hairline.
   Individual article/post prose is deliberately out of scope here.
   ============================================================================ */

.hub-body {
  background: #050506 !important;
  color: #f5f5f3;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.hub-shell, .hub-main { background: #050506; min-width: 0; }
.hub-main { padding: 0; }

/* ---- left navigation --------------------------------------------------- */
.hub-side {
  border-right: 0;
  box-shadow: inset -1px 0 0 rgba(255,255,255,.05), 14px 0 40px -28px rgba(0,0,0,1);
  background: #050506;
  padding: 4.5rem 0 0;
}
.hub-nav { display: flex; flex-direction: column; gap: 6px; padding: 0 .75rem; }
.hub-nav a {
  font-family: var(--font-label);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #a4a4a1;
  background: linear-gradient(165deg, #0b0b0e, #050506);
  border: 1px solid rgba(255,255,255,.10);
  border-top-color: rgba(255,255,255,.16);
  border-bottom-color: #000;
  border-radius: 9px;
  padding: .8rem .9rem;
  text-decoration: none;
  display: block;
  box-shadow: 0 12px 24px -14px rgba(0,0,0,1), inset 0 1px 0 rgba(255,255,255,.06), inset 0 -2px 6px rgba(0,0,0,.7);
}
.hub-nav a:hover { color: #f5f5f3; border-top-color: rgba(255,255,255,.28); }
.hub-nav a.active, .hub-nav a[aria-current="page"] {
  color: #050506;
  background: linear-gradient(165deg, #f5f5f3, #c9ccd1);
  border-color: #f5f5f3;
  box-shadow: 0 14px 28px -12px rgba(0,0,0,1), inset 0 1px 0 rgba(255,255,255,.7);
}

/* ---- index masthead ---------------------------------------------------- */
.hub-head {
  padding: 0 0 1.8rem;
  box-shadow: inset 0 -1px 0 rgba(0,0,0,1), 0 1px 0 rgba(255,255,255,.05);
}
.hub-eyebrow {
  font-family: var(--font-label);
  font-size: 10px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: #6f6f70;
  display: block;
  margin-bottom: 1rem;
}
.hub-head h1 {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: clamp(2rem, 3.4vw, 3rem);
  line-height: 1;
  letter-spacing: -.03em;
  color: #f5f5f3;
  margin: 0;
}
.hub-sub { font-size: 1rem; line-height: 1.6; color: #a4a4a1; max-width: 70ch; margin: 1rem 0 0; }

/* ---- toolbar, search and chips ---------------------------------------- */
.hub-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 1.6rem 0;
  padding: .9rem;
  background: linear-gradient(165deg, #0a0a0d, #050507);
  border: 1px solid rgba(255,255,255,.10);
  border-top-color: rgba(255,255,255,.16);
  border-bottom-color: #000;
  border-radius: 12px;
  box-shadow: 0 22px 46px -26px rgba(0,0,0,1), inset 0 1px 0 rgba(255,255,255,.06), inset 0 -2px 8px rgba(0,0,0,.75);
}
.hub-search, .fchip, .chip, .hub-actions a, .hub-actions button, .hub-cta {
  font-family: var(--font-label) !important;
  letter-spacing: .12em !important;
  text-transform: uppercase !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  border-top-color: rgba(255,255,255,.16) !important;
  border-bottom-color: #000 !important;
  border-radius: 8px !important;
  background: linear-gradient(165deg, #0b0b0e, #050506) !important;
  color: #a4a4a1 !important;
  box-shadow: 0 10px 20px -12px rgba(0,0,0,1), inset 0 1px 0 rgba(255,255,255,.06) !important;
}
.hub-search { height: 38px; min-width: 220px; flex: 1 1 260px; font-size: 11px; padding: 0 .8rem; }
.hub-search::placeholder, .codev-find input::placeholder { color: #6f6f70; }
.hub-search:focus { outline: none; color: #f5f5f3; border-color: rgba(255,255,255,.28) !important; }
.fchip, .chip { font-size: 10px; padding: .6rem .85rem; text-decoration: none; cursor: pointer; }
.fchip:hover, .chip:hover { color: #f5f5f3 !important; border-top-color: rgba(255,255,255,.28) !important; }
.fchip.on, .chip.on, .chip.active, .chip.gold {
  color: #050506 !important;
  background: linear-gradient(165deg, #f5f5f3, #c9ccd1) !important;
  border-color: #f5f5f3 !important;
  box-shadow: 0 12px 26px -10px rgba(0,0,0,1), inset 0 1px 0 rgba(255,255,255,.7) !important;
}

/* ---- index cards: rounded black faces, stacked depth ------------------ */
.hub-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 1080px) { .hub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .hub-grid { grid-template-columns: 1fr; } }
.hub-card, .dv-card-morphic, .study-tile, section.lib .tile {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-radius: 14px !important;
  background: linear-gradient(165deg, #0b0b0e 0%, #070709 42%, #040405 100%) !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  border-top-color: rgba(255,255,255,.18) !important;
  border-bottom-color: #000 !important;
  box-shadow:
    0 30px 64px -30px rgba(0,0,0,1),
    0 10px 24px -12px rgba(0,0,0,.92),
    inset 0 1px 0 rgba(255,255,255,.07),
    inset 0 -2px 10px rgba(0,0,0,.72) !important;
  overflow: hidden;
  color: #f5f5f3;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease;
}
.hub-card:hover, .dv-card-morphic:hover, .study-tile:hover, section.lib .tile:hover {
  transform: translateY(-2px);
  border-top-color: rgba(255,255,255,.28) !important;
  box-shadow:
    0 44px 90px -36px rgba(0,0,0,1),
    0 16px 32px -12px rgba(0,0,0,.95),
    inset 0 1px 0 rgba(255,255,255,.10),
    inset 0 -2px 12px rgba(0,0,0,.78) !important;
}
.hub-card > *, .study-tile > *, section.lib .tile > * { min-width: 0; }
.hub-card h2, .study-tile-body h2, section.lib .tile h3 {
  font-family: var(--font-sans);
  font-weight: 400;
  letter-spacing: -.02em;
  font-size: 1.15rem;
  line-height: 1.3;
  color: #f5f5f3;
  margin: .4rem 0;
}
.hub-card p, .study-tile-body p, section.lib .tile p { color: #a4a4a1; font-size: 13px; line-height: 1.6; }
.hub-thumb {
  border: 0;
  border-bottom: 1px solid #000;
  border-radius: 13px 13px 0 0;
  overflow: hidden;
  background: #000;
  box-shadow: inset 0 -1px 0 rgba(255,255,255,.05), 0 6px 14px -10px rgba(0,0,0,1);
}
.hub-thumb img { display: block; width: 100%; height: auto; filter: none; }
.hub-dur {
  position: absolute; left: .7rem; bottom: .7rem;
  font-family: var(--font-label); font-size: 9px; letter-spacing: .1em;
  color: #f5f5f3; background: rgba(0,0,0,.85);
  border: 1px solid rgba(255,255,255,.16); border-radius: 7px; padding: .25rem .45rem;
  box-shadow: 0 8px 16px -8px rgba(0,0,0,1);
}
.hub-meta, .hub-cta, .hub-dur, .study-tile-meta, .study-tile-action,
.tile-meta, .tile-how, .cat-tag, .pane-tag, .tag-sm, .chip {
  font-family: var(--font-label) !important;
  font-size: 9px !important;
  letter-spacing: .12em !important;
  text-transform: uppercase !important;
  color: #6f6f70 !important;
}
.hub-meta { display: flex; justify-content: space-between; gap: .6rem; margin-top: auto; padding-top: .8rem; box-shadow: inset 0 1px 0 rgba(0,0,0,1); }
.study-tile-preview { border: 0; border-bottom: 1px solid #000; border-radius: 13px 13px 0 0; background: #000; box-shadow: inset 0 -1px 0 rgba(255,255,255,.05); }
.study-tile-body, .tile-body { display: flex; flex-direction: column; gap: .4rem; padding: 1rem; flex: 1; }
.study-tile-action, .tile-meta { color: #f5f5f3 !important; box-shadow: inset 0 -1px 0 rgba(0,0,0,.95); padding-bottom: .3rem; }
.hub-empty {
  border: 1px dashed rgba(255,255,255,.16) !important;
  border-radius: 14px !important;
  background: #050506 !important;
  box-shadow: inset 0 2px 12px rgba(0,0,0,.9), 0 20px 40px -28px rgba(0,0,0,1);
  padding: 2rem; color: #6f6f70; font-family: var(--font-label);
}

/* ---- post-page navigation + action buttons ---------------------------- */
.hub-actions {
  border: 1px solid rgba(255,255,255,.12) !important;
  border-radius: 12px !important;
  background: linear-gradient(165deg, #0b0b0e, #050506) !important;
  box-shadow: 0 24px 48px -24px rgba(0,0,0,1), inset 0 1px 0 rgba(255,255,255,.07) !important;
}
.hub-actions a, .hub-actions button {
  font-size: 9px !important;
  padding: .55rem .8rem !important;
  text-decoration: none;
  cursor: pointer;
}
.hub-actions a:hover, .hub-actions button:hover { color: #f5f5f3 !important; }
.hub-actions .primary {
  color: #050506 !important;
  background: linear-gradient(165deg, #f5f5f3, #c9ccd1) !important;
  border-color: #f5f5f3 !important;
}
.hub-actions .div { width: 1px; height: 20px; background: #000; box-shadow: 1px 0 0 rgba(255,255,255,.05); }
.hub-toast {
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  background: linear-gradient(165deg, #0b0b0e, #050506);
  box-shadow: 0 22px 44px -22px rgba(0,0,0,1), inset 0 1px 0 rgba(255,255,255,.07);
}

/* ---- lightbox for archive images -------------------------------------- */
dialog.dv-lightbox {
  width: min(1100px, calc(100vw - 32px));
  max-height: min(92vh, 1040px);
  padding: 0;
  border: 1px solid rgba(255,255,255,.12);
  border-top-color: rgba(255,255,255,.20);
  border-bottom-color: #000;
  border-radius: 16px;
  background: linear-gradient(165deg, #0a0a0d, #040405);
  color: #f5f5f3;
  overflow: hidden;
  box-shadow: 0 60px 120px -40px rgba(0,0,0,1), 0 20px 44px -18px rgba(0,0,0,.96), inset 0 1px 0 rgba(255,255,255,.08);
}
.dv-lightbox::backdrop { background: rgba(0,0,0,.92); }
.dv-lb-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .8rem 1rem;
  box-shadow: inset 0 -1px 0 rgba(0,0,0,1), 0 1px 0 rgba(255,255,255,.05);
  background: linear-gradient(165deg, #0b0b0e, #050506);
}
.dv-lb-label { font-family: var(--font-label); font-size: 9px; letter-spacing: .18em; text-transform: uppercase; color: #6f6f70; }
.dv-lb-x {
  font-family: var(--font-label); font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  color: #a4a4a1; cursor: pointer;
  background: linear-gradient(165deg, #0b0b0e, #050506);
  border: 1px solid rgba(255,255,255,.10); border-bottom-color: #000; border-radius: 8px;
  padding: .45rem .7rem;
  box-shadow: 0 8px 18px -10px rgba(0,0,0,1), inset 0 1px 0 rgba(255,255,255,.06);
}
.dv-lb-x:hover { color: #050506; background: #f5f5f3; }
.dv-lb-body { padding: 1rem; background: #000; display: grid; place-items: center; max-height: calc(92vh - 120px); overflow: auto; }
.dv-lb-body img { display: block; max-width: 100%; max-height: calc(92vh - 140px); width: auto; height: auto; border-radius: 10px; box-shadow: 0 30px 70px -30px rgba(0,0,0,1); }
.dv-lb-cap {
  margin: 0; padding: .8rem 1rem;
  font-family: var(--font-label); font-size: 10px; line-height: 1.6; color: #a4a4a1;
  box-shadow: inset 0 1px 0 rgba(0,0,0,1);
}

/* ---- card action buttons: real coloured buttons on every section ------ */
.hub-meta > span:last-child,
.hub-cta,
.study-tile-action,
.tile-meta,
.hub-actions a,
.hub-actions button {
  display: inline-flex !important;
  align-items: center;
  gap: .35rem;
  font-family: var(--font-label) !important;
  font-size: 9px !important;
  letter-spacing: .1em !important;
  text-transform: uppercase !important;
  text-decoration: none !important;
  color: #050506 !important;
  background: linear-gradient(165deg, #f5f5f3, #c9ccd1) !important;
  border: 1px solid #f5f5f3 !important;
  border-radius: 9px !important;
  padding: .6rem .85rem !important;
  cursor: pointer;
  box-shadow: 0 14px 28px -12px rgba(0,0,0,1), 0 4px 10px -6px rgba(0,0,0,.9), inset 0 1px 0 rgba(255,255,255,.8), inset 0 -2px 6px rgba(0,0,0,.25) !important;
  transition: color .15s, background .15s, border-color .15s, transform .15s;
}
.hub-meta > span:last-child:hover,
.hub-cta:hover,
.study-tile-action:hover,
.tile-meta:hover,
.hub-actions a:hover,
.hub-actions button:hover {
  transform: translateY(-1px);
  color: #03130d !important;
  background: linear-gradient(165deg, #7ce8bb, #43b98a) !important;
  border-color: #54d6a0 !important;
}
.hub-actions .primary {
  color: #03130d !important;
  background: linear-gradient(165deg, #54d6a0, #2e9e73) !important;
  border-color: #54d6a0 !important;
}

@media (max-width: 900px) {
  .hub-side { padding: 0; border-right: 0; border-bottom: 1px solid #000; box-shadow: inset 0 -1px 0 rgba(255,255,255,.05), 0 14px 40px -26px rgba(0,0,0,1); }
  .hub-grid { grid-template-columns: 1fr; }
}
