/*
 * Blog‑specific overrides for the OTH Astra child theme.
 *
 * This file assumes that the global CSS bundle (loaded from /css/bundle.php)
 * has already been enqueued.  Only styles unique to the blog live here.
 */

/* Hero styling */
.hero {
  text-align: center;
  margin-top: 20px;
}
.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin-bottom: 0.4rem;
  font-weight: 700;
}
.hero-tagline {
  max-width: 800px;
  margin: 0.5rem auto 1.2rem;
  line-height: 1.5;
}

/* Blog posts listing */
.blog-posts article {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.blog-posts .entry-title {
  font-size: 1.4rem;
  margin: 0 0 0.3rem;
  color: var(--text);
}
.blog-posts .entry-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.6rem;
}
.blog-posts .entry-summary {
  color: var(--text);
}

/* Archive header */
.archive-header {
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.6rem;
}
.archive-title {
  font-size: 1.6rem;
  margin: 0;
}
.archive-description {
  margin-top: 0.3rem;
  color: var(--muted);
}

/* Single post content */
.entry-header {
  margin-bottom: 1rem;
}
.entry-header .entry-title {
  font-size: 2rem;
  margin-bottom: 0.3rem;
}
.entry-header .entry-meta {
  font-size: 0.9rem;
  color: var(--muted);
}
.entry-content {
  line-height: 1.65;
  margin-top: 1rem;
}
.entry-content img {
  margin: 1.2rem 0;
  border-radius: 8px;
}
.entry-footer {
  margin-top: 2rem;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Header logo sizing
 *
 * Ensure the blog logo scales to match the main site’s branding.  Adjust
 * the height here if the main site updates its logo dimensions.
 */
/* Adjust blog logo sizing to match main site.  The dedicated blog image is
   displayed at 200×40 pixels, so enforce that height here. */
.brand img {
  height: 40px;
  width: auto;
  display: block;
}

/* Mobile menu backdrop */
.nav-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 999;
}
.nav-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* Basic nav styling (complements the bundle’s nav styles) */
.main-nav {
  display: flex;
  align-items: center;
}
.nav-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.nav-links a {
  font-weight: 600;
  color: #0b1020;
  text-decoration: none;
  padding: 8px 6px;
}
.nav-links a.active {
  text-decoration: underline;
}
.nav-toggle {
  margin-left: auto;
  background: none;
  border: 0;
  cursor: pointer;
  display: none;
}
.nav-toggle .nav-toggle-bar {
  display: block;
  width: 24px;
  height: 2px;
  background: currentColor;
  position: relative;
}
.nav-toggle .nav-toggle-bar::before,
.nav-toggle .nav-toggle-bar::after {
  content: '';
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
}
.nav-toggle .nav-toggle-bar::before { top: -6px; }
.nav-toggle .nav-toggle-bar::after  { top:  6px; }

/* Featured image on blog cards.  Fills the width of the card and
 * maintains a reasonable aspect ratio using object-fit. */
.blog-card .featured-image {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 0.7rem;
}

/* Aspect‑ratio wrapper: when present, use it to reserve space and
   let the image fill the box without causing layout shifts. */
.img-box {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 6px;
  margin-bottom: 0.7rem; /* move spacing to wrapper */
}
.img-box > img.featured-image {
  width: 100%;
  height: 100%;
  margin: 0; /* reset margin moved to wrapper */
  object-fit: cover;
  display: block;
}

/* Show mobile toggle and collapse nav on small screens */
@media (max-width: 767px) {
  .nav-toggle {
    display: block;
  }
  .nav-links {
    display: none;
  }
  .nav-links.is-open {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: #fff;
    position: fixed;
    top: 0;
    right: 0;
    width: 70%;
    max-width: 280px;
    height: 100vh;
    padding: 1.5rem;
    box-shadow: -2px 0 4px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    z-index: 1000;
  }
  .nav-links.is-open a {
    padding: 10px 0;
  }
}