/*
Theme Name:  Starpath Child
Theme URI:
Author:      Starpath
Description: Child theme of Twenty Twenty-Four
Template:    twentytwentyfour
Version:     1.0.0
License:     GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: starpath-child
*/

/* ── Inter font ────────────────────────────────────────── */
@font-face {
  font-family: 'Inter';
  src: url('assets/inter.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  padding-top: 64px; /* offset for fixed header */
}
@media (min-width: 1024px) {
  body { padding-top: 80px; }
}

/* ── Header ─────────────────────────────────────────────── */
.sp-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: #0a1628;
  box-shadow: 0 1px 8px rgba(0,0,0,.35);
}

.sp-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1rem;
}
@media (min-width: 1024px) {
  .sp-header-inner { height: 80px; padding: 0 2rem; }
}

/* Logo */
.sp-logo-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  flex-shrink: 0;
}
.sp-logo-img {
  width: 36px; height: 36px;
  object-fit: contain;
}
@media (min-width: 1024px) {
  .sp-logo-img { width: 40px; height: 40px; }
}
.sp-logo-text {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  white-space: nowrap;
}
@media (min-width: 1024px) {
  .sp-logo-text { font-size: 1.25rem; }
}

/* Desktop nav */
.sp-nav {
  display: none;
  align-items: center;
  gap: 0.25rem;
}
@media (min-width: 1024px) {
  .sp-nav { display: flex; }
}

.sp-nav-btn {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255,255,255,.9);
  transition: color .2s;
  text-decoration: none;
  font-family: inherit;
}
.sp-nav-btn:hover,
.sp-nav-active {
  color: #fff;
}

/* Chevron icon */
.sp-chevron {
  width: 14px; height: 14px;
  transition: transform .2s;
}
.sp-dropdown:hover .sp-chevron,
.sp-dropdown-menu.open ~ .sp-chevron,
.sp-nav-btn[aria-expanded="true"] .sp-chevron {
  transform: rotate(180deg);
}

/* Dropdown */
.sp-dropdown {
  position: relative;
}
.sp-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 200;
  min-width: 180px;
  background: #fff;
  border: 1px solid #f3f4f6;
  border-radius: 0.5rem;
  box-shadow: 0 10px 25px rgba(0,0,0,.12);
  padding: 0.5rem 0;
}
.sp-dropdown:hover .sp-dropdown-menu,
.sp-dropdown-menu.open {
  display: block;
}
.sp-dropdown-menu a {
  display: block;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  color: #374151;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.sp-dropdown-menu a:hover {
  background: #ecfeff;
  color: #0891b2;
}

/* Mobile toggle */
.sp-mobile-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: #fff;
}
@media (min-width: 1024px) {
  .sp-mobile-toggle { display: none; }
}
.sp-mobile-toggle svg {
  width: 24px; height: 24px;
}

/* Mobile menu */
.sp-mobile-menu {
  display: none;
  background: #0a1628;
  padding: 1rem;
}
.sp-mobile-menu.open {
  display: block;
}
.sp-mobile-section {
  margin-bottom: 0.5rem;
}
.sp-mobile-heading {
  display: block;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #22d3ee;
  margin: 0;
}
.sp-mobile-menu a {
  display: block;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: rgba(255,255,255,.8);
  text-decoration: none;
  transition: color .15s;
}
.sp-mobile-menu a:hover {
  color: #67e8f9;
}

/* ── Footer ─────────────────────────────────────────────── */
.sp-footer {
  background: #060e1e;
  color: #fff;
}

.sp-footer-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 4rem 1rem;
}
@media (min-width: 1024px) {
  .sp-footer-inner { padding: 4rem 2rem; }
}

/* Top 3-column grid */
.sp-footer-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}
@media (min-width: 1024px) {
  .sp-footer-top { grid-template-columns: 1fr 1fr 1fr; }
}

/* Brand column */
.sp-footer-logo-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  margin-bottom: 1.5rem;
}
.sp-footer-logo-link img {
  width: 40px; height: 40px;
  object-fit: contain;
}
.sp-footer-logo-text {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

.sp-footer-desc {
  font-size: 0.875rem;
  color: rgba(255,255,255,.5);
  line-height: 1.6;
  max-width: 280px;
  margin-bottom: 1.5rem;
}

.sp-footer-contact { display: flex; flex-direction: column; gap: 0.75rem; }
.sp-footer-contact-row {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  font-size: 0.875rem;
  color: rgba(255,255,255,.5);
}
.sp-footer-contact-row svg {
  width: 15px; height: 15px;
  flex-shrink: 0;
  margin-top: 2px;
}

/* WhatsApp */
.sp-whatsapp-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}
.sp-wa-btn-wrap {
  position: relative;
}
.sp-wa-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  background: rgba(255,255,255,.1);
  border: none;
  border-radius: 9999px;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s;
  font-family: inherit;
}
.sp-wa-btn:hover { background: #25d366; }
.sp-wa-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.sp-qr-panel {
  display: none;
  position: absolute;
  bottom: calc(100% + 0.75rem);
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border-radius: 0.5rem;
  padding: 0.5rem;
  box-shadow: 0 10px 25px rgba(0,0,0,.2);
  text-align: center;
  z-index: 100;
  white-space: nowrap;
}
.sp-qr-panel.visible { display: block; }
.sp-wa-btn-wrap:hover .sp-qr-panel { display: block; }
.sp-qr-panel img { display: block; width: 128px; height: 128px; object-fit: contain; }
.sp-qr-panel p { font-size: 0.75rem; color: #1f2937; margin: 0.5rem 0 0; font-weight: 500; }

.sp-qr-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 90;
}
.sp-qr-overlay.active { display: block; }

/* Map column */
.sp-footer-map {}
.sp-footer-col-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff;
  margin: 0 0 1rem;
}
.sp-map-img {
  width: 100%;
  height: auto;
  object-fit: contain;
}
.sp-map-cities {
  display: flex;
  justify-content: space-between;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: rgba(255,255,255,.5);
  padding: 0 0.25rem;
}

/* Link columns */
.sp-footer-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.sp-footer-link-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}
.sp-footer-link-col a {
  font-size: 0.875rem;
  color: rgba(255,255,255,.5);
  text-decoration: none;
  transition: color .15s;
}
.sp-footer-link-col a:hover { color: #22d3ee; }

/* Bottom bar */
.sp-footer-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,.1);
}
@media (min-width: 640px) {
  .sp-footer-bottom {
    flex-direction: row;
    justify-content: space-between;
  }
}
.sp-footer-copy {
  font-size: 0.875rem;
  color: rgba(255,255,255,.3);
  margin: 0;
}
.sp-footer-legal {
  display: flex;
  gap: 1rem;
}
.sp-footer-legal a {
  font-size: 0.875rem;
  color: rgba(255,255,255,.3);
  text-decoration: none;
  transition: color .15s;
}
.sp-footer-legal a:hover { color: rgba(255,255,255,.6); }

/* ── Breadcrumb ────────────────────────────────────────── */
.wp-block-shortcode:has(.starpath-breadcrumb) {
    text-align: left !important;
}
.starpath-breadcrumb {
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    color: #666;
    line-height: 1.6;
    text-align: left !important;
}
.starpath-breadcrumb a,
.starpath-breadcrumb a:link,
.starpath-breadcrumb a:visited {
    color: inherit;
    text-decoration: none !important;
}
.starpath-breadcrumb a:hover {
    color: #333;
    text-decoration: none !important;
}
.starpath-breadcrumb .bc-sep {
    margin: 0 0.4em;
    color: #bbb;
}
.starpath-breadcrumb .bc-current {
    color: #333;
}

/* ── Post byline (By Author | Date) on single ─────────── */
.starpath-byline {
    display: block;
    font-size: 0.8125rem;
    color: #888;
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
}
.starpath-byline__author {
    color: #0f172a;
}
.starpath-byline__sep {
    color: #ccc;
    display: inline-block;
    transform: scaleY(0.8);
    padding: 0 0.4em;
}

/* ── Sidebar ───────────────────────────────────────────── */

/* Prevent any ancestor overflow from silently breaking position:sticky */
.wp-block-columns:has(.starpath-sidebar),
.wp-block-column:has(.starpath-sidebar) {
    overflow: visible !important;
}

.starpath-sidebar {
    padding-left: 1.5rem !important;
    align-self: flex-start !important; /* required for sticky to work in flex */
    /* top + position:sticky are set dynamically by js/sidebar.js */
}

.starpath-sidebar .sidebar-section {
    margin-bottom: 1.75rem;
}

/* ── Latest Posts section ──────────────────────────────── */
.starpath-sidebar .sidebar-section:first-child {
    background: transparent;
    padding: 0;
}

/* "LATEST POSTS" heading — large, bold */
.sidebar-latest-heading {
    font-size: 1.375rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.01em !important;
    text-transform: uppercase !important;
    color: #000 !important;
    margin: 0 0 1.25rem !important;
    padding: 0 !important;
    background: none !important;
    border: none !important;
    display: block !important;
    font-family: inherit !important;
    line-height: 1.1 !important;
}

.starpath-sidebar .wp-block-latest-posts {
    padding: 0 !important;
    list-style: none !important;
    margin: 0 !important;
}

/* Each post row — image left, text right */
.starpath-sidebar .wp-block-latest-posts li {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 0.375rem !important;
    padding: 1.25rem 0 !important;
    border-bottom: 1px solid #e0e0e0 !important;
    border-top: none !important;
}
.starpath-sidebar .wp-block-latest-posts li:first-child {
    border-top: 1px solid #e0e0e0 !important;
}
.starpath-sidebar .wp-block-latest-posts li:last-child {
    border-bottom: 1px solid #e0e0e0 !important;
}

/* Thumbnail — square, no radius */
.starpath-sidebar .wp-block-latest-posts__featured-image {
    flex-shrink: 0 !important;
    width: 80px !important;
    height: 80px !important;
    overflow: hidden !important;
}
.starpath-sidebar .wp-block-latest-posts__featured-image a {
    display: block !important;
    width: 80px !important;
    height: 80px !important;
    padding: 0 !important;
    text-decoration: none !important;
}
.starpath-sidebar .wp-block-latest-posts__featured-image img {
    width: 80px !important;
    height: 80px !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
    border-radius: 0 !important;
}

/* Text column — title + date stacked */
.starpath-sidebar .wp-block-latest-posts__list-item-info {
    flex: 1 !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
}

/* Post title */
.starpath-sidebar .wp-block-latest-posts a,
.starpath-sidebar .wp-block-latest-posts a:link,
.starpath-sidebar .wp-block-latest-posts a:visited,
.starpath-sidebar .wp-block-latest-posts li > a,
.starpath-sidebar .wp-block-latest-posts__list-item-info > a,
.starpath-sidebar .wp-block-latest-posts .wp-block-latest-posts__post-title {
    font-size: 1rem !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
    color: #000 !important;
    text-decoration: none !important;
    display: block !important;
    overflow: visible !important;
    letter-spacing: -0.01em !important;
    transition: color .15s !important;
    margin-bottom: 0.5rem !important;
}
.starpath-sidebar .wp-block-latest-posts a:hover,
.starpath-sidebar .wp-block-latest-posts li > a:hover,
.starpath-sidebar .wp-block-latest-posts__list-item-info > a:hover {
    color: #444 !important;
    text-decoration: none !important;
}

/* Date — below the title, grey */
.starpath-sidebar .wp-block-latest-posts__post-date {
    display: block !important;
    font-size: 0.8125rem !important;
    font-weight: 400 !important;
    color: #888 !important;
    margin-top: 0 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
}

/* No-thumbnail fallback: column layout */
.starpath-sidebar .wp-block-latest-posts li:not(:has(.wp-block-latest-posts__featured-image)) {
    flex-direction: column !important;
    gap: 0.25rem !important;
}

/* Responsive */
@media (max-width: 480px) {
    .starpath-sidebar .wp-block-latest-posts__featured-image,
    .starpath-sidebar .wp-block-latest-posts__featured-image a {
        width: 80px !important;
        height: 80px !important;
    }
    .starpath-sidebar .wp-block-latest-posts__featured-image img {
        width: 80px !important;
        height: 80px !important;
    }
}

/* ── Subscribe CTA ─────────────────────────────────────── */
.sidebar-subscribe {
    background: #ffffff;
    border: 6px solid rgb(247, 247, 247);
    border-radius: 4px;
    padding: 2rem 1.75rem 2rem !important;
    text-align: center;
}

.sidebar-subscribe .wp-block-heading {
    font-size: 2rem !important;
    font-weight: 900 !important;
    line-height: 1.15 !important;
    color: #0a0a0a !important;
    margin: 0 0 2rem !important;
    letter-spacing: -0.02em !important;
}
.sidebar-subscribe p {
    font-size: 1.0625rem !important;
    color: #444 !important;
    line-height: 1.65 !important;
    margin: 0 0 2.25rem !important;
}

.sidebar-subscribe-form {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    text-align: left;
}

/* Email input — tall, light border, centred placeholder */
.sidebar-subscribe-form input[type="email"] {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid #c8cdd6;
    border-radius: 4px;
    font-size: 0.9375rem;
    box-sizing: border-box;
    background: #fff;
    color: #111;
    outline: none;
    text-align: center;
    transition: border-color .2s;
    font-family: inherit;
}
.sidebar-subscribe-form input[type="email"]::placeholder {
    color: #aaa;
}
.sidebar-subscribe-form input[type="email"]:focus {
    border-color: #1e2d5a;
}

/* Subscribe button — dark navy, full width, uppercase */
.sidebar-subscribe-form button {
    width: 100%;
    padding: 0.95rem 1rem;
    background: #1e2d5a;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    transition: background .2s;
    font-family: inherit;
}
.sidebar-subscribe-form button:hover {
    background: #162247;
}
.sidebar-subscribe-form button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.sidebar-subscribe-success,
.sidebar-subscribe-error {
    font-size: 0.9rem !important;
    margin: 0.5rem 0 0 !important;
    text-align: center;
}
.sidebar-subscribe .sidebar-subscribe-success {
    color: rgb(0, 167, 61) !important;
    font-size: 0.8125rem !important;
}
.sidebar-subscribe-error {
    color: #c0392b !important;
}

/* ── Sidebar promotional ad blocks ────────────────────── */
.sidebar-ad {
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}
.sidebar-ad__img-placeholder {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
    display: block;
}
/* Block style: plain clickable image, no overlay */
.sidebar-ad--img-link {
    display: block;
    text-decoration: none !important;
}
.sidebar-ad--img-link:hover {
    opacity: 0.92;
}

/* Slot 3: Mine Smarter From Space ad */
.sidebar-ad__img-placeholder--3 {
    background-image: url('assets/ad-mine-smarter.webp');
    background-size: cover;
    background-position: center top;
    height: auto;
    aspect-ratio: 6 / 5;   /* matches the image's natural proportions */
}
/* Slot 1: dark gaming gradient placeholder */
.sidebar-ad__img-placeholder--1 {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 40%, #0f3460 100%);
}
/* Slot 4: Grow Smarter From Space ad */
.sidebar-ad__img-placeholder--4 {
    background-image: url('assets/ad-agriculture-2.webp');
    background-size: cover;
    background-position: center top;
    height: auto;
    aspect-ratio: 6 / 5;
}
/* Slot 2: blue shield gradient placeholder */
.sidebar-ad__img-placeholder--2 {
    background: linear-gradient(135deg, #0d1b4b 0%, #1a3a8f 50%, #00cfff 100%);
}
/* Block style 1: text overlaid on image */
.sidebar-ad--overlay {
    position: relative;
}
.sidebar-ad__overlay-content {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.42);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.sidebar-ad__title {
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
    color: #fff !important;
    margin: 0 0 0.4rem !important;
    padding: 0 !important;
    background: none !important;
    border: none !important;
}
.sidebar-ad__subtitle {
    font-size: 0.875rem !important;
    color: rgba(255,255,255,0.88) !important;
    margin: 0 !important;
    line-height: 1.4 !important;
}
.sidebar-ad__btn {
    display: inline-block;
    padding: 0.6rem 1.4rem;
    background: #3b5bdb;
    color: #fff !important;
    border-radius: 6px;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none !important;
    transition: background .18s;
    white-space: nowrap;
}
.sidebar-ad__btn:hover { background: #2f4bc7 !important; }
.sidebar-ad__btn--right { align-self: flex-end; }
/* Block style 2: image on top, content panel below */
.sidebar-ad--below { background: #e8eaf6; }
.sidebar-ad__below-content { padding: 1.1rem 1.25rem 1.25rem; }
.sidebar-ad__title--dark {
    color: #0a0a0a !important;
    font-size: 1.375rem !important;
    margin: 0 0 0.85rem !important;
}
.sidebar-ad__below-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.sidebar-ad__note {
    font-size: 0.875rem;
    color: #3b5bdb;
    font-weight: 500;
    line-height: 1.35;
}
.sidebar-ad__btn--solid {
    background: #2541b2;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.8125rem;
    font-weight: 700;
    flex-shrink: 0;
}
.sidebar-ad__btn--solid:hover { background: #1a3299 !important; }

/* ── Ad placeholder slots ──────────────────────────────── */
.starpath-ad-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border: 2px dashed #d0d0d0;
    color: #aaa;
    font-size: 0.8125rem;
    text-align: center;
    width: 100%;
    min-height: 200px;
    margin-bottom: 1rem;
    box-sizing: border-box;
}

/* ── Blog homepage 4-column grid ──────────────────────── */

/* Force uniform row heights on the post grid */
.wp-block-query .wp-block-post-template {
  grid-auto-rows: 1fr !important;
  align-items: stretch !important;
}
.wp-block-query .wp-block-post-template > li {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
}

.sp-grid-card {
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;       /* fill the li height */
  transition: box-shadow .2s;
}
.sp-grid-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
}
.sp-grid-card .wp-block-post-featured-image {
  margin: 0;
  flex-shrink: 0;
  aspect-ratio: 16 / 9 !important;
  overflow: hidden !important;
  width: 100% !important;
}
/* Default gradient placeholder for posts without a featured image */
.sp-grid-card .sp-default-thumbnail {
  width: 100%;
  height: 100%;
  display: block;
}
.sp-grid-card .wp-block-post-featured-image a {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
}
.sp-grid-card .wp-block-post-featured-image img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  border-radius: 0 !important;
}
.sp-grid-card-body {
  flex: 1;
  min-width: 0;                   /* prevent flex blowout */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-right: 1rem !important; /* guarantee equal right padding */
  overflow-wrap: break-word;      /* break long unspaced words */
  word-break: break-word;
}
.sp-grid-card .wp-block-post-title {
  font-size: 1rem !important;
  line-height: 1.4;
  margin: 0 !important;
  /* Clamp to 2 lines max */
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}
.sp-grid-card .wp-block-post-title a {
  color: #0f172a;
  text-decoration: none;
  transition: color .15s;
}
.sp-grid-card .wp-block-post-title a:hover {
  color: #0891b2;
}
/* Clamp excerpt to 3 lines */
.sp-grid-card .wp-block-post-excerpt p {
  display: -webkit-box !important;
  -webkit-line-clamp: 3 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  margin: 0 !important;
}
.sp-grid-card .wp-block-read-more {
  display: inline-block;
  margin-top: auto;
  padding-top: 0.5rem;
  color: #0891b2;
  font-size: 0.8125rem;
  text-decoration: none;
}
.sp-grid-card .wp-block-read-more:hover {
  text-decoration: underline;
}

/* ── Homepage pagination ───────────────────────────────── */
.wp-block-query-pagination {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.375rem !important;
    flex-wrap: wrap !important;
    padding-top: calc(2.5rem - 10px) !important;
    padding-bottom: 1rem !important;
}

/* Shared button base — page numbers, prev, next */
.wp-block-query-pagination-numbers .page-numbers,
.wp-block-query-pagination-previous,
.wp-block-query-pagination-next {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 2.5rem !important;
    height: 2.5rem !important;
    padding: 0 !important;
    border: 1px solid #d1d5db !important;
    border-radius: 6px !important;
    font-size: 0.9375rem !important;
    font-weight: 500 !important;
    color: #374151 !important;
    text-decoration: none !important;
    background: #fff !important;
    transition: background .15s, border-color .15s, color .15s !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
}
.wp-block-query-pagination-numbers .page-numbers:hover,
.wp-block-query-pagination-previous:hover,
.wp-block-query-pagination-next:hover {
    background: #f3f4f6 !important;
    border-color: #9ca3af !important;
    color: #111 !important;
    text-decoration: none !important;
}

/* Active page */
.wp-block-query-pagination-numbers .page-numbers.current {
    background: #1e2d5a !important;
    border-color: #1e2d5a !important;
    color: #fff !important;
    font-weight: 700 !important;
}

/* Ellipsis */
.wp-block-query-pagination-numbers .page-numbers.dots {
    border-color: transparent !important;
    background: transparent !important;
    color: #9ca3af !important;
    pointer-events: none !important;
}

/* Prev / Next — no underline on inner link */
.wp-block-query-pagination-previous a,
.wp-block-query-pagination-next a {
    text-decoration: none !important;
    color: inherit !important;
}

/* Responsive: 2 cols on tablet, 1 col on mobile */
@media (max-width: 899px) {
  .wp-block-query .wp-block-post-template.is-flex-container {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}
@media (max-width: 599px) {
  .wp-block-query .wp-block-post-template.is-flex-container {
    grid-template-columns: 1fr !important;
  }
}

/* ── Post prev / next navigation ───────────────────────── */
.sp-post-nav {
    border-top: 1px solid #e5e7eb;
    padding-top: 1.5rem !important;
    margin-top: 2rem !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    gap: 2rem !important;
}

.sp-post-nav .wp-block-post-navigation-link {
    flex: 1 1 0;
    min-width: 0;
}

.sp-post-nav .wp-block-post-navigation-link a {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 0.3rem !important;
    text-decoration: none !important;
    color: inherit !important;
}

/* Label: inline-flex so icon sits beside the text */
.sp-post-nav .wp-block-post-navigation-link__label,
.sp-post-nav .post-navigation-link__label {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.45rem !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    color: #888 !important;
    line-height: 1 !important;
}

/* SVG nav icons — sized and coloured via currentColor */
.sp-post-nav .sp-nav-icon {
    width: 0.6rem;
    height: 0.9rem;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Post title */
.sp-post-nav .wp-block-post-navigation-link__title,
.sp-post-nav .post-navigation-link__title {
    font-size: 0.9375rem !important;
    font-weight: 600 !important;
    color: #0f172a !important;
    line-height: 1.4 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}
.sp-post-nav .wp-block-post-navigation-link a:hover .wp-block-post-navigation-link__title,
.sp-post-nav .wp-block-post-navigation-link a:hover .post-navigation-link__title {
    color: #0891b2 !important;
}

/* Next: label on top-right (order 1), title below (order 2) */
.sp-post-nav .wp-block-post-navigation-link__next a,
.sp-post-nav .wp-block-post-navigation-link--next a,
.sp-post-nav .post-navigation-link-next a {
    align-items: flex-end !important;
}
.sp-post-nav .wp-block-post-navigation-link__next .wp-block-post-navigation-link__title,
.sp-post-nav .wp-block-post-navigation-link--next .wp-block-post-navigation-link__title,
.sp-post-nav .post-navigation-link-next .wp-block-post-navigation-link__title,
.sp-post-nav .post-navigation-link-next .post-navigation-link__title {
    order: 2 !important;
    text-align: right !important;
    width: 100% !important;
}
.sp-post-nav .wp-block-post-navigation-link__next .wp-block-post-navigation-link__label,
.sp-post-nav .wp-block-post-navigation-link--next .wp-block-post-navigation-link__label,
.sp-post-nav .post-navigation-link-next .wp-block-post-navigation-link__label,
.sp-post-nav .post-navigation-link-next .post-navigation-link__label {
    order: 1 !important;
    display: block !important;
    width: 100% !important;
    text-align: right !important;
}

/* ── Blog index post cards ─────────────────────────────── */
.sp-post-card .wp-block-post-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Category pill above title */
.sp-card-category {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #0891b2 !important;
  margin-bottom: 0.25rem;
}
.sp-card-category a {
  color: inherit;
  text-decoration: none;
}

/* Post title link color in card */
.sp-post-card .wp-block-post-title a {
  color: #0f172a;
  text-decoration: none;
  transition: color .15s;
}
.sp-post-card .wp-block-post-title a:hover {
  color: #0891b2;
}

/* Read more link */
.sp-post-card .wp-block-read-more {
  display: inline-block;
  margin-top: 0.75rem;
  color: #0891b2;
  text-decoration: none;
  font-size: 0.875rem;
}
.sp-post-card .wp-block-read-more:hover {
  text-decoration: underline;
}

/* Stack on small screens */
@media (max-width: 599px) {
  .sp-post-card .wp-block-columns {
    flex-direction: column;
  }
  .sp-post-card .wp-block-column:first-child {
    flex-basis: auto !important;
    width: 100%;
  }
}

/* ── Tag archive: hide author ──────────────────────────── */
.starpath-tag-archive .wp-block-post-author,
.starpath-tag-archive .wp-block-post-author-name {
    display: none !important;
}

/* ── Post navigation (prev / next) ────────────────────── */
.wp-block-post-navigation-link {
    flex: 1 1 0;
    min-width: 0;
}
.wp-block-post-navigation-link.has-text-align-right {
    text-align: right;
}
.wp-block-post-navigation-link a {
    text-decoration: none !important;
}
.wp-block-post-navigation-link a .wp-block-post-navigation-link__label {
    display: block;
    color: #888888 !important;
    margin-bottom: 0.35rem;
}
.wp-block-post-navigation-link a .wp-block-post-navigation-link__title {
    color: inherit;
}
