:root {
  --primary: #1a1a1a;
  --primary-dark: #0d0d0d;
  --secondary: #f5f5f2;
  --accent: #3d6b4f;
  --accent-hover: #2d5340;
  --link: #2d6a4f;
  --btn-primary-bg: #3d6b4f;
  --btn-primary-hover: #2d5340;
  --btn-primary-text: #ffffff;
  --text: #1a1a1a;
  --text-muted: #5c5c5c;
  --bg: #ffffff;
  --bg-card: #ffffff;
  --bg-subtle: #f5f5f2;
  --bg-footer: #1c1c1c;
  --border: #e2e2de;
  --radius: 2px;
  --font: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: "Lora", Georgia, "Times New Roman", serif;
  --container: 1240px;
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 15px;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
img[width][height] { height: auto; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 1.25rem; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.narrow { max-width: 760px; }

/* Header */
.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  position: relative;
}

.nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 90;
}
.nav-backdrop.active { display: block; }
body.nav-menu-open { overflow: hidden; }

.logo {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  text-decoration: none;
  letter-spacing: -0.02em;
}
.logo:hover { color: var(--accent); text-decoration: none; }
.logo-text { line-height: 1.1; }
.brand-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 50%;
  flex-shrink: 0;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 0;
}

.header-end {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
  margin-right: -0.75rem;
  flex-shrink: 0;
}

@media (min-width: 641px) {
  .site-header .header-inner {
    padding-right: 0.65rem;
  }
}
.main-nav a {
  color: var(--text);
  font-size: 0.875rem;
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}
.main-nav a:hover {
  color: var(--accent);
  text-decoration: none;
}

.nav-dropdown { position: relative; }
.nav-dropdown-btn {
  background: none; border: none; font: inherit;
  color: var(--text); cursor: pointer; padding: 0;
  font-size: 0.9rem;
}
.nav-dropdown-btn:hover { color: var(--link); }
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 180px;
  padding: 0.25rem 0;
  margin-top: 0.25rem;
}
@media (hover: hover) and (pointer: fine) {
  .nav-dropdown:hover .nav-dropdown-menu { display: block; }
}
.nav-dropdown.is-open .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a {
  display: block;
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
}

.header-search {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.header-search input {
  border: none;
  background: transparent;
  padding: 0.35rem 0.6rem;
  font-size: 0.875rem;
  width: 140px;
  min-width: 0;
  outline: none;
}

.header-search--block {
  width: 100%;
}
.header-search--block input {
  flex: 1;
  width: auto;
}
.header-search button {
  border: none;
  border-left: 1px solid var(--border);
  background: var(--bg-subtle);
  padding: 0.35rem 0.6rem;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.header-auth-bar {
  display: none;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.25rem 0.5rem;
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
}

.mobile-nav-header,
.mobile-nav-footer,
.main-nav-links { display: contents; }

.mobile-nav-header,
.mobile-nav-footer { display: none; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.875rem;
  border: 1px solid var(--border);
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  background: var(--bg-subtle);
  color: var(--text);
}
.btn:hover { background: var(--border); color: var(--text); text-decoration: none; }
.btn-primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  border-color: var(--btn-primary-bg);
}
.btn-primary:hover {
  background: var(--btn-primary-hover);
  border-color: var(--btn-primary-hover);
  color: var(--btn-primary-text);
}
.btn-primary:focus-visible {
  outline: 2px solid var(--btn-primary-hover);
  outline-offset: 2px;
}
.btn-outline {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text);
}
.btn-outline:hover {
  background: var(--bg-subtle);
  color: var(--text);
}
.btn-accent {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}
.btn-accent:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }

/* Sections */
.section { padding: 2.5rem 0; }
.section-compact { padding-top: 1.5rem; padding-bottom: 0; }
.section-alt { background: var(--bg-subtle); border-top: 1px solid var(--border); }
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}
.section-header h2,
.section-header-spruce h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}
.section-header-spruce {
  border-bottom: 2px solid var(--text);
  padding-bottom: 0.65rem;
}
.section-header p { color: var(--text-muted); font-size: 0.9rem; }
.view-all { font-size: 0.875rem; color: var(--text-muted); font-weight: normal; }
.view-all:hover { color: var(--link); text-decoration: underline; }

/* Categories */
.categories-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.category-card {
  display: inline-block;
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: normal;
  color: var(--text);
  background: var(--bg-card);
  text-decoration: none;
}
.category-card:hover {
  background: var(--bg-subtle);
  color: var(--text);
  text-decoration: none;
  border-color: #bbb;
}
.category-icon { display: none; }
.category-card h3 {
  font-size: inherit;
  font-weight: 500;
  display: inline;
  margin: 0;
}
.category-card p { display: none; }

.categories-grid-rich {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem;
}
.category-card-rich {
  display: block;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  text-decoration: none;
}
.category-card-rich:hover {
  border-color: #bbb;
  background: var(--bg-subtle);
  text-decoration: none;
}
.category-card-rich h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text);
}
.category-card-rich p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.5rem;
}
.featured-article {
  display: grid;
  grid-template-columns: minmax(200px, 280px) 1fr;
  gap: 1.25rem;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
}
.featured-article-image {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-subtle);
}
.featured-article-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.featured-article-body h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0.25rem 0 0.5rem;
  line-height: 1.35;
}
.featured-article-body h2 a { color: var(--text); text-decoration: none; }
.featured-article-body h2 a:hover { color: var(--link); text-decoration: underline; }
.featured-article-body > p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  line-height: 1.55;
}
.read-more {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.home-layout,
.page-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2rem;
  align-items: start;
}
.home-main,
.page-main-col { min-width: 0; }
.home-sidebar,
.page-sidebar {
  position: sticky;
  top: 4.5rem;
}
.sidebar-box {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  margin-bottom: 0.75rem;
}
.sidebar-box-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.65rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.sidebar-box-head h3 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  margin: 0;
}
.sidebar-box-head .view-all { font-size: 0.8rem; }
.sidebar-box > p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.5rem;
}
.sidebar-empty {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
}
.sidebar-article-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: none;
  overflow-y: auto;
}
.sidebar-article-list li {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
}
.sidebar-article-list li:last-child { border-bottom: none; }
.sidebar-article-list a {
  display: block;
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--text);
  text-decoration: none;
  margin-bottom: 0.2rem;
}
.sidebar-article-list a:hover { color: var(--link); text-decoration: underline; }
.sidebar-article-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.sidebar-article-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-article-meta time { flex-shrink: 0; }

.spotlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.spotlight-block {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
}
.spotlight-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.65rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.spotlight-head h3 { font-size: 0.95rem; font-weight: 600; }
.spotlight-head h3 a { color: var(--text); text-decoration: none; }
.spotlight-head h3 a:hover { color: var(--link); text-decoration: underline; }
.spotlight-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.spotlight-list li {
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
}
.spotlight-list li:last-child { border-bottom: none; }
.spotlight-list a {
  display: block;
  font-size: 0.875rem;
  color: var(--text);
  text-decoration: none;
  line-height: 1.4;
  margin-bottom: 0.15rem;
}
.spotlight-list a:hover { color: var(--link); text-decoration: underline; }
.spotlight-list time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Articles Grid */
.articles-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.articles-grid-4.articles-grid-cards,
.articles-grid.articles-grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
  border: none;
  overflow: visible;
}

.article-card {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  transition: background 0.15s;
}
.article-card:hover { background: var(--bg-subtle); }
.article-card:last-child { border-bottom: none; }
.article-card-image {
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-subtle);
}
.article-card-image img {
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center;
}
.article-card-body { padding: 0; min-width: 0; }
.article-category {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
}
.article-category:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}
.article-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0.2rem 0 0.35rem;
  line-height: 1.35;
}
.article-card h3 a { color: var(--text); text-decoration: none; }
.article-card h3 a:hover { color: var(--link); text-decoration: underline; }
.article-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Breeds */
.breeds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.breed-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  color: var(--text);
  text-decoration: none;
}
.breed-card:hover { text-decoration: none; border-color: var(--text-muted); }
.breed-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.breed-card-overlay {
  position: static;
  background: none;
  padding: 0.6rem 0.75rem;
  display: block;
}
.breed-card h3 {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
}

/* Newsletter */
.newsletter-section {
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
}
.newsletter-box { max-width: 480px; }
.newsletter-box h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.newsletter-box > p { margin-bottom: 1rem; color: var(--text-muted); font-size: 0.9rem; }
.newsletter-form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.newsletter-form input {
  flex: 1;
  min-width: 180px;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  outline: none;
}
.newsletter-form input:focus { border-color: var(--accent); outline: 1px solid var(--accent); }

/* Footer — Spruce Pets dark */
.site-footer {
  background: var(--bg-footer);
  color: #b8b8b8;
  margin-top: auto;
  font-size: 0.9rem;
}
.footer-top {
  padding: 2.5rem 1.25rem 2rem;
}
.footer-newsletter {
  max-width: 520px;
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #3a3a3a;
}
.footer-newsletter h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.35rem;
}
.footer-newsletter > p {
  color: #b8b8b8;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}
.footer-newsletter .newsletter-form input {
  background: #fff;
  border-color: #fff;
}
.footer-columns {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 2rem;
}
.footer-col h3 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fff;
  margin-bottom: 0.85rem;
}
.footer-logo {
  color: #fff;
  margin-bottom: 0.65rem;
}
.footer-logo:hover { color: #c8e6d0; }
.footer-tagline {
  font-size: 0.9rem;
  line-height: 1.55;
  color: #b8b8b8;
  max-width: 280px;
}
.footer-links-col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.footer-links-col a {
  color: #d4d4d4;
  text-decoration: none;
  font-size: 0.9rem;
}
.footer-links-col a:hover {
  color: #fff;
  text-decoration: underline;
}
.footer-categories {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.footer-categories a {
  color: #d4d4d4;
  font-size: 0.9rem;
  text-decoration: none;
}
.footer-categories a:hover {
  color: #fff;
  text-decoration: underline;
}

.auth-legal {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0 0 1rem;
}

.ad-slot {
  margin: 1rem 0 1.25rem;
  min-height: 100px;
  overflow: hidden;
  contain: layout;
}
.ad-slot[data-ad-position="sidebar"] {
  min-height: 280px;
}
.ad-slot[data-ad-position="banner"],
.ad-slot[data-ad-position="article"] {
  min-height: 100px;
}
.ad-slot ins.adsbygoogle {
  display: block;
  min-height: inherit;
}
.ad-slot--unfilled {
  display: none !important;
  margin: 0 !important;
  min-height: 0 !important;
  overflow: hidden;
  pointer-events: none;
}
.ad-slot--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.page-sidebar > .ad-slot {
  margin-bottom: 0.75rem;
}

.social-share {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 1rem 0;
}
.social-share a { margin-left: 0.25rem; }
.footer-bottom {
  border-top: 1px solid #3a3a3a;
  padding: 1rem 0;
  text-align: center;
  font-size: 0.8rem;
  color: #888;
}

/* Breadcrumbs */
.breadcrumbs {
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 0;
  font-size: 0.85rem;
}
.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
}
.breadcrumbs li:not(:last-child)::after {
  content: '/';
  margin-left: 0.35rem;
  color: var(--text-muted);
}
.breadcrumbs a { color: var(--link); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent-hover); text-decoration: underline; }
.breadcrumbs span { color: var(--text); }

/* Page Main */
.page-main { padding: 2rem 0; flex: 1; }
.page-header { margin-bottom: 1.5rem; }
.page-header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.page-header p { color: var(--text-muted); font-size: 0.95rem; }

/* Article Page */
.article-container { max-width: 760px; }
.article-header { margin-bottom: 1.5rem; }
.article-header h1 {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.25;
  margin: 0.5rem 0 0.75rem;
}
.article-featured-image {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
  aspect-ratio: 16 / 9;
  max-height: 400px;
  background: var(--bg-subtle);
}
.article-featured-image img {
  width: 100%;
  height: 100%;
  max-height: 400px;
  object-fit: cover;
}
.article-content img {
  max-width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--bg-subtle);
}
.article-inline-image {
  margin: 1.25rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-subtle);
}
.article-inline-image img {
  width: 100%;
  display: block;
}
.article-content {
  font-size: 1rem;
  line-height: 1.7;
}
.article-content h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 1.75rem 0 0.5rem;
}
.article-content p { margin-bottom: 1rem; }
.article-content ul, .article-content ol { margin: 0.75rem 0 0.75rem 1.25rem; }
.article-content li { margin-bottom: 0.35rem; }
.article-internal-nav {
  margin: 1.75rem 0 0;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
}
.article-internal-nav-lead {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text);
}
.article-internal-nav-lead a {
  font-weight: 500;
}
.article-cross-links {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.article-cross-links-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.65rem;
}
.article-cross-links ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}
.article-cross-links li {
  font-size: 0.9rem;
  line-height: 1.45;
}
.article-cross-links-meta {
  color: var(--text-muted);
  font-size: 0.85rem;
}
.article-cross-links-meta a {
  font-weight: normal;
}

.category-hub {
  margin-top: 0.5rem;
}
.category-hub-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 1rem;
}
.category-hub-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}
.category-hub-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  background: var(--bg-card);
}
.category-hub-item a {
  font-weight: 600;
  font-size: 0.95rem;
}
.category-hub-item p {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
}
.category-hub-section {
  margin-top: 2rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}


.article-faq {
  margin-top: 1.5rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}
.article-faq h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}
.faq-list {
  display: grid;
  gap: 0.5rem;
}
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  padding: 0.55rem 0.7rem;
}
.faq-item summary {
  cursor: pointer;
  font-weight: 500;
  color: var(--text);
}
.faq-item p {
  margin-top: 0.45rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Comments */
.comments-section { border-top: 1px solid var(--border); padding-top: 2rem; }
.comments-section h2 { font-size: 1.125rem; font-weight: 600; margin: 1.25rem 0 1rem; }
.comments-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1rem 1.5rem;
  align-items: start;
}
.comments-list-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  padding: 0.5rem 1rem;
}
.comments-list-wrap .empty-state { margin: 0.75rem 0; }
.comment {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}
.comment:last-of-type { border-bottom: none; }
.comment strong { display: block; margin-bottom: 0.15rem; font-size: 0.9rem; }
.comment time { font-size: 0.8rem; color: var(--text-muted); }
.comment p { margin-top: 0.35rem; font-size: 0.95rem; }
.comment-form {
  margin-top: 0;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  padding: 1rem;
}
.comment-form h3 { font-size: 1rem; margin-bottom: 0.75rem; }
.comment-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.comment-form input,
.comment-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.45rem 0.6rem;
  font: inherit;
  font-size: 0.9rem;
  background: var(--bg);
  outline: none;
}
.comment-form textarea {
  resize: vertical;
  min-height: 110px;
  margin-bottom: 0.5rem;
}
.comment-form input:focus,
.comment-form textarea:focus {
  border-color: var(--accent);
  outline: 1px solid var(--accent);
}

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 500; margin-bottom: 0.3rem; font-size: 0.875rem; }
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
  font-size: 0.9rem;
  background: var(--bg);
  outline: none;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--accent);
  outline: 1px solid var(--accent);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-message { margin-top: 0.75rem; font-size: 0.875rem; }
.form-message.success { color: #116329; }
.form-message.error { color: #82071e; }

.search-form-large {
  display: flex;
  gap: 0.5rem;
  max-width: 480px;
  margin-top: 0.75rem;
}
.search-form-large input {
  flex: 1;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  outline: none;
}

.content-page h1 { font-size: 1.5rem; font-weight: 600; margin-bottom: 0.75rem; }
.content-page h2 { font-size: 1.1rem; font-weight: 600; margin: 1.5rem 0 0.5rem; }
.content-page p, .content-page li { margin-bottom: 0.6rem; color: var(--text); }
.content-page .lead { font-size: 1rem; color: var(--text); }
.content-page ul { margin-left: 1.25rem; }

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
  font-size: 0.9rem;
}
.infinite-load-more {
  padding: 1rem 0 0.5rem;
  text-align: center;
}
.infinite-load-more p {
  font-size: 0.875rem;
  color: var(--text-muted);
}
.empty-state { color: var(--text-muted); padding: 2rem 0; font-size: 0.9rem; }
.error-page { padding: 4rem 0; }
.error-page h1 { font-size: 3rem; font-weight: 600; color: var(--text-muted); }

/* Auth */
.header-auth {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  margin-left: 0.5rem;
  padding-right: 0.15rem;
}
.header-user {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.logout-form { margin: 0; }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.8rem; }
.btn-block { width: 100%; }

.auth-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.auth-card .page-header { margin-bottom: 1rem; }
.auth-switch {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}
.alert {
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.875rem;
  border: 1px solid;
}
.alert-error {
  background: #ffebe9;
  color: #82071e;
  border-color: #ff818266;
}
.alert-success {
  background: #dafbe1;
  color: #116329;
  border-color: #4ac26b66;
}
.auth-divider {
  display: flex;
  align-items: center;
  margin: 1rem 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.auth-divider span { padding: 0 0.75rem; }
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.875rem;
  text-decoration: none;
}
.btn-google:hover { background: var(--bg-subtle); color: var(--text); text-decoration: none; }
.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.3rem;
}
.label-row label { margin-bottom: 0; }
.forgot-link { font-size: 0.85rem; }
.verify-hint { font-size: 0.875rem; color: var(--text-muted); margin: 0.75rem 0; }
.verify-code-input {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.35rem;
  text-align: center;
  font-family: ui-monospace, monospace;
}
.verify-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 0.75rem;
  border: 1px solid var(--border);
}
.verify-icon.success { background: #dafbe1; color: #116329; border-color: #4ac26b66; }
.verify-icon.error { background: #ffebe9; color: #82071e; border-color: #ff818266; }
.text-center { text-align: center; }
.user-badge {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

/* —— Spruce Pets–style homepage & cards —— */
.trust-bar {
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 0;
}
.trust-bar-inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  text-align: center;
}
.trust-stat strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}
.trust-stat span {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.35;
}
.hero-stories-section {
  padding-top: 1.75rem;
  padding-bottom: 0.5rem;
}
.hero-stories-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}
.hero-story-card {
  display: flex;
  flex-direction: column;
}
.hero-story-card-image {
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-subtle);
  margin-bottom: 0.75rem;
}
.hero-story-card-image img {
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center;
}
.hero-story-card-body h3 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 0.35rem 0 0;
}
.hero-story-card-body h3 a {
  color: var(--text);
  text-decoration: none;
}
.hero-story-card-body h3 a:hover {
  color: var(--accent);
  text-decoration: underline;
}
.editors-picks-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.spruce-newsletter {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  padding: 2rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.spruce-newsletter h2 {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.spruce-newsletter > p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}
.spruce-newsletter .newsletter-form {
  justify-content: center;
}
.category-count {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
  margin-top: 0.35rem;
}
/* Card grid lists (home, blog, category) */
.articles-grid.articles-grid-cards,
.articles-grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
  border: none;
  border-radius: 0;
  overflow: visible;
}
.articles-grid.articles-grid-cards .article-card,
.articles-grid-cards .article-card,
.article-card.article-card--vertical {
  display: flex;
  flex-direction: column;
  grid-template-columns: unset;
  padding: 0;
  border: none;
  border-bottom: none;
  border-radius: var(--radius);
  background: transparent;
  box-shadow: none;
}
.articles-grid.articles-grid-cards .article-card:hover,
.articles-grid-cards .article-card:hover {
  background: transparent;
}
.articles-grid.articles-grid-cards .article-card-image,
.articles-grid-cards .article-card-image,
.article-card--vertical .article-card-image {
  display: block;
  width: 100%;
  flex-shrink: 0;
  border: none;
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  background: var(--bg-subtle);
}
.articles-grid.articles-grid-cards .article-card-image img,
.articles-grid-cards .article-card-image img,
.article-card--vertical .article-card-image img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: center;
}
.articles-grid.articles-grid-cards .article-card-body,
.articles-grid-cards .article-card-body,
.article-card--vertical .article-card-body {
  padding: 0;
  min-width: 0;
}
.articles-grid.articles-grid-cards .article-card h3,
.articles-grid-cards .article-card h3,
.article-card--vertical h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.35;
}
.editors-picks-grid .article-card-image,
.hero-story-card-image {
  display: block;
  width: 100%;
  overflow: hidden;
  background: var(--bg-subtle);
}
.editors-picks-grid .article-card-image img,
.hero-story-card-image img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center;
}
.home-main-spruce .page-main {
  padding-top: 0;
}
.page-header h1,
.article-header h1,
.content-page h1 {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.featured-article {
  border: none;
  box-shadow: var(--shadow-card);
  border-radius: var(--radius);
}
.featured-article-body h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
}
.category-card-rich {
  border-radius: var(--radius);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.category-card-rich:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-card);
}
.category-card-rich h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
}
.breadcrumbs {
  background: var(--bg-subtle);
  font-size: 0.8rem;
}
.site-header {
  box-shadow: 0 1px 0 var(--border);
}

/* Responsive */
@media (max-width: 640px) {
  .container { padding: 0 1rem; }

  .header-inner {
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    flex-wrap: nowrap;
  }

  .logo {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .header-end { display: none; }

  .header-auth-bar {
    display: flex;
    align-items: center;
    margin-left: auto;
    flex-shrink: 0;
  }

  .header-auth--compact {
    gap: 0.35rem;
  }

  .header-auth--compact .btn-sm {
    padding: 0.4rem 0.55rem;
    font-size: 0.75rem;
    min-height: 36px;
  }

  .header-auth--compact .header-user { display: none; }

  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    z-index: 120;
    margin-left: 0.15rem;
  }

  .main-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    z-index: 110;
    overflow: hidden;
    gap: 0;
  }

  .main-nav.open { display: flex; }

  .mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }

  .mobile-nav-title {
    font-weight: 600;
    font-size: 1rem;
  }

  .mobile-nav-close {
    border: none;
    background: var(--bg-subtle);
    border-radius: var(--radius);
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text);
  }

  .main-nav-links {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 1rem;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
  }

  .main-nav-links > a,
  .main-nav-links .nav-dropdown-btn {
    display: block;
    padding: 0.85rem 0.25rem;
    font-size: 1rem;
    min-height: 44px;
    line-height: 1.4;
    border-bottom: 1px solid var(--border);
  }

  .main-nav-links > a:last-of-type { border-bottom: none; }

  .main-nav .nav-dropdown {
    width: 100%;
    border-bottom: 1px solid var(--border);
  }

  .main-nav .nav-dropdown-btn {
    width: 100%;
    text-align: left;
  }

  .main-nav .nav-dropdown-menu {
    position: static;
    display: none;
    border: none;
    padding: 0 0 0.5rem 0.75rem;
    margin-top: 0;
    min-width: 0;
  }

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

  .main-nav .nav-dropdown-menu a {
    padding: 0.65rem 0.25rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .mobile-nav-footer {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    border-top: 1px solid var(--border);
    background: var(--bg-subtle);
    flex-shrink: 0;
  }

  .mobile-nav-footer .header-auth {
    margin-left: 0;
    padding-right: 0;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .mobile-nav-footer .header-auth .btn {
    flex: 1;
    min-width: calc(50% - 0.25rem);
    min-height: 44px;
    text-align: center;
  }

  .mobile-nav-footer .logout-form {
    flex: 1;
    min-width: calc(50% - 0.25rem);
  }

  .mobile-nav-footer .logout-form .btn {
    width: 100%;
    min-height: 44px;
  }

  .mobile-nav-user {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
  }

  .form-row { grid-template-columns: 1fr; }
  .comment-form .form-row { grid-template-columns: 1fr; }

  /* Horizontal list layout only (not card grid) */
  .articles-grid:not(.articles-grid-cards) .article-card {
    grid-template-columns: 1fr;
  }
  .articles-grid:not(.articles-grid-cards) .article-card-image img {
    height: auto;
  }

  .footer-grid {
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem 1rem;
  }

  .section { padding: 2rem 0; }

  .featured-article {
    grid-template-columns: 1fr;
  }
  .home-layout,
  .page-layout {
    grid-template-columns: 1fr;
  }
  .home-sidebar,
  .page-sidebar {
    position: static;
  }
  .comments-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .spotlight-grid {
    grid-template-columns: 1fr;
  }
  .categories-grid-rich {
    grid-template-columns: 1fr;
  }

  .page-main { padding: 1.5rem 0; }
  .article-header h1 { font-size: 1.5rem; }

  .search-form-large {
    flex-direction: column;
  }

  .search-form-large .btn {
    width: 100%;
  }

  .trust-bar-inner {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  .hero-stories-grid {
    grid-template-columns: 1fr;
  }
  .editors-picks-grid {
    grid-template-columns: 1fr;
  }
  .footer-columns {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .articles-grid-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) and (min-width: 641px) {
  .hero-stories-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-columns {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 641px) {
  .header-auth-bar { display: none; }
}
