/* =========================================================================
   buddyhead98 — a pastiche of buddyhead.com, 1998-2003

   The 2003 /grn/ era is the structural shell. Its entire stylesheet was:

       a { text-decoration: none; font-weight: bold; }
       a:link, a:visited, a:active { color: #ffffff; }
       a:hover { color: #ffffff; text-decoration: underline; }
       .bodytextfucker { font-family: Verdana; font-size: 9px; color: #FFFFFF; }

   with <body bgcolor="#1C521C">. Earlier eras supply accents.
   Values marked "sampled" are verbatim from archived markup.
   ========================================================================= */

:root {
  /* --- 2003, sampled from /grn/main.php3 --- */
  --bh-field: #1C521C;        /* body bgcolor                       */
  --bh-panel: #2E692C;        /* records panel bgcolor              */
  --bh-ink: #FFFFFF;          /* body text and all links            */

  /* --- 2003, read from the screenshot --- */
  --bh-acid: #C3E84F;         /* header duotone highlight           */
  --bh-acid-mid: #6DA82E;     /* header duotone midtone             */
  --bh-deep: #12300C;         /* header silhouette, page edge       */

  /* Section titles and feature links. #7ACC5B (4.67:1) at body size;
     the authentic #5FAF43 is 3.39:1 and is reserved for large display
     type, where it is compliant. See TEST-PLAN.md Phase 5. */
  --bh-title: #7ACC5B;
  --bh-title-display: #5FAF43;

  /* --- earlier eras, accents only --- */
  --bh-mustard: #E8D040;      /* 2001 gossip field                  */
  --bh-gossip-link: #B00000;  /* 4.75:1 on mustard                  */
  --bh-hot: #FF3300;          /* 2001 inline highlight              */
  --bh-active: #CCCCFF;       /* 2001 alink                         */
  --bh-gold: #D6A259;         /* 1999 link — hairlines, 9.17:1 on black */
  /* The 1999 gold is only 3.59:1 on oxblood, so the top bar gets a lighter
     tint of it (5.11:1). Same family, still period. */
  --bh-gold-lift: #E8C88A;
  --bh-oxblood: #A30000;      /* 2000 cover band                    */
  --bh-bar: #000000;          /* 2000 banner bars                   */

  /* Original: 800 = 250 + 3 + 535. Scaled to keep the ~1:2.1 ratio
     while giving post bodies a readable measure. */
  --bh-total: 1040px;
  --bh-rail: 260px;
  --bh-divider: 4px;
  --bh-main: 760px;
  --bh-header-h: 230px;

  --bh-font: Verdana, Geneva, "DejaVu Sans", sans-serif;
  /* The original body copy was 9px. Genuinely unreadable; 12px base,
     9-10px kept for chrome. */
  --bh-size: 12px;
  --bh-size-chrome: 10px;
}

/* --- reset ------------------------------------------------------------- */

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

html { background: var(--bh-deep); }

body {
  margin: 0;                      /* topmargin=0 leftmargin=0 marginwidth=0 */
  padding: 0 0 2.2em;             /* room for the fixed status bar */
  background-color: var(--bh-field);
  color: var(--bh-ink);
  font-family: var(--bh-font);
  font-size: var(--bh-size);
  line-height: 1.5;
  overflow-x: hidden;
}

/* The 2003 rule, verbatim: bold, undecorated, underline only on hover. */
a {
  color: var(--bh-ink);
  font-weight: 700;
  text-decoration: none;
}
a:visited { color: var(--bh-ink); }
a:hover { color: var(--bh-ink); text-decoration: underline; }
a:active { color: var(--bh-active); }

:focus-visible {
  outline: 2px solid var(--bh-acid);
  outline-offset: 1px;
}

img { max-width: 100%; }

/* --- header band ------------------------------------------------------- */

.bh-header {
  position: relative;
  height: var(--bh-header-h);
  overflow: visible;              /* the wordmark breaks the bounds */
  /* The 2003 header.jpg is a bright chartreuse sky over a dark treeline:
     acid dominates the upper two-thirds, deep only at the very bottom. */
  background: linear-gradient(
    to bottom,
    var(--bh-acid) 0%,
    var(--bh-acid) 38%,
    var(--bh-acid-mid) 72%,
    var(--bh-deep) 100%
  );
}

.bh-header-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Duotone: strip the photo to luminance and let the acid gradient beneath
     supply the hue. `luminosity` is the same technique buddyhead2 used for
     its hero, so the lineage holds. `multiply` was tried first and crushed
     everything to mud. brightness lifts the midtones so the sky stays acid
     rather than olive. */
  /* Highlights must land in the midtones: with `luminosity` a near-white sky
     stays near-white whatever hue sits beneath it, so the photo is darkened
     and its contrast compressed until the acid green can show through. */
  filter: grayscale(1) brightness(0.62) contrast(1.15);
  mix-blend-mode: luminosity;
  opacity: 0.92;
}

/* The shipped default is already in the right palette, so it needs none of
   the duotone treatment applied to an arbitrary photograph. */
.bh-header-photo--default {
  filter: none;
  mix-blend-mode: normal;
  opacity: 1;
}

.bh-wordmark {
  position: absolute;
  left: 5%;
  bottom: -18px;                  /* overlaps and breaks the lower bound */
  z-index: 2;
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  font-style: italic;
  color: var(--bh-ink);
  /* heavy dark outline so the white marker wordmark holds against the
     bright sky above and the dark treeline below */
  text-shadow:
     3px 3px 0 var(--bh-deep), -2px -2px 0 var(--bh-deep),
     2px -2px 0 var(--bh-deep), -2px  2px 0 var(--bh-deep),
     0 0 12px rgba(18, 48, 12, 0.85);
  transform: rotate(-1.5deg);
}
.bh-wordmark:hover { text-decoration: none; }

/* --- banner bars (2000) ------------------------------------------------ */

.bh-banner {
  overflow: hidden;
  border-block: 1px solid var(--bh-deep);
}
.bh-banner--oxblood { background: var(--bh-oxblood); }
.bh-banner--oxblood .bh-banner-ad {
  border-color: var(--bh-gold-lift);
  color: var(--bh-gold-lift);
}
.bh-banner--black { background: var(--bh-bar); }

.bh-banner-strip {
  display: flex;
  gap: 2.5rem;
  align-items: center;
  justify-content: center;
  min-height: 60px;               /* the 468x60 slot */
  padding: 0 1rem;
  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.bh-banner-strip::-webkit-scrollbar { display: none; }

.bh-banner-ad {
  flex: none;
  padding: 0.35em 0.9em;
  border: 1px solid var(--bh-gold);
  color: var(--bh-gold);
  font-size: var(--bh-size-chrome);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* --- shell ------------------------------------------------------------- */

.bh-shell {
  max-width: var(--bh-total);
  margin: 0 auto;
  padding: 1.5rem 0 2rem;
}

.bh-cols {
  display: grid;
  grid-template-columns: var(--bh-rail) var(--bh-divider) var(--bh-main);
  align-items: start;
}

/* vertical_dots.gif, 3x444 */
.bh-divider {
  align-self: stretch;
  min-height: 100%;
  background-image: repeating-linear-gradient(
    to bottom,
    var(--bh-gold) 0 2px,
    transparent 2px 6px
  );
  opacity: 0.55;
}

.bh-rail { padding: 0 16px 0 19px; }   /* the original 19/225/16 gutters */
.bh-main { padding-left: 12px; min-width: 0; }

/* horizontal_dots.gif */
.bh-rule {
  height: 3px;
  margin: 1.25rem 0;
  background-image: repeating-linear-gradient(
    to right,
    var(--bh-gold) 0 2px,
    transparent 2px 6px
  );
  opacity: 0.55;
}

/* --- section titles ---------------------------------------------------- */

.bh-section-title {
  margin: 0 0 0.75rem;
  font-size: 19px;                /* large display type: authentic green ok */
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bh-title-display);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
/* the little angled swoosh tab beside each heading */
.bh-section-title::after {
  content: "";
  flex: 1;
  height: 10px;
  background: var(--bh-title-display);
  opacity: 0.5;
  transform: skewX(-28deg);
}

/* --- rail -------------------------------------------------------------- */

.bh-rail-body { font-size: var(--bh-size); }
.bh-rail-date { margin: 0 0 0.5em; font-weight: 700; }
.bh-rail-excerpt { margin: 0 0 0.75em; }
.bh-rail-byline { margin: 0; font-size: var(--bh-size-chrome); }
.bh-rail-tour p { margin: 0.25em 0; }

.bh-email { display: block; }
.bh-email-label {
  display: block;
  margin-bottom: 0.4em;
  font-weight: 700;
  color: var(--bh-title);
}
.bh-email-row { display: flex; gap: 4px; }
.bh-email input {
  flex: 1;
  min-width: 0;
  padding: 3px 5px;
  border: 2px inset var(--bh-panel);   /* period bevel */
  background: var(--bh-ink);
  color: var(--bh-deep);
  font-family: var(--bh-font);
  font-size: var(--bh-size);
}
.bh-email-go {
  padding: 3px 10px;
  border: 2px outset var(--bh-panel);  /* submit.gif */
  background: var(--bh-panel);
  color: var(--bh-ink);
  font-family: var(--bh-font);
  font-size: var(--bh-size-chrome);
  font-weight: 700;
  cursor: pointer;
}

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

.bh-nav {
  /* skewX displaces the box by tan(12deg) x height/2 (~6px) beyond its
     layout width, so reserve that or it overflows the viewport. */
  margin: 0 7px 1.25rem;
  background: linear-gradient(90deg, var(--bh-panel), var(--bh-title-display));
  transform: skewX(-12deg);            /* the parallelogram */
  clip-path: polygon(2% 0, 100% 0, 98% 100%, 0 100%);
}

.bh-nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0 1.5rem;
  list-style: none;
}

.bh-nav-item a {
  display: block;
  padding: 0.55rem 0.35rem;
  min-height: 44px;                    /* tap target */
  display: flex;
  align-items: center;
  transform: skewX(12deg);             /* counter-skew: text sits upright */
  color: var(--bh-deep);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.bh-nav-item a:hover,
.bh-nav-item a:visited { color: var(--bh-deep); }

/* --- feed + preview pane ----------------------------------------------- */

.bh-feed-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: start;
}

.bh-preview {
  position: sticky;
  top: 1rem;
  width: 138px;                    /* the original 138x166 */
  height: 166px;
  border: 1px solid var(--bh-deep);
  background: var(--bh-deep);
  overflow: hidden;
}
.bh-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* --- feed accordion ---------------------------------------------------- */

.bh-entry {
  margin-bottom: 2px;
  border-bottom: 1px solid rgba(214, 162, 89, 0.25);
}

.bh-acc > summary {
  display: flex;
  gap: 0.5em;
  align-items: baseline;
  padding: 0.4em 0.2em;
  cursor: pointer;
  /* replace the native disclosure triangle with a period marker */
  list-style: none;
}
.bh-acc > summary::-webkit-details-marker { display: none; }
.bh-acc > summary::marker { content: ""; }

.bh-acc > summary:hover .bh-title { text-decoration: underline; }

.bh-marker {
  flex: none;
  width: 2.2em;
  color: var(--bh-title);
  font-weight: 700;
  font-family: "Courier New", Courier, monospace;
}

.bh-date {
  flex: none;
  color: var(--bh-title);
  font-weight: 700;
}

.bh-title { color: var(--bh-ink); }

.bh-entry-body {
  padding: 0.25em 0.2em 1.1em 2.7em;
}
.bh-entry-body > :first-child { margin-top: 0; }

.bh-teaser { margin: 0 0 0.8em; }

.bh-byline,
.bh-permalink {
  margin: 0.6em 0 0;
  font-size: var(--bh-size-chrome);
}
.bh-byline { color: var(--bh-title); }

/* Posts tagged `gossip` quote the 2001 gossip page: mustard field, black
   text, red links. Ghost's {{post_class}} emits tag-<slug>, so no extra
   markup is needed. */
.tag-gossip .bh-entry-body {
  margin: 0.2em 0 0.6em;
  padding: 0.8em 1em;
  background: var(--bh-mustard);
  color: var(--bh-bar);
}
.tag-gossip .bh-entry-body a {
  color: var(--bh-gossip-link);
}
.tag-gossip .bh-entry-body a:visited { color: var(--bh-gossip-link); }
.tag-gossip .bh-entry-body a:active { color: var(--bh-bar); }
.tag-gossip .bh-byline { color: #5F500E; }  /* 5.12:1 on mustard */

/* --- post page --------------------------------------------------------- */

.bh-post-title {
  margin: 0 0 0.3em;
  font-size: 26px;
  line-height: 1.2;
  color: var(--bh-ink);
}

.bh-post-meta {
  margin: 0 0 1.2em;
  font-size: var(--bh-size-chrome);
  color: var(--bh-title);
}

.bh-post-image {
  display: block;
  width: 100%;
  margin-bottom: 1.2em;
  border: 1px solid var(--bh-deep);
}

.bh-post-body :first-child { margin-top: 0; }
.bh-post-body img { height: auto; }

.bh-post-nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(214, 162, 89, 0.35);
  font-size: var(--bh-size-chrome);
}
.bh-back { color: var(--bh-title); }

/* --- feed foot / progressive loading ----------------------------------- */

.bh-feed-foot { padding: 0.5rem 0 0; text-align: center; }

.bh-sentinel { height: 1px; }

.bh-feed-status {
  margin: 0.6em 0;
  min-height: 1.2em;
  font-size: var(--bh-size-chrome);
  color: var(--bh-title);
}

.bh-retry {
  margin: 0.6em 0;
  padding: 0.5em 1.2em;
  border: 2px outset var(--bh-oxblood);
  background: var(--bh-oxblood);
  color: var(--bh-ink);
  font-family: var(--bh-font);
  font-size: var(--bh-size-chrome);
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.bh-load-more {
  margin: 0.6em 0;
  padding: 0.5em 1.4em;
  border: 2px outset var(--bh-panel);
  background: var(--bh-panel);
  color: var(--bh-ink);
  font-family: var(--bh-font);
  font-size: var(--bh-size);
  font-weight: 700;
  cursor: pointer;
}

.bh-pager { margin: 1em 0; font-size: var(--bh-size-chrome); }
.bh-pager a { text-decoration: underline; }

/* --- records panel ----------------------------------------------------- */

.bh-records {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 1.5rem;
  padding: 10px;
  background: var(--bh-panel);
  overflow-x: auto;                    /* the 2000 sideways tile wall */
  scrollbar-width: thin;
}

.bh-tile {
  flex: none;
  width: 96px;
  height: 96px;
  display: block;
  border: 1px solid var(--bh-deep);
  background: var(--bh-deep) center/cover no-repeat;
  overflow: hidden;
}

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

.bh-footer {
  max-width: var(--bh-total);
  margin: 0 auto;
  padding: 1.25rem 19px 2rem;
  font-size: var(--bh-size-chrome);
  line-height: 1.7;
}
.bh-footer p { margin: 0 0 0.35em; }
.bh-footer-nag { color: var(--bh-title); }

/* --- status bar (the 1999 window.status scroller) ---------------------- */

.bh-statusbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  overflow: hidden;
  white-space: nowrap;
  padding: 4px 0;
  border-top: 1px solid var(--bh-deep);
  background: var(--bh-bar);
  color: var(--bh-title);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.bh-marquee { display: inline-block; }

/* The scroller parks its text one full width off-screen, so it is only
   readable once the animation runs. Readers who suppress motion must still
   get the text, so the offset is applied with the animation, not before. */
@media (prefers-reduced-motion: no-preference) {
  .bh-marquee {
    padding-left: 100%;
    animation: bh-scroll 24s linear infinite;
  }
}

@keyframes bh-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

/* --- Koenig cards (gscan requires these to be styled) ------------------ */

.kg-width-wide { max-width: 85vw; }
.kg-width-full { max-width: 100vw; }

/* --- narrow viewports -------------------------------------------------- */

@media (max-width: 640px) {
  :root { --bh-header-h: 150px; }

  .bh-feed-wrap { grid-template-columns: 1fr; }
  .bh-preview { display: none; }

  .bh-cols {
    grid-template-columns: 1fr;
  }
  /* the rail moves below the feed */
  .bh-main { order: 1; padding-left: 0; }
  .bh-divider { order: 2; min-height: 3px; height: 3px;
    background-image: repeating-linear-gradient(
      to right, var(--bh-gold) 0 2px, transparent 2px 6px); }
  .bh-rail { order: 3; padding: 1rem 12px 0; }

  .bh-shell, .bh-footer { padding-inline: 12px; }
  .bh-wordmark { font-size: 30px; }
}
