/* ============================================================
   BLOG STYLES
   Uses the custom properties defined in style.css.
   ============================================================ */

/* ------------------------------------------------------------
   1. NAV — solid look on blog pages
   ------------------------------------------------------------ */

body.blog-page #navbar {
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.blog-main {
  padding: 7rem 1.5rem 5rem;
}

@media (min-width: 1024px) {
  .blog-main {
    padding: 9rem 2rem 7rem;
  }
}

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

/* ------------------------------------------------------------
   2. BLOG LIST
   ------------------------------------------------------------ */

.blog-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.blog-header h1 {
  display: inline-block;
  position: relative;
  font-size: 2.4rem;
  margin-bottom: 0.75rem;
  padding-bottom: 1.25rem;
}

.blog-header h1::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 2px;
  background: var(--teal);
  box-shadow: 0 0 12px var(--teal);
  border-radius: 2px;
}

.blog-header p {
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto;
}

@media (min-width: 1024px) {
  .blog-header h1 {
    font-size: 3.2rem;
  }
}

.post-card {
  display: flex;
  flex-direction: column;
}

.post-card-image {
  display: flex;
}

.post-placeholder {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, var(--teal-lt) 0%, transparent 55%),
    var(--surface-alt);
  border-bottom: 2px solid var(--teal-border);
}

.post-card-info {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.post-card-info h2 {
  font-size: 1.1rem;
  line-height: 1.4;
  margin-bottom: 0.4rem;
}

.post-card-info h2 a {
  color: var(--text-primary);
  transition: color var(--transition);
}

.post-card-info h2 a:hover {
  color: var(--teal);
}

.post-card-date {
  font-size: 0.8rem;
  margin-bottom: 0.75rem;
}

.post-card-more {
  margin-top: auto;
  color: var(--teal);
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.post-card-more:hover {
  text-decoration: underline;
}

.blog-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 3rem 1rem;
}

/* ------------------------------------------------------------
   3. POST
   ------------------------------------------------------------ */

.post {
  max-width: 720px;
  margin: 0 auto;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}

.breadcrumb li + li::before {
  content: '/';
  margin-right: 0.4rem;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--text-muted);
  transition: color var(--transition);
}

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

.breadcrumb [aria-current="page"] {
  color: var(--text-primary);
}

.post-header h1 {
  font-size: 2rem;
  line-height: 1.15;
  margin-bottom: 1rem;
}

@media (min-width: 1024px) {
  .post-header h1 {
    font-size: 2.8rem;
  }
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.post-image {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 2.5rem;
  background: var(--surface-alt);
}

.post-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ------------------------------------------------------------
   4. POST CONTENT (Markdown output)
   ------------------------------------------------------------ */

.post-content {
  color: var(--text-primary);
  font-size: 1.05rem;
  line-height: 1.8;
  overflow-wrap: break-word;
}

.post-content > * + * {
  margin-top: 1.25rem;
}

.post-content h2 {
  font-size: 1.5rem;
  line-height: 1.3;
  margin-top: 2.75rem;
}

.post-content h3 {
  font-size: 1.2rem;
  line-height: 1.4;
  margin-top: 2rem;
}

.post-content p,
.post-content li {
  color: var(--text-primary);
  line-height: 1.8;
}

.post-content ul,
.post-content ol {
  padding-left: 1.5rem;
}

.post-content ul {
  list-style: disc;
}

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

.post-content li + li {
  margin-top: 0.5rem;
}

.post-content li::marker {
  color: var(--teal);
}

.post-content a {
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.post-content a:hover {
  text-decoration-thickness: 2px;
}

.post-content a:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  border-radius: 2px;
}

.post-content strong {
  font-weight: 700;
}

.post-content em {
  font-style: italic;
}

.post-content blockquote {
  border-left: 3px solid var(--teal);
  background: var(--surface-card);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.post-content blockquote p {
  color: var(--text-muted);
}

.post-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}

.post-content pre {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  max-width: 100%;
  line-height: 1.6;
}

.post-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.88rem;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
}

.post-content figure {
  margin-left: 0;
  margin-right: 0;
}

.post-content figcaption {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.5rem;
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* Tables scroll horizontally on small screens */
.post-content table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.post-content th,
.post-content td {
  border: 1px solid var(--border);
  padding: 0.6rem 0.9rem;
  text-align: left;
  white-space: nowrap;
}

.post-content th {
  background: var(--surface-card);
  font-weight: 600;
}

/* ------------------------------------------------------------
   5. POST CALL TO ACTION
   ------------------------------------------------------------ */

.post-cta {
  margin-top: 3.5rem;
  padding: 2.5rem 1.5rem;
  border-radius: var(--radius);
  text-align: center;
  background: linear-gradient(135deg, var(--teal-dk) 0%, var(--teal) 50%, var(--teal-dk) 100%);
  box-shadow: var(--shadow-glow);
}

.post-cta h2 {
  color: var(--bg);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.post-cta p {
  color: var(--bg);
  opacity: 0.8;
  margin-bottom: 1.5rem;
}

.post-cta-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.post-cta .btn-primary {
  background: var(--bg);
  border-color: var(--bg);
  color: var(--teal);
}

.post-cta .btn-primary:hover {
  background: transparent;
  color: var(--bg);
  box-shadow: none;
}

.post-cta-call {
  color: var(--bg);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.post-cta-call:focus-visible,
.post-cta .btn-primary:focus-visible {
  outline-color: var(--bg);
}

@media (min-width: 600px) {
  .post-cta {
    padding: 3rem 2.5rem;
  }

  .post-cta-actions {
    flex-direction: row;
    justify-content: center;
  }
}

.post-back {
  margin-top: 2.5rem;
}

.post-back a {
  color: var(--teal);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.post-back a:hover {
  text-decoration: underline;
}

/* ------------------------------------------------------------
   6. REDUCED MOTION
   ------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  .post-card-info h2 a,
  .breadcrumb a,
  .post-cta .btn-primary {
    transition: none;
  }

  .post-cta .btn-primary:hover {
    transform: none;
  }
}
