/* ── Variables ── */
:root {
  --primary:    #0A6E4F;
  --primary-dk: #085940;
  --accent:     #F5A623;
  --text:       #1a1a2e;
  --text-muted: #6b7280;
  --bg:         #ffffff;
  --bg-soft:    #f9fafb;
  --border:     #e5e7eb;
  --radius:     8px;
  --shadow:     0 2px 12px rgba(0,0,0,.08);
  --font-sans:  'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-sans); color: var(--text); background: var(--bg); line-height: 1.65; }
img  { max-width: 100%; height: auto; display: block; }
a    { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ── */
.container { max-width: 1140px; margin: 0 auto; padding: 0 1.25rem; }

/* ── Header ── */
.site-header { background: #0d1b2a; border-bottom: 1px solid rgba(255,255,255,.08); position: sticky; top: 0; z-index: 100; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { height: 36px; width: auto; filter: brightness(1.15) saturate(1.2); }


/* ── Filter pills ── */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; padding: 1.5rem 1.25rem; }
.pill { padding: .35rem .9rem; border-radius: 20px; border: 1px solid var(--border); font-size: .85rem; color: var(--text-muted); transition: all .2s; }
.pill:hover, .pill.active { background: var(--primary); color: #fff; border-color: var(--primary); text-decoration: none; }

/* ── Post grid ── */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.75rem; padding-bottom: 3rem; }
.post-card { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--bg); box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; }
.post-card:hover { transform: translateY(-3px); box-shadow: 0 6px 24px rgba(0,0,0,.12); }
.post-card-img { width: 100%; height: 200px; object-fit: cover; }
.post-card-body { padding: 1.25rem; display: flex; flex-direction: column; flex: 1; gap: .6rem; }
.post-meta-cats { display: flex; gap: .4rem; flex-wrap: wrap; }
.cat-tag { background: #e6f4ef; color: var(--primary); padding: .2rem .65rem; border-radius: 4px; font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.post-card-body h2 { font-size: 1.1rem; line-height: 1.4; }
.post-card-body h2 a { color: var(--text); }
.post-card-body h2 a:hover { color: var(--primary); }
.post-summary { font-size: .9rem; color: var(--text-muted); flex: 1; }
.post-meta { font-size: .8rem; color: var(--text-muted); display: flex; gap: .75rem; flex-wrap: wrap; }
.read-more { font-size: .88rem; font-weight: 600; color: var(--primary); margin-top: auto; }

/* ── Pagination ── */
.pagination { display: flex; justify-content: center; gap: .5rem; padding: 2rem 0 3rem; }
.pagination a, .pagination span { padding: .4rem .85rem; border: 1px solid var(--border); border-radius: 6px; font-size: .9rem; }
.pagination .active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Single post ── */
.post-container { max-width: 780px; }
.breadcrumb { padding: 1.5rem 0 .5rem; font-size: .85rem; color: var(--text-muted); }
.breadcrumb a { color: var(--text-muted); }

.post-header { margin-bottom: 2rem; }
.post-cats { margin-bottom: .75rem; display: flex; gap: .4rem; }
.post-header h1 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); line-height: 1.25; margin-bottom: 1rem; }
.post-byline { font-size: .9rem; color: var(--text-muted); display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.post-byline .author { font-weight: 600; color: var(--text); }
.sep { opacity: .4; }

.post-hero-img { margin-bottom: 2.5rem; border-radius: var(--radius); overflow: hidden; }
.post-hero-img img { width: 100%; max-height: 480px; object-fit: cover; }
.post-hero-img figcaption { font-size: .8rem; color: var(--text-muted); padding: .5rem 0; text-align: center; font-style: italic; }

/* ── Post content typography ── */
.post-content { font-size: 1.05rem; line-height: 1.8; }
.post-content h2 { font-size: 1.5rem; margin: 2.5rem 0 .8rem; color: var(--text); }
.post-content h3 { font-size: 1.2rem; margin: 2rem 0 .6rem; }
.post-content p  { margin-bottom: 1.25rem; }
.post-content ul, .post-content ol { padding-left: 1.5rem; margin-bottom: 1.25rem; }
.post-content li { margin-bottom: .4rem; }
.post-content strong { color: var(--text); }
.post-content img { border-radius: var(--radius); margin: 1.5rem 0; box-shadow: var(--shadow); }
.post-content blockquote { border-left: 4px solid var(--primary); margin: 1.5rem 0; padding: .75rem 1.25rem; background: var(--bg-soft); font-style: italic; color: var(--text-muted); border-radius: 0 var(--radius) var(--radius) 0; }
.post-content table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; }
.post-content th, .post-content td { border: 1px solid var(--border); padding: .65rem 1rem; text-align: left; }
.post-content th { background: var(--bg-soft); font-weight: 600; }
.post-content code { background: #f1f5f9; padding: .15em .4em; border-radius: 4px; font-size: .88em; font-family: 'Fira Code', monospace; }
.post-content pre { background: #1a1a2e; color: #e2e8f0; padding: 1.25rem; border-radius: var(--radius); overflow-x: auto; margin-bottom: 1.5rem; }
.post-content pre code { background: none; color: inherit; padding: 0; }

/* ── Tags ── */
.post-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin: 2.5rem 0; }
.tag { background: var(--bg-soft); border: 1px solid var(--border); color: var(--text-muted); padding: .3rem .75rem; border-radius: 20px; font-size: .83rem; }
.tag:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }

/* ── Post nav ── */
.post-nav { display: flex; justify-content: space-between; border-top: 1px solid var(--border); padding: 1.5rem 0; margin-top: 2rem; gap: 1rem; }
.post-nav a { font-size: .9rem; font-weight: 500; max-width: 45%; }
.back-link { padding-bottom: 3rem; }
.back-link a { font-weight: 500; }

/* ── Footer ── */
.site-footer { background: var(--text); color: rgba(255,255,255,.7); padding: 2rem 0; font-size: .88rem; }
.site-footer .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.footer-links { display: flex; gap: 1.25rem; }
.footer-links a { color: rgba(255,255,255,.7); }
.footer-links a:hover { color: #fff; text-decoration: none; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .post-grid { grid-template-columns: 1fr; }
  .post-nav { flex-direction: column; }
  .site-footer .container { flex-direction: column; text-align: center; }
}
@media (max-width: 480px) {
}

/* ── Header layout ── */
.header-inner { display: flex; align-items: center; gap: 1.5rem; }
.main-nav { display: flex; align-items: center; gap: 0; margin-left: auto; }

/* Nav links */
.nav-link {
  color: rgba(255,255,255,.82);
  font-size: .9rem;
  font-weight: 500;
  padding: .5rem .9rem;
  display: block;
  transition: color .2s;
  white-space: nowrap;
}
.nav-link:hover, .nav-link.active { color: #fff; text-decoration: none; }
.nav-link.active { color: var(--primary); }

/* Dropdown */
.nav-dropdown { position: relative; }
.dropdown-toggle { cursor: pointer; display: flex; align-items: center; gap: .25rem; }
.caret { font-size: .7rem; opacity: .7; }
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #1a2a3a;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius);
  min-width: 140px;
  list-style: none;
  padding: .4rem 0;
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
  z-index: 200;
}
.dropdown-menu li a {
  display: block;
  padding: .5rem 1rem;
  color: rgba(255,255,255,.8);
  font-size: .88rem;
  white-space: nowrap;
}
.dropdown-menu li a:hover { color: #fff; background: rgba(255,255,255,.06); text-decoration: none; }
.nav-dropdown { position: relative; padding-bottom: 0; align-self: stretch; align-items: center; }
.nav-dropdown:hover .dropdown-menu { display: block; }

/* Social icons in header */
.social-icons { display: flex; align-items: center; gap: .6rem; margin-left: .5rem; }
.social-icons a {
  color: rgba(255,255,255,.6);
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  transition: color .2s;
}
.social-icons a:hover { color: #fff; }
.social-icons svg { width: 18px; height: 18px; }

/* Hamburger (mobile) */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: .4rem;
  margin-left: auto;
}
.nav-toggle span {
  display: block;
  width: 22px; height: 2px;
  background: rgba(255,255,255,.8);
  border-radius: 2px;
  transition: .3s;
}

/* ── Starfield section hero ── */
.section-hero {
  background:
    radial-gradient(ellipse at 20% 50%, rgba(10,110,79,.25) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(13,143,103,.15) 0%, transparent 50%),
    #0d1b2a;
  background-image: url("/blog/images/posts/night-sky.jpg");
  background-size: cover;
  position: relative;
  overflow: hidden;
  padding: 4rem 0 3rem;
  color: #fff;
}
/* Starfield dots via pseudo */
.section-hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1px 1px at 10% 15%, rgba(255,255,255,.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 25% 40%, rgba(255,255,255,.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 40% 10%, rgba(255,255,255,.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 55% 60%, rgba(255,255,255,.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 70% 25%, rgba(255,255,255,.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 80% 70%, rgba(255,255,255,.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 90% 45%, rgba(255,255,255,.5) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 15% 75%, rgba(255,255,255,.3) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 35% 85%, rgba(255,255,255,.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 60% 90%, rgba(255,255,255,.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 5% 55%, rgba(255,255,255,.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 48% 35%, rgba(255,255,255,.6) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 75% 80%, rgba(255,255,255,.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 92% 12%, rgba(255,255,255,.5) 0%, transparent 100%);
  pointer-events: none;
}
.section-hero .container { position: relative; z-index: 1; }
.section-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  color: var(--primary);
  margin-bottom: .6rem;
}
.section-hero p { font-size: 1rem; opacity: .85; max-width: 580px; }

/* ── No posts message ── */
.no-posts { color: var(--text-muted); padding: 2rem 0; }

/* ── Mobile ── */
@media (max-width: 900px) {
  .social-icons { display: none; }
  .nav-toggle { display: flex; }
  .main-nav {
    display: none;
    position: absolute;
    top: 64px; left: 0; right: 0;
    background: #0d1b2a;
    flex-direction: column;
    align-items: stretch;
    padding: 1rem 0;
    border-top: 1px solid rgba(255,255,255,.08);
    z-index: 150;
  }
  .main-nav.open { display: flex; }
  .nav-dropdown { width: 100%; }
  .dropdown-menu {
    position: static;
    display: none;
    border: none;
    background: rgba(255,255,255,.04);
    border-radius: 0;
    box-shadow: none;
    padding: 0;
  }
  .nav-dropdown:hover .dropdown-menu { display: none; }
  .nav-dropdown.open .dropdown-menu { display: block; }
  .dropdown-toggle { width: 100%; justify-content: space-between; padding-right: 1.2rem; }
  .site-header { position: relative; }
}
