/* ============================================================
   shared.css — Patrick T. Hoffman Site
   Shared styles for main site and essay pages.
   ============================================================ */

/* ========== DESIGN TOKENS ========== */
:root {
  --royal: #1a3a8a;
  --royal-light: #2a5acd;
  --orange: #E87722;
  --orange-accessible: #c45e0a;
  --yellow: #F5C518;
  --white: #FFFFFF;
  --grey-light: #F0F2F5;
  --grey-mid: #D1D5DB;
  --charcoal: #1C1C1E;
  --navy-dark: #0a1428;
  --navy-mid: #101e3a;
  --text-body: #444;
  --text-secondary: #636363;
  --text-muted: #666;
}

/* ========== RESET ========== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: 'DM Sans', sans-serif;
  color: var(--charcoal);
  background: var(--white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* ========== NAVIGATION ========== */
.top-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 1.25rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.4s ease;
}

.top-nav.scrolled {
  background: rgba(10,20,40,0.92);
  backdrop-filter: blur(12px);
  padding: 0.85rem 2rem;
  box-shadow: 0 2px 20px rgba(0,0,0,0.2);
}

/* Essay pages: start with solid bg since there's no hero */
.top-nav.solid {
  background: var(--navy-dark);
  padding: 0.85rem 2rem;
}

.nav-logo {
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: 1.15rem;
  color: var(--white);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-logo span { color: var(--orange); }

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: color 0.3s;
}

.nav-links a:hover { color: var(--white); }

@media (max-width: 768px) {
  .nav-links { display: none; }
}

/* ========== FOOTER ========== */
footer {
  position: relative;
  z-index: 10;
  background: var(--navy-dark);
  color: rgba(255,255,255,0.4);
  text-align: center;
  padding: 2.5rem 2rem;
  font-size: 0.8rem;
}

footer a {
  color: var(--orange);
  text-decoration: none;
}

footer a:hover { color: var(--yellow); }

/* ========== ARTICLE / ESSAY LAYOUT ========== */
.article-header {
  background: var(--navy-dark);
  padding: 8rem 2rem 4rem;
  position: relative;
  overflow: hidden;
}

.article-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(26,58,138,0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26,58,138,0.1) 1px, transparent 1px);
  background-size: 30px 30px;
  opacity: 0.4;
}

.article-header-content {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
}

.article-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  margin-bottom: 2rem;
  transition: color 0.3s;
}

.article-back:hover { color: var(--yellow); }

.article-back svg {
  width: 16px;
  height: 16px;
}

.article-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.article-tag {
  display: inline-block;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--white);
  background: var(--royal);
  padding: 0.25rem 0.6rem;
  border-radius: 3px;
}

.article-tag.orange { background: var(--orange-accessible); }
.article-tag.yellow { background: #b8960a; }

.article-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  color: var(--white);
  line-height: 1.15;
  margin-bottom: 1rem;
}

.article-meta {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.55);
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.article-meta-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* ========== ARTICLE BODY ========== */
.article-body {
  max-width: 680px;
  margin: 0 auto;
  padding: 4rem 2rem 6rem;
}

.article-body p {
  font-size: 1.1rem;
  line-height: 1.9;
  color: var(--text-body);
  margin-bottom: 1.75rem;
}

.article-body h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--charcoal);
  margin-top: 3rem;
  margin-bottom: 1rem;
  line-height: 1.25;
}

.article-body h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--charcoal);
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.article-body blockquote {
  border-left: 3px solid var(--royal);
  margin: 2rem 0;
  padding: 1rem 1.5rem;
  background: var(--grey-light);
  border-radius: 0 8px 8px 0;
}

.article-body blockquote p {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1.05rem;
  color: #555;
  margin-bottom: 0;
}

.article-body blockquote cite {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-style: normal;
  font-size: 0.8rem;
  color: var(--orange-accessible);
  font-weight: 700;
  margin-top: 0.5rem;
}

.article-body a {
  color: var(--royal-light);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.3s;
}

.article-body a:hover { color: var(--orange); }

.article-body ul,
.article-body ol {
  margin: 1.5rem 0;
  padding-left: 1.5rem;
}

.article-body li {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-body);
  margin-bottom: 0.5rem;
}

.article-body strong {
  font-weight: 700;
  color: var(--charcoal);
}

.article-body em {
  font-style: italic;
}

.article-body hr {
  border: none;
  height: 1px;
  background: var(--grey-mid);
  margin: 3rem 0;
}

.article-body figure {
  margin: 2.5rem 0;
}

.article-body figure img {
  border-radius: 8px;
  width: 100%;
}

.article-body figcaption {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.75rem;
  text-align: center;
  font-style: italic;
}

.article-body code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.9em;
  background: var(--grey-light);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  color: var(--royal);
}

.article-body pre {
  background: var(--navy-dark);
  color: rgba(255,255,255,0.85);
  padding: 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 2rem 0;
  font-size: 0.85rem;
  line-height: 1.6;
}

.article-body pre code {
  background: none;
  padding: 0;
  color: inherit;
  border-radius: 0;
}

/* Lead paragraph — first paragraph gets special treatment */
.article-body .lead {
  font-size: 1.25rem;
  line-height: 1.8;
  color: var(--charcoal);
  font-weight: 400;
}

/* Pullquote — centered highlight */
.pullquote {
  text-align: center;
  margin: 3rem 0;
  padding: 2rem 1rem;
  border-top: 2px solid var(--royal);
  border-bottom: 2px solid var(--royal);
}

.pullquote p {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--royal);
  line-height: 1.4;
  margin-bottom: 0;
}

/* ========== ARTICLE FOOTER / AUTHOR ========== */
.article-author {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 2rem 4rem;
}

.author-card {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  padding: 2rem;
  background: var(--grey-light);
  border-radius: 10px;
  border-left: 3px solid var(--royal);
}

.author-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--navy-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--orange);
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.author-info h4 {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.author-info p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.author-links {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.author-links a {
  font-size: 0.8rem;
  color: var(--royal-light);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s;
}

.author-links a:hover { color: var(--orange); }

/* ========== MORE ESSAYS ========== */
.more-essays {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 2rem 5rem;
}

.more-essays h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--grey-mid);
}

.more-essay-item {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 1.25rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  transition: all 0.3s ease;
}

.more-essay-item:hover { padding-left: 0.75rem; }

.more-essay-item h4 {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  transition: color 0.3s;
}

.more-essay-item:hover h4 { color: var(--royal); }

.more-essay-item p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ========== REDUCED MOTION ========== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .article-header { padding: 7rem 1.5rem 3rem; }
  .article-body { padding: 3rem 1.5rem 4rem; }
  .article-author { padding: 0 1.5rem 3rem; }
  .more-essays { padding: 0 1.5rem 4rem; }
  .author-card { flex-direction: column; text-align: center; }
  .author-links { justify-content: center; }
  .pullquote p { font-size: 1.15rem; }
}
