/* =============================================================================
   Base Reset and Typography
   Variables are overridden dynamically by persona-styles.html partial
   ============================================================================= */

*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  /* Base colors - defaults, overridden by persona-styles.html */
  --color-bg: #faf9f6;
  --color-text: #2d2d2d;
  --color-accent: #c9a227;
  --color-link: #1a5f7a;
  --color-muted: #6b6b6b;

  /* Current persona color (set dynamically via body class in persona-styles) */
  --current-persona-color: var(--color-accent);

  /* Typography */
  --font-body: system-ui, -apple-system, sans-serif;
  --font-heading: Georgia, serif;
  --font-code: ui-monospace, SFMono-Regular, monospace;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 2rem;
  --space-xl: 4rem;

  /* Layout */
  --max-content-width: 800px;
  --max-nav-width: 1200px;
}

body {
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  margin: 0;
  padding: 0;
}

/* =============================================================================
   Typography
   ============================================================================= */

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.2;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-md);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }

a {
  color: var(--color-link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code, pre {
  font-family: var(--font-code);
}

/* =============================================================================
   Layout
   ============================================================================= */

.site-header {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 2px solid var(--current-persona-color, #eee);
  transition: border-color 0.3s ease;
}

.main-nav {
  max-width: var(--max-nav-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.site-logo {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--color-text);
}

.site-logo:hover {
  text-decoration: none;
  color: var(--current-persona-color, var(--color-accent));
}

.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--color-text);
  transition: color 0.2s ease;
}

.nav-links a.active {
  color: var(--current-persona-color, var(--color-accent));
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--current-persona-color, var(--color-accent));
  text-decoration: none;
}

/* Nav icons (emoji) */
.nav-icon {
  margin-right: 0.25em;
}

.site-main {
  max-width: var(--max-content-width);
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg);
}

/* =============================================================================
   Homepage
   ============================================================================= */

.home-hero {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.hero-tagline {
  font-size: 1.25rem;
  color: var(--color-muted);
}

/* =============================================================================
   Persona Cards (Dynamic)
   Card colors are set via inline style --persona-color from shortcode
   ============================================================================= */

.persona-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.persona-cards--list {
  grid-template-columns: 1fr;
}

.persona-cards--compact {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-md);
}

.card {
  padding: var(--space-lg);
  border-radius: 8px;
  background: white;
  border-left: 4px solid var(--persona-color, var(--color-accent));
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card__icon {
  font-size: 2rem;
  display: block;
  margin-bottom: var(--space-sm);
}

.card__title {
  margin-top: 0;
  margin-bottom: var(--space-sm);
}

.card__title a {
  color: var(--color-text);
}

.card__title a:hover {
  color: var(--persona-color, var(--color-accent));
  text-decoration: none;
}

.card__tagline {
  color: var(--color-muted);
  font-size: 0.9rem;
  margin: 0 0 var(--space-sm) 0;
  font-style: italic;
}

.card__description {
  margin: 0 0 var(--space-md) 0;
  font-size: 0.95rem;
}

.card__social {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.card__contact {
  display: inline-block;
  margin-top: var(--space-sm);
  font-size: 0.875rem;
  color: var(--color-muted);
}

.social-link {
  display: inline-block;
  padding: var(--space-xs) var(--space-sm);
  background: #f5f5f5;
  border-radius: 4px;
  font-size: 0.8rem;
  color: var(--color-text);
  transition: all 0.2s ease;
}

.social-link:hover {
  background: var(--persona-color, var(--color-accent));
  color: white;
  text-decoration: none;
}

/* =============================================================================
   Posts
   ============================================================================= */

.post-header {
  margin-bottom: var(--space-lg);
}

.post-title {
  margin-bottom: var(--space-sm);
  color: var(--current-persona-color, var(--color-text));
}

.post-meta {
  color: var(--color-muted);
  font-size: 0.9rem;
}

.post-persona {
  color: var(--current-persona-color, var(--color-accent));
}

.post-content {
  margin-bottom: var(--space-lg);
}

/*
 * Every image, not just the ones inside .post-content. The cover sits in a <figure class="post-image">
 * *outside* that container, so a scoped rule left it at intrinsic width and any photo wider than the column
 * broke the layout — which only shows up once there is a real photograph rather than a test file.
 */
img {
  max-width: 100%;
  height: auto;
}

.post-content img,
.post-image img {
  border-radius: 4px;
}

/* UA default <figure> margins are 40px each side; the cover should line up with the text, not indent from it. */
.post-image {
  margin: 0 0 var(--space-lg);
}

.post-image img {
  display: block;
  width: 100%;
}

/* Rendered as two bare links run together until now: no layout, no separation, no labels. */
.post-navigation {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
  border-top: 1px solid #eee;
  padding-top: var(--space-md);
  margin-top: var(--space-lg);
}

.post-navigation .next-post {
  margin-left: auto;
  text-align: right;
}

.post-footer {
  border-top: 1px solid #eee;
  padding-top: var(--space-lg);
  margin-top: var(--space-lg);
}

.post-tags a {
  display: inline-block;
  background: #f0f0f0;
  padding: var(--space-xs) var(--space-sm);
  border-radius: 4px;
  margin-right: var(--space-xs);
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.post-tags a:hover {
  background: var(--current-persona-color, var(--color-accent));
  color: white;
  text-decoration: none;
}

/* =============================================================================
   Post List
   ============================================================================= */

.post-list {
  margin-top: var(--space-xl);
}

.post-preview {
  padding: var(--space-md) 0;
  border-bottom: 1px solid #eee;
}

.post-preview h3 {
  margin: 0 0 var(--space-xs) 0;
  font-size: 1.25rem;
}

.post-preview time {
  font-size: 0.875rem;
  color: var(--color-muted);
}

.post-preview .post-persona {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* =============================================================================
   Syndication Links (POSSE)
   ============================================================================= */

.syndication-links {
  margin-top: var(--space-md);
  font-size: 0.9rem;
  color: var(--color-muted);
  background: #f8f8f8;
  border-radius: 8px;
  padding: var(--space-md);
}

.syndication-label {
  margin: 0 0 var(--space-sm) 0;
  font-weight: 500;
  color: var(--color-text);
}

.syndication-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.syndication-list li {
  display: inline-flex;
}

.syndication-list a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  border-radius: 4px;
  background: white;
  border: 1px solid #e0e0e0;
  font-size: 0.8rem;
  color: var(--color-text);
  transition: all 0.2s ease;
}

.syndication-list a:hover {
  text-decoration: none;
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: white;
}

/* Platform-specific syndication colors */
.syndication-bluesky:hover { background: #0085ff !important; border-color: #0085ff !important; }
.syndication-mastodon:hover { background: #563acc !important; border-color: #563acc !important; }
.syndication-threads:hover { background: #000000 !important; border-color: #000000 !important; }
.syndication-instagram:hover { background: #e4405f !important; border-color: #e4405f !important; }
.syndication-devto:hover { background: #0a0a0a !important; border-color: #0a0a0a !important; }
.syndication-linkedin:hover { background: #0077b5 !important; border-color: #0077b5 !important; }
.syndication-twitter:hover { background: #000000 !important; border-color: #000000 !important; }

.syndication-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.syndication-content {
  display: none;
}

/* =============================================================================
   Footer (Dynamic)
   ============================================================================= */

.site-footer {
  border-top: 1px solid #eee;
  padding: var(--space-xl) var(--space-lg);
  font-size: 0.9rem;
  color: var(--color-muted);
}

.footer-content {
  max-width: var(--max-nav-width);
  margin: 0 auto;
}

.footer-copyright {
  text-align: center;
  margin-bottom: var(--space-md);
}

.posse-note {
  font-size: 0.8rem;
  text-align: center;
  margin-bottom: var(--space-md);
}

.footer-personas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-md);
}

.footer-persona {
  text-align: center;
}

.footer-persona__name {
  display: block;
  font-weight: 500;
  margin-bottom: var(--space-xs);
  color: var(--color-text);
}

.footer-persona__links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  justify-content: center;
}

.footer-social {
  font-size: 0.8rem;
  color: var(--color-muted);
  transition: color 0.2s ease;
}

.footer-social:hover {
  text-decoration: none;
}

.footer-contact {
  text-align: center;
  margin-top: var(--space-md);
}

/* Legacy social-links class for backwards compatibility */
.social-links {
  list-style: none;
  padding: 0;
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

/* =============================================================================
   Responsive
   ============================================================================= */

@media (max-width: 768px) {
  .persona-cards {
    grid-template-columns: 1fr;
  }

  .footer-personas {
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 600px) {
  h1 { font-size: 2rem; }

  .site-main {
    padding: var(--space-lg) var(--space-md);
  }

  .nav-links {
    gap: var(--space-md);
  }

  .main-nav {
    flex-direction: column;
    text-align: center;
  }

  .card {
    padding: var(--space-md);
  }
}

/* =============================================================================
   Responsive Images
   ============================================================================= */

.responsive-image {
  max-width: 100%;
  height: auto;
  display: block;
}

.responsive-image.has-lqip {
  background-size: cover;
  background-position: center;
}

/* =============================================================================
   Figure
   ============================================================================= */

.figure {
  margin: var(--space-lg) 0;
  padding: 0;
}

.figure__image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}

.figure__caption {
  margin-top: var(--space-sm);
  font-size: 0.875rem;
  color: var(--color-muted);
  text-align: center;
}

.figure__caption-text {
  display: block;
}

.figure__credit {
  display: block;
  font-size: 0.8rem;
  font-style: italic;
  margin-top: var(--space-xs);
}

.figure__credit a {
  color: var(--color-muted);
}

.figure--lightbox a {
  cursor: zoom-in;
}

/* =============================================================================
   Gallery
   ============================================================================= */

.gallery {
  margin: var(--space-lg) 0;
}

.gallery__item {
  margin: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 4px;
  background: #f5f5f5;
}

.gallery__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.gallery__item:hover .gallery__image {
  transform: scale(1.05);
}

.gallery--lightbox .gallery__item a {
  display: block;
  cursor: zoom-in;
}

.gallery__caption {
  padding: var(--space-sm);
  font-size: 0.8rem;
  color: var(--color-muted);
  background: white;
}

.gallery__credit {
  display: block;
  font-size: 0.75rem;
  font-style: italic;
}

.gallery__empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--color-muted);
  padding: var(--space-xl);
}

/* =============================================================================
   Video
   ============================================================================= */

.video-wrapper {
  position: relative;
  width: 100%;
  margin: var(--space-lg) 0;
  background: #000;
  border-radius: 4px;
  overflow: hidden;
}

.video-iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-player {
  width: 100%;
  height: 100%;
  display: block;
}

/* =============================================================================
   Lightbox
   ============================================================================= */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox--open {
  opacity: 1;
  visibility: visible;
}

.lightbox__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  cursor: pointer;
}

.lightbox__container {
  position: relative;
  z-index: 1;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
  max-height: 85vh;
}

.lightbox__image {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 4px;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.lightbox__image--loading {
  opacity: 0.5;
}

.lightbox__caption {
  margin-top: var(--space-md);
  color: white;
  font-size: 0.9rem;
  text-align: center;
  max-width: 600px;
}

.lightbox__counter {
  position: absolute;
  bottom: var(--space-md);
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.8rem;
}

.lightbox__close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: var(--space-sm);
  opacity: 0.7;
  transition: opacity 0.2s ease;
  z-index: 2;
}

.lightbox__close:hover {
  opacity: 1;
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: var(--space-md);
  opacity: 0.7;
  transition: opacity 0.2s ease;
  z-index: 2;
}

.lightbox__nav:hover {
  opacity: 1;
}

.lightbox__nav--prev {
  left: var(--space-md);
}

.lightbox__nav--next {
  right: var(--space-md);
}

@media (max-width: 768px) {
  .lightbox__nav {
    padding: var(--space-sm);
  }

  .lightbox__nav--prev {
    left: var(--space-xs);
  }

  .lightbox__nav--next {
    right: var(--space-xs);
  }

  .lightbox__close {
    top: var(--space-sm);
    right: var(--space-sm);
  }
}

