/* ============================================================
   All Points North — Main Stylesheet
   ============================================================ */

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

/* ---------- CSS Variables ---------- */
:root {
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;

  /* Light mode */
  --bg:           #fafaf8;
  --bg-card:      #ffffff;
  --bg-nav:       rgba(250, 250, 248, 0.92);
  --bg-hero:      #f0ede6;
  --bg-footer:    #1a1a2e;
  --text:         #1a1a2e;
  --text-muted:   #6b7280;
  --text-light:   #9ca3af;
  --accent:       #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft:  #eff6ff;
  --border:       #e5e7eb;
  --border-light: #f3f4f6;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:    0 4px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.05);
  --shadow-lg:    0 10px 40px rgba(0,0,0,.10), 0 4px 16px rgba(0,0,0,.06);
  --radius:       12px;
  --radius-sm:    8px;
  --radius-lg:    20px;
  --nav-height:   70px;
  --transition:   0.25s ease;
}

[data-theme="dark"] {
  --bg:           #0f0f1a;
  --bg-card:      #1a1a2e;
  --bg-nav:       rgba(15, 15, 26, 0.95);
  --bg-hero:      #16162a;
  --bg-footer:    #0a0a14;
  --text:         #e8e8f0;
  --text-muted:   #9ca3af;
  --text-light:   #6b7280;
  --accent:       #60a5fa;
  --accent-hover: #93c5fd;
  --accent-soft:  #1e3a5f;
  --border:       #2d2d4a;
  --border-light: #232338;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.3), 0 1px 2px rgba(0,0,0,.2);
  --shadow-md:    0 4px 16px rgba(0,0,0,.35), 0 2px 6px rgba(0,0,0,.25);
  --shadow-lg:    0 10px 40px rgba(0,0,0,.5), 0 4px 16px rgba(0,0,0,.35);
}

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

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

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background var(--transition), color var(--transition);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  line-height: 1.25;
  color: var(--text);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.5rem); }
h4 { font-size: 1.125rem; }

p { color: var(--text-muted); }

/* ---------- Utility ---------- */
.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .65rem 1.4rem;
  border-radius: 50px;
  font-family: var(--font-sans);
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37,99,235,.35);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}
.btn-outline:hover {
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.tag {
  display: inline-block;
  padding: .25rem .75rem;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 50px;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.section-label {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: .75rem;
}

/* ---------- Navigation ---------- */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  height: var(--nav-height);
  background: var(--bg-nav);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: background var(--transition), border-color var(--transition);
}

.navbar.scrolled {
  box-shadow: var(--shadow-sm);
}

.nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
}

.nav-logo .logo-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: .25rem;
}

.nav-links a {
  padding: .45rem .85rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  background: var(--border-light);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
}

/* Dark mode toggle */
.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all var(--transition);
  flex-shrink: 0;
}
.theme-toggle:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
  border: none;
  background: none;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all var(--transition);
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav drawer */
.nav-drawer {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0;
  width: 100%;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 1rem clamp(1rem, 4vw, 2rem) 1.5rem;
  z-index: 999;
  box-shadow: var(--shadow-md);
  transform: translateY(-10px);
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition);
}
.nav-drawer.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: all;
}
.nav-drawer a {
  display: block;
  padding: .75rem 0;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-light);
  transition: color var(--transition);
}
.nav-drawer a:last-child { border-bottom: none; }
.nav-drawer a:hover, .nav-drawer a.active { color: var(--accent); }

/* ---------- Page offset ---------- */
main { padding-top: var(--nav-height); flex: 1; }

/* ---------- Hero ---------- */
.hero {
  background: var(--bg-hero);
  padding: clamp(4rem, 8vw, 7rem) 0 clamp(3rem, 6vw, 5rem);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -60%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(37,99,235,.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner {
  max-width: 780px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--accent-soft);
  color: var(--accent);
  padding: .35rem 1rem;
  border-radius: 50px;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.hero h1 {
  margin-bottom: 1.25rem;
}

.hero h1 em {
  font-style: italic;
  color: var(--accent);
}

.hero-sub {
  font-size: 1.125rem;
  max-width: 560px;
  margin-bottom: 2rem;
  color: var(--text-muted);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
}

.hero-scroll {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .85rem;
  color: var(--text-light);
  margin-top: 2.5rem;
}

.hero-scroll::before {
  content: '';
  display: block;
  width: 32px;
  height: 1px;
  background: var(--text-light);
}

/* ---------- Featured Post (big card) ---------- */
.featured-section {
  padding: clamp(3rem, 6vw, 5rem) 0 2rem;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.featured-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition);
}

.featured-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0,0,0,.12);
}

.featured-card-img {
  position: relative;
  overflow: hidden;
  min-height: 380px;
}

.featured-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.featured-card:hover .featured-card-img img { transform: scale(1.03); }

.featured-card-body {
  padding: clamp(2rem, 4vw, 3rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-meta {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  font-size: .82rem;
  color: var(--text-light);
}

.featured-meta .tag { margin-right: .25rem; }

.featured-card-body h2 {
  margin-bottom: 1rem;
  line-height: 1.3;
}
.featured-card-body h2 a:hover { color: var(--accent); }

.featured-card-body p {
  margin-bottom: 1.75rem;
  font-size: .97rem;
  flex: 1;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .9rem;
  font-weight: 600;
  color: var(--accent);
  transition: gap var(--transition);
}
.read-more:hover { gap: .7rem; }
.read-more svg { transition: transform var(--transition); }
.read-more:hover svg { transform: translateX(3px); }

/* ---------- Post Grid ---------- */
.posts-section {
  padding: 2rem 0 clamp(3rem, 6vw, 5rem);
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 1.75rem;
}

.post-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.post-card-img {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/10;
}

.post-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.post-card:hover .post-card-img img { transform: scale(1.05); }

.post-card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.post-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1rem;
  font-size: .8rem;
  color: var(--text-light);
}

.post-card-body h3 {
  margin-bottom: .6rem;
  line-height: 1.35;
}
.post-card-body h3 a:hover { color: var(--accent); }

.post-card-body p {
  font-size: .9rem;
  margin-bottom: 1.25rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
  font-size: .82rem;
  color: var(--text-light);
}

.author-mini {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  overflow: hidden;
}

/* ---------- Newsletter Strip ---------- */
.newsletter-section {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 50%, #1e40af 100%);
  padding: clamp(3rem, 6vw, 5rem) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.newsletter-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.newsletter-inner {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
}

.newsletter-section h2 {
  color: #fff;
  margin-bottom: .75rem;
}

.newsletter-section p {
  color: rgba(255,255,255,.8);
  margin-bottom: 2rem;
  font-size: 1rem;
}

.newsletter-form {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.newsletter-form input {
  flex: 1;
  min-width: 220px;
  padding: .75rem 1.25rem;
  border-radius: 50px;
  border: 2px solid transparent;
  background: rgba(255,255,255,.15);
  color: #fff;
  font-family: var(--font-sans);
  font-size: .95rem;
  outline: none;
  backdrop-filter: blur(8px);
  transition: border-color var(--transition), background var(--transition);
}
.newsletter-form input::placeholder { color: rgba(255,255,255,.6); }
.newsletter-form input:focus {
  border-color: rgba(255,255,255,.5);
  background: rgba(255,255,255,.2);
}

.newsletter-form button {
  background: #fff;
  color: #1d4ed8;
  padding: .75rem 1.75rem;
  border-radius: 50px;
  border: none;
  font-family: var(--font-sans);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}
.newsletter-form button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,0,0,.2);
}

/* ---------- Categories Strip ---------- */
.categories-section {
  padding: clamp(2.5rem, 5vw, 4rem) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}

.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  display: block;
}

.category-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.category-icon {
  font-size: 1.75rem;
  margin-bottom: .5rem;
  display: block;
}

.category-card span:last-child {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* ---------- Sidebar Layout (Blog page) ---------- */
.blog-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 3rem;
  padding: clamp(2rem, 4vw, 3.5rem) 0 clamp(3rem, 6vw, 5rem);
  align-items: start;
}

.sidebar {
  position: sticky;
  top: calc(var(--nav-height) + 1.5rem);
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.sidebar-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.sidebar-widget h4 {
  margin-bottom: 1.1rem;
  padding-bottom: .75rem;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

.sidebar-search {
  position: relative;
}

.sidebar-search input {
  width: 100%;
  padding: .65rem 1rem .65rem 2.5rem;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: .9rem;
  outline: none;
  transition: border-color var(--transition);
}
.sidebar-search input:focus { border-color: var(--accent); }
.sidebar-search svg {
  position: absolute;
  left: .85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  width: 16px;
  height: 16px;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.sidebar-posts li {
  padding: .75rem 0;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  gap: .75rem;
  align-items: flex-start;
}
.sidebar-posts li:last-child { border-bottom: none; padding-bottom: 0; }

.sidebar-post-img {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-hero);
  overflow: hidden;
}
.sidebar-post-img img { width: 100%; height: 100%; object-fit: cover; }

.sidebar-post-info { flex: 1; }
.sidebar-post-info a {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  display: block;
  margin-bottom: .25rem;
  transition: color var(--transition);
}
.sidebar-post-info a:hover { color: var(--accent); }
.sidebar-post-info span {
  font-size: .77rem;
  color: var(--text-light);
}

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: 2.5rem 0;
  flex-wrap: wrap;
}

.pagination a, .pagination span {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 500;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  transition: all var(--transition);
}
.pagination a:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.pagination .active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ---------- Single Post ---------- */
.post-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  padding: clamp(2rem, 4vw, 3.5rem) 0 clamp(3rem, 6vw, 5rem);
  align-items: start;
}

.post-hero-img {
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 2.5rem;
  aspect-ratio: 21/9;
  display: flex;
}
.post-hero-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--bg-hero);
}

.post-header {
  margin-bottom: 2.5rem;
}

.post-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
  font-size: .85rem;
  color: var(--text-light);
}

.post-body {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--text-muted);
}

.post-body h2 {
  font-size: 1.6rem;
  color: var(--text);
  margin: 2.5rem 0 1rem;
}

.post-body h3 {
  font-size: 1.2rem;
  color: var(--text);
  margin: 2rem 0 .75rem;
}

.post-body p { margin-bottom: 1.5rem; }

.post-body ul, .post-body ol {
  margin: 1.25rem 0 1.5rem 1.5rem;
  color: var(--text-muted);
}
.post-body li { margin-bottom: .5rem; }
.post-body ul { list-style: disc; }
.post-body ol { list-style: decimal; }

.post-body blockquote {
  border-left: 3px solid var(--accent);
  margin: 2rem 0;
  padding: 1rem 1.5rem;
  background: var(--accent-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--text);
}

.post-body code {
  background: var(--border-light);
  padding: .15em .45em;
  border-radius: 4px;
  font-size: .9em;
  font-family: 'Fira Code', 'Courier New', monospace;
  color: var(--accent);
}

.post-body pre {
  background: #1a1a2e;
  color: #e8e8f0;
  padding: 1.5rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 2rem 0;
  font-size: .9rem;
  line-height: 1.6;
}
.post-body pre code {
  background: none;
  color: inherit;
  padding: 0;
}

.post-body img {
  border-radius: var(--radius);
  margin: 2rem auto;
  box-shadow: var(--shadow-md);
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.post-share {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.post-share span {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.share-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: .9rem;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}
.share-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.author-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  margin-top: 3rem;
}

.author-card .avatar-lg {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  overflow: hidden;
}
.author-card .avatar-lg img { width: 100%; height: 100%; object-fit: cover; }

.author-info h4 { margin-bottom: .35rem; }
.author-info .author-role {
  font-size: .8rem;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .6rem;
}
.author-info p { font-size: .9rem; margin-bottom: 1rem; }

/* ---------- About Page ---------- */
.page-hero {
  background: var(--bg-hero);
  padding: clamp(3rem, 6vw, 5rem) 0;
  text-align: center;
}
.page-hero p {
  font-size: 1.1rem;
  max-width: 600px;
  margin: 1rem auto 0;
}

.about-content {
  padding: clamp(3rem, 6vw, 5rem) 0;
}
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  margin-bottom: 4rem;
}
.about-grid.reverse { direction: rtl; }
.about-grid.reverse > * { direction: ltr; }

.about-img {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  aspect-ratio: 4/3;
}
.about-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-text h2 { margin-bottom: 1.25rem; }
.about-text p { margin-bottom: 1.25rem; font-size: 1rem; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1.5rem;
  margin: 3rem 0;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.25rem;
  text-align: center;
}
.stat-number {
  font-family: var(--font-serif);
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--accent);
  display: block;
  margin-bottom: .25rem;
}
.stat-label {
  font-size: .82rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ---------- Contact Page ---------- */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 4rem;
  padding: clamp(3rem, 6vw, 5rem) 0;
  align-items: start;
}

.contact-info h2 { margin-bottom: 1rem; }
.contact-info p { margin-bottom: 2rem; }

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.contact-icon {
  width: 42px;
  height: 42px;
  background: var(--accent-soft);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  color: var(--accent);
}
.contact-item h5 {
  font-size: .82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-light);
  margin-bottom: .25rem;
}
.contact-item p { font-size: .95rem; margin: 0; }

.contact-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
}

.form-group {
  margin-bottom: 1.25rem;
}
.form-group label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: .5rem;
  color: var(--text);
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: .75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: .95rem;
  outline: none;
  transition: border-color var(--transition);
  resize: vertical;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--accent);
}
.form-group textarea { min-height: 130px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ---------- Footer ---------- */
footer {
  background: var(--bg-footer);
  color: rgba(255,255,255,.7);
  padding: clamp(3rem, 6vw, 5rem) 0 2rem;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand .nav-logo { color: #fff; margin-bottom: 1rem; }
.footer-brand p {
  color: rgba(255,255,255,.55);
  font-size: .9rem;
  max-width: 280px;
  line-height: 1.7;
}

.footer-col h5 {
  font-family: var(--font-sans);
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255,255,255,.4);
  margin-bottom: 1.1rem;
}

.footer-col ul li {
  margin-bottom: .65rem;
}
.footer-col ul li a {
  color: rgba(255,255,255,.65);
  font-size: .9rem;
  transition: color var(--transition);
}
.footer-col ul li a:hover { color: #fff; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: .82rem;
  color: rgba(255,255,255,.4);
}

.social-links {
  display: flex;
  gap: .5rem;
}
.social-link {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.6);
  font-size: .85rem;
  transition: all var(--transition);
  text-decoration: none;
}
.social-link:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ---------- Placeholder image gradients ---------- */
.img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: linear-gradient(135deg, var(--accent-soft), var(--border));
}

.img-placeholder-1 { background: linear-gradient(135deg, #dbeafe, #bfdbfe); }
.img-placeholder-2 { background: linear-gradient(135deg, #d1fae5, #a7f3d0); }
.img-placeholder-3 { background: linear-gradient(135deg, #fce7f3, #fbcfe8); }
.img-placeholder-4 { background: linear-gradient(135deg, #fef3c7, #fde68a); }
.img-placeholder-5 { background: linear-gradient(135deg, #e0e7ff, #c7d2fe); }
.img-placeholder-6 { background: linear-gradient(135deg, #f3e8ff, #e9d5ff); }

[data-theme="dark"] .img-placeholder-1 { background: linear-gradient(135deg, #1e3a5f, #1e40af); }
[data-theme="dark"] .img-placeholder-2 { background: linear-gradient(135deg, #064e3b, #065f46); }
[data-theme="dark"] .img-placeholder-3 { background: linear-gradient(135deg, #4c1d47, #831843); }
[data-theme="dark"] .img-placeholder-4 { background: linear-gradient(135deg, #451a03, #78350f); }
[data-theme="dark"] .img-placeholder-5 { background: linear-gradient(135deg, #1e1b4b, #312e81); }
[data-theme="dark"] .img-placeholder-6 { background: linear-gradient(135deg, #2e1065, #4c1d95); }

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .82rem;
  color: var(--text-light);
  margin-bottom: 2rem;
}
.breadcrumb a {
  color: var(--accent);
  transition: opacity var(--transition);
}
.breadcrumb a:hover { opacity: .75; }
.breadcrumb span { color: var(--text-light); }

/* ---------- Back to top ---------- */
#backToTop {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 4px 16px rgba(37,99,235,.4);
  opacity: 0;
  transform: translateY(12px);
  transition: all var(--transition);
  z-index: 900;
}
#backToTop.visible { opacity: 1; transform: translateY(0); }
#backToTop:hover { transform: translateY(-2px); }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1a1a2e;
  color: #fff;
  padding: .75rem 1.5rem;
  border-radius: 50px;
  font-size: .9rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: all var(--transition);
  z-index: 9999;
  white-space: nowrap;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Progress bar ---------- */
#readProgress {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  height: 3px;
  background: var(--accent);
  width: 0%;
  z-index: 999;
  transition: width .1s linear;
}

/* ---------- Animations ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-up {
  animation: fadeUp .6s ease both;
}
.fade-up-d1 { animation-delay: .1s; }
.fade-up-d2 { animation-delay: .2s; }
.fade-up-d3 { animation-delay: .3s; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .blog-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .post-layout { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .nav-links, .nav-actions .btn { display: none; }
  .nav-hamburger { display: flex; }
  .nav-drawer { display: block; }

  .featured-card { grid-template-columns: 1fr; }
  .featured-card-img { min-height: 220px; }

  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
  .about-grid.reverse { direction: ltr; }

  .contact-layout { grid-template-columns: 1fr; }

  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }

  .form-row { grid-template-columns: 1fr; }
  .author-card { flex-direction: column; gap: 1rem; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .hero-cta { flex-direction: column; }
  .hero-cta .btn { width: 100%; justify-content: center; }
}
