/* ==========================================================================
   Planet Proctor — responsive stylesheet
   Keeps the original 2004 palette: black space, teal bars, cream panels.
   ========================================================================== */

:root{
  --teal:      #008080;
  --teal-dk:   #005f5f;
  --cream:     #FFFFCC;
  --cream-alt: #fdfde0;
  --ink:       #000099;
  --lime:      #00FF00;
  --gold:      #FFFF99;
  --link:      #0000CC;
  --visited:   #9900CC;
  --active:    #FF0000;
  --hover:     #009999;
  --rule:      #d8d8a8;
  --shadow:    0 2px 10px rgba(0,0,0,.55);
  --font:      Verdana, Geneva, Arial, Helvetica, sans-serif;
  --maxw:      1080px;
}

*,*::before,*::after{ box-sizing:border-box; }

html{ -webkit-text-size-adjust:100%; }

body{
  margin:0;
  font-family:var(--font);
  font-size:16px;
  line-height:1.6;
  color:#000;
  background-color:#000;
  background-image:url(../images/space.gif);
  background-repeat:repeat;
}

img{ max-width:100%; height:auto; border:0; }

a{ color:var(--link); }
a:visited{ color:var(--visited); }
a:hover{ color:var(--hover); }
a:active{ color:var(--active); }

:focus-visible{ outline:3px solid var(--lime); outline-offset:2px; }

.wrap{
  max-width:var(--maxw); margin:0 auto;
  padding-left:max(12px, env(safe-area-inset-left));
  padding-right:max(12px, env(safe-area-inset-right));
}

.skip{
  position:absolute; left:-9999px; top:0; background:var(--cream);
  color:#000; padding:10px 16px; z-index:200; font-weight:bold;
}
.skip:focus{ left:8px; top:8px; }

/* ------------------------------ masthead -------------------------------- */

.masthead{
  padding:calc(14px + env(safe-area-inset-top,0px)) 0 10px;
  text-align:center;
}

.masthead-inner{
  display:flex; align-items:center; justify-content:center;
  gap:clamp(10px,4vw,34px);
}

.masthead-logo{ width:clamp(52px,11vw,104px); flex:none; }
.masthead-logo:last-child{ display:none; }

.masthead-title{
  margin:0;
  font-size:clamp(1.6rem,6.2vw,2.8rem);
  line-height:1.1;
  color:var(--lime);
  font-weight:normal;
  letter-spacing:.5px;
  text-shadow:0 0 14px rgba(0,255,0,.45);
}
.masthead-sub{
  margin:6px 0 0;
  font-size:clamp(.7rem,2.6vw,.85rem);
  color:var(--gold);
  line-height:1.45;
}

@media (min-width:760px){
  .masthead-logo:last-child{ display:block; }
}

/* -------------------------------- nav ----------------------------------- */

/* iOS Safari tints the strip behind the status bar by sampling whatever content
   sits at the very top of the viewport. The sticky nav is teal and pins to
   top:0, so after any scroll that strip turned teal. Claim the safe area with an
   always-black bar and start the nav below it. env() falls back to 0px, so on
   anything without a notch every rule here is a no-op. */
body::before{
  content:"";
  position:fixed; top:0; left:0; right:0;
  height:env(safe-area-inset-top,0px);
  background:#000;
  z-index:300;
  pointer-events:none;
}

.nav{
  background:var(--teal);
  border-top:2px solid var(--teal-dk);
  border-bottom:2px solid var(--teal-dk);
  position:sticky; top:env(safe-area-inset-top,0px); z-index:100;
  box-shadow:var(--shadow);
}
.nav-bar{
  max-width:var(--maxw); margin:0 auto; padding:0 12px;
  display:flex; align-items:center; justify-content:space-between;
  flex-wrap:wrap; gap:12px;
}
.nav-brand{
  color:#fff; font-weight:bold; font-size:.85rem; text-decoration:none;
  padding:12px 0; display:flex; align-items:center; gap:8px;
}
.nav-brand:visited{ color:#fff; }
.nav-brand:hover{ color:var(--gold); }

.nav-toggle{
  position:absolute; width:1px; height:1px; margin:0;
  opacity:0; pointer-events:none;
}
.nav-toggle:focus-visible + .nav-bar .nav-burger{ outline:3px solid var(--lime); outline-offset:2px; }
.nav-burger{
  display:flex; flex-direction:column; justify-content:center; gap:5px;
  width:44px; height:44px; padding:10px; cursor:pointer; flex:none;
  background:transparent; border:1px solid rgba(255,255,255,.45); border-radius:4px;
}
.nav-burger span{ display:block; height:2px; background:#fff; border-radius:2px; }

.nav-list{
  list-style:none; margin:0; padding:0;
  display:none; width:100%; flex-direction:column;
  border-top:1px solid rgba(255,255,255,.25);
}
.nav-toggle:checked ~ .nav-bar .nav-list{ display:flex; }

.nav-list a{
  display:block; padding:12px 4px; color:#fff; text-decoration:none;
  font-size:.86rem; border-bottom:1px solid rgba(255,255,255,.16);
}
.nav-list a:visited{ color:#fff; }
.nav-list a:hover,.nav-list a:focus{ color:var(--gold); background:rgba(0,0,0,.22); }
.nav-list a[aria-current="page"]{ color:var(--gold); font-weight:bold; }
.nav-list a.hot{ color:#FFD9D9; }
.nav-list a.hot:visited{ color:#FFD9D9; }

@media (min-width:900px){
  .nav-burger{ display:none; }
  .nav-list{
    display:flex; flex-direction:row; width:auto; border-top:0;
    flex-wrap:wrap; justify-content:flex-end;
  }
  .nav-list a{ padding:13px 11px; border-bottom:0; }
  .nav-list li + li a{ border-left:1px solid rgba(255,255,255,.2); }
}

/* ------------------------------- panels --------------------------------- */

.panel{
  background:var(--cream);
  margin:16px 0;
  box-shadow:var(--shadow);
  overflow:hidden;
}

.panel-head{
  background:var(--teal);
  color:#fff;
  display:flex; align-items:center; gap:8px;
  padding:8px 12px;
  font-size:clamp(.95rem,3.2vw,1.15rem);
  font-weight:bold;
}
.panel-head img{ flex:none; }
.panel-head h1,.panel-head h2{
  margin:0; font-size:inherit; color:#fff; font-weight:bold; font-family:var(--font);
}

.panel-body{ padding:16px clamp(12px,3vw,26px) 22px; }
/* long-form pages: keep the measure readable on wide screens */
.panel-body.prose{ max-width:76ch; margin:0 auto; }
.panel-body p{ color:#000; font-size:.9rem; line-height:1.65; }
.panel-body h2,.panel-body h3{ color:var(--ink); font-family:var(--font); }
.panel-body h2{ font-size:1.15rem; }
.panel-body h3{ font-size:1rem; }
.panel-body hr{ border:0; border-top:1px solid var(--rule); margin:22px auto; width:75%; }

/* ------------------------------ home hero ------------------------------- */

.hero{ display:grid; gap:clamp(16px,4vw,32px); grid-template-columns:1fr; align-items:start; }
@media (min-width:780px){ .hero{ grid-template-columns:minmax(0,4fr) minmax(0,6fr); } }

.hero-portrait{ text-align:center; }
.hero-portrait img{ width:100%; max-width:360px; box-shadow:0 2px 12px rgba(0,0,0,.35); }

.hero-aside{ text-align:center; }
.hero-aside img{ max-width:380px; width:100%; }

.latest-btn{
  display:inline-block; margin-top:14px; padding:12px 22px;
  background:var(--teal); color:#fff !important; text-decoration:none;
  font-weight:bold; font-size:.9rem; border-radius:3px; box-shadow:var(--shadow);
}
.latest-btn:hover{ background:var(--teal-dk); color:var(--gold) !important; }

.intro{ font-size:.95rem !important; }

/* ------------------------------- archive -------------------------------- */

.jump{
  display:flex; flex-wrap:wrap; gap:6px; justify-content:center;
  padding:14px clamp(10px,3vw,20px);
  background:var(--cream-alt); border-bottom:1px solid var(--rule);
}
.jump a{
  display:block; padding:7px 10px; min-width:44px; text-align:center;
  background:var(--teal); color:#fff !important; text-decoration:none;
  font-size:.78rem; border-radius:3px;
}
.jump a:hover{ background:var(--teal-dk); color:var(--gold) !important; }

.decade{ margin:0 0 6px; }
.decade-title{
  margin:0; padding:10px clamp(12px,3vw,20px);
  background:var(--teal-dk); color:var(--gold);
  font-size:1rem; letter-spacing:1px; text-transform:uppercase;
}

.years{ display:grid; gap:14px; grid-template-columns:1fr; padding:14px clamp(10px,3vw,20px); }
@media (min-width:620px){ .years{ grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (min-width:1000px){ .years{ grid-template-columns:repeat(3,minmax(0,1fr)); } }

.year{ border:1px solid var(--rule); background:#fff; scroll-margin-top:90px; }
.year > summary{
  cursor:pointer; list-style:none; padding:10px 12px;
  background:var(--teal); color:#fff; font-weight:bold; font-size:.9rem;
  display:flex; align-items:center; justify-content:space-between; gap:10px;
}
.year > summary::-webkit-details-marker{ display:none; }
.year > summary::after{ content:"▸"; font-size:.9rem; transition:transform .15s; }
.year[open] > summary::after{ transform:rotate(90deg); }
.year > summary:hover{ background:var(--teal-dk); color:var(--gold); }
.year-count{ font-weight:normal; font-size:.75rem; opacity:.9; }

.issues{
  list-style:none; margin:0; padding:10px;
  display:grid; gap:6px;
  grid-template-columns:repeat(auto-fill,minmax(58px,1fr));
}
.issues a{
  display:flex; align-items:center; justify-content:center;
  min-height:40px; padding:6px 4px;
  background:var(--cream); color:var(--ink) !important; text-decoration:none;
  font-size:.82rem; border:1px solid var(--rule); border-radius:3px;
}
.issues a:hover{ background:var(--teal); color:#fff !important; border-color:var(--teal-dk); }
.issues a .ext{ font-size:.6rem; opacity:.65; margin-left:3px; }

/* ------------------------------- gallery -------------------------------- */

.grid{
  display:grid; gap:10px; padding:14px clamp(10px,3vw,20px);
  grid-template-columns:repeat(auto-fill,minmax(120px,1fr));
}
@media (min-width:700px){ .grid{ grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:14px; } }

.tile{
  display:block; position:relative; padding:0; border:0; cursor:pointer;
  background:var(--teal); border-radius:3px; overflow:hidden;
  aspect-ratio:1/1; box-shadow:0 1px 5px rgba(0,0,0,.4);
}
.tile img{
  width:100%; height:100%; object-fit:cover; display:block;
  transition:transform .25s ease, filter .25s ease;
}
.tile:hover img,.tile:focus-visible img{ transform:scale(1.06); filter:brightness(1.08); }
.tile-cap{
  position:absolute; left:0; right:0; bottom:0;
  background:linear-gradient(transparent,rgba(0,0,0,.78));
  color:#fff; font-size:.7rem; padding:14px 6px 5px; text-align:center;
}

/* lightbox */
.lb{
  position:fixed; inset:0; z-index:500; display:none;
  background:rgba(0,0,0,.97); padding:0;
}
.lb[open],.lb.on{ display:flex; align-items:center; justify-content:center; }
.lb-img{
  max-width:96vw; max-height:82vh; width:auto; height:auto;
  object-fit:contain; box-shadow:0 4px 30px rgba(0,0,0,.8);
}
.lb-bar{
  position:absolute; left:0; right:0; bottom:0;
  display:flex; align-items:center; justify-content:center; gap:14px;
  padding:12px; color:var(--gold); font-size:.8rem;
  background:linear-gradient(transparent,rgba(0,0,0,.85));
}
.lb-btn{
  background:rgba(0,128,128,.85); color:#fff; border:1px solid rgba(255,255,255,.35);
  border-radius:4px; width:52px; height:52px; font-size:1.4rem; line-height:1;
  cursor:pointer; display:flex; align-items:center; justify-content:center;
}
.lb-btn:hover{ background:var(--teal); color:var(--gold); }
.lb-close{ position:absolute; top:10px; right:10px; }
.lb-open-full{ color:var(--gold); font-size:.75rem; }

@media (max-width:600px){
  .lb-img{ max-height:74vh; }
}

/* -------------------------------- misc ---------------------------------- */

.newslist{ list-style:none; margin:0; padding:0; }
.newslist li{
  padding:12px clamp(10px,3vw,16px);
  border-bottom:1px solid var(--rule);
  font-size:.9rem; line-height:1.6;
}
.newslist li:nth-child(even){ background:var(--cream-alt); }
.newslist li:last-child{ border-bottom:0; }
.newslist b{ color:var(--ink); }

.linkgrid{
  list-style:none; margin:0; padding:0;
  display:grid; gap:8px; grid-template-columns:1fr;
}
@media (min-width:560px){ .linkgrid{ grid-template-columns:repeat(2,minmax(0,1fr)); } }
.linkgrid a{
  display:block; padding:12px 14px; background:var(--cream-alt);
  border:1px solid var(--rule); text-decoration:none; font-size:.85rem;
}
.linkgrid a:hover{ background:var(--teal); color:#fff !important; }

.center{ text-align:center; }

/* ------------------------------- footer --------------------------------- */

.footer{
  background:var(--teal); color:#fff; margin-top:20px;
  padding:20px 12px calc(26px + env(safe-area-inset-bottom,0px));
  text-align:center; font-size:.78rem; line-height:1.7;
  border-top:2px solid var(--teal-dk);
}
.footer a{ color:var(--gold); }
.footer a:visited{ color:var(--gold); }
.footer-links{
  display:flex; flex-wrap:wrap; gap:6px 18px; justify-content:center;
  list-style:none; margin:0 0 14px; padding:0;
}
.footer-sub{ opacity:.85; }

@media (prefers-reduced-motion:reduce){
  *{ animation:none !important; transition:none !important; }
}
