/* ============================================
   GEAR ON — Blog Hub
   Premium Editorial Theme
   Mobile-first · Vanilla CSS
   ============================================ */

@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('/fonts/outfit-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}

/* ── Design Tokens ── */
:root {
  --primary: #1B5E20;
  --primary-dark: #0D3B0F;
  --primary-light: #E8F5E9;
  --secondary: #1B2A4A;
  --bg: #FFFFFF;
  --surface: #F8F9FC;
  --surface-alt: #F0F2F8;
  --text-primary: #1A1A2E;
  --text-secondary: #555770;
  --text-muted: #8A8DA0;
  --border: #E8EAF0;
  --shadow-sm: 0 2px 8px rgba(27, 42, 74, 0.06);
  --shadow-md: 0 4px 20px rgba(27, 42, 74, 0.08);
  --radius-card: 12px;
  --radius-btn: 50px;
  --max-width: 1120px;
  --nav-height: 64px;
  --transition: 0.2s ease;
}

/* ── Reset & Base ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

::selection {
  background: var(--primary-light);
  color: var(--primary-dark);
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

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

/* ── Layout ── */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: 56px 0;
}

.section-header {
  margin-bottom: 32px;
}

.section-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--secondary);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.section-header p {
  margin-top: 8px;
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 520px;
}

.section-header--center {
  text-align: center;
}

.section-header--center p {
  margin-left: auto;
  margin-right: auto;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-btn);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  border: none;
  transition: background var(--transition), color var(--transition), border-color var(--transition),
    opacity var(--transition);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: #fff;
}

.btn-sm {
  padding: 10px 18px;
  font-size: 0.85rem;
}

/* ── Navigation ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--transition);
}

.site-header.is-scrolled {
  box-shadow: var(--shadow-sm);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--secondary);
  flex-shrink: 0;
}

.nav-logo span {
  color: var(--primary);
}

.nav-logo img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 8px;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--secondary);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.nav-toggle[aria-expanded='true'] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded='true'] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded='true'] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-menu {
  display: none;
  position: fixed;
  inset: var(--nav-height) 0 0 0;
  background: var(--bg);
  padding: 24px 20px 40px;
  overflow-y: auto;
  border-top: 1px solid var(--border);
}

.nav-menu.is-open {
  display: block;
}

.nav-menu ul {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-menu a {
  display: block;
  padding: 14px 12px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  border-radius: 8px;
  transition: background var(--transition), color var(--transition);
}

.nav-menu a:hover,
.nav-menu a[aria-current='page'] {
  background: var(--primary-light);
  color: var(--primary);
}

/* ── Breadcrumb ── */
.breadcrumb {
  padding: 16px 0 0;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.breadcrumb li + li::before {
  content: '/';
  margin-right: 6px;
  color: var(--border);
}

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

/* ── Hero ── */
.blog-hero {
  padding: 40px 0 48px;
}

.blog-hero h1 {
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: var(--secondary);
  max-width: 16ch;
}

.blog-hero p {
  margin-top: 16px;
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 38ch;
  line-height: 1.7;
}

.blog-hero .btn {
  margin-top: 28px;
}

/* ── Search & Filter ── */
.blog-toolbar {
  padding: 0 0 40px;
}

.toolbar-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

.search-wrap {
  position: relative;
  flex: 1;
}

.search-wrap svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-primary);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color var(--transition);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:hover,
.search-input:focus {
  border-color: var(--primary);
  outline: none;
}

.filter-select {
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-primary);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color var(--transition);
}

.filter-select:hover,
.filter-select:focus {
  border-color: var(--primary);
  outline: none;
}

.search-status {
  font-size: 0.85rem;
  color: var(--text-muted);
  min-height: 1.25em;
}

.search-status:empty {
  display: none;
}

/* ── Category Cards ── */
.category-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.category-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.category-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.category-card__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 10px;
}

.category-card__title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--secondary);
  line-height: 1.3;
}

.category-card__desc {
  margin-top: 4px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ── Featured Article Cards ── */
.article-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.article-card {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), opacity var(--transition);
}

.article-card:hover {
  box-shadow: var(--shadow-md);
}

.article-card.is-hidden {
  display: none;
}

.article-card__image {
  aspect-ratio: 16 / 10;
  background: var(--surface-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.article-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.article-card__image svg {
  opacity: 0.45;
}

.article-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 20px;
}

.article-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.article-card__category {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
  background: var(--primary-light);
  padding: 4px 10px;
  border-radius: 20px;
}

.article-card__time {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.article-card__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--secondary);
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.article-card__title a:hover {
  color: var(--primary);
}

.article-card__excerpt {
  margin-top: 8px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  flex: 1;
}

.article-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.article-card__date {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ── Latest Articles (Horizontal Cards) ── */
.latest-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.latest-card {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  padding: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), opacity var(--transition);
}

.latest-card:hover {
  box-shadow: var(--shadow-md);
}

.latest-card.is-hidden {
  display: none;
}

.latest-card__thumb {
  width: 96px;
  height: 72px;
  background: var(--surface-alt);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

.latest-card__thumb svg {
  opacity: 0.4;
}

.latest-card__category {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
}

.latest-card__title {
  margin-top: 4px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--secondary);
  line-height: 1.35;
}

.latest-card__title a:hover {
  color: var(--primary);
}

.latest-card__meta {
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── SEO Location Links ── */
.location-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.location-link {
  display: inline-block;
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}

.location-link:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-light);
}

/* ── Newsletter ── */
.newsletter {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.newsletter-inner {
  text-align: center;
  max-width: 480px;
  margin: 0 auto;
}

.newsletter h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--secondary);
}

.newsletter p {
  margin-top: 10px;
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 24px;
}

.newsletter-input {
  width: 100%;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-primary);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color var(--transition);
}

.newsletter-input:focus {
  border-color: var(--primary);
  outline: none;
}

.newsletter-message {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--primary);
  min-height: 1.25em;
}

.newsletter-message:empty {
  display: none;
}

/* ── Footer ── */
.site-footer {
  padding: 48px 0 32px;
  background: var(--secondary);
  color: rgba(255, 255, 255, 0.85);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

.footer-brand .footer-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
}

.footer-brand .footer-logo span {
  color: #7BC67E;
}

.footer-brand .footer-logo img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.footer-brand p {
  margin-top: 12px;
  font-size: 0.88rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.65);
  max-width: 280px;
}

.footer-social {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  transition: background var(--transition);
}

.footer-social a:hover {
  background: rgba(255, 255, 255, 0.16);
}

.footer-col h3 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fff;
  margin-bottom: 14px;
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col a {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.65);
  transition: color var(--transition);
}

.footer-col a:hover {
  color: #fff;
}

.footer-bottom {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  line-height: 1.6;
}

/* ── Empty State ── */
.no-results {
  display: none;
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.no-results.is-visible {
  display: block;
}

/* ── Tablet ── */
@media (min-width: 600px) {
  .container {
    padding: 0 24px;
  }

  .blog-hero__content {
    padding: 48px 24px 44px;
  }

  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .toolbar-inner {
    flex-direction: row;
    align-items: center;
  }

  .filter-select {
    width: auto;
    min-width: 200px;
  }

  .newsletter-form {
    flex-direction: row;
  }

  .newsletter-form .newsletter-input {
    flex: 1;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Desktop ── */
@media (min-width: 768px) {
  .section {
    padding: 72px 0;
  }

  .section-header h2 {
    font-size: 1.75rem;
  }

  .blog-hero--banner {
    min-height: clamp(360px, 38vw, 520px);
  }

  .blog-hero__content {
    padding: 64px 24px 56px;
  }

  .blog-hero--banner h1 {
    max-width: 22ch;
  }

  .nav-toggle {
    display: none;
  }

  .nav-menu {
    display: block;
    position: static;
    padding: 0;
    border: none;
    overflow: visible;
    background: transparent;
  }

  .nav-menu ul {
    flex-direction: row;
    align-items: center;
    gap: 4px;
  }

  .nav-menu a {
    padding: 8px 14px;
    font-size: 0.9rem;
  }

  .category-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }

  .article-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
  }

  .latest-card {
    grid-template-columns: 140px 1fr;
    gap: 20px;
    padding: 18px;
  }

  .latest-card__thumb {
    width: 140px;
    height: 96px;
  }

  .footer-grid {
    grid-template-columns: 1.4fr repeat(4, 1fr);
    gap: 24px;
  }
}

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

  .blog-hero h1 {
    max-width: 20ch;
  }
}
