/* =====================================================================
   jamescaw.com — Shared Stylesheet
   Minimalist academic-professional. Warm but restrained.
   ===================================================================== */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Inter:wght@300;400;500;600&display=swap');

/* --- Custom Properties --- */
:root {
  --sidebar-width: 290px;

  /* Palette */
  --color-sidebar-bg:       #17161A;
  --color-sidebar-border:   #2E2C34;
  --color-sidebar-text:     #C8C3B8;
  --color-sidebar-heading:  #EDE8E0;
  --color-sidebar-muted:    #7A7670;

  --color-bg:               #F8F6F1;
  --color-surface:          #FFFFFF;
  --color-border:           #E4DDD2;
  --color-border-light:     #EDE8E0;

  --color-text:             #26231E;
  --color-text-secondary:   #6A6358;
  --color-text-muted:       #9A9288;

  --color-accent:           #C4903A;
  --color-accent-hover:     #A97A2C;
  --color-accent-light:     rgba(196, 144, 58, 0.10);
  --color-accent-rule:      rgba(196, 144, 58, 0.30);

  /* Typography */
  --font-serif:  'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-sans:   'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, sans-serif;

  /* Spacing */
  --space-xs:    0.375rem;
  --space-sm:    0.75rem;
  --space-md:    1.25rem;
  --space-lg:    2rem;
  --space-xl:    3rem;
  --space-2xl:   4.5rem;

  /* Radius */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   16px;

  /* Transitions */
  --transition:  all 0.2s ease;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* =====================================================================
   LAYOUT — Sidebar + Content
   ===================================================================== */

.layout {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--color-sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 100;
  padding: 2.5rem 2rem 2rem;
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

/* --- Profile block --- */
.profile-photo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.profile-photo {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--color-accent);
  position: relative;
  background: #2E2C34;
  flex-shrink: 0;
}

.profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.profile-photo-initials {
  display: none;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 2.25rem;
  font-weight: 600;
  color: var(--color-accent);
  letter-spacing: 0.03em;
  background: #2A2830;
}

.profile-name {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--color-sidebar-heading);
  letter-spacing: 0.01em;
  text-align: center;
  line-height: 1.3;
  margin-bottom: 0.4rem;
}

.profile-title {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--color-accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.profile-tagline {
  font-size: 0.8rem;
  color: var(--color-sidebar-muted);
  text-align: center;
  line-height: 1.55;
  margin-bottom: 1.75rem;
  padding: 0 0.25rem;
}

/* --- Sidebar divider --- */
.sidebar-divider {
  width: 100%;
  height: 1px;
  background: var(--color-sidebar-border);
  margin: 1.25rem 0;
}

/* --- Navigation --- */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0.5rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-sidebar-text);
  letter-spacing: 0.02em;
  transition: var(--transition);
  position: relative;
}

.nav-link:hover {
  color: var(--color-sidebar-heading);
  background: rgba(255,255,255,0.05);
}

.nav-link.active {
  color: var(--color-accent);
  background: rgba(196, 144, 58, 0.08);
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--color-accent);
  border-radius: 0 2px 2px 0;
}

.nav-icon {
  width: 16px;
  height: 16px;
  opacity: 0.7;
  flex-shrink: 0;
}

.nav-link.active .nav-icon { opacity: 1; }

/* --- External links --- */
.sidebar-links-label {
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-sidebar-muted);
  margin-bottom: 0.6rem;
  padding: 0 0.25rem;
}

.sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--color-sidebar-text);
  transition: var(--transition);
  line-height: 1.3;
}

.sidebar-link:hover {
  color: var(--color-accent);
  background: rgba(196, 144, 58, 0.05);
}

.sidebar-link svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.6;
}

.sidebar-link:hover svg { opacity: 1; }

/* --- Sidebar footer --- */
.sidebar-footer {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-sidebar-border);
}

.sidebar-contact {
  font-size: 0.75rem;
  color: var(--color-sidebar-muted);
  line-height: 1.6;
}

.sidebar-contact a {
  color: var(--color-accent);
  transition: var(--transition);
}

.sidebar-contact a:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

/* --- Main content --- */
.content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.content-inner {
  flex: 1;
  padding: 4rem 5rem 4rem 4.5rem;
  max-width: 780px;
}

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

.page-eyebrow {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 0.75rem;
}

.page-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.2;
  margin-bottom: 1.25rem;
  letter-spacing: -0.01em;
}

.page-intro {
  font-size: 1.075rem;
  line-height: 1.78;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2xl);
  max-width: 620px;
  font-weight: 400;
}

.page-intro strong {
  color: var(--color-text);
  font-weight: 500;
}

/* Section headings */
.section {
  margin-bottom: var(--space-2xl);
}

.section-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: var(--space-md);
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

.section-label span {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.section-heading {
  font-family: var(--font-serif);
  font-size: 1.55rem;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.3;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.section-heading em {
  color: var(--color-accent);
  font-style: italic;
}

p {
  margin-bottom: 1rem;
  line-height: 1.78;
}

p:last-child { margin-bottom: 0; }

.text-secondary { color: var(--color-text-secondary); }

/* Accent rule */
.accent-rule {
  width: 48px;
  height: 3px;
  background: var(--color-accent);
  border-radius: 2px;
  margin: 1rem 0 1.5rem;
}

/* =====================================================================
   CAREER TIMELINE
   ===================================================================== */

.timeline {
  position: relative;
  padding-left: 1.75rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: linear-gradient(to bottom, var(--color-accent), var(--color-border-light));
}

.timeline-item {
  position: relative;
  margin-bottom: 2rem;
  padding-bottom: 0.25rem;
}

.timeline-item:last-child { margin-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: -1.75rem;
  top: 5px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--color-bg);
  border: 2px solid var(--color-accent);
  z-index: 1;
}

.timeline-item.highlight .timeline-dot {
  background: var(--color-accent);
}

.timeline-period {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 0.2rem;
}

.timeline-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 0.35rem;
  line-height: 1.35;
}

.timeline-desc {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  line-height: 1.65;
  margin: 0;
}

/* =====================================================================
   BOOKS & PUBLICATIONS
   ===================================================================== */

.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-top: 0.5rem;
}

.book-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: var(--transition);
  position: relative;
}

.book-card:hover {
  border-color: var(--color-accent-rule);
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  transform: translateY(-1px);
}

.book-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  margin-bottom: 0.75rem;
}

.book-badge.published {
  background: rgba(196, 144, 58, 0.12);
  color: var(--color-accent-hover);
}

.book-badge.forthcoming {
  background: rgba(106, 99, 88, 0.1);
  color: var(--color-text-secondary);
}

.book-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.35;
  margin-bottom: 0.4rem;
}

.book-subtitle {
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin-bottom: 0.6rem;
}

.book-format {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
  margin-bottom: 0.85rem;
}

.book-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.775rem;
  font-weight: 500;
  color: var(--color-accent);
  transition: var(--transition);
}

.book-link:hover {
  color: var(--color-accent-hover);
  gap: 0.5rem;
}

.book-link svg {
  width: 12px;
  height: 12px;
}

/* =====================================================================
   PODCAST CARD
   ===================================================================== */

.podcast-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  transition: var(--transition);
}

.podcast-card:hover {
  border-color: var(--color-accent-rule);
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.podcast-icon {
  width: 52px;
  height: 52px;
  background: var(--color-accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: white;
}

.podcast-icon svg { width: 26px; height: 26px; }

.podcast-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.35rem;
  line-height: 1.3;
}

.podcast-desc {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: 0.85rem;
}

.podcast-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.podcast-link {
  font-size: 0.775rem;
  font-weight: 500;
  color: var(--color-accent);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: var(--transition);
}

.podcast-link:hover { color: var(--color-accent-hover); }

.podcast-link svg { width: 13px; height: 13px; }

/* =====================================================================
   CTA / CONTACT BLOCK
   ===================================================================== */

.cta-block {
  background: var(--color-text);
  border-radius: var(--radius-md);
  padding: 2.5rem;
  color: white;
  margin-top: var(--space-xl);
}

.cta-block .section-heading {
  color: white;
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
}

.cta-block p {
  color: rgba(255,255,255,0.72);
  font-size: 0.925rem;
  line-height: 1.7;
  max-width: 500px;
  margin-bottom: 1.5rem;
}

.cta-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.35rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: var(--transition);
  cursor: pointer;
}

.cta-btn.primary {
  background: var(--color-accent);
  color: white;
}

.cta-btn.primary:hover {
  background: var(--color-accent-hover);
  transform: translateY(-1px);
}

.cta-btn.secondary {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.15);
}

.cta-btn.secondary:hover {
  background: rgba(255,255,255,0.14);
  color: white;
}

.cta-btn svg { width: 15px; height: 15px; }

/* =====================================================================
   PULL QUOTE
   ===================================================================== */

.pull-quote {
  border-left: 3px solid var(--color-accent);
  padding: 0.5rem 0 0.5rem 1.5rem;
  margin: 1.75rem 0;
}

.pull-quote p {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-style: italic;
  color: var(--color-text);
  line-height: 1.65;
  margin-bottom: 0.5rem;
}

.pull-quote cite {
  font-size: 0.775rem;
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
  font-style: normal;
  font-weight: 500;
}

/* =====================================================================
   INFO CARD / CREDENTIAL BOX
   ===================================================================== */

.info-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.75rem;
  margin: 1.5rem 0;
}

.info-card-title {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.info-row {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.6rem;
  font-size: 0.875rem;
}

.info-row:last-child { margin-bottom: 0; }

.info-row dt {
  font-weight: 500;
  color: var(--color-text-secondary);
  min-width: 130px;
  flex-shrink: 0;
}

.info-row dd { color: var(--color-text); }

/* =====================================================================
   THEME PILLARS (Bitcoin / Jesus pages)
   ===================================================================== */

.pillars {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}

.pillar {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.pillar-icon {
  font-size: 1.35rem;
  margin-bottom: 0.6rem;
  display: block;
}

.pillar-title {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.3rem;
}

.pillar-desc {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  line-height: 1.55;
  margin: 0;
}

/* =====================================================================
   EXTERNAL LINKS SECTION
   ===================================================================== */

.link-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1rem 0;
}

.link-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  color: var(--color-text);
}

.link-item:hover {
  border-color: var(--color-accent-rule);
  background: var(--color-accent-light);
  transform: translateX(3px);
}

.link-item svg {
  width: 16px;
  height: 16px;
  color: var(--color-accent);
  flex-shrink: 0;
}

.link-item-label {
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--color-text);
}

.link-item-url {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-left: auto;
}

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

.site-footer {
  margin-left: var(--sidebar-width);
  padding: 2rem 4.5rem;
  border-top: 1px solid var(--color-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-copy {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-link {
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  transition: var(--transition);
}

.footer-link:hover {
  color: var(--color-accent);
}

/* =====================================================================
   SCRIPTURE BLOCK (Jesus page)
   ===================================================================== */

.scripture-block {
  background: linear-gradient(135deg, #F8F3EA 0%, #F3EDE0 100%);
  border-radius: var(--radius-md);
  padding: 2rem 2.25rem;
  margin: 1.75rem 0;
  position: relative;
}

.scripture-block::before {
  content: '\201C';
  font-family: var(--font-serif);
  font-size: 5rem;
  line-height: 1;
  color: var(--color-accent);
  opacity: 0.25;
  position: absolute;
  top: 0.5rem;
  left: 1.25rem;
}

.scripture-text {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-style: italic;
  color: var(--color-text);
  line-height: 1.7;
  margin-bottom: 0.75rem;
  padding-left: 1rem;
  position: relative;
  z-index: 1;
}

.scripture-ref {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  padding-left: 1rem;
}

/* =====================================================================
   MOBILE NAV TOGGLE
   ===================================================================== */

.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--color-sidebar-bg);
  z-index: 200;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--color-sidebar-border);
}

.mobile-logo {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--color-sidebar-heading);
  font-weight: 600;
}

.mobile-nav-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-sidebar-text);
  padding: 0.4rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-nav-toggle:hover { color: var(--color-sidebar-heading); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.25s ease;
}

/* =====================================================================
   RESPONSIVE — MOBILE
   ===================================================================== */

@media (max-width: 900px) {
  .mobile-header {
    display: flex;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    padding-top: 4rem;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.visible {
    display: block;
    opacity: 1;
  }

  .content {
    margin-left: 0;
    padding-top: 56px;
  }

  .content-inner {
    padding: 2.5rem 1.5rem 3rem;
  }

  .site-footer {
    margin-left: 0;
    padding: 1.5rem;
  }

  .books-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .podcast-card {
    flex-direction: column;
    gap: 1rem;
  }

  .cta-block { padding: 1.75rem; }

  .pillars {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 540px) {
  .page-title { font-size: 1.8rem; }
  .books-grid { grid-template-columns: 1fr; }
  .pillars { grid-template-columns: 1fr; }
  .cta-links { flex-direction: column; }
  .cta-btn { justify-content: center; }
}

/* =====================================================================
   UTILITY
   ===================================================================== */

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
