/*
Theme Name: Brian Ragle
Theme URI: https://brianragle.com
Author: Brian Ragle
Author URI: https://brianragle.com
Description: Custom dark editorial theme for photography and writing — built for brianragle.com and vagabondvisions.studio.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: brianragle
Tags: photography, dark, editorial, portfolio, writing, custom-menu, featured-images, wide-blocks
*/

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  /* Color palette */
  --bg:            #111111;
  --bg-surface:    #1a1a1a;
  --bg-elevated:   #222222;
  --bg-hover:      #2a2a2a;
  --border:        #282828;
  --border-light:  #333333;

  --text:          #e8e6e1;
  --text-muted:    #888888;
  --text-faint:    #555555;

  --accent:        #c8a97a;
  --accent-hover:  #d9bc91;
  --accent-dim:    rgba(200, 169, 122, 0.15);

  --white:         #ffffff;
  --black:         #000000;

  /* Typography */
  --font-body:     'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-display:  'Cormorant Garamond', 'Georgia', 'Times New Roman', serif;
  --font-mono:     'JetBrains Mono', 'Fira Code', 'Courier New', monospace;

  /* Type scale */
  --text-xs:    0.75rem;    /* 12px */
  --text-sm:    0.875rem;   /* 14px */
  --text-base:  1rem;       /* 16px */
  --text-lg:    1.125rem;   /* 18px */
  --text-xl:    1.25rem;    /* 20px */
  --text-2xl:   1.5rem;     /* 24px */
  --text-3xl:   1.875rem;   /* 30px */
  --text-4xl:   2.25rem;    /* 36px */
  --text-5xl:   3rem;       /* 48px */
  --text-6xl:   3.75rem;    /* 60px */
  --text-7xl:   4.5rem;     /* 72px */

  /* Spacing */
  --space-1:   0.25rem;
  --space-2:   0.5rem;
  --space-3:   0.75rem;
  --space-4:   1rem;
  --space-5:   1.25rem;
  --space-6:   1.5rem;
  --space-8:   2rem;
  --space-10:  2.5rem;
  --space-12:  3rem;
  --space-16:  4rem;
  --space-20:  5rem;
  --space-24:  6rem;
  --space-32:  8rem;

  /* Layout */
  --container-max:    1400px;
  --content-max:      780px;
  --wide-max:         1100px;
  --nav-height:       64px;

  /* Transitions */
  --ease:       cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out:   cubic-bezier(0, 0, 0.2, 1);
  --duration:   200ms;
  --duration-slow: 400ms;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
  --shadow:     0 4px 6px rgba(0,0,0,0.4), 0 2px 4px rgba(0,0,0,0.3);
  --shadow-lg:  0 10px 25px rgba(0,0,0,0.5), 0 4px 10px rgba(0,0,0,0.3);
  --shadow-xl:  0 20px 50px rgba(0,0,0,0.6);

  /* Radius */
  --radius-sm:  2px;
  --radius:     4px;
  --radius-lg:  8px;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  background: var(--accent);
  color: var(--black);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  z-index: 9999;
  border-radius: var(--radius);
  transition: top var(--duration) var(--ease);
}
.skip-link:focus {
  top: var(--space-4);
}

/* Selection */
::selection {
  background: var(--accent-dim);
  color: var(--accent);
}

/* Focus */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
}

input, textarea, select {
  font: inherit;
  color: inherit;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
}

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

/* ============================================================
   TYPOGRAPHY — BASE ELEMENTS
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--text);
}

h1 { font-size: clamp(var(--text-4xl), 5vw, var(--text-7xl)); }
h2 { font-size: clamp(var(--text-3xl), 3.5vw, var(--text-5xl)); }
h3 { font-size: clamp(var(--text-2xl), 2.5vw, var(--text-4xl)); }
h4 { font-size: clamp(var(--text-xl), 2vw, var(--text-3xl)); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p {
  margin-bottom: var(--space-6);
  color: var(--text);
}
p:last-child { margin-bottom: 0; }

a:not([class]) {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color var(--duration) var(--ease);
}
a:not([class]):hover { color: var(--accent-hover); }

strong, b { font-weight: 600; }
em, i { font-style: italic; }

blockquote {
  border-left: 2px solid var(--accent);
  padding: var(--space-4) var(--space-6);
  margin: var(--space-8) 0;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-style: italic;
  line-height: 1.5;
}
blockquote cite {
  display: block;
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  font-style: normal;
  color: var(--text-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-elevated);
  padding: 0.1em 0.4em;
  border-radius: var(--radius-sm);
  color: var(--accent);
}

pre {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  overflow-x: auto;
  margin: var(--space-8) 0;
}
pre code {
  background: none;
  padding: 0;
  color: var(--text);
}

/* ============================================================
   LAYOUT UTILITIES
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.container--content {
  max-width: var(--content-max);
}

.container--wide {
  max-width: var(--wide-max);
}

@media (min-width: 768px) {
  .container { padding-inline: var(--space-10); }
}
@media (min-width: 1200px) {
  .container { padding-inline: var(--space-16); }
}

/* ============================================================
   SITE HEADER & NAVIGATION
   ============================================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  background: rgba(17, 17, 17, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--duration) var(--ease), background var(--duration) var(--ease);
}

.site-header.scrolled {
  border-bottom-color: var(--border);
  background: rgba(17, 17, 17, 0.97);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-8);
}

/* Logo / Site title */
.site-branding {
  flex-shrink: 0;
}

.site-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--text);
  transition: color var(--duration) var(--ease);
}
.site-title:hover { color: var(--accent); }

/* Primary navigation */
.main-navigation {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.nav-menu li { position: relative; }

.nav-menu a {
  font-size: var(--text-sm);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color var(--duration) var(--ease);
  padding: var(--space-1) 0;
}
.nav-menu a:hover,
.nav-menu .current-menu-item > a,
.nav-menu .current_page_item > a {
  color: var(--text);
}
.nav-menu .current-menu-item > a::after,
.nav-menu .current_page_item > a::after {
  content: '';
  display: block;
  height: 1px;
  background: var(--accent);
  margin-top: 2px;
}

/* Dropdown */
.nav-menu .sub-menu {
  display: none;
  position: absolute;
  top: calc(100% + var(--space-4));
  left: 50%;
  transform: translateX(-50%);
  min-width: 180px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-2) 0;
  box-shadow: var(--shadow-lg);
  flex-direction: column;
}
.nav-menu li:hover > .sub-menu,
.nav-menu li:focus-within > .sub-menu {
  display: flex;
}
.nav-menu .sub-menu a {
  display: block;
  padding: var(--space-2) var(--space-5);
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: var(--text-sm);
}
.nav-menu .sub-menu a:hover { background: var(--bg-hover); }

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 28px;
  padding: var(--space-2);
}
.menu-toggle span {
  display: block;
  height: 1px;
  background: var(--text);
  transition: transform var(--duration) var(--ease), opacity var(--duration) var(--ease), width var(--duration) var(--ease);
}
.menu-toggle.active span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle.active span:nth-child(2) { opacity: 0; width: 0; }
.menu-toggle.active span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Nav search link (optional) */
.nav-search-link {
  color: var(--text-muted);
  transition: color var(--duration) var(--ease);
}
.nav-search-link:hover { color: var(--text); }
.nav-search-link svg { width: 18px; height: 18px; }

@media (max-width: 768px) {
  .menu-toggle { display: flex; }

  .nav-menu-wrapper {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(17,17,17,0.98);
    backdrop-filter: blur(16px);
    padding: var(--space-12) var(--space-6);
    overflow-y: auto;
    z-index: 99;
  }
  .nav-menu-wrapper.open { display: block; }

  .nav-menu {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-1);
  }
  .nav-menu a {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    letter-spacing: 0.01em;
    text-transform: none;
    color: var(--text);
    padding: var(--space-3) 0;
  }
  .nav-menu a:hover { color: var(--accent); }
  .nav-menu .sub-menu {
    position: static;
    transform: none;
    display: flex;
    background: none;
    border: none;
    box-shadow: none;
    padding: var(--space-2) 0 var(--space-2) var(--space-4);
  }
  .nav-menu .sub-menu a {
    font-family: var(--font-body);
    font-size: var(--text-base);
    padding: var(--space-1) 0;
    color: var(--text-muted);
  }
}

/* ============================================================
   SITE FOOTER
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--space-16) 0 var(--space-8);
  margin-top: var(--space-32);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-8);
  align-items: end;
  margin-bottom: var(--space-8);
}

.footer-brand .site-title {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-2);
  display: block;
}

.footer-tagline {
  color: var(--text-faint);
  font-size: var(--text-sm);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.footer-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-2);
}

.footer-nav a {
  font-size: var(--text-sm);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  transition: color var(--duration) var(--ease);
}
.footer-nav a:hover { color: var(--text); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border);
  font-size: var(--text-xs);
  color: var(--text-faint);
  letter-spacing: 0.04em;
}

@media (max-width: 640px) {
  .footer-inner {
    grid-template-columns: 1fr;
  }
  .footer-nav {
    align-items: flex-start;
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--space-3) var(--space-6);
  }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ============================================================
   PAGE WRAPPER / MAIN CONTENT
   ============================================================ */
.site-main {
  padding-top: var(--nav-height);
  min-height: 60vh;
}

/* ============================================================
   HERO / FRONT PAGE
   ============================================================ */
.hero {
  position: relative;
  min-height: 90vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--bg);
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-media img,
.hero-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Slideshow slides — stack on top of each other, fade in/out */
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.5s ease;
}
.hero-slide.active {
  opacity: 1;
}
.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.hero-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(17,17,17,0.95) 0%,
    rgba(17,17,17,0.5) 40%,
    rgba(17,17,17,0.1) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: var(--space-20) 0 var(--space-16);
}

.hero-eyebrow {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-4);
}

.hero-title {
  font-size: clamp(var(--text-4xl), 6vw, 7rem);
  font-weight: 300;
  line-height: 1.05;
  max-width: 900px;
  margin-bottom: var(--space-6);
}

.hero-description {
  font-size: var(--text-lg);
  color: var(--text-muted);
  max-width: 560px;
  margin-bottom: var(--space-10);
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* Static hero (no image) */
.hero--static {
  min-height: 50vh;
  background: var(--bg);
  align-items: center;
}
.hero--static .hero-media { display: none; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: var(--radius);
  transition: all var(--duration) var(--ease);
  text-decoration: none;
  line-height: 1;
}

.btn--primary {
  background: var(--accent);
  color: var(--black);
}
.btn--primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(200, 169, 122, 0.3);
}

.btn--ghost {
  border: 1px solid var(--border-light);
  color: var(--text);
}
.btn--ghost:hover {
  border-color: var(--text-muted);
  background: var(--bg-hover);
}

.btn--text {
  color: var(--accent);
  padding-inline: 0;
}
.btn--text:hover { color: var(--accent-hover); }
.btn--text::after {
  content: '→';
  transition: transform var(--duration) var(--ease);
}
.btn--text:hover::after { transform: translateX(4px); }

/* ============================================================
   SECTION LABELS & DIVIDERS
   ============================================================ */
.section-label {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-10);
}

.section-label__text {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-faint);
  white-space: nowrap;
}

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

/* ============================================================
   POST CARDS — GRID
   ============================================================ */
.posts-grid {
  display: grid;
  gap: var(--space-8);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr));
}

.posts-grid--featured {
  grid-template-columns: repeat(12, 1fr);
}
.posts-grid--featured .post-card:first-child {
  grid-column: span 7;
}
.posts-grid--featured .post-card:not(:first-child) {
  grid-column: span 5;
}
@media (max-width: 900px) {
  .posts-grid--featured .post-card:first-child,
  .posts-grid--featured .post-card:not(:first-child) {
    grid-column: span 12;
  }
}

.post-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--duration) var(--ease), transform var(--duration-slow) var(--ease-out);
}
.post-card:hover {
  border-color: var(--border-light);
  transform: translateY(-3px);
}

.post-card__image {
  aspect-ratio: 16/10;
  overflow: hidden;
  background: var(--bg-elevated);
}
.post-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease-out);
}
.post-card:hover .post-card__image img {
  transform: scale(1.03);
}

.post-card__body {
  flex: 1;
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.post-card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.post-card__meta .cat-link {
  color: var(--accent);
  transition: color var(--duration) var(--ease);
}
.post-card__meta .cat-link:hover { color: var(--accent-hover); }
.post-card__meta .sep { opacity: 0.4; }

.post-card__title {
  font-size: var(--text-xl);
  line-height: 1.25;
  margin: 0;
}
.post-card__title a {
  color: var(--text);
  transition: color var(--duration) var(--ease);
}
.post-card__title a:hover { color: var(--accent); }

.post-card__excerpt {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.65;
  flex: 1;
  margin: 0;
}

.post-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-2);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.read-time {
  font-size: var(--text-xs);
  color: var(--text-faint);
  letter-spacing: 0.05em;
}

/* ============================================================
   FRONT PAGE SECTIONS
   ============================================================ */
.front-page-section {
  padding: var(--space-20) 0;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-6);
  margin-bottom: var(--space-10);
}

.section-header h2 {
  font-size: clamp(var(--text-2xl), 3vw, var(--text-4xl));
  font-weight: 300;
}

/* ============================================================
   SINGLE POST
   ============================================================ */
.post-header {
  padding: var(--space-20) 0 var(--space-16);
  text-align: left;
}

.post-header__meta {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.post-header__meta a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--duration) var(--ease);
}
.post-header__meta a:hover { color: var(--accent-hover); }
.post-header__meta .sep { opacity: 0.4; }

.post-header__title {
  font-size: clamp(var(--text-4xl), 5.5vw, 5.5rem);
  font-weight: 300;
  line-height: 1.05;
  max-width: 900px;
  margin-bottom: var(--space-6);
}

.post-header__subtitle {
  font-size: var(--text-xl);
  color: var(--text-muted);
  font-family: var(--font-display);
  font-style: italic;
  max-width: 680px;
  line-height: 1.5;
}

.post-featured-image {
  width: 100%;
  max-height: 70vh;
  overflow: hidden;
  margin-bottom: var(--space-16);
}
.post-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Post content */
.post-content {
  max-width: var(--content-max);
  margin-inline: auto;
}

.post-content > * { margin-bottom: var(--space-6); }
.post-content > *:last-child { margin-bottom: 0; }

.post-content h2 {
  font-size: clamp(var(--text-2xl), 3vw, var(--text-4xl));
  margin-top: var(--space-12);
  margin-bottom: var(--space-4);
}
.post-content h3 {
  font-size: clamp(var(--text-xl), 2vw, var(--text-3xl));
  margin-top: var(--space-10);
  margin-bottom: var(--space-3);
}
.post-content h4 {
  font-size: var(--text-xl);
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
}

.post-content p {
  font-size: clamp(var(--text-base), 1.1vw, var(--text-lg));
  line-height: 1.8;
  color: var(--text);
}

.post-content ul,
.post-content ol {
  margin: var(--space-4) 0 var(--space-6) var(--space-6);
  list-style: revert;
}
.post-content li {
  margin-bottom: var(--space-2);
  line-height: 1.7;
}

.post-content img {
  width: 100%;
  border-radius: var(--radius-lg);
  margin: var(--space-8) 0;
}

/* Wide and full-width images inside content */
.post-content .alignwide {
  width: calc(100% + 200px);
  max-width: var(--wide-max);
  margin-inline: calc(-100px);
}
.post-content .alignfull {
  width: 100vw;
  max-width: none;
  margin-inline: calc(50% - 50vw);
}

@media (max-width: 900px) {
  .post-content .alignwide {
    width: 100%;
    margin-inline: 0;
  }
}

.post-content figure {
  margin: var(--space-8) 0;
}
.post-content figcaption {
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-faint);
  text-align: center;
  font-style: italic;
  letter-spacing: 0.02em;
}

/* Gallery inside post content */
.post-content .wp-block-gallery {
  width: calc(100% + 200px);
  margin-inline: calc(-100px);
  margin-block: var(--space-10);
}
@media (max-width: 900px) {
  .post-content .wp-block-gallery {
    width: 100%;
    margin-inline: 0;
  }
}

/* Post footer */
.post-footer {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-top: var(--space-12);
  margin-top: var(--space-12);
  border-top: 1px solid var(--border);
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-8);
}

.tag-link {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  transition: all var(--duration) var(--ease);
}
.tag-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Post navigation */
.post-navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  padding-top: var(--space-8);
  border-top: 1px solid var(--border);
  margin-top: var(--space-8);
}

.post-nav-link {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color var(--duration) var(--ease), background var(--duration) var(--ease);
}
.post-nav-link:hover {
  border-color: var(--border-light);
  background: var(--bg-surface);
}
.post-nav-link--next { text-align: right; }

.post-nav-label {
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.post-nav-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--text);
  line-height: 1.3;
}

@media (max-width: 560px) {
  .post-navigation { grid-template-columns: 1fr; }
  .post-nav-link--next { text-align: left; }
}

/* ============================================================
   PORTFOLIO / GALLERY
   ============================================================ */
.portfolio-header {
  padding: var(--space-24) 0 var(--space-16);
}
.portfolio-header h1 {
  font-weight: 300;
  margin-bottom: var(--space-4);
}
.portfolio-header p {
  color: var(--text-muted);
  font-size: var(--text-lg);
  max-width: 560px;
}

.portfolio-filters {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-10);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--border);
}

.filter-btn {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--text-faint);
  transition: all var(--duration) var(--ease);
}
.filter-btn:hover,
.filter-btn.active {
  border-color: var(--border-light);
  color: var(--text);
}
.filter-btn.active {
  background: var(--bg-elevated);
}

/* Masonry / photo grid */
.photo-grid {
  columns: 3;
  column-gap: var(--space-3);
}
@media (max-width: 900px) { .photo-grid { columns: 2; } }
@media (max-width: 560px) { .photo-grid { columns: 1; } }

.photo-item {
  break-inside: avoid;
  margin-bottom: var(--space-3);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-surface);
  border-radius: var(--radius);
}

.photo-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform var(--duration-slow) var(--ease-out), filter var(--duration) var(--ease);
}
.photo-item:hover img {
  transform: scale(1.02);
  filter: brightness(0.85);
}

.photo-item__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(17,17,17,0.85) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--duration) var(--ease);
  display: flex;
  align-items: flex-end;
  padding: var(--space-4);
}
.photo-item:hover .photo-item__overlay { opacity: 1; }

.photo-item__caption {
  font-size: var(--text-sm);
  color: var(--text);
  line-height: 1.4;
}

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.96);
  align-items: center;
  justify-content: center;
}
.lightbox.open { display: flex; }

.lightbox-inner {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 82vh;
  object-fit: contain;
  border-radius: var(--radius);
}

.lightbox-caption {
  margin-top: var(--space-3);
  color: var(--text-muted);
  font-size: var(--text-sm);
  text-align: center;
  font-style: italic;
}

.lightbox-close {
  position: fixed;
  top: var(--space-6);
  right: var(--space-6);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-light);
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 20px;
  transition: all var(--duration) var(--ease);
  z-index: 1001;
}
.lightbox-close:hover {
  background: var(--bg-elevated);
  color: var(--text);
  border-color: var(--text-muted);
}

.lightbox-prev,
.lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-light);
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 20px;
  transition: all var(--duration) var(--ease);
  z-index: 1001;
}
.lightbox-prev { left: var(--space-6); }
.lightbox-next { right: var(--space-6); }
.lightbox-prev:hover,
.lightbox-next:hover {
  background: var(--bg-elevated);
  color: var(--text);
  border-color: var(--text-muted);
}

@media (max-width: 640px) {
  .lightbox-prev { left: var(--space-3); }
  .lightbox-next { right: var(--space-3); }
  .lightbox-close { top: var(--space-3); right: var(--space-3); }
}

/* ============================================================
   ARCHIVE / WRITING LIST
   ============================================================ */
.archive-header {
  padding: var(--space-24) 0 var(--space-12);
}
.archive-header__eyebrow {
  font-size: var(--text-xs);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-4);
}
.archive-header h1 {
  font-weight: 300;
  margin-bottom: var(--space-4);
}
.archive-header p {
  color: var(--text-muted);
  font-size: var(--text-lg);
  max-width: 560px;
}

/* Writing list — editorial style */
.writing-list {
  display: flex;
  flex-direction: column;
}

.writing-item {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: var(--space-6) var(--space-8);
  align-items: baseline;
  padding: var(--space-6) 0;
  border-bottom: 1px solid var(--border);
  transition: background var(--duration) var(--ease);
}
.writing-item:first-child { border-top: 1px solid var(--border); }

.writing-item__date {
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding-top: 3px;
}

.writing-item__content {}

.writing-item__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: var(--space-2);
}
.writing-item__title a {
  color: var(--text);
  transition: color var(--duration) var(--ease);
}
.writing-item__title a:hover { color: var(--accent); }

.writing-item__excerpt {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

.writing-item__cat {
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
  transition: color var(--duration) var(--ease);
}
.writing-item__cat:hover { color: var(--accent-hover); }

@media (max-width: 768px) {
  .writing-item {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }
  .writing-item__date { padding-top: 0; }
  .writing-item__cat { order: -1; }
}

/* ============================================================
   SEARCH
   ============================================================ */
.search-form {
  position: relative;
  max-width: 560px;
  margin-bottom: var(--space-10);
}
.search-form input[type="search"] {
  width: 100%;
  padding: var(--space-4) var(--space-12) var(--space-4) var(--space-5);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  font-size: var(--text-base);
  color: var(--text);
  transition: border-color var(--duration) var(--ease);
}
.search-form input[type="search"]:focus {
  border-color: var(--accent);
  outline: none;
}
.search-form button {
  position: absolute;
  right: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  transition: color var(--duration) var(--ease);
}
.search-form button:hover { color: var(--accent); }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-16) 0 var(--space-8);
}

.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding-inline: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  color: var(--text-muted);
  transition: all var(--duration) var(--ease);
}
.page-numbers:hover { border-color: var(--border-light); color: var(--text); }
.page-numbers.current {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--black);
}
.page-numbers.dots { border-color: transparent; }

/* ============================================================
   STATIC PAGE
   ============================================================ */
.page-header {
  padding: var(--space-24) 0 var(--space-12);
}
.page-header h1 { font-weight: 300; }

.page-content {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-bottom: var(--space-24);
}

/* ============================================================
   404
   ============================================================ */
.error-404 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  padding: var(--space-20);
}
.error-404__code {
  font-family: var(--font-display);
  font-size: clamp(6rem, 15vw, 12rem);
  font-weight: 300;
  color: var(--bg-elevated);
  line-height: 1;
  user-select: none;
}
.error-404 h1 {
  margin-top: var(--space-4);
  font-size: var(--text-3xl);
  font-weight: 300;
}
.error-404 p {
  color: var(--text-muted);
  margin: var(--space-4) 0 var(--space-8);
}

/* ============================================================
   WORDPRESS BLOCK EDITOR COMPATIBILITY
   ============================================================ */
.wp-block-image img { border-radius: var(--radius-lg); }
.wp-block-image figcaption {
  color: var(--text-faint);
  font-size: var(--text-sm);
  font-style: italic;
  text-align: center;
}

.wp-block-separator {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-10) auto;
}
.wp-block-separator.is-style-wide { max-width: 100%; }
.wp-block-separator.is-style-dots {
  border: none;
  text-align: center;
  color: var(--text-faint);
  letter-spacing: 0.5em;
}
.wp-block-separator.is-style-dots::before {
  content: '· · ·';
}

.wp-block-pullquote {
  border: none;
  padding: var(--space-10) 0;
  text-align: center;
}
.wp-block-pullquote blockquote {
  border: none;
  font-size: clamp(var(--text-xl), 2.5vw, var(--text-3xl));
  color: var(--text);
  max-width: 820px;
  margin-inline: auto;
}

.wp-block-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.wp-block-table th,
.wp-block-table td {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  text-align: left;
}
.wp-block-table th {
  background: var(--bg-surface);
  font-weight: 600;
  letter-spacing: 0.05em;
}
.wp-block-table tr:hover td { background: var(--bg-surface); }

/* ============================================================
   COMMENTS
   ============================================================ */
.comments-area {
  max-width: var(--content-max);
  margin-inline: auto;
  padding: var(--space-16) 0;
  border-top: 1px solid var(--border);
}
.comments-title {
  font-size: var(--text-2xl);
  font-weight: 300;
  margin-bottom: var(--space-8);
}
.comment-list { list-style: none; }
.comment {
  padding: var(--space-6) 0;
  border-bottom: 1px solid var(--border);
}
.comment-author { font-weight: 500; margin-bottom: var(--space-1); }
.comment-metadata {
  font-size: var(--text-xs);
  color: var(--text-faint);
  letter-spacing: 0.05em;
  margin-bottom: var(--space-3);
}
.comment-body p { font-size: var(--text-sm); color: var(--text-muted); }
.comment-respond { margin-top: var(--space-10); }
.comment-form label {
  display: block;
  font-size: var(--text-sm);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: var(--space-2);
}
.comment-form input,
.comment-form textarea {
  display: block;
  width: 100%;
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color var(--duration) var(--ease);
}
.comment-form input:focus,
.comment-form textarea:focus {
  border-color: var(--accent);
  outline: none;
}
.comment-form textarea { min-height: 140px; resize: vertical; }
.comment-form .submit {
  background: var(--accent);
  color: var(--black);
  padding: var(--space-3) var(--space-8);
  border-radius: var(--radius);
  font-weight: 500;
  font-size: var(--text-sm);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background var(--duration) var(--ease);
  cursor: pointer;
  border: none;
}
.comment-form .submit:hover { background: var(--accent-hover); }

/* ============================================================
   RESPONSIVE UTILITIES
   ============================================================ */
@media (max-width: 640px) {
  .hide-mobile { display: none !important; }
}
@media (min-width: 641px) {
  .show-mobile-only { display: none !important; }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.animate-fade-up { animation: fadeUp 0.6s var(--ease-out) both; }
.animate-fade-in { animation: fadeIn 0.4s var(--ease-out) both; }

[data-animate] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}
[data-animate].in-view {
  opacity: 1;
  transform: none;
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */
@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;
  }
  [data-animate] {
    opacity: 1;
    transform: none;
  }
}

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}
.screen-reader-text:focus {
  background-color: var(--bg-elevated);
  clip: auto !important;
  clip-path: none;
  color: var(--text);
  display: block;
  font-size: var(--text-sm);
  height: auto;
  left: var(--space-4);
  padding: var(--space-2) var(--space-4);
  top: var(--space-4);
  width: auto;
  z-index: 100000;
}

/* High contrast mode */
@media (prefers-contrast: more) {
  :root {
    --text: #ffffff;
    --text-muted: #cccccc;
    --border: #555555;
    --border-light: #777777;
  }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  .site-header, .site-footer, .post-navigation,
  .lightbox, .menu-toggle { display: none !important; }
  body { background: white; color: black; }
  .post-content { max-width: 100%; }
  a { color: black; text-decoration: underline; }
}
