/* Agentic — style.css
   American Dynamism theme: warm cream + burnt amber
   -------------------------------------------------- */

/* ==================
   COLOR SYSTEM
================== */

:root {
  /* Page backgrounds (light, editorial) */
  --bg-surface:  #faf8f4;   /* body — warm cream */
  --bg-card:     #f0ede6;   /* card backgrounds */
  --bg-elevated: #e8e3d8;   /* subtle raise (inline code, inputs) */
  --bg-hover:    #e0dbd0;   /* hover state on cards */

  /* Dark surfaces (hero fallback, footer, code blocks) */
  --bg-deep:     #1c1a17;   /* near-black ink — footer, hero fallback */
  --bg-code:     #241f1a;   /* warm dark for pre/code blocks */

  /* Text */
  --text-primary:   #1c1a17;  /* near-black ink */
  --text-secondary: #5a5550;  /* warm medium gray */
  --text-tertiary:  #8a857e;  /* light warm gray — meta, captions */

  /* Accent */
  --accent:        #b45309;   /* burnt amber */
  --accent-hover:  #92400e;   /* darker on hover (higher contrast) */
  --accent-light:  #d97706;   /* lighter amber — hero hr, decorative */

  /* Borders */
  --border:       #d4cfc6;    /* warm light gray */
  --border-strong: #b8b3aa;   /* slightly more visible */

  /* Font stacks */
  --font-serif: 'Lora', 'Times New Roman', serif;
  --font-sans:  'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-mono:  'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

/* ==================
   RESET & BASE
================== */

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

body {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 20px;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--bg-surface);
}

/* ==================
   TYPOGRAPHY
================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 800;
  margin-top: 0;
  color: var(--text-primary);
}

p {
  margin: 30px 0;
}

p a {
  text-decoration: underline;
}

a {
  color: var(--text-primary);
}

a:hover, a:focus {
  color: var(--accent);
}

a img:hover, a img:focus {
  cursor: zoom-in;
}

blockquote {
  color: var(--text-secondary);
  font-style: italic;
  border-left: 3px solid var(--accent);
  padding-left: 20px;
  margin-left: 0;
}

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

/* Code blocks — syntax.css handles colors/bg for pre */
pre, pre code {
  font-size: 14px;
  line-height: 1.6;
}

/* Inline code — light warm chip on the cream page */
code {
  font-size: 14px;
  font-family: var(--font-mono);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  color: var(--accent-hover);
}

/* <mark> used in posts as inline command highlighting */
mark {
  font-family: var(--font-mono);
  font-size: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  color: var(--accent-hover);
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 30px 0;
}

hr.small {
  max-width: 100px;
  border-width: 4px;
  border-color: var(--accent-light);
  margin: 15px auto;
}

::selection {
  color: #faf8f4;
  background: var(--accent);
  text-shadow: none;
}

/* ==================
   LAYOUT
================== */

.container {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 24px;
}

.container--wide {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ==================
   NAVIGATION
================== */

nav.site-nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-sans);
  height: 60px;
  background: linear-gradient(to bottom, rgba(28, 26, 23, 0.75), transparent);
}

nav.site-nav a.brand {
  font-weight: 800;
  font-size: 18px;
  text-decoration: none;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

nav.site-nav a.brand:hover,
nav.site-nav a.brand:focus {
  color: var(--accent-light);
}

nav.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 4px;
}

nav.site-nav ul a {
  color: white;
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 10px 16px;
  display: block;
}

nav.site-nav ul a:hover,
nav.site-nav ul a:focus {
  color: var(--accent-light);
}

/* ==================
   HERO / INTRO HEADER
================== */

.intro-header {
  background: no-repeat center center;
  background-color: var(--bg-deep);
  background-size: cover;
  margin-bottom: 50px;
  position: relative;
}

/* Warm dark overlay — keeps white text readable, eliminates cold blue */
.intro-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(28, 26, 23, 0.60) 0%,
    rgba(28, 26, 23, 0.82) 100%
  );
  z-index: 1;
}

/* All heading sections inside hero sit above overlay */
.intro-header .site-heading,
.intro-header .post-heading,
.intro-header .page-heading {
  padding: 150px 24px 90px;
  color: white;
  max-width: 780px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

@media (min-width: 768px) {
  .intro-header .site-heading,
  .intro-header .post-heading,
  .intro-header .page-heading {
    padding: 200px 24px 130px;
  }
}

/* Site/page headings: centered */
.intro-header .site-heading,
.intro-header .page-heading {
  text-align: center;
}

.intro-header .site-heading h1,
.intro-header .page-heading h1 {
  font-size: 50px;
  color: white;
  font-weight: 800;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

@media (min-width: 768px) {
  .intro-header .site-heading h1,
  .intro-header .page-heading h1 {
    font-size: 80px;
    letter-spacing: -1px;
  }
}

/* Post heading: left-aligned */
.intro-header .post-heading h1 {
  font-size: 35px;
  color: white;
  font-weight: 800;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

@media (min-width: 768px) {
  .intro-header .post-heading h1 {
    font-size: 55px;
  }
}

.intro-header .subheading {
  font-family: var(--font-sans);
  font-size: 24px;
  font-weight: 300;
  display: block;
  margin: 10px 0 0;
  color: white;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.intro-header .post-heading .subheading {
  font-size: 24px;
  font-weight: 600;
  margin: 10px 0 30px;
}

@media (min-width: 768px) {
  .intro-header .post-heading .subheading {
    font-size: 30px;
  }
}

.intro-header .meta {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 300;
  font-size: 20px;
  display: block;
  color: rgba(255, 255, 255, 0.85);
}

.intro-header .meta a {
  color: white;
}

/* ==================
   POST GRID (HOMEPAGE)
================== */

.post-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-bottom: 40px;
}

@media (min-width: 640px) {
  .post-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .post-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.post-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 6px 20px rgba(180, 83, 9, 0.12);
}

.post-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.post-card-link:hover,
.post-card-link:focus {
  color: inherit;
  text-decoration: none;
}

.post-card-image {
  width: 100%;
  height: 180px;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-elevated);
}

.post-card-content {
  padding: 20px;
}

.post-card-title {
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 8px;
  color: var(--text-primary);
  line-height: 1.3;
}

.post-card-subtitle {
  font-size: 15px;
  font-weight: 300;
  color: var(--text-secondary);
  margin: 0 0 12px;
  line-height: 1.4;
}

.post-card-meta {
  font-size: 13px;
  color: var(--text-tertiary);
  margin: 0;
  font-style: italic;
}

/* ==================
   PAGER (PREV / NEXT)
================== */

.pager {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
  display: flex;
  justify-content: space-between;
}

.pager li > a {
  font-family: var(--font-sans);
  text-transform: uppercase;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  text-decoration: none;
  color: var(--text-primary);
  display: inline-block;
}

@media (min-width: 768px) {
  .pager li > a {
    padding: 15px 25px;
  }
}

.pager li > a:hover,
.pager li > a:focus {
  color: white;
  background: var(--accent);
  border-color: var(--accent);
}

.pager li.next {
  margin-left: auto;
}

/* ==================
   FOOTER
================== */

footer {
  padding: 50px 0 65px;
  text-align: center;
  background-color: var(--bg-deep);
  border-top: 3px solid var(--accent);
}

footer .social-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
}

footer .social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #2e2b27;
  text-decoration: none;
  transition: background 0.2s;
}

footer .social-links a:hover {
  background: var(--accent);
}

footer .social-links svg {
  width: 20px;
  height: 20px;
  fill: white;
}

footer .footer-copy {
  color: #8a857e;
  font-size: 13px;
  margin-top: 20px;
  font-family: var(--font-sans);
}

/* ==================
   ARTICLE CONTENT
================== */

article a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

article a:hover {
  color: var(--accent-hover);
}

article h2 {
  margin-top: 48px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

article h3 {
  margin-top: 32px;
  margin-bottom: 12px;
}

article img {
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* ==================
   CAPTIONS
================== */

.caption {
  text-align: center;
  font-size: 14px;
  padding: 10px;
  font-style: italic;
  margin: 0;
  display: block;
  color: var(--text-secondary);
}

/* ==================
   SECTION HEADING
================== */

.section-heading {
  font-size: 36px;
  font-weight: 700;
}

/* ==================
   PRINT
================== */

@media print {
  body { background: white; color: black; }
  nav.site-nav, footer, .pager { display: none; }
  .intro-header::before { display: none; }
  a { color: black; }
  pre { border-color: #ccc; background: #f8f8f8; color: black; }
}
