/* =============================================
   EVERETT HILL — SITE STYLES
   Matches the "AI for Christians" book brand:
   warm paper, near-black type, one red-pen accent.
   Fonts: Archivo + Instrument Serif (SIL OFL 1.1, see /fonts/)
   ============================================= */

/* --- Fonts --- */
@font-face {
  font-family: "Archivo";
  src: url("/fonts/Archivo-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/InstrumentSerif-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/InstrumentSerif-Italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --paper:        #F2EDE3;
  --paper-deep:   #E9E2D4;
  --paper-light:  #F8F5EE;
  --ink:          #0E0E10;
  --ink-dim:      #45423B;
  --rule:         #C9C1B2;
  --red:          #E8432F;

  --font-sans:  "Archivo", system-ui, -apple-system, sans-serif;
  --font-serif: "Instrument Serif", Georgia, "Times New Roman", serif;

  --max-width: 1100px;
  --narrow-width: 720px;
  --radius: 2px;
  --transition: 0.2s ease;

  --underline: url("/images/brand/pen-mark.svg");
}

html { font-size: 17px; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-weight: 450;
  color: var(--ink-dim);
  background: var(--paper);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-sans);
  color: var(--ink);
  font-weight: 800;
  font-stretch: 112%;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

a { color: var(--ink); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--red); }

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

::selection { background: var(--red); color: var(--paper); }

/* The red-pen underline, reusable on any inline element */
.pen {
  background: var(--underline) no-repeat left bottom / 100% 0.35em;
  padding-bottom: 0.18em;
}

/* --- Layout --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}
.container-narrow {
  max-width: var(--narrow-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}
.center { text-align: center; }

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  font-stretch: 112%;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  border: 2px solid transparent;
}
.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.btn-primary:hover { background: var(--red); border-color: var(--red); color: var(--paper); }
.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn-secondary:hover { background: var(--ink); color: var(--paper); }

/* --- Navigation --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  padding-bottom: 1rem;
}
.site-logo {
  font-family: var(--font-sans);
  font-size: 1.2rem;
  font-weight: 900;
  font-stretch: 125%;
  letter-spacing: -0.035em;
  color: var(--ink);
  background: var(--underline) no-repeat left bottom / 100% 0.4em;
  padding-bottom: 0.2em;
}
.site-logo:hover { color: var(--ink); }

.site-nav { position: relative; }
.nav-links {
  list-style: none;
  display: flex;
  gap: 0.35rem;
}
.nav-links li a {
  font-family: var(--font-sans);
  font-size: 0.74rem;
  font-weight: 700;
  font-stretch: 112%;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-dim);
  padding: 0.4rem 0.6rem;
  display: inline-block;
}
.nav-links li a:hover { color: var(--ink); }
.nav-links li a.active {
  color: var(--ink);
  background: var(--underline) no-repeat center bottom / calc(100% - 1.2rem) 0.45em;
}

/* Mobile nav */
.nav-toggle { display: none; }
.nav-toggle-label { display: none; cursor: pointer; }
.nav-toggle-label span {
  display: block;
  width: 24px; height: 2px;
  background: var(--ink);
  margin: 5px 0;
  transition: var(--transition);
}

@media (max-width: 768px) {
  .nav-toggle-label { display: block; }
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    right: 0;
    top: calc(100% + 1rem);
    background: var(--paper-light);
    border: 1px solid var(--rule);
    min-width: 220px;
    padding: 0.5rem;
  }
  .nav-links li a { display: block; padding: 0.6rem 0.75rem; }
  .nav-toggle:checked ~ .nav-links { display: flex; }
}

/* --- Hero --- */
.hero {
  background: var(--paper);
  color: var(--ink);
  padding: 6rem 0 5rem;
  border-bottom: 1px solid var(--rule);
}
.hero-text { max-width: 720px; }
.hero h1 {
  font-size: 4.25rem;
  font-weight: 900;
  font-stretch: 125%;
  letter-spacing: -0.035em;
  line-height: 0.95;
  margin-bottom: 1rem;
}
.hero-tagline {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 2rem;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 1.75rem;
  display: inline-block;
  background: var(--underline) no-repeat left bottom / 100% 0.35em;
  padding-bottom: 0.3em;
}
.hero-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin-bottom: 1.5rem;
}
.hero-roles span {
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 700;
  font-stretch: 112%;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.hero-roles span + span::before {
  content: "/";
  margin-right: 1.25rem;
  color: var(--rule);
}
.hero-intro {
  font-size: 1.1rem;
  color: var(--ink-dim);
  margin-bottom: 2rem;
  line-height: 1.6;
  max-width: 620px;
}

/* --- Sections --- */
.section { padding: 4.5rem 0; }
.section-alt { background: var(--paper-deep); }
.section-title {
  font-size: 2.1rem;
  font-weight: 900;
  font-stretch: 125%;
  letter-spacing: -0.03em;
  margin-bottom: 2.25rem;
}

.content-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3.5rem;
}
.content-two-col h2 {
  font-size: 1.5rem;
  margin-bottom: 0.9rem;
}
.content-two-col p { margin-bottom: 1rem; }
.content-two-col strong { color: var(--ink); font-weight: 700; }
.content-two-col .btn { margin-right: 0.5rem; margin-top: 0.5rem; }

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.card {
  background: var(--paper-light);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--ink);
  border-radius: var(--radius);
  padding: 1.75rem;
}
.card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.9rem;
}
.card ul { padding-left: 1.1rem; }
.card li { margin-bottom: 0.45rem; font-size: 0.95rem; }
.card li::marker { color: var(--red); }

/* CTA */
.cta-section { background: var(--ink); color: var(--paper); }
.cta-section h2 {
  color: var(--paper);
  font-size: 2.1rem;
  font-weight: 900;
  font-stretch: 125%;
  letter-spacing: -0.03em;
  margin-bottom: 0.9rem;
}
.cta-section p {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.35rem;
  color: var(--rule);
  margin-bottom: 2rem;
}
.cta-section .btn-primary { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.cta-section .btn-primary:hover { background: var(--red); border-color: var(--red); color: var(--paper); }

/* --- Page headers (blog list, contact) --- */
.page-header {
  padding: 3.5rem 0 2rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2.5rem;
}
.page-header h1,
.page-header h2 {
  font-size: 2.75rem;
  font-weight: 900;
  font-stretch: 125%;
  letter-spacing: -0.035em;
  display: inline-block;
  background: var(--underline) no-repeat left bottom / 100% 0.3em;
  padding-bottom: 0.25em;
  margin-bottom: 0.75rem;
}
.page-header p { font-size: 1.05rem; }

/* Two-column grid on desktop, one on mobile */
.post-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.post-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper-light);
  transition: border-color var(--transition), transform var(--transition);
}
.post-card:hover { border-color: var(--ink); transform: translateY(-2px); }
.post-card-image-link { display: block; }
.post-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  filter: saturate(0.85);
}
.post-card-body {
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.post-card-body h2,
.post-card-body h3 {
  font-size: 1.15rem;
  margin-bottom: 0.6rem;
  line-height: 1.25;
}
.post-card-body h2 a,
.post-card-body h3 a { color: var(--ink); }
.post-card-body h2 a:hover,
.post-card-body h3 a:hover { color: var(--red); }
.post-card-body p {
  color: var(--ink-dim);
  font-size: 0.92rem;
  margin-bottom: 0.9rem;
  flex: 1;
}
.read-more {
  font-size: 0.72rem;
  font-weight: 700;
  font-stretch: 112%;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  margin-top: auto;
}
.read-more:hover { color: var(--red); }

/* Single post hero image */
.post-hero-image {
  width: 100%;
  max-height: 420px;
  overflow: hidden;
  border-radius: var(--radius);
  margin-bottom: 2.25rem;
}
.post-hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 768px) {
  .post-grid { grid-template-columns: 1fr; }
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 3rem;
  font-size: 0.85rem;
  color: var(--ink-dim);
}

/* --- Single Post --- */
.post-single { padding: 3.5rem 0; }
.post-header { margin-bottom: 2.5rem; }
.post-header h1 {
  font-size: 2.6rem;
  font-weight: 900;
  font-stretch: 125%;
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin-bottom: 1rem;
}
.post-meta {
  font-size: 0.74rem;
  font-weight: 700;
  font-stretch: 112%;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-dim);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.post-categories { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.category {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 0.1rem 0.5rem;
  font-size: 0.68rem;
  color: var(--ink-dim);
}
.post-content {
  font-size: 1.05rem;
  line-height: 1.8;
}
.post-content p { margin-bottom: 1.3rem; }
.post-content strong { color: var(--ink); font-weight: 700; }
.post-content h2 {
  font-size: 1.6rem;
  margin: 2.5rem 0 0.9rem;
}
.post-content h3 {
  font-size: 1.2rem;
  margin: 2rem 0 0.6rem;
}
.post-content em { font-style: italic; }
.post-content blockquote {
  border-left: 3px solid var(--ink);
  padding: 0.25rem 0 0.25rem 1.5rem;
  margin: 2rem 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.35rem;
  line-height: 1.45;
  color: var(--ink);
}
.post-content blockquote p { margin-bottom: 0.75rem; }
.post-content blockquote strong {
  font-family: var(--font-sans);
  font-style: normal;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}
.post-content ul, .post-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.3rem;
}
.post-content li { margin-bottom: 0.45rem; }
.post-content li::marker { color: var(--red); }
.post-content a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.post-content a:hover { color: var(--red); }
.post-content hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 2.75rem 0;
}
.post-footer { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--rule); }

/* --- YouTube embed (Hugo shortcode) --- */
.post-content .youtube,
.post-content iframe[src*="youtube"] {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
  border-radius: var(--radius);
  margin: 1.5rem 0;
}

/* --- Contact Form --- */
.contact-form { margin-top: 2rem; }
.form-group { margin-bottom: 1.5rem; }
.form-group label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  font-stretch: 112%;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 0.45rem;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--paper-light);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(232, 67, 47, 0.18);
}
.form-group textarea { resize: vertical; }
.hidden { display: none; }

/* Anchor targets clear the sticky header */
[id] { scroll-margin-top: 5rem; }

/* Space between a post grid and the button under it */
.post-grid + p { margin-top: 2.5rem; }

/* --- Footer --- */
.site-footer {
  background: var(--ink);
  color: var(--rule);
  padding: 2.5rem 0;
  margin-top: 4rem;
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.site-footer p { font-size: 0.82rem; }
.footer-nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.footer-nav a {
  font-size: 0.72rem;
  font-weight: 700;
  font-stretch: 112%;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rule);
}
.footer-nav a:hover { color: var(--paper); }

/* A CTA right before the footer shouldn't leave a paper gap */
.cta-section + .site-footer,
.site-main:has(> .cta-section:last-child) + .site-footer { margin-top: 0; border-top: 1px solid #2a2a2e; }

/* --- Responsive --- */
@media (max-width: 768px) {
  .hero h1 { font-size: 2.9rem; }
  .hero-tagline { font-size: 1.6rem; }
  .hero { padding: 3.5rem 0; }
  .hero-roles { flex-direction: column; gap: 0.4rem; }
  .hero-roles span + span::before { content: none; }
  .content-two-col { grid-template-columns: 1fr; gap: 2.5rem; }
  .cards { grid-template-columns: 1fr; }
  .section { padding: 3rem 0; }
  .section-title, .cta-section h2 { font-size: 1.7rem; }
  .page-header h1, .page-header h2 { font-size: 2.1rem; }
  .post-header h1 { font-size: 2rem; }
}

@media (max-width: 480px) {
  .container, .container-narrow { padding: 0 1rem; }
  .hero h1 { font-size: 2.3rem; }
  .post-header h1 { font-size: 1.7rem; }
}

/* --- Homepage book list --- */
.book-list { list-style: none; margin: 0 0 1.5rem; border-top: 1px solid var(--rule); }
.book-list li { padding: 0.9rem 0; border-bottom: 1px solid var(--rule); }
.book-list a {
  display: inline-block;
  font-family: var(--font-serif);
  font-size: 1.45rem;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 0.2rem;
}
.book-list a:hover { color: var(--red); }
.book-list span { display: block; font-size: 0.92rem; }

/* --- Full-width page banner (front matter: wide_banner) --- */
.wide-banner {
  background: #F2EDE3;
  border-bottom: 1px solid var(--rule);
}
.wide-banner img {
  width: 100%;
  height: auto;
  min-height: 220px;
  max-height: 460px;
  object-fit: cover;
  object-position: center;
  margin: 0 auto;
}
.post-single-after-banner { padding-top: 2.5rem; }

/* Kept for screen readers and search engines, hidden on screen (front matter: hide_title) */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --- About page: keep Get in Touch close to the About text --- */
.about-intro { padding-bottom: 0; }
.about-contact { padding-top: 0; }
.about-contact .page-header { padding-top: 1.75rem; border-top: 1px solid var(--rule); }

/* Homepage: the tagline leads the hero (the name is already in the header) */
.hero-tagline-lead {
  font-size: 3.1rem;
  line-height: 1.1;
  max-width: 820px;
  margin-bottom: 2rem;
}
@media (max-width: 768px) {
  .hero-tagline-lead { font-size: 2.2rem; }
}
.nowrap { white-space: nowrap; }
@media (max-width: 420px) { .hero-tagline-lead { font-size: 1.85rem; } }

/* --- Homepage hero: the new book --- */
.eyebrow {
  font-size: 0.74rem;
  font-weight: 700;
  font-stretch: 112%;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 1rem;
}
.eyebrow a { color: var(--ink-dim); }
.hero-book { padding: 4.5rem 0; }
.hero-book-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 4rem;
  align-items: center;
}
.hero-book-title {
  font-family: var(--font-sans);
  font-weight: 900;
  font-stretch: 125%;
  letter-spacing: -0.04em;
  font-size: 5.5rem;
  line-height: 0.9;
  margin-bottom: 1rem;
}
.hero-book-title a { color: var(--ink); }
.hero-book-title em {
  display: block;
  font-family: var(--font-serif);
  font-weight: 400;
  font-stretch: 100%;
  letter-spacing: 0;
  font-size: 0.62em;
  line-height: 1.15;
  padding-bottom: 0.12em;
  background: var(--underline) no-repeat left bottom / 75% 0.22em;
  width: fit-content;
  padding-right: 0.5em;
}
.hero-book-subtitle {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  max-width: 460px;
  margin-bottom: 1.25rem;
}
.hero-book-cover img {
  width: 100%;
  max-width: 340px;
  margin-left: auto;
  box-shadow: 0 18px 40px rgba(14, 14, 16, 0.18), 0 2px 6px rgba(14, 14, 16, 0.08);
  transition: transform var(--transition);
}
.hero-book-cover:hover img { transform: translateY(-4px); }

/* COO pitch, now in its own section */
.coo-tagline { font-size: 1.7rem; margin-bottom: 1.25rem; }
.coo-intro { max-width: 640px; margin-bottom: 2.25rem; font-size: 1.05rem; }
.section .section-title + .hero-roles { margin-top: -1.25rem; }

/* --- Topics --- */
.topic-list { list-style: none; columns: 2; column-gap: 3rem; margin-bottom: 3rem; }
.topic-list li { break-inside: avoid; padding: 0.55rem 0; border-bottom: 1px solid var(--rule); display: flex; justify-content: space-between; gap: 1rem; }
.topic-list a { color: var(--ink); font-weight: 600; }
.topic-list a:hover { color: var(--red); }
.topic-count { font-size: 0.8rem; color: var(--ink-dim); }
a.category { color: var(--ink-dim); }
a.category:hover { color: var(--ink); border-color: var(--ink); }
.post-card-date {
  font-size: 0.7rem !important;
  font-weight: 700;
  font-stretch: 112%;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 0.5rem !important;
  flex: none !important;
}

/* --- 404 --- */
.not-found-lead { font-family: var(--font-serif); font-style: italic; font-size: 1.4rem; color: var(--ink); }
.not-found-links { margin-top: 1rem; }

@media (max-width: 768px) {
  .hero-book-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .hero-book-title { font-size: 3.6rem; }
  .hero-book-cover img { max-width: 240px; margin: 0; }
  .topic-list { columns: 1; }
}

/* --- Book signup (shortcode: signup) --- */
.signup-box { margin: 1.5rem 0 0.5rem; }
.signup-frame { width: 100%; height: 1100px; border: 1px solid var(--rule); background: #fff; border-radius: var(--radius); }
.signup-soon { padding: 1rem 1.25rem; border-left: 3px solid var(--ink); background: var(--paper-light); }
@media (max-width: 768px) { .hero-book-cover { display: none; } }
/* Google Form embed: tall enough to show every question and the Submit button */
.signup-frame { height: 1520px; }
@media (max-width: 600px) { .signup-frame { height: 1820px; } }
