/*
Theme Name: Bill Gassman
Theme URI: https://billgassman.com/
Author: Bill Gassman
Description: A compact classic theme for Bill Gassman's topic-based document library.
Version: 0.2.4
Requires at least: 6.7
Requires PHP: 8.1
Text Domain: billgassman
*/

/* ---- Design tokens: change the site-wide look here ---- */
:root {
  --bg: #f5ead8;
  --surface: #ebddc5;
  --ink: #201e1d;
  --divider: rgba(32, 30, 29, 0.16);
  --cobalt: #1f4fa0;
  --green: #2e6b3e;
  --amber: #c07d0a;
  --cobalt-text: #1a4488;
  --green-text: #255834;
  --amber-text: #96600a;
  --muted: rgba(32, 30, 29, 0.58);
  --content: 1040px;
  --gutter: 48px;
  --radius-card: 28px;
  --radius-row: 16px;
  --shadow-sm: 0 1px 2px rgba(46, 43, 37, 0.14);
  --shadow-md: 0 3px 10px rgba(46, 43, 37, 0.16);
  --font-heading: "Caprasimo", Georgia, serif;
  --font-body: "Figtree", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@font-face {
  font-family: "Caprasimo";
  src: url("assets/fonts/caprasimo-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Figtree";
  src: url("assets/fonts/figtree-variable.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.55 var(--font-body);
  text-rendering: optimizeLegibility;
}

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

a { color: var(--cobalt-text); text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }

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

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.55em;
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.015em;
}

h1 { font-size: clamp(34px, 5vw, 48px); }
h2 { font-size: 32px; }
h3 { font-size: 25px; }
h4 { font-size: 20px; }
h5 { font-size: 16px; }
h6 { font: 700 13px/1.2 var(--font-body); letter-spacing: 0.08em; text-transform: uppercase; }

p { margin: 0 0 1em; }

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-frame {
  width: min(100%, calc(var(--content) + (2 * var(--gutter))));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---- Header: one compact row ---- */
.site-header { min-height: 68px; }

.site-header__inner {
  position: relative;
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font: 400 18px/1 var(--font-heading);
  text-decoration: none;
  white-space: nowrap;
}

.site-brand__mark { flex: none; }

.primary-nav { margin-left: auto; }
.primary-nav ul { display: flex; align-items: center; gap: 22px; margin: 0; padding: 0; list-style: none; }
.primary-nav a { color: var(--ink); font-size: 14px; text-decoration: none; }
.primary-nav .current-menu-item > a,
.primary-nav .current_page_item > a { color: var(--cobalt-text); }

.menu-toggle {
  display: none;
  margin-left: auto;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--divider);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: 700 13px/1 var(--font-body);
}

/* ---- Buttons and topic labels ---- */
.button,
button,
input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--topic-color, var(--cobalt));
  color: var(--bg);
  font: 700 14px/1 var(--font-body);
  text-decoration: none;
  cursor: pointer;
}

.button:hover { filter: brightness(0.92); text-decoration: none; }
.button--secondary { border: 1px solid var(--divider); background: transparent; color: var(--ink); }
.button--secondary:hover { background: rgba(32, 30, 29, 0.07); filter: none; }
.button--amber { color: var(--ink); }

.topic-pill {
  display: inline-flex;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--topic-color, var(--cobalt));
  color: var(--bg);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.topic-pill[data-topic-color="amber"] { color: var(--ink); }

/* ---- Home page hero ---- */
.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 56px;
  align-items: end;
  padding: 44px 0 50px;
}

.home-hero__tagline {
  margin-bottom: 14px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.home-hero__tagline .technology { color: var(--cobalt-text); }
.home-hero__tagline .ecology { color: var(--green-text); }
.home-hero__tagline .economy { color: var(--amber-text); }
.home-hero h1 { max-width: 18ch; }
.home-hero__intro { max-width: 54ch; font-size: 16px; }

.library-search { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.library-search input[type="search"] {
  width: 100%;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
.library-search__stats { margin-top: 8px; color: var(--muted); font-size: 12px; text-align: right; }

/* ---- Home page: shelf grid ---- */
.shelf-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px 56px;
  padding-bottom: 64px;
}

.shelf { min-width: 0; }
.shelf__heading { display: flex; align-items: baseline; gap: 14px; border-bottom: 3px solid var(--topic-color); }
.shelf--coming .shelf__heading { border-bottom-style: dashed; border-bottom-color: rgba(32, 30, 29, 0.36); }
.shelf__heading h3 { flex: 1; margin: 0 0 5px; }
.shelf__link { color: var(--topic-text-color); font-size: 12px; white-space: nowrap; }
.shelf__description { min-height: 3.1em; margin: 10px 0 8px; color: rgba(32, 30, 29, 0.82); font-size: 13px; }
.shelf__coming-label { color: var(--muted); font: 600 12px/1 var(--font-body); }
.shelf__tags { display: flex; flex-wrap: wrap; gap: 8px; }
.shelf__tags span { padding: 6px 9px; border: 1px solid var(--divider); border-radius: 999px; font-size: 12px; }
.shelf__highlight { margin: 12px 7px 0; padding-top: 12px; border-top: 1px solid var(--divider); color: rgba(32, 30, 29, 0.82); font-size: 13px; }
.shelf__highlight a { color: var(--topic-text-color); font-weight: 700; white-space: nowrap; }

.compact-document {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px 7px;
  border-radius: 12px;
  color: var(--ink);
  text-decoration: none;
}
.compact-document:hover { background: rgba(32, 30, 29, 0.05); text-decoration: none; }
.file-chip { display: grid; place-items: center; min-height: 38px; padding: 4px; border-radius: 6px; background: var(--surface); font-size: 9px; font-weight: 700; letter-spacing: 0.08em; }
.compact-document__title { display: block; font-size: 14px; font-weight: 600; }
.compact-document__meta { display: block; margin-top: 1px; color: var(--muted); font-size: 11.5px; }

/* ---- Topic pages ---- */
.topic-main { --topic-color: var(--cobalt); --topic-text-color: var(--cobalt-text); padding: 34px 0 64px; }
.back-link { display: inline-block; margin-bottom: 18px; color: var(--topic-text-color); }
.topic-external-link { display: inline-block; margin-top: 10px; color: var(--topic-text-color); font-weight: 700; }
.topic-hero { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 48px; align-items: center; margin-bottom: 48px; }
.topic-hero__intro { max-width: 54ch; font-size: 16.5px; }
.topic-hero__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.topic-hero__image { aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius-card); background: var(--surface); }
.topic-hero__image img { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.6) contrast(0.85) brightness(1.1); opacity: 0.94; }

.topic-section { margin-top: 46px; }
.document-list { margin-top: 12px; }
.document-row {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) 136px;
  gap: 18px;
  align-items: center;
  padding: 16px;
  border-top: 1px solid var(--divider);
  border-radius: var(--radius-row);
}
.document-row:hover { background: rgba(32, 30, 29, 0.05); }
.document-row__cover { display: grid; place-items: center; width: 62px; height: 80px; overflow: hidden; border-radius: 6px; background: var(--surface); }
.document-row__cover img { width: 100%; height: 100%; object-fit: cover; }
.document-row__title { color: var(--ink); font: 400 19px/1.2 var(--font-heading); }
.document-row__description { max-width: 60ch; margin: 6px 0; font-size: 14px; }
.document-row__meta { display: flex; flex-wrap: wrap; gap: 5px 12px; color: var(--muted); font-size: 12px; }
.document-row__actions { display: grid; gap: 7px; }
.document-row__actions .button { width: 100%; }
.document-row__note { color: var(--muted); font-size: 10.5px; text-align: center; }

.topic-lower-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px; }
.empty-state { padding: 18px; border-radius: var(--radius-card); background: var(--surface); color: var(--muted); }
.ai-manifesto { max-width: 760px; padding: 26px 28px 14px; border-left: 4px solid var(--topic-color); border-radius: 0 var(--radius-card) var(--radius-card) 0; background: var(--surface); }
.ai-manifesto h2 { font-size: 28px; }

/* ---- Drone and panorama page ---- */
.drone-hero { display: grid; grid-template-columns: 1fr 180px; gap: 48px; align-items: end; margin-bottom: 38px; }
.drone-stats { color: var(--muted); font-size: 13px; text-align: right; }
.drone-stats span { display: block; }
.panorama-shell { position: relative; min-height: 440px; overflow: hidden; border-radius: var(--radius-card); background: var(--surface); }
.tour-gate { position: relative; min-height: 440px; }
.tour-gate__poster { display: block; width: 100%; height: 520px; object-fit: cover; filter: saturate(0.78) contrast(0.92) brightness(1.04); }
.tour-gate__shade { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; background: linear-gradient(180deg, rgba(32,30,29,0.06), rgba(32,30,29,0.5)); }
.tour-gate__panel { max-width: 440px; padding: 20px 22px; border-radius: 24px; background: rgba(245,234,216,0.94); box-shadow: var(--shadow-md); text-align: center; }
.tour-gate__panel h2 { margin-bottom: 8px; font-size: 26px; }
.tour-gate__panel p { margin-bottom: 16px; }
.tour-gate__actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 9px; }
.tour-frame { display: block; width: 100%; min-height: 520px; border: 0; background: var(--surface); }
.tour-links { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-top: 10px; color: var(--muted); font-size: 12px; }
.tour-links a { white-space: nowrap; }
.drone-columns { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 48px; margin-top: 38px; }

/* ---- Notes, pages, and search ---- */
.content-page { max-width: 760px; padding: 44px 0 72px; }
.content-page--wide { max-width: none; }
.entry-list { display: grid; gap: 18px; }
.entry-card { padding: 18px; border-radius: var(--radius-card); background: var(--surface); }
.entry-card h2 { font-size: 24px; }
.entry-meta { color: var(--muted); font-size: 12px; }
.entry-content { font-size: 17px; line-height: 1.65; }
.entry-content > * { max-width: 70ch; }
.entry-content img, .entry-content .alignwide { max-width: min(100%, 1040px); }

/* ---- Footer ---- */
.site-footer { background: var(--surface); }
.site-footer__inner { display: grid; grid-template-columns: 1fr auto; gap: 36px; padding-top: 24px; padding-bottom: 24px; }
.site-footer__brand { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 7px; font: 400 16px/1 var(--font-heading); }
.site-footer p { max-width: 60ch; margin: 0; color: var(--muted); font-size: 12.5px; }
.site-footer__links { display: flex; gap: 18px; align-items: center; font-size: 13px; }

/* ---- Responsive rules ---- */
@media (max-width: 1040px) {
  :root { --gutter: 32px; }
  .drone-columns { grid-template-columns: 1fr; }
}

@media (max-width: 779px) {
  :root { --gutter: 20px; }
  .topic-main, .content-page { padding-inline: var(--gutter); }
  .topic-main .panorama-shell {
    margin-inline: calc(-1 * var(--gutter));
    border-radius: 0;
  }
  .menu-toggle { display: inline-flex; }
  .primary-nav { display: none; position: absolute; z-index: 10; top: 62px; right: 20px; left: 20px; padding: 12px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-md); }
  .primary-nav.is-open { display: block; }
  .primary-nav ul { align-items: stretch; flex-direction: column; gap: 2px; }
  .primary-nav a { display: block; min-height: 44px; padding: 12px; }
  .home-hero, .topic-hero, .drone-hero, .topic-lower-grid, .site-footer__inner { grid-template-columns: 1fr; }
  .home-hero { gap: 24px; padding-top: 30px; }
  .library-search__stats { text-align: left; }
  .shelf-grid { grid-template-columns: 1fr; }
  .shelf__description { min-height: auto; }
  .document-row { grid-template-columns: 52px 1fr; }
  .document-row__cover { width: 52px; height: 68px; }
  .document-row__actions { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .document-row__note { grid-column: 1 / -1; }
  .ai-manifesto { padding: 22px 20px 10px; }
  .drone-stats { text-align: left; }
  .tour-gate__poster, .tour-frame { height: 68vh; min-height: 500px; }
  .tour-links { align-items: flex-start; flex-direction: column; }
  .site-footer__links { align-items: flex-start; flex-wrap: wrap; }
}
