/* =========================================================
   AltWorld Comics — global publisher theme + shared chrome
   This file owns the site-wide header/footer and generic colors.
   Section themes override ONLY variables, never the header layout.
   ========================================================= */

:root{
  --bg:#05080d;
  --bg-mid:#070b11;
  --panel:#0a0f17;
  --panel2:#101722;
  --cream:#e8edf3;
  --body-copy:#b6c1cd;
  --muted:#9aa8b8;
  --gold:#1677ff;
  --red:#0d5fcb;
  --line:#24364a;
  --soft:rgba(22,119,255,.12);
  --body-glow:rgba(22,119,255,.14);
  --accent-border:rgba(76,151,255,.34);
  --accent-border-strong:rgba(76,151,255,.66);
  --accent-faint:rgba(22,119,255,.07);
  --chrome-bg:rgba(4,8,14,.97);
  --chrome-border:#203247;
  --chrome-text:#dfe6ee;
  --chrome-muted:#93a2b4;
}

body{
  background:
    radial-gradient(circle at 50% -10%,var(--body-glow),transparent 38%),
    linear-gradient(180deg,var(--bg) 0%,var(--bg-mid) 48%,var(--bg) 100%);
  color:var(--cream);
}

/* ------------------------- GLOBAL HEADER ------------------------- */
.topbar{
  width:100%;
  min-height:76px;
  box-sizing:border-box;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);
  align-items:center;
  gap:18px;
  position:sticky;
  top:0;
  z-index:1000;
  padding:0 clamp(18px,3vw,46px);
  background:var(--chrome-bg);
  border-bottom:1px solid var(--chrome-border);
  box-shadow:0 8px 28px rgba(0,0,0,.28);
  backdrop-filter:blur(8px);
}

.topbar .brand-wrap{
  grid-column:1;
  justify-self:start;
  position:static;
  left:auto;
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
  color:var(--chrome-text);
  text-decoration:none;
}

.topbar .site-logo{
  width:42px;
  height:42px;
  flex:0 0 42px;
  border-radius:50%;
  object-fit:cover;
}

.topbar .brand-wrap span{
  color:var(--chrome-text);
  font:800 19px/1 Arial,sans-serif;
  letter-spacing:1.6px;
  white-space:nowrap;
}

.topbar .nav{
  grid-column:2;
  justify-self:center;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  flex-wrap:nowrap;
}

.topbar .nav-link,
.topbar .nav a{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:38px;
  padding:9px 15px;
  border:1px solid transparent;
  border-radius:999px;
  background:transparent;
  color:var(--chrome-muted);
  text-decoration:none;
  font:700 15px/1 Arial,sans-serif;
  white-space:nowrap;
  transition:color .18s ease,background .18s ease,border-color .18s ease;
}

.topbar .nav-link:hover,
.topbar .nav-link.active,
.topbar .nav a:hover,
.topbar .nav a.active{
  color:var(--gold);
  background:var(--soft);
  border-color:var(--accent-border);
}

@media(max-width:820px){
  .topbar{
    grid-template-columns:1fr;
    grid-template-rows:auto auto;
    justify-items:center;
    gap:9px;
    padding:11px 16px 12px;
  }
  .topbar .brand-wrap{grid-column:1;justify-self:center}
  .topbar .nav{grid-column:1;flex-wrap:wrap;gap:5px}
  .topbar .brand-wrap span{font-size:17px}
  .topbar .nav-link,.topbar .nav a{font-size:13px;padding:8px 11px;min-height:34px}
}

/* ------------------------- GLOBAL COMPONENT PALETTE ------------------------- */
.hero-strip img{border-color:var(--accent-border)}
.kicker,.section-title p,.eyebrow,.card-meta,.card-status,.brand-enter,.library-count-label{color:var(--gold)}
.intro-panel .lead,.catalog-intro,.card p,.portal-card p,.subhead p,.about-card p,.shelf-head>p{color:var(--muted)}

.card,.about-card,.brand-card,.library-tile{
  background:linear-gradient(180deg,color-mix(in srgb,var(--panel2) 88%,transparent),color-mix(in srgb,var(--panel) 96%,transparent));
  border-color:var(--accent-border);
}
.card:hover,.brand-card:hover,.library-tile:hover{border-color:var(--accent-border-strong)}
.card-media{border-bottom-color:color-mix(in srgb,var(--gold) 24%,transparent)}

.btn{
  background:linear-gradient(180deg,var(--gold),var(--red));
  border-color:color-mix(in srgb,var(--gold) 75%,white 8%);
  color:#f7f8fa;
  box-shadow:0 8px 20px color-mix(in srgb,var(--red) 25%,transparent);
}
.btn.secondary{
  background:var(--accent-faint);
  border-color:var(--accent-border);
  color:color-mix(in srgb,var(--gold) 86%,white 14%);
}
.btn:hover{filter:brightness(1.08)}

.portal-card{
  border-color:var(--accent-border);
  background:linear-gradient(145deg,var(--soft),rgba(255,255,255,.02)),var(--panel);
}
.filter-btn{border-color:var(--accent-border);background:rgba(255,255,255,.025);color:var(--muted)}
.filter-btn.active,.filter-btn:hover{color:var(--gold);background:var(--soft);border-color:var(--accent-border-strong)}
.about-links a,.about-links span{color:var(--gold);border-color:var(--accent-border)}
.library-heading-row{border-bottom-color:color-mix(in srgb,var(--gold) 22%,transparent)}
.library-count-label{border-color:var(--accent-border)}
.library-tile{border-color:var(--accent-border)}
.library-tile:hover{border-color:var(--accent-border-strong)}
.library-logo-fallback{color:var(--cream)}
.library-info{background:linear-gradient(180deg,transparent,color-mix(in srgb,var(--bg) 96%,black))}
.library-status{border-left-color:color-mix(in srgb,var(--gold) 24%,transparent)}
.post-modal-box{background:var(--panel);border-color:var(--accent-border)}
.modal-close{background:var(--panel2);color:var(--cream);border-color:var(--accent-border)}
.modal-img{background:var(--bg);border-bottom-color:color-mix(in srgb,var(--gold) 24%,transparent)}
.modal-text{color:var(--body-copy)}

/* ------------------------- WORK / SERIES PAGES ------------------------- */
.work-copy .deck,.work-section p,.work-section li,.wiki-table td,.series-intro-copy .deck{color:var(--body-copy)}
.work-cover img,.lore-card,.editorial-figure,.profile-card,.series-facts,.feature-art,.wide-editorial,
.remaster-principles,.edition-card,.edition-cover img{border-color:var(--accent-border)}
.work-tags span{color:var(--gold);border-color:var(--accent-border)}
.work-section{border-top-color:color-mix(in srgb,var(--gold) 22%,transparent)}
.lore-card,.profile-card,.series-facts,.editorial-figure,.edition-card{background:color-mix(in srgb,var(--panel2) 72%,transparent)}
.breadcrumbs a,.work-section h3,.wiki-table th,.series-subtitle,.timeline-year,.edition-label{color:var(--gold)}
.wiki-table th,.wiki-table td{border-bottom-color:color-mix(in srgb,var(--gold) 20%,transparent)}
.note{background:var(--accent-faint)}
.series-jump{border-top-color:color-mix(in srgb,var(--gold) 20%,transparent);border-bottom-color:color-mix(in srgb,var(--gold) 20%,transparent)}
.series-jump a:hover{color:var(--gold);background:var(--soft)}
.timeline{border-left-color:var(--accent-border)}
.timeline-item::before{background:var(--gold);box-shadow:0 0 0 5px var(--accent-faint)}
.remaster-principles{background:linear-gradient(180deg,var(--accent-faint),rgba(255,255,255,.015))}
.edition-card.featured{background:linear-gradient(145deg,var(--soft),rgba(255,255,255,.02))}

/* Compact editorial scale shared by the site */
.brand-wrap span{font-size:19px}
.intro-panel .lead{font-size:16px;line-height:1.6}
.section-title h1,.section-title h2{font-size:22px;line-height:1.12;margin-bottom:16px;letter-spacing:.2px}
.library-heading h1{font-size:24px;margin-bottom:12px}
.catalog-intro{font-size:16px;line-height:1.6}
.shelf-head h2{font-size:20px}
.brand-copy h3{font-size:24px}
.brand-copy p{font-size:15px;line-height:1.55}
.card h3{font-size:19px;line-height:1.18}
.card p{font-size:14px;line-height:1.5}
.portal-card{padding:28px;min-height:260px}
.portal-card h2{font-size:22px}
.portal-card p{font-size:16px;line-height:1.5}
.subhead h2{font-size:21px}
.about-card p{font-size:16px;line-height:1.7}
.modal-post h2{font-size:23px}
.modal-text{font-size:16px;line-height:1.75}
.work-copy h1{font-size:28px;line-height:1.04}
.work-copy .deck{font-size:18px;line-height:1.5}
.work-section h2{font-size:21px}
.work-section h3{font-size:18px}
.work-section p,.work-section li{font-size:16px;line-height:1.7}
.wiki-table td{font-size:15px}
.series-intro-copy h1{font-size:30px;line-height:1}
.series-subtitle{font-size:17px}
.series-intro-copy .deck{font-size:17px;line-height:1.6}
.edition-copy p{font-size:15px}
.btn{min-height:39px;padding:0 16px;font-size:11px}
.filter-btn{font-size:13px;padding:8px 13px}
.content-wrap{margin:38px auto}
.page-top{margin-top:38px}
.library-heading{margin-bottom:26px}
.library-shelf{margin:30px 0 46px}

/* Homepage visual portals are real HTML now; no JS patching. */
#home .portal-section-title{text-align:center;margin-bottom:14px}
#home .portal-section-title p,#home .portal-section-title h1{text-align:center}
#home .visual-portals{
  width:min(100%,680px);
  margin:0 auto;
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:22px;
  align-items:center;
}
#home .visual-portal{
  display:block;
  position:relative;
  aspect-ratio:1;
  overflow:hidden;
  border:1px solid var(--accent-border);
  border-radius:14px;
  background:var(--bg);
  text-decoration:none;
  transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease;
}
#home .visual-portal img{width:100%;height:100%;display:block;object-fit:cover}
#home .visual-portal:hover,#home .visual-portal:focus-visible{
  transform:translateY(-3px);
  border-color:var(--accent-border-strong);
  box-shadow:0 14px 30px color-mix(in srgb,var(--red) 18%,transparent);
  outline:none;
}

/* ------------------------- FOOTER ------------------------- */
footer{
  width:min(92vw,1180px);
  margin:64px auto 0;
  padding:24px 0 20px;
  border-top:1px solid var(--chrome-border);
  display:grid;
  grid-template-columns:42px auto 1fr;
  grid-template-areas:"logo brand tagline" "legal legal legal";
  align-items:center;
  column-gap:14px;
  row-gap:18px;
  color:color-mix(in srgb,var(--muted) 74%,transparent);
  font-family:Arial,sans-serif;
  font-size:12px;
}
footer::before{
  content:"";
  grid-area:logo;
  width:42px;height:42px;border-radius:50%;
  background:url("/images/altworld-comics-logo.jpg") center/cover no-repeat;
  box-shadow:0 0 0 1px var(--accent-border);
}
footer span:first-child{grid-area:brand;color:var(--chrome-text);font-size:14px;font-weight:800;letter-spacing:1.4px;white-space:nowrap}
footer span:last-child{grid-area:tagline;justify-self:end;color:var(--muted);font-size:12px;letter-spacing:.3px;text-align:right}
footer::after{
  content:"© 2026 AltWorld Comics · Independent publishing";
  grid-area:legal;display:block;padding-top:15px;
  border-top:1px solid color-mix(in srgb,var(--gold) 14%,transparent);
  color:color-mix(in srgb,var(--muted) 68%,transparent);
  font-size:10px;letter-spacing:.4px;text-transform:uppercase;
}
footer.altworld-footer{
  grid-template-columns:42px auto 1fr auto;
  grid-template-areas:"logo brand social tagline" "legal legal legal legal";
}
footer .footer-social{grid-area:social;display:flex;align-items:center;justify-content:center;gap:9px;padding:0 18px}
footer .footer-social a{
  width:34px;height:34px;display:inline-flex;align-items:center;justify-content:center;
  border:1px solid var(--accent-border);border-radius:50%;color:var(--muted);
  background:rgba(255,255,255,.018);text-decoration:none;
  transition:color .18s,border-color .18s,background .18s,transform .18s,box-shadow .18s;
}
footer .footer-social a:hover,footer .footer-social a:focus-visible{
  color:var(--gold);border-color:var(--accent-border-strong);background:var(--soft);
  transform:translateY(-2px);outline:none;
}
footer .footer-social svg{width:16px;height:16px;display:block;fill:currentColor}

/* ------------------------- ABOUT ------------------------- */
.about-page{max-width:1100px}
.about-heading{max-width:760px}
.about-lead{font-size:15px;line-height:1.6;color:var(--muted);max-width:680px}
.about-manifesto{max-width:820px;padding:4px 0 30px}
.about-manifesto p{font-size:15px;line-height:1.72;color:var(--body-copy);margin:0 0 13px}
.about-section{padding:28px 0;border-top:1px solid color-mix(in srgb,var(--gold) 18%,transparent)}
.about-section-head{margin-bottom:16px}
.about-section-head h2,.about-community h2,.about-lines h2{font-size:20px;line-height:1.2;margin:4px 0 0}
.about-project-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.about-project{position:relative;min-height:170px;border:1px solid var(--accent-border);border-radius:12px;overflow:hidden;text-decoration:none;background:var(--panel)}
.about-project::before{content:"";position:absolute;inset:0;background-image:linear-gradient(180deg,rgba(3,7,12,.08),rgba(3,7,12,.88)),var(--about-bg);background-size:cover;background-position:center;transition:transform .25s,filter .25s}
.about-project:hover::before{transform:scale(1.025);filter:brightness(1.08)}
.about-project span{position:absolute;left:18px;right:18px;bottom:16px;z-index:1;display:flex;flex-direction:column;gap:4px}
.about-project small{font:700 10px/1.2 Arial,sans-serif;letter-spacing:1.2px;text-transform:uppercase;color:var(--gold)}
.about-project strong{font:700 20px/1.1 Georgia,serif;color:var(--cream)}
.about-lines{display:grid;grid-template-columns:1fr 1fr;gap:16px;padding:28px 0;border-top:1px solid color-mix(in srgb,var(--gold) 18%,transparent)}
.about-lines article{padding:22px;border:1px solid var(--accent-border);border-radius:12px;background:linear-gradient(180deg,color-mix(in srgb,var(--panel2) 72%,transparent),color-mix(in srgb,var(--panel) 92%,transparent))}
.about-lines p:not(.eyebrow),.about-community p{font-size:14px;line-height:1.65;color:var(--muted)}
.about-community{display:grid;grid-template-columns:1fr auto;gap:30px;align-items:center;padding:28px 24px;border:1px solid var(--accent-border);border-radius:12px;background:linear-gradient(145deg,var(--soft),rgba(255,255,255,.015))}
.community-icon-link,.about-icon-links a{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;border-radius:50%;border:1px solid var(--accent-border);color:var(--muted);background:rgba(255,255,255,.02);transition:.18s ease}
.community-icon-link{width:52px;height:52px;color:var(--gold);border-color:var(--accent-border-strong)}
.community-icon-link:hover,.about-icon-links a:hover{color:var(--gold);border-color:var(--accent-border-strong);background:var(--soft);transform:translateY(-2px)}
.community-icon-link svg{width:23px;height:23px;fill:currentColor}
.about-connect{padding:30px 0 4px;border-top:1px solid color-mix(in srgb,var(--gold) 18%,transparent);margin-top:28px}
.about-icon-links{display:flex;gap:10px;flex-wrap:wrap}
.about-icon-links svg{width:18px;height:18px;fill:currentColor}
.about-creator{display:grid;grid-template-columns:190px minmax(0,1fr);gap:28px;align-items:start;padding:28px 0;margin:0 0 28px;border-top:1px solid color-mix(in srgb,var(--gold) 18%,transparent);border-bottom:1px solid color-mix(in srgb,var(--gold) 18%,transparent)}
.creator-photo{width:190px}
.creator-photo img{display:block;width:100%;height:auto;max-height:270px;object-fit:cover;object-position:center 24%;border:1px solid var(--accent-border);border-radius:10px;box-shadow:0 12px 28px rgba(0,0,0,.30)}
.about-creator h2{font-size:22px;line-height:1.15;margin:4px 0 12px}
.about-creator .creator-copy>p:not(.eyebrow){font-size:14px;line-height:1.65;color:var(--muted);max-width:720px;margin:0 0 11px}
.creator-links{display:flex;gap:10px;flex-wrap:wrap;justify-content:flex-start;margin-top:17px}
.creator-links a{display:flex;align-items:center;gap:9px;min-height:42px;padding:0 14px;border:1px solid var(--accent-border);border-radius:999px;color:var(--muted);background:rgba(255,255,255,.02);text-decoration:none;font:700 11px/1 Arial,sans-serif;transition:.18s}
.creator-links a:hover{color:var(--gold);border-color:var(--accent-border-strong);background:var(--soft);transform:translateY(-2px)}
.creator-links svg{width:17px;height:17px;fill:currentColor}

@media(max-width:860px){
  .hero-strip{width:min(94vw,1200px)}
  .section-title h1,.section-title h2{font-size:21px}
  .library-heading h1{font-size:23px}
  .portal-card h2{font-size:21px}
  .work-copy h1{font-size:26px}
  .work-copy .deck{font-size:17px}
  .series-intro-copy h1{font-size:28px}
  .series-subtitle{font-size:19px}
  .work-section h2{font-size:20px}
  .modal-post h2{font-size:22px}
  .modal-text{font-size:15px}
}
@media(max-width:700px){
  #home .visual-portals{width:min(100%,520px);gap:12px}
  footer{grid-template-columns:42px 1fr;grid-template-areas:"logo brand" "logo tagline" "legal legal";row-gap:5px;margin-top:48px}
  footer span:last-child{justify-self:start;text-align:left;font-size:11px}
  footer::after{margin-top:12px}
  footer.altworld-footer{grid-template-columns:42px 1fr auto;grid-template-areas:"logo brand social" "logo tagline tagline" "legal legal legal"}
  footer .footer-social{justify-content:flex-end;padding:0}
  .about-project-grid,.about-lines{grid-template-columns:1fr}
  .about-project{min-height:150px}
  .about-community{grid-template-columns:1fr}
  .community-icon-link{justify-self:start}
  .about-creator{grid-template-columns:1fr;gap:20px}
  .creator-photo{width:min(220px,65vw)}
}
@media(max-width:560px){
  .section-title h1,.section-title h2{font-size:20px}
  .library-heading h1{font-size:22px}
  .work-copy h1{font-size:24px}
  .series-intro-copy h1{font-size:26px}
  .work-section p,.work-section li{font-size:15px}
}
@media(max-width:520px){
  #home .visual-portals{width:min(100%,360px);gap:8px}
  #home .visual-portal{border-radius:10px}
  footer.altworld-footer{grid-template-columns:42px 1fr;grid-template-areas:"logo brand" "logo tagline" "social social" "legal legal"}
  footer .footer-social{justify-content:flex-start;padding-top:12px}
}
