/*!
 * Educa Theme — Lightweight, Modern & SEO-Optimized
 * Single CSS file replacing Bulma, Bootstrap, jQuery UI, etc.
 * Target: < 10KB
 */

/* ========================================
   1. CSS Custom Properties
   ======================================== */
:root {
  --c-primary: #16a34a;
  --c-primary-dark: #15803d;
  --c-primary-light: #dcfce7;
  --c-bg: #f8fafb;
  --c-surface: #ffffff;
  --c-text: #1e293b;
  --c-text-secondary: #64748b;
  --c-text-muted: #94a3b8;
  --c-border: #e2e8f0;
  --c-border-light: #f1f5f9;
  --c-dark: #0f172a;
  --c-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --c-shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --c-shadow-lg: 0 10px 30px rgba(0,0,0,.1);
  --radius: .5rem;
  --radius-lg: .75rem;
  --max-w: 1200px;
  --nav-h: 60px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --transition: .2s ease;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

img, video, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--c-primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--c-primary-dark); }
ul, ol { list-style: none; }
h1, h2, h3, h4, h5, h6 { line-height: 1.3; color: var(--c-text); font-weight: 700; }
h1 { font-size: clamp(1.5rem, 4vw, 2.25rem); }
h2 { font-size: clamp(1.25rem, 3vw, 1.5rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: .875rem; }

/* ========================================
   3. Layout
   ======================================== */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1rem;
  overflow: hidden;
}

.site-main {
  min-height: calc(100vh - var(--nav-h) - 120px);
  padding: 2rem 0;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  min-width: 0;
}

.content-grid > * {
  min-width: 0;
  overflow: hidden;
}

@media (min-width: 960px) {
  .content-grid {
    grid-template-columns: 1fr 300px;
  }
}

/* ========================================
   4. Navbar
   ======================================== */
.site-header {
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--c-text);
}

.nav-brand:hover { color: var(--c-primary); }

.nav-brand img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

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

.nav-links a {
  padding: .5rem .75rem;
  border-radius: var(--radius);
  color: var(--c-text-secondary);
  font-size: .875rem;
  font-weight: 500;
  transition: all var(--transition);
}

.nav-links a:hover {
  color: var(--c-primary);
  background: var(--c-primary-light);
}

/* Hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: .5rem;
  color: var(--c-text);
}

.nav-toggle svg { width: 24px; height: 24px; }

/* ========================================
   5. Cards Grid (Homepage)
   ======================================== */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}



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

.post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--c-shadow-lg);
}

.post-card__img {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  flex-shrink: 0;
}

.post-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}

.post-card:hover .post-card__img img {
  transform: scale(1.03);
}

.post-card__body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.post-card__title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: .5rem;
  line-height: 1.4;
}

.post-card__title a {
  color: var(--c-text);
}

.post-card__title a:hover {
  color: var(--c-primary);
}

.post-card__meta {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .8rem;
  color: var(--c-text-muted);
  margin-bottom: .75rem;
}

.post-card__meta svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.post-card__excerpt {
  font-size: .9rem;
  color: var(--c-text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

.post-card__cta {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  font-size: .8rem;
  font-weight: 600;
  color: var(--c-primary);
  padding: .375rem .75rem;
  border: 1px solid var(--c-primary);
  border-radius: var(--radius);
  transition: all var(--transition);
}

.post-card__cta:hover {
  background: var(--c-primary);
  color: #fff;
}

.post-card__cta svg {
  width: 14px;
  height: 14px;
}

/* ========================================
   6. Breadcrumb
   ======================================== */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  font-size: .85rem;
  color: var(--c-text-muted);
  margin-bottom: 1.5rem;
  padding: 0;
}

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

.breadcrumb a:hover {
  color: var(--c-primary);
}

.breadcrumb__sep {
  margin: 0 .25rem;
  color: var(--c-text-muted);
}

.breadcrumb__current {
  color: var(--c-text);
  font-weight: 500;
}

/* ========================================
   7. Article Content
   ======================================== */
.article-content {
  overflow: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
  margin: 1.75rem 0 .75rem;
}

.article-content p {
  margin-bottom: 1rem;
}

.article-content ul,
.article-content ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
  list-style: disc;
}

.article-content ol { list-style: decimal; }

.article-content li {
  margin-bottom: .375rem;
}

.article-content blockquote {
  border-left: 3px solid var(--c-primary);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  background: var(--c-border-light);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--c-text-secondary);
}

/* Force all images/embeds to fit container — overrides inline styles from CMS */
.article-content img,
.article-content iframe,
.article-content embed,
.article-content object,
.article-content video {
  max-width: 100% !important;
  height: auto !important;
  border-radius: var(--radius);
  margin: 1rem 0;
}

/* Tables: scrollable wrapper on mobile */
.article-content table {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-collapse: collapse;
  margin: 1rem 0;
}

.article-content th,
.article-content td {
  padding: .625rem .75rem;
  border: 1px solid var(--c-border);
  text-align: left;
  white-space: nowrap;
}

.article-content th {
  background: var(--c-border-light);
  font-weight: 600;
}

.article-content figure {
  margin: 1.5rem 0;
  overflow: hidden;
}

.article-content figcaption {
  font-size: .8rem;
  color: var(--c-text-muted);
  margin-top: .5rem;
  text-align: center;
}

/* Prevent any child from overflowing */
.article-content * {
  max-width: 100%;
}

/* ========================================
   8. Share Buttons
   ======================================== */
.share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 1.25rem 0;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  padding: .375rem .75rem;
  border-radius: var(--radius);
  font-size: .8rem;
  font-weight: 500;
  color: #fff;
  transition: opacity var(--transition);
}

.share-btn:hover { opacity: .85; color: #fff; }
.share-btn svg { width: 16px; height: 16px; fill: currentColor; }
.share-btn--fb { background: #1877f2; }
.share-btn--tg { background: #0088cc; }
.share-btn--wa { background: #25d366; }
.share-btn--tw { background: #1da1f2; }
.share-btn--email { background: var(--c-text-secondary); }



/* ========================================
   9. CTA Box
   ======================================== */
.cta-box {
  text-align: center;
  padding: 2rem;
  margin: 2rem 0;
  background: var(--c-primary-light);
  border-radius: var(--radius-lg);
  border: 1px solid #bbf7d0;
}

.cta-box p {
  font-style: italic;
  color: var(--c-text-secondary);
  margin-bottom: 1rem;
}

/* ========================================
   10. Buttons
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .625rem 1.25rem;
  border: none;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn--primary {
  background: var(--c-primary);
  color: #fff;
}

.btn--primary:hover {
  background: var(--c-primary-dark);
  color: #fff;
}

.btn--outline {
  background: transparent;
  color: var(--c-primary);
  border: 1px solid var(--c-primary);
}

.btn--outline:hover {
  background: var(--c-primary);
  color: #fff;
}

/* ========================================
   11. Tags
   ======================================== */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 1rem 0;
}

.tag {
  display: inline-block;
  padding: .25rem .625rem;
  font-size: .75rem;
  font-weight: 500;
  background: var(--c-primary-light);
  color: var(--c-primary-dark);
  border-radius: 9999px;
  transition: all var(--transition);
}

.tag:hover {
  background: var(--c-primary);
  color: #fff;
}

/* ========================================
   12. Author Box
   ======================================== */
.author-box {
  display: flex;
  gap: 1.25rem;
  padding: 1.5rem;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  margin: 2rem 0;
}

.author-box__avatar {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
}

.author-box__name {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: .375rem;
}

.author-box__bio {
  font-size: .875rem;
  color: var(--c-text-secondary);
  line-height: 1.6;
}



/* ========================================
   13. Sidebar
   ======================================== */
.sidebar-widget {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.sidebar-widget__title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: .75rem;
  border-bottom: 2px solid var(--c-primary);
}

.sidebar-list {
  display: flex;
  flex-direction: column;
}

.sidebar-list a {
  display: block;
  padding: .5rem 0;
  color: var(--c-text-secondary);
  font-size: .875rem;
  border-bottom: 1px solid var(--c-border-light);
  transition: all var(--transition);
}

.sidebar-list a:last-child { border-bottom: none; }

.sidebar-list a:hover {
  color: var(--c-primary);
  padding-left: .375rem;
}

/* ========================================
   14. Video Container
   ======================================== */
.video-container {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 1.5rem 0;
}

.video-container iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ========================================
   15. Image Gallery
   ======================================== */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.image-grid__item {
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--c-border);
}

.image-grid__item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform .3s ease;
}

.image-grid__item:hover img {
  transform: scale(1.05);
}

.image-grid__caption {
  font-size: .75rem;
  color: var(--c-text-muted);
  padding: .5rem;
  text-align: center;
}

/* ========================================
   16. Footer
   ======================================== */
.site-footer {
  background: var(--c-dark);
  color: #cbd5e1;
  padding: 2rem 0;
  margin-top: 3rem;
}

.footer-inner {
  text-align: center;
  font-size: .875rem;
}

.footer-inner a {
  color: #86efac;
}

.footer-inner a:hover {
  color: #4ade80;
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .25rem 1rem;
  margin-top: .75rem;
}

/* ========================================
   17. Back to Top
   ======================================== */
.back-to-top {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  width: 42px;
  height: 42px;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--c-primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--c-shadow-md);
  transition: all var(--transition);
  z-index: 90;
}

.back-to-top:hover {
  background: var(--c-primary-dark);
  transform: translateY(-2px);
}

.back-to-top.is-visible {
  display: flex;
}

.back-to-top svg {
  width: 20px;
  height: 20px;
}

/* ========================================
   18. 404 Page
   ======================================== */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 50vh;
  padding: 3rem 1rem;
}

.error-page__code {
  font-size: 6rem;
  font-weight: 800;
  color: var(--c-primary);
  line-height: 1;
  margin-bottom: .5rem;
}

.error-page__title {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.error-page__text {
  color: var(--c-text-secondary);
  margin-bottom: 2rem;
  max-width: 400px;
}

/* ========================================
   19. Static Pages
   ======================================== */
.page-content {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
}

.page-content h1 {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--c-primary);
}

.page-content h6 {
  font-size: 1rem;
  font-weight: 700;
  margin: 1.5rem 0 .5rem;
  color: var(--c-text);
}

.page-content p {
  margin-bottom: 1rem;
  color: var(--c-text-secondary);
  line-height: 1.7;
}

.page-content ul,
.page-content ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
  list-style: disc;
}

.page-content ol { list-style: decimal; }

.page-content li {
  margin-bottom: .375rem;
  color: var(--c-text-secondary);
}

.page-content a {
  color: var(--c-primary);
  text-decoration: underline;
}

/* Alert box for static pages */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  font-size: .9rem;
}

.alert--info {
  background: #fefce8;
  border: 1px solid #fde68a;
  color: #92400e;
}

/* ========================================
   20. Hero Image (Post)
   ======================================== */
.hero-figure {
  margin: 1.5rem 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.hero-figure img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.hero-figure figcaption {
  font-size: .8rem;
  color: var(--c-text-muted);
  padding: .75rem 0;
}

/* ========================================
   21. Load More
   ======================================== */
.load-more {
  text-align: center;
  margin: 2.5rem 0;
}

/* ========================================
   22. Utility Classes
   ======================================== */
.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;
}

.text-center { text-align: center; }
.text-muted { color: var(--c-text-muted); }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* ========================================
   23. Responsive — Tablet (≤ 960px)
   ======================================== */
@media (max-width: 960px) {
  /* Stack content + sidebar */
  .content-grid {
    grid-template-columns: 1fr;
  }

  /* Cards: 2 columns on tablet */
  .posts-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  /* Image gallery: 2 columns */
  .image-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Reduce main padding */
  .site-main {
    padding: 1.5rem 0;
  }
}

/* ========================================
   24. Responsive — Mobile (≤ 768px)
   ======================================== */
@media (max-width: 768px) {
  /* Navbar hamburger */
  .nav-toggle { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
    padding: .5rem 0;
    box-shadow: var(--c-shadow-md);
    z-index: 99;
  }

  .nav-links.is-open { display: flex; }

  .nav-links a {
    padding: .875rem 1.25rem;
    width: 100%;
    font-size: .95rem;
    border-bottom: 1px solid var(--c-border-light);
  }

  .nav-links a:last-child { border-bottom: none; }

  /* Typography scale down */
  h1 { font-size: 1.375rem; }
  h2 { font-size: 1.2rem; }
  h3 { font-size: 1.1rem; }

  /* Container tighter padding */
  .container {
    padding: 0 .875rem;
  }

  /* Main content less padding */
  .site-main {
    padding: 1rem 0;
  }

  /* Homepage cards: still 2 columns */
  .posts-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: .75rem;
  }

  .post-card__body {
    padding: 1rem;
  }

  .post-card__title {
    font-size: .95rem;
  }

  .post-card__excerpt {
    font-size: .825rem;
    -webkit-line-clamp: 2;
  }

  .post-card__meta {
    font-size: .75rem;
  }

  .post-card__cta {
    font-size: .75rem;
    padding: .3rem .6rem;
  }

  /* Share buttons: icon only */
  .share-btn span:not(.share-btn__icon) { display: none; }
  .share-btn {
    padding: .5rem;
    min-width: 36px;
    min-height: 36px;
    justify-content: center;
  }

  /* Author box stack */
  .author-box {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.25rem;
  }

  .author-box__avatar {
    width: 64px;
    height: 64px;
  }

  .author-box__bio {
    font-size: .8rem;
  }

  /* CTA box */
  .cta-box {
    padding: 1.25rem;
    margin: 1.5rem 0;
  }

  /* Page content */
  .page-content {
    padding: 1.25rem;
  }

  /* Footer */
  .site-footer {
    padding: 1.5rem 0;
    margin-top: 2rem;
  }

  .footer-links {
    flex-direction: column;
    align-items: center;
    gap: .5rem;
  }

  /* Image gallery: 2 columns */
  .image-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: .75rem;
  }

  /* Video container */
  .video-container {
    border-radius: var(--radius);
    margin: 1rem 0;
  }

  /* Hero figure */
  .hero-figure {
    margin: 1rem 0;
    border-radius: var(--radius);
  }

  /* Sidebar */
  .sidebar-widget {
    padding: 1rem;
  }

  /* Breadcrumb */
  .breadcrumb {
    font-size: .8rem;
    margin-bottom: 1rem;
  }

  /* 404 */
  .error-page__code {
    font-size: 4rem;
  }

  /* Back to top: larger touch target */
  .back-to-top {
    width: 44px;
    height: 44px;
    bottom: 1rem;
    right: 1rem;
  }

  /* Lightbox mobile */
  .lightbox__img {
    max-width: 96vw;
    max-height: 85vh;
    border-radius: var(--radius);
  }

  .lightbox__close {
    top: .75rem;
    right: .75rem;
    width: 44px;
    height: 44px;
  }

  .lightbox__caption {
    font-size: .75rem;
    max-width: 90vw;
    bottom: .75rem;
  }
}

/* ========================================
   25. Responsive — Small Mobile (≤ 480px)
   ======================================== */
@media (max-width: 480px) {
  /* Single column cards */
  .posts-grid {
    grid-template-columns: 1fr;
    gap: .875rem;
  }

  /* Card image shorter on small screens */
  .post-card__img {
    aspect-ratio: 16 / 9;
  }

  .post-card__body {
    padding: .875rem;
  }

  .post-card__title {
    font-size: .9rem;
  }

  .post-card__excerpt {
    -webkit-line-clamp: 3;
    font-size: .825rem;
  }

  /* Full width buttons on small screens */
  .btn {
    width: 100%;
    justify-content: center;
    padding: .75rem 1rem;
  }

  .post-card__cta {
    width: 100%;
    justify-content: center;
  }

  /* Image gallery: single column */
  .image-grid {
    grid-template-columns: 1fr;
  }

  /* Container edge-to-edge feel */
  .container {
    padding: 0 .75rem;
  }

  /* Article content tighter */
  .article-content p {
    font-size: .925rem;
  }

  .article-content h2 {
    font-size: 1.1rem;
  }

  .article-content h3 {
    font-size: 1rem;
  }

  /* Tags smaller */
  .tag {
    font-size: .7rem;
    padding: .2rem .5rem;
  }

  /* Page content tighter */
  .page-content {
    padding: 1rem;
    border-radius: var(--radius);
  }

  /* 404 smaller */
  .error-page {
    min-height: 40vh;
    padding: 2rem .75rem;
  }

  .error-page__code {
    font-size: 3.5rem;
  }

  .error-page__title {
    font-size: 1.25rem;
  }
}

/* ========================================
   26. Touch Target & Safe Area
   ======================================== */
@media (pointer: coarse) {
  /* Minimum 44px touch targets */
  .nav-links a,
  .sidebar-list a,
  .footer-links a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .share-btn {
    min-width: 44px;
    min-height: 44px;
  }
}

/* Safe area for notched phones */
@supports (padding: env(safe-area-inset-bottom)) {
  .site-footer {
    padding-bottom: calc(2rem + env(safe-area-inset-bottom));
  }

  .back-to-top {
    bottom: calc(1rem + env(safe-area-inset-bottom));
  }
}

/* ========================================
   27. Focus & Accessibility
   ======================================== */
*:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

/* ========================================
   24. Print
   ======================================== */
@media print {
  .site-header,
  .site-footer,
  .back-to-top,
  .share-buttons,
  .btn,
  .sidebar-widget,
  .nav-toggle { display: none !important; }

  body { background: #fff; color: #000; }

  .post-card {
    border: 1px solid #ccc;
    box-shadow: none;
    break-inside: avoid;
  }
}

/* ========================================
   25. Lightbox
   ======================================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.85);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
  cursor: zoom-out;
}

.lightbox.is-active {
  opacity: 1;
  visibility: visible;
}

.lightbox__img {
  max-width: 92vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 8px 40px rgba(0,0,0,.4);
  transform: scale(.92);
  transition: transform .25s ease;
}

.lightbox.is-active .lightbox__img {
  transform: scale(1);
}

.lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.15);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  transition: background var(--transition);
}

.lightbox__close:hover {
  background: rgba(255,255,255,.3);
}

.lightbox__caption {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  color: #e2e8f0;
  font-size: .85rem;
  text-align: center;
  max-width: 80vw;
  padding: .5rem 1rem;
  background: rgba(0,0,0,.5);
  border-radius: var(--radius);
}

/* Make lightbox trigger images show pointer */
[data-lightbox] {
  cursor: zoom-in;
}

/* ========================================
   26. Reduced Motion
   ======================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
