/* ══════════════════════════════════════════════════════════════════════════
   Blue Arctic Blog — Stylesheet
   Layers on top of the main site's styles.min.css.
   Uses the same CSS custom properties (--accent, --navy, etc.).
   ══════════════════════════════════════════════════════════════════════════ */


/* ── Reset GP remnants ────────────────────────────────────────────────────
   GeneratePress may inject default body/content styles even with its
   header/footer removed. Override anything that conflicts.
   We use !important sparingly but necessarily here — GP injects styles
   via inline and high-specificity selectors that need overriding. */

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg, #fff);
  color: var(--text, #1a1a2e);
  margin: 0;
}

#main-content {
  padding-top: 0;
}

/* Make sure GP's content-area and site containers don't add unwanted width */
.site-content,
.content-area,
.site-main,
.inside-article,
.entry-content,
.page-content,
.post-content {
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* GP wraps content in a grid — flatten it */
.site-content {
  display: block !important;
}

.site-content .content-area {
  width: 100% !important;
  float: none !important;
}

/* Hide any GP sidebar that leaks through */
#right-sidebar,
#left-sidebar,
.sidebar,
.widget-area,
#secondary {
  display: none !important;
}

/* Override GP's default article spacing */
.generate-columns,
.post-image,
.entry-header,
.entry-meta,
.post-navigation {
  margin: 0;
  padding: 0;
}

/* GP page/post wrappers */
.inside-article {
  padding: 0 !important;
}

article.type-post,
article.type-page {
  margin-bottom: 0 !important;
}

/* Hide GP-generated headings/titles that duplicate ours */
.page-header,
.archive-title,
.entry-title-link {
  /* Only hide if GP leaks these outside our templates */
}

/* GP's structural containers — remove any max-width */
.grid-container,
.site-container,
.inside-page-header {
  max-width: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Remove GP's default underline/color for links inside content */
.entry-content a {
  text-decoration-color: currentColor;
}


/* ── Blog sub-navigation ──────────────────────────────────────────────────
   Sticky horizontal bar below the main nav.
   Categories on the left, search toggle on the right.
   Similar to dreamhost.com/blog pattern. */

.blog-subnav {
  position: sticky;
  top: 72px;          /* Height of the main nav after scroll */
  z-index: 900;       /* Below main nav (1000) but above content */
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.2s ease;
}

.blog-subnav.stuck {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.blog-subnav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 52px;
}

/* Category links */
.blog-subnav-cats {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex: 1;
  min-width: 0;
}

.blog-subnav-cats::-webkit-scrollbar {
  display: none;
}

.blog-subnav-link {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary, #5a6275);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.blog-subnav-link:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text, #1a1a2e);
}

.blog-subnav-link.active {
  background: var(--accent, #2abcf3);
  color: #fff;
}

/* Search toggle + form
   !important overrides needed — GeneratePress main.min.css (which resists
   dequeue) applies broad button{} rules that can override class selectors
   in some cascade scenarios. These ensure the toggle is always visible. */
.blog-subnav-search {
  display: flex !important;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.blog-subnav .blog-search-toggle {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px;
  min-height: 36px;
  border-radius: 50%;
  border: none !important;
  background: transparent !important;
  cursor: pointer;
  color: #5a6275 !important;
  padding: 0 !important;
  margin: 0;
  opacity: 1 !important;
  visibility: visible !important;
  overflow: visible !important;
  transition: background 0.15s, color 0.15s;
}

.blog-subnav .blog-search-toggle:hover {
  background: rgba(0, 0, 0, 0.04) !important;
  color: #1a1a2e !important;
}

.blog-subnav .blog-search-toggle svg {
  display: block !important;
  width: 18px !important;
  height: 18px !important;
  opacity: 1 !important;
  visibility: visible !important;
  fill: none;
  stroke: currentColor;
}

.blog-search-form {
  display: flex;
  align-items: center;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-width 0.3s ease, opacity 0.2s ease;
}

.blog-search-form.open {
  max-width: 280px;
  opacity: 1;
}

.blog-search-input {
  width: 240px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.82rem;
  color: var(--text, #1a1a2e);
  background: var(--bg, #fff);
  outline: none;
  transition: border-color 0.15s;
}

.blog-search-input:focus {
  border-color: var(--accent, #2abcf3);
}

.blog-search-input::placeholder {
  color: var(--text-muted, #9ca3af);
}

.blog-search-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--accent, #2abcf3);
  margin-left: -4px;
}

.blog-search-submit svg,
.blog-search-submit i {
  width: 16px;
  height: 16px;
}


/* ── Blog hero ────────────────────────────────────────────────────────────
   Title area at the top of archive and category pages. */

.blog-hero {
  padding: 56px 0 40px;
  text-align: center;
}

.blog-hero-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text, #1a1a2e);
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}

.blog-hero-desc {
  font-size: 1rem;
  color: var(--text-secondary, #5a6275);
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.65;
}


/* ── Blog card grid ───────────────────────────────────────────────────────
   Responsive grid of post cards. */

.blog-archive {
  padding: 0 0 80px;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.blog-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.blog-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

.blog-card-thumb {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.blog-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.blog-card:hover .blog-card-thumb img {
  transform: scale(1.04);
}

/* Placeholder thumbnail when no featured image is set */
.blog-card-thumb--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
}

.blog-card-placeholder {
  color: #cbd5e1;
}

.blog-card-body {
  padding: 24px;
}

.blog-card-cat {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent, #2abcf3);
  text-decoration: none;
  margin-bottom: 10px;
}

.blog-card-cat:hover {
  text-decoration: underline;
}

.blog-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.4;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}

.blog-card-title a {
  color: var(--text, #1a1a2e);
  text-decoration: none;
}

.blog-card-title a:hover {
  color: var(--accent, #2abcf3);
}

.blog-card-excerpt {
  font-size: 0.88rem;
  color: var(--text-secondary, #5a6275);
  line-height: 1.6;
  margin: 0 0 16px;
}

.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted, #9ca3af);
}

.blog-card-sep {
  color: var(--text-muted, #9ca3af);
}


/* ── Single post ──────────────────────────────────────────────────────────
   Article layout with constrained content width for readability. */

.container--narrow {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

.blog-single-header {
  padding: 56px 0 32px;
  text-align: center;
}

.blog-single-title {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--text, #1a1a2e);
  margin: 16px 0;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.blog-single-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted, #9ca3af);
}

.blog-single-hero {
  margin-bottom: 48px;
}

.blog-single-hero-img {
  width: 100%;
  max-width: 960px;
  height: auto;
  border-radius: 16px;
  margin: 0 auto;
  display: block;
}

/* Post body content */
.blog-single-content {
  padding-bottom: 48px;
}

.blog-single-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 48px 0 16px;
  letter-spacing: -0.01em;
}

.blog-single-content h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 36px 0 12px;
}

.blog-single-content p {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-secondary, #3a3f50);
  margin: 0 0 24px;
}

.blog-single-content a {
  color: var(--accent, #2abcf3);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.blog-single-content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 32px 0;
}

.blog-single-content blockquote {
  margin: 32px 0;
  padding: 20px 24px;
  border-left: 3px solid var(--accent, #2abcf3);
  background: rgba(42, 188, 243, 0.04);
  border-radius: 0 12px 12px 0;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-secondary, #3a3f50);
}

.blog-single-content blockquote p:last-child {
  margin-bottom: 0;
}

.blog-single-content pre {
  background: var(--navy, #0b1729);
  color: #e2e8f0;
  padding: 20px 24px;
  border-radius: 12px;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.7;
  margin: 32px 0;
}

.blog-single-content code {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.88em;
}

.blog-single-content ul,
.blog-single-content ol {
  margin: 0 0 24px;
  padding-left: 24px;
}

.blog-single-content li {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-secondary, #3a3f50);
  margin-bottom: 8px;
}


/* ── Tags ─────────────────────────────────────────────────────────────── */

.blog-single-tags {
  padding: 0 0 32px;
}

.blog-tag {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary, #5a6275);
  background: rgba(0, 0, 0, 0.04);
  text-decoration: none;
  margin: 0 6px 6px 0;
  transition: background 0.15s, color 0.15s;
}

.blog-tag:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--text, #1a1a2e);
}


/* ── Author card ──────────────────────────────────────────────────────── */

.blog-single-author {
  padding: 0 0 64px;
}

.blog-author-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(0, 0, 0, 0.015);
}

.blog-author-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  flex-shrink: 0;
}

.blog-author-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text, #1a1a2e);
  margin-bottom: 4px;
}

.blog-author-bio {
  font-size: 0.85rem;
  color: var(--text-secondary, #5a6275);
  line-height: 1.55;
  margin: 0;
}


/* ── Related posts ────────────────────────────────────────────────────── */

.blog-related {
  padding: 64px 0 80px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.blog-related-heading {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 32px;
  letter-spacing: -0.01em;
}


/* ── Pagination ───────────────────────────────────────────────────────── */

.blog-pagination {
  padding: 48px 0 0;
  text-align: center;
}

.blog-pagination .nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.blog-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary, #5a6275);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.blog-pagination .page-numbers:hover {
  background: rgba(0, 0, 0, 0.04);
}

.blog-pagination .page-numbers.current {
  background: var(--accent, #2abcf3);
  color: #fff;
}


/* ── Empty state ──────────────────────────────────────────────────────── */

.blog-empty {
  text-align: center;
  padding: 80px 0;
}

.blog-empty h1,
.blog-empty h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 20px 0 8px;
}

.blog-empty p {
  color: var(--text-secondary, #5a6275);
  margin: 0 0 24px;
}

.blog-empty a:not(.btn) {
  color: var(--accent, #2abcf3);
}


/* ── Responsive ───────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .blog-grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .blog-subnav {
    top: 60px;  /* Smaller nav on mobile */
  }

  .blog-subnav-inner {
    height: 48px;
  }

  .blog-grid,
  .blog-grid--3 {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .blog-hero {
    padding: 40px 0 28px;
  }

  .blog-hero-title {
    font-size: 1.5rem;
  }

  .blog-single-title {
    font-size: 1.7rem;
  }

  .blog-single-header {
    padding: 40px 0 24px;
  }

  .blog-single-content h2 {
    font-size: 1.3rem;
  }

  .blog-single-content p,
  .blog-single-content li {
    font-size: 1rem;
  }

  .blog-author-card {
    flex-direction: column;
    text-align: center;
  }

  /* On mobile, hide search form entirely — show full-width below */
  .blog-search-form.open {
    position: absolute;
    right: 0;
    top: 100%;
    max-width: 100vw;
    width: 100vw;
    background: #fff;
    padding: 12px 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
  }

  .blog-search-form.open .blog-search-input {
    width: 100%;
    flex: 1;
  }
}

@media (max-width: 480px) {
  .blog-card-body {
    padding: 18px;
  }
}
