/* ============================================
   PETNUDGE.COM - Pet Care Blog
   Mobile-First | Light Theme | Warm & Friendly
   ============================================ */

/* --- Design Tokens --- */
:root {
  --bg-primary: #FAFAF8;
  --bg-secondary: #F0EDE8;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F7F5F0;
  --text-primary: #2D2A26;
  --text-secondary: #5C5650;
  --text-muted: #9A9490;
  --accent: #2C7A7B;
  --accent-hover: #256868;
  --accent-light: #E6F6F6;
  --accent-warm: #E8985E;
  --accent-warm-light: #FFF3E8;
  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-card: rgba(0, 0, 0, 0.06);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 50px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.1);
  --font-heading: 'Nunito', sans-serif;
  --font-body: 'Inter', sans-serif;
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --max-width: 1200px;
  --article-width: 720px;
  --nav-height: 64px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 20px);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
button { font: inherit; cursor: pointer; background: none; border: none; color: inherit; }

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
}

h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.4rem); }

.accent { color: var(--accent); }

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

.section { padding: 40px 0; }
.section--tight { padding: 24px 0; }
.section--flush-top { padding-top: 10px !important; }

.section-header { margin-bottom: 14px; }
.section-header h2 { margin-bottom: 4px; }
.section-header p { color: var(--text-secondary); }

.section-label {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 4px;
  display: block;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  color: var(--accent);
  font-size: 0.92rem;
}
.text-link:hover { color: var(--accent-hover); text-decoration: underline; }

.dot { color: var(--text-muted); margin: 0 4px; }

/* Reading progress */
.reading-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-warm));
  z-index: 2000;
  transition: width 80ms linear;
}

/* --- Navigation --- */
.nav {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(250, 250, 248, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  z-index: 1000;
  display: flex;
  align-items: center;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.nav.is-scrolled {
  border-bottom-color: var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

.nav .container { display: flex; align-items: center; justify-content: space-between; }

.nav-logo {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-logo-mark { font-size: 1.35rem; }
.nav-logo-text { color: var(--accent); }
.nav-logo-text strong { color: var(--text-primary); font-weight: 800; }

.nav-links {
  display: none;
  gap: 28px;
  align-items: center;
}
.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 4px 0;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 2px;
  background: var(--accent);
  border-radius: 1px;
  transition: width var(--transition-normal);
}
.nav-links a:hover,
.nav-links a.active { color: var(--text-primary); }
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }

.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 30px;
  height: 30px;
  padding: 0;
  z-index: 1001;
}
.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform var(--transition-normal), opacity var(--transition-fast);
  transform-origin: center;
}
.nav-open .hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-open .hamburger span:nth-child(2) { opacity: 0; }
.nav-open .hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(250, 250, 248, 0.98);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
  z-index: 999;
}
.nav-open .mobile-menu { opacity: 1; visibility: visible; }
.mobile-menu a {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}
.mobile-menu a:hover { color: var(--accent); }

/* --- Hero --- */
.hero {
  padding: 28px 0 16px;
  text-align: center;
  background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent-warm-light) 100%);
  position: relative;
  overflow: hidden;
}
.hero--compact {
  padding: 20px 0 6px;
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%; left: -10%;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(44, 122, 123, 0.15) 0%, transparent 70%);
  border-radius: 50%;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -30%; right: -10%;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(232, 152, 94, 0.15) 0%, transparent 70%);
  border-radius: 50%;
}
.hero .container { position: relative; z-index: 1; }
.hero-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}
.hero h1 {
  margin-bottom: 12px;
  line-height: 1.2;
}
.hero .accent { color: var(--accent); }
.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}
.hero-ctas {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  transition: all var(--transition-normal);
  text-decoration: none;
  border: 2px solid transparent;
}
.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover {
  background: var(--accent-hover);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}
.btn-ghost,
.btn-outline {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}
.btn-ghost:hover,
.btn-outline:hover {
  background: var(--accent);
  color: white;
}

/* --- Categories Grid --- */
.category-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.category-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: all var(--transition-normal);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}
.category-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
  color: var(--text-primary);
}
.category-card .cat-emoji {
  font-size: 2rem;
  flex-shrink: 0;
  width: 52px; height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-light);
  border-radius: var(--radius-md);
}
.category-card .cat-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
}
.category-card .cat-count {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* --- Article Grid & Cards --- */
.article-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.article-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  color: var(--text-primary);
  transition: all var(--transition-normal);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}
.article-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  color: var(--text-primary);
}

.article-card-img {
  aspect-ratio: 1005 / 489;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--text-muted);
  overflow: hidden;
}
.article-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}
.article-card:hover .article-card-img img {
  transform: scale(1.03);
}
.card-emoji-fallback { font-size: 3rem; opacity: 0.5; }

.article-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.article-card-body h2,
.article-card-body h3 {
  font-size: 1.1rem;
  line-height: 1.35;
  margin: 0;
}
.article-card-body p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.55;
  margin: 0;
}
.article-card-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: auto;
  padding-top: 8px;
}

.category-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  align-self: flex-start;
  text-decoration: none;
}
.category-badge:hover { background: var(--accent); color: white; }

/* --- Featured article card variant (larger) --- */
.article-card--featured .article-card-body { padding: 24px; }
.article-card--featured h2 { font-size: clamp(1.2rem, 2.6vw, 1.6rem); }

/* (Ad slot styles removed — no active ad network) */

/* --- Article page --- */
.article-page { padding: 24px 0 0; }

.article-header {
  max-width: var(--article-width);
  margin: 0 auto 24px;
  text-align: center;
}
.breadcrumbs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { color: var(--border-subtle); }

.article-header .category-badge { margin-bottom: 16px; }
.article-header h1 {
  margin-bottom: 16px;
  line-height: 1.25;
}
.article-lede {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.55;
  max-width: 640px;
  margin: 0 auto 20px;
}
.article-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.article-meta a { color: var(--text-secondary); font-weight: 600; }

.article-featured-img {
  max-width: var(--article-width);
  margin: 0 auto 32px;
  border-radius: var(--radius-md);
  overflow: hidden;
}
.article-featured-img img {
  width: 100%;
  aspect-ratio: 1005 / 489;
  object-fit: cover;
}

.article-body {
  max-width: var(--article-width);
  margin: 0 auto;
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-primary);
}
.article-body p { margin-bottom: 1.3em; }
.article-body h2 {
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  margin-top: 2em;
  margin-bottom: 0.6em;
  scroll-margin-top: calc(var(--nav-height) + 20px);
}
.article-body h3 {
  font-size: clamp(1.1rem, 2.2vw, 1.3rem);
  margin-top: 1.6em;
  margin-bottom: 0.5em;
  scroll-margin-top: calc(var(--nav-height) + 20px);
}
.article-body ul,
.article-body ol {
  margin: 0 0 1.3em 0;
  padding-left: 1.4em;
}
.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }
.article-body li { margin-bottom: 0.5em; }
.article-body li::marker { color: var(--accent); }

.article-body img {
  width: 100%;
  border-radius: var(--radius-md);
  margin: 1.4em 0;
}

.article-body blockquote {
  margin: 1.5em 0;
  padding: 16px 22px;
  border-left: 4px solid var(--accent);
  background: var(--accent-light);
  font-style: italic;
  color: var(--text-primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.article-body a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(44, 122, 123, 0.35);
  text-underline-offset: 3px;
}
.article-body a:hover { text-decoration-color: var(--accent); }

.article-body strong { color: var(--text-primary); font-weight: 700; }

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.4em 0;
  font-size: 0.94rem;
}
.article-body th,
.article-body td {
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  text-align: left;
}
.article-body th {
  background: var(--bg-secondary);
  font-weight: 700;
}

/* Author box */
.author-box {
  max-width: var(--article-width);
  margin: 40px auto 0;
  padding: 24px;
  background: var(--accent-light);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-card);
}
.author-box-inner {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: start;
}
.author-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  box-shadow: var(--shadow-sm);
}
.author-box h3 { font-size: 1.05rem; margin-bottom: 6px; }
.author-box p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-bottom: 8px;
  line-height: 1.6;
}

/* Related articles section */
.related-articles {
  background: var(--bg-secondary);
  padding: 56px 0;
  margin-top: 56px;
}

/* --- Footer --- */
.footer {
  background: var(--bg-secondary);
  padding: 48px 0 24px;
  border-top: 1px solid var(--border-subtle);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  margin-bottom: 32px;
}
.footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 320px;
  margin-top: 10px;
}
.footer-links h4,
.footer-note h4 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--text-primary);
  margin-bottom: 14px;
}
.footer-links a {
  display: block;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 4px 0;
  transition: color var(--transition-fast);
}
.footer-links a:hover { color: var(--accent); }
.footer-note p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 280px;
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* --- Error page --- */
.error-page { text-align: center; padding: 80px 20px; }
.error-icon { font-size: 4.5rem; margin-bottom: 16px; opacity: 0.6; }
.error-page h1 { margin-bottom: 12px; }
.error-page p {
  color: var(--text-secondary);
  margin-bottom: 24px;
  max-width: 440px;
  margin-left: auto; margin-right: auto;
}
.error-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Legal pages --- */
.legal-page { padding: 24px 0 64px; }
.legal-content {
  max-width: var(--article-width);
  margin: 0 auto;
  padding: 24px 20px;
}
.legal-content .breadcrumbs {
  justify-content: flex-start;
  margin-bottom: 20px;
}
.legal-content h1 { margin-bottom: 6px; }
.legal-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
}
.legal-content h2 {
  font-size: 1.25rem;
  margin-top: 32px;
  margin-bottom: 12px;
}
.legal-content p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.7;
}
.legal-content ul {
  list-style: disc;
  padding-left: 1.4em;
  margin-bottom: 1em;
}
.legal-content li {
  color: var(--text-secondary);
  padding: 4px 0;
}
.legal-content li::marker { color: var(--accent); }

/* --- Scroll Animations --- */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Media queries --- */

/* Tablet */
@media (min-width: 640px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .article-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1.5fr; }
  .section { padding: 48px 0; }
  .section--tight { padding: 28px 0; }
  .section--flush-top { padding-top: 14px !important; }
}

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

/* Desktop */
@media (min-width: 1024px) {
  .nav-links { display: flex; }
  .hamburger { display: none; }
  .mobile-menu { display: none; }

  .hero { padding: 40px 0 14px; }
  .hero--compact { padding: 28px 0 8px; }
  .category-grid { grid-template-columns: repeat(4, 1fr); }
}

/* Print */
@media print {
  .nav, .mobile-menu, .ad-slot, .author-box, .related-articles, .footer, .reading-progress, .hamburger {
    display: none !important;
  }
  .article-body { max-width: 100%; font-size: 11pt; }
  a { color: inherit; text-decoration: underline; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
