/*
 * Nasaqq Ghost Theme — screen.css
 * Design system ported from /Teach/auther/nasaqq-theme.css
 */

/* ══════════════════════════════════════════════════════
   DESIGN TOKENS
   ══════════════════════════════════════════════════════ */
:root {
  --ink:       #1a1814;
  --ink-mid:   #3d3a34;
  --ink-light: #7a7670;
  --ink-faint: #b8b4ae;

  --paper:      #f9f6f0;
  --paper-warm: #f2ede4;
  --paper-card: #ffffff;

  --accent:      #c0392b;
  --accent-gold: #b8860b;
  --accent-teal: #1a6b5a;
  --accent-blue: #1e4e8c;

  --rule: #d4cfc6;

  --chart-red:   #c0392b;
  --chart-green: #1a6b5a;
  --chart-blue:  #1e4e8c;
  --chart-gold:  #b8860b;
  --chart-gray:  #7a7670;

  --on-dark-highlight: #e8d5a0;

  --font-serif: 'Source Serif 4', Georgia, serif;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-mono: 'Cascadia Mono', 'SF Mono', 'Fira Code', monospace;

  --content-width: 780px;
  --wide-width: 1200px;
}

/* ─────────────────────────────────────────────────────
   RESET & BASE
   ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 18px; scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-serif);
  font-weight: 300;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-blue); text-underline-offset: 3px; }
a:hover { color: var(--accent); }

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

/* ─────────────────────────────────────────────────────
   SITE HEADER
   ───────────────────────────────────────────────────── */
.site-header {
  background: var(--ink);
  border-bottom: 4px solid var(--accent);
  padding: 1.2rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header__logo {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.6rem;
  color: var(--paper);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.site-header__logo:hover { color: var(--on-dark-highlight); }

.site-nav {
  display: flex;
  gap: 1.8rem;
  align-items: center;
}
.site-nav ul,
.site-nav .nav {
  display: flex;
  gap: 1.8rem;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  font-family: var(--font-serif);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-decoration: none;
  transition: color 0.2s;
}
.site-nav a:hover,
.site-nav a.nav-current { color: var(--paper); }

/* Mobile nav toggle */
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--paper); margin: 5px 0; transition: 0.3s; }

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--ink);
    flex-direction: column;
    padding: 1.5rem 2rem;
    gap: 1rem;
    border-bottom: 4px solid var(--accent);
  }
  .site-nav.is-open { display: flex; }
  .site-nav ul,
  .site-nav .nav {
    flex-direction: column;
    gap: 1rem;
  }
}

/* ─────────────────────────────────────────────────────
   SITE FOOTER
   ───────────────────────────────────────────────────── */
.site-footer {
  background: var(--ink);
  color: var(--ink-faint);
  padding: 3rem 2rem;
  text-align: center;
  border-top: 4px solid var(--accent);
}
.site-footer__inner {
  max-width: var(--wide-width);
  margin: 0 auto;
}
.site-footer__tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--on-dark-highlight);
  margin-bottom: 1rem;
}
.site-footer__copy {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.site-footer a { color: var(--ink-faint); }
.site-footer a:hover { color: var(--paper); }

/* ─────────────────────────────────────────────────────
   HOMEPAGE — HERO
   ───────────────────────────────────────────────────── */
.hero {
  background: var(--ink);
  color: var(--paper);
  text-align: center;
  padding: 5rem 2rem 4rem;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.15;
  max-width: 820px;
  margin: 0 auto 1.2rem;
}
.hero h1 em { font-style: italic; color: var(--on-dark-highlight); }
.hero__sub {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 300;
  font-style: italic;
  color: var(--ink-faint);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ─────────────────────────────────────────────────────
   HOMEPAGE — PROJECT CARDS
   ───────────────────────────────────────────────────── */
.projects {
  max-width: var(--wide-width);
  margin: 0 auto;
  padding: 4rem 2rem;
}
.projects__heading {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.65rem;
  color: var(--ink);
  text-align: center;
  margin-bottom: 2.5rem;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.project-card {
  background: var(--paper-card);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--ink);
  padding: 2rem 1.8rem;
  transition: border-top-color 0.2s;
}
.project-card:hover { border-top-color: var(--accent); }

.project-card__icon {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 0.8rem;
}
.project-card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
  margin-bottom: 0.6rem;
}
.project-card p {
  font-size: 0.9rem;
  color: var(--ink-mid);
  line-height: 1.6;
  margin-bottom: 1rem;
}
.project-card__link {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
}

/* ─────────────────────────────────────────────────────
   HOMEPAGE — LATEST POSTS
   ───────────────────────────────────────────────────── */
.latest-posts {
  max-width: var(--wide-width);
  margin: 0 auto;
  padding: 0 2rem 5rem;
}
.latest-posts__heading {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.65rem;
  color: var(--ink);
  margin-bottom: 2rem;
  padding-top: 3rem;
  border-top: 1px solid var(--rule);
}

.post-feed {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

/* ─────────────────────────────────────────────────────
   POST CARD (shared between homepage and tag/author)
   ───────────────────────────────────────────────────── */
.post-card {
  background: var(--paper-card);
  border: 1px solid var(--rule);
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.post-card:hover {
  box-shadow: 0 4px 16px rgba(26, 24, 20, 0.08);
}
.post-card__image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-bottom: 1px solid var(--rule);
}
.post-card__content {
  padding: 1.5rem;
}
.post-card__tag {
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 0.5rem;
}
.post-card__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}
.post-card__title a {
  color: var(--ink);
  text-decoration: none;
}
.post-card__title a:hover { color: var(--accent); }
.post-card__excerpt {
  font-size: 0.88rem;
  color: var(--ink-mid);
  line-height: 1.6;
  margin-bottom: 1rem;
}
.post-card__meta {
  font-size: 0.72rem;
  color: var(--ink-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ─────────────────────────────────────────────────────
   ARTICLE / POST — MASTHEAD
   ───────────────────────────────────────────────────── */
.post-masthead {
  background: var(--ink);
  color: var(--paper);
  text-align: center;
  padding: 3rem 2rem 2.5rem;
  border-bottom: 4px solid var(--accent);
}
.post-masthead__tag {
  font-family: var(--font-serif);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 1.2rem;
}
.post-masthead__tag a { color: var(--ink-faint); text-decoration: none; }
.post-masthead__tag a:hover { color: var(--on-dark-highlight); }

.post-masthead h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2rem, 6vw, 3.8rem);
  line-height: 1.1;
  color: var(--paper);
  max-width: 820px;
  margin: 0 auto 1rem;
}
.post-masthead h1 em { font-style: italic; color: var(--on-dark-highlight); }

.post-masthead__excerpt {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 300;
  font-style: italic;
  color: var(--ink-faint);
  max-width: 600px;
  margin: 0 auto 1.8rem;
  line-height: 1.6;
}
.post-masthead__byline {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #888;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

/* ─────────────────────────────────────────────────────
   ARTICLE / POST — BODY (gh-content)
   Matches auther .article-wrap styles exactly
   ───────────────────────────────────────────────────── */
.gh-content {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 2rem 2rem 6rem;
}

.gh-content p {
  margin-bottom: 1.5rem;
  font-size: 1rem;
  color: var(--ink-mid);
}
.gh-content p strong { font-weight: 600; color: var(--ink); }
.gh-content p em { font-style: italic; }

/* Headings */
.gh-content h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.65rem;
  line-height: 1.25;
  color: var(--ink);
  margin-bottom: 1.4rem;
  padding-top: 3.5rem;
  border-top: 1px solid var(--rule);
  margin-top: 3.5rem;
}
.gh-content h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
  margin: 2rem 0 0.8rem;
}
.gh-content h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-light);
  margin: 1.5rem 0 0.5rem;
}

/* Blockquote — opening provocation style */
.gh-content blockquote {
  margin: 2.5rem 0 2rem;
  padding: 2rem 2.5rem;
  border-left: 4px solid var(--accent);
  background: var(--paper-warm);
  position: relative;
}
.gh-content blockquote::before {
  content: '\201C';
  font-family: var(--font-display);
  font-size: 5rem;
  color: var(--accent);
  opacity: 0.2;
  position: absolute;
  top: -0.8rem;
  left: 1.2rem;
  line-height: 1;
}
.gh-content blockquote p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.2rem !important;
  line-height: 1.6;
  color: var(--ink);
  position: relative;
  z-index: 1;
  margin: 0 !important;
}

/* Lists */
.gh-content ul,
.gh-content ol {
  margin: 0 0 1.5rem 1.5rem;
  color: var(--ink-mid);
}
.gh-content li {
  margin-bottom: 0.4rem;
  font-size: 1rem;
  line-height: 1.7;
}
.gh-content ul li::marker { color: var(--accent); }
.gh-content ol li::marker { color: var(--ink-faint); font-family: var(--font-display); }

/* Code */
.gh-content code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  background: var(--paper-warm);
  padding: 0.1em 0.35em;
  border-radius: 2px;
  color: var(--ink);
}
.gh-content pre {
  background: var(--ink);
  color: var(--paper);
  padding: 1.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  border-left: 3px solid var(--accent-gold);
}
.gh-content pre code {
  background: transparent;
  padding: 0;
  font-size: 0.82rem;
  color: var(--paper);
  line-height: 1.7;
}

/* HR */
.gh-content hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 3rem 0;
}

/* Tables */
.gh-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  background: var(--paper-card);
  margin: 2rem 0;
  border: 1px solid var(--rule);
  border-top: 3px solid var(--ink);
  display: table;
  overflow-x: auto;
}
.gh-content thead tr {
  background: var(--ink);
  color: var(--paper);
}
.gh-content thead th {
  padding: 0.7rem 0.9rem;
  text-align: left;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.gh-content tbody tr { border-bottom: 1px solid var(--rule); }
.gh-content tbody tr:nth-child(even) { background: var(--paper-warm); }
.gh-content tbody td {
  padding: 0.55rem 0.9rem;
  color: var(--ink-mid);
  vertical-align: top;
  line-height: 1.45;
}

/* Images */
.gh-content img {
  border: 1px solid var(--rule);
  margin: 2rem 0;
}
.gh-content figure { margin: 2rem 0; }
.gh-content figcaption {
  font-size: 0.75rem;
  color: var(--ink-faint);
  font-style: italic;
  margin-top: 0.5rem;
  text-align: center;
}

/* Ghost card widths */
.gh-content .kg-width-wide {
  max-width: calc(var(--content-width) + 200px);
  margin-left: calc(50% - (var(--content-width) + 200px) / 2);
  margin-right: calc(50% - (var(--content-width) + 200px) / 2);
}
.gh-content .kg-width-full {
  max-width: none;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

/* ─────────────────────────────────────────────────────
   AUTHER COMPONENTS (usable via HTML card in Ghost)
   Pull quotes, stat rows, closing question, footnote
   ───────────────────────────────────────────────────── */
.pull-quote {
  margin: 2.5rem -2rem;
  padding: 1.8rem 2.5rem;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  text-align: center;
}
.pull-quote p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.4rem !important;
  line-height: 1.5;
  color: var(--ink) !important;
  margin: 0 auto !important;
  max-width: 600px;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}
.stat-card {
  text-align: center;
  padding: 1.5rem 1rem;
  background: var(--ink);
  color: var(--paper);
}
.stat-number {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 2rem;
  color: var(--on-dark-highlight);
  display: block;
  line-height: 1.1;
  margin-bottom: 0.4rem;
}
.stat-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  line-height: 1.4;
}

.closing-question {
  margin: 3rem 0 2rem;
  padding: 2rem 2.5rem;
  background: var(--ink);
  color: var(--paper);
  text-align: center;
}
.closing-question p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.2rem !important;
  color: var(--on-dark-highlight) !important;
  line-height: 1.6;
  margin: 0 !important;
}

.footnote {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.75rem;
  color: var(--ink-faint);
  line-height: 1.7;
}

/* ─────────────────────────────────────────────────────
   STATIC PAGE LAYOUT
   ───────────────────────────────────────────────────── */
.page-content {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 3rem 2rem 6rem;
}

/* ─────────────────────────────────────────────────────
   PAGINATION
   ───────────────────────────────────────────────────── */
.pagination {
  max-width: var(--wide-width);
  margin: 0 auto;
  padding: 0 2rem 4rem;
  display: flex;
  justify-content: center;
  gap: 2rem;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.pagination a {
  color: var(--ink-mid);
  text-decoration: none;
  padding: 0.5rem 1.2rem;
  border: 1px solid var(--rule);
}
.pagination a:hover {
  border-color: var(--ink);
  color: var(--ink);
}

/* ─────────────────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────────────────── */
@media (max-width: 600px) {
  html { font-size: 16px; }
  .gh-content { padding: 1.5rem 1.2rem 4rem; }
  .gh-content blockquote { padding: 1.5rem; margin: 2rem 0; }
  .pull-quote { margin: 2rem -1.2rem; padding: 1.4rem 1.5rem; }
  .hero { padding: 3rem 1.2rem 2.5rem; }
  .projects { padding: 2.5rem 1.2rem; }
  .latest-posts { padding: 0 1.2rem 3rem; }
  .post-masthead { padding: 2rem 1.2rem; }
  .stat-row { grid-template-columns: 1fr 1fr; }
}

/* ─────────────────────────────────────────────────────
   PRINT
   ───────────────────────────────────────────────────── */
@media print {
  body { background: white; font-size: 11pt; line-height: 1.7; }
  .site-header, .site-footer, .pagination { display: none; }
  .post-masthead {
    background: white;
    color: black;
    border-bottom: 2px solid black;
  }
  .post-masthead h1 { color: black; font-size: 24pt; }
  .post-masthead h1 em { color: #8a6a00; }
  .stat-card { background: #eee; color: black; border: 1px solid #ccc; }
  .stat-number { color: #8a6a00; }
  .closing-question { background: #eee; }
  .closing-question p { color: #3d3a34 !important; }
  a { color: inherit; text-decoration: none; }
}
