﻿/* ============================================
   dogfeedingcalc.com Global Styles
   Primary Color: #7CB450 (Pet Grass Green)
   Container: 1200px max-width
   ============================================ */

:root {
  --primary: #7CB450;
  --primary-dark: #5a9a3a;
  --primary-light: #e8f5e9;
  --primary-lighter: #f0fdf4;
  --accent: #f59e0b;
  --accent-light: #fffbeb;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --bg: #F8FAFC;
  --bg-card: #ffffff;
  --bg-result: #ecfdf5;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 6px 18px rgba(124, 180, 80, 0.09);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
}

/* === 1200px Container === */
.container {
  max-width: 1200px;
  width: 92%;
  margin: 0 auto;
  padding: 0 12px;
}

/* === Typography === */
h1 { font-size: 28px; font-weight: 700; color: var(--text); line-height: 1.3; margin-bottom: 12px; }
h2 { font-size: 22px; font-weight: 700; color: var(--primary); margin: 32px 0 16px; }
h3 { font-size: 18px; font-weight: 600; color: var(--primary); margin: 24px 0 12px; }
h4 { font-size: 16px; font-weight: 600; color: var(--text); margin: 20px 0 10px; }
p { line-height: 1.75; margin: 16px 0; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { margin: 12px 0 12px 20px; }
li { margin-bottom: 8px; }


/* === Tab Calculator (index.html) === */
.tab-header {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--border-light);
}
.tab-btn {
  flex: 1;
  padding: 14px 20px;
  background: none;
  border: none;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all .15s;
}
.tab-btn:hover {
  color: var(--primary);
  background: var(--primary-lighter);
}
.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* === Calculator Box (Ad Blocker) === */
.calculator-box {
  width: 100%;
  padding: 32px;
  margin: 36px 0;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: var(--shadow);
  border: 1px solid #f1f5f9;
}

/* === Two-Row Navigation === */
.top-nav {
  background: #fff;
  border-bottom: 2px solid var(--primary-light);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0;
}

.top-nav .container {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Row 1: Logo + Tools */
.nav-row-1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  flex-wrap: wrap;
  gap: 8px;
}

.nav-logo {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: -0.3px;
}

.nav-logo:hover { color: var(--primary-dark); }

.nav-row-1-links {
  display: flex;
  gap: 3px;
  align-items: center;
  flex-wrap: wrap;
}

.nav-row-1-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  padding: 5px 8px;
  border-radius: 6px;
  transition: all .15s;
  white-space: nowrap;
}

.nav-row-1-links a:hover {
  color: var(--primary);
  background: var(--primary-lighter);
}

.nav-row-1-links a.active {
  color: var(--primary);
  background: var(--primary-light);
  font-weight: 600;
}

/* Row 2: Info & Legal */
.nav-row-2 {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 0 10px;
  gap: 3px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border-light);
}

.nav-row-2 a {
  text-decoration: none;
  color: var(--text-light);
  font-size: 12.5px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all .15s;
  white-space: nowrap;
}

.nav-row-2 a:hover {
  color: var(--primary);
  background: var(--primary-lighter);
}

.nav-row-2 a.active {
  color: var(--primary);
  background: var(--primary-light);
  font-weight: 600;
}

/* Mobile Hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  flex-shrink: 0;
}

.hamburger, .hamburger::before, .hamburger::after {
  display: block;
  width: 22px;
  height: 2.5px;
  background: var(--text);
  border-radius: 2px;
  transition: all .25s;
}

.hamburger { position: relative; }
.hamburger::before, .hamburger::after { content: ''; position: absolute; left: 0; }
.hamburger::before { top: -7px; }
.hamburger::after { top: 7px; }

.nav-toggle.open .hamburger { background: transparent; }
.nav-toggle.open .hamburger::before { top: 0; transform: rotate(45deg); }
.nav-toggle.open .hamburger::after { top: 0; transform: rotate(-45deg); }

/* Mobile Styles — nav always visible, links wrap instead of folding */
@media (max-width: 900px) {
  .nav-toggle { display: none; }
  .nav-row-1 { justify-content: flex-start; }
  .nav-row-1-links, .nav-row-2 {
    display: flex;
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 6px 0;
    gap: 3px;
  }
  .nav-row-1-links a, .nav-row-2 a {
    text-align: center;
    padding: 6px 10px;
    font-size: 13px;
  }
  .nav-row-2 {
    border-top: 1px solid var(--border);
  }
}

@media (max-width: 520px) {
  .nav-row-1-links a, .nav-row-2 a {
    padding: 5px 8px;
    font-size: 12px;
  }
}

/* === Hero Section === */
.hero {
  text-align: center;
  padding: 40px 0 32px;
  background: linear-gradient(135deg, var(--primary-lighter) 0%, #fff 100%);
  border-radius: 0 0 var(--radius) var(--radius);
  margin-bottom: 32px;
}

.hero h1 { font-size: 32px; color: var(--primary); margin-bottom: 12px; }
.hero .subtitle { font-size: 16px; color: var(--text-muted); max-width: 700px; margin: 0 auto; }

/* === Tools Grid === */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin: 28px 0 32px;
}

.tool-card {
  display: block;
  text-decoration: none;
  color: var(--text);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  transition: all .2s;
  background: #fff;
}

.tool-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  text-decoration: none;
}

.tool-card .tool-icon { font-size: 42px; margin-bottom: 12px; display: block; }
.tool-card .tool-name { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.tool-card .tool-desc { font-size: 13px; color: var(--text-muted); line-height: 1.5; }

.tool-card.featured {
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--primary-lighter) 0%, #fff 60%);
}

/* === FAQ Accordion === */
.faq {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 16px;
}
.faq > h2 {
  font-size: 22px;
  margin-bottom: 18px;
  color: var(--primary);
}
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  overflow: hidden;
  background: #fff;
}

/* Injected FAQ: h3/p visible format (used on calculator & blog pages) */
/* Use !important to override .article-body h3/p global rules */
.faq-item h3 {
  background: var(--bg-card);
  padding: 16px 20px;
  font-weight: 600;
  font-size: 15px;
  color: var(--text) !important;
  margin: 0 !important;
  cursor: default;
  border-bottom: 1px solid var(--border);
}
.faq-item p {
  padding: 14px 20px !important;
  margin: 0 !important;
  line-height: 1.7;
  color: var(--text-light);
  font-size: 14.5px;
}
.faq-item p a { color: var(--primary); }
.faq-item p a:hover { text-decoration: underline; }

/* Original FAQ: accordion format (.faq-question / .faq-answer) */

.faq-question {
  background: var(--bg-card);
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background .15s;
}

.faq-question:hover { background: var(--primary-lighter); }
.faq-question .arrow { transition: transform .2s; }

.faq-answer {
  padding: 0 20px;
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease, padding .3s ease;
}

.faq-answer.open {
  padding: 16px 20px;
  max-height: 500px;
}

/* === External Links Box === */
.links-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 1200px;
  width: 92%;
  margin-left: auto;
  margin-right: auto;
  margin-top: 32px;
  margin-bottom: 32px;
}

.links-box h3 { margin-top: 0; }
.links-box ul { margin-left: 20px; }

/* === Footer === */
footer {
  background: linear-gradient(135deg, #1a2e1a 0%, #2d4a2d 100%);
  color: #c8d4c8;
  font-size: 14px;
  margin-top: 48px;
  border-top: 4px solid var(--primary);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 36px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
}

/* Brand column */
.footer-brand {
  padding-right: 16px;
}

.footer-logo {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
  letter-spacing: -0.3px;
}

.footer-tagline {
  font-size: 13.5px;
  line-height: 1.65;
  color: #9aab9a;
  max-width: 280px;
}

/* Link columns */
.footer-col h4 {
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary);
  display: inline-block;
}

.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 7px; }

.footer-col a {
  color: #a8c4a8;
  text-decoration: none;
  font-size: 13.5px;
  transition: color 0.2s, padding-left 0.2s;
  display: inline-block;
}

.footer-col a:hover {
  color: var(--primary-light);
  padding-left: 3px;
}

/* Bottom bar */
.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  font-size: 12.5px;
  color: #7a9a7a;
}

.footer-disclosure {
  margin-top: 6px;
  font-size: 11.5px;
  color: #6a8a6a;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    padding: 36px 20px 24px;
  }
  .footer-brand {
    grid-column: 1 / -1;
    padding-right: 0;
    margin-bottom: 8px;
  }
  .footer-tagline { max-width: 100%; }
}

@media (max-width: 480px) {
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 28px 18px 20px;
  }
}

/* === AdSense Empty Space Hiding === */
ins.adsbygoogle[data-ad-status="unfilled"],
iframe[src*="adsbygoogle"][data-ad-status="unfilled"] {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

ins.adsbygoogle[data-ad-status="filled"],
iframe[src*="adsbygoogle"][data-ad-status="filled"] {
  display: block !important;
}

/* === Print Styles === */
@media print {
  .top-nav, #ad-top, .ad-slot, footer, .faq-question, .hero { display: none; }
  body { background: #fff; }
  .calculator-box { box-shadow: none; border: 1px solid #ccc; }
  h1, h2, h3 { page-break-after: avoid; }
  p, li { page-break-inside: avoid; }
}

/* === Dark Theme === */
[data-theme="dark"] {
  --primary: #8dd65a;
  --primary-dark: #a4e87a;
  --primary-light: #1a2e10;
  --primary-lighter: #0f1f0a;
  --accent: #fbbf24;
  --accent-light: #3a2e0a;
  --text: #e5e7eb;
  --text-muted: #9ca3af;
  --text-light: #6b7280;
  --border: #374151;
  --border-light: #1f2937;
  --bg: #111827;
  --bg-card: #1f2937;
  --bg-result: #064e3b;
  --shadow: 0 6px 18px rgba(0,0,0,0.3);
}

[data-theme="dark"] body { background: var(--bg); color: var(--text); }
[data-theme="dark"] .top-nav { background: #1f2937; border-bottom-color: var(--border); }
[data-theme="dark"] .hero { background: linear-gradient(135deg, #1a2e10 0%, #111827 100%); }
[data-theme="dark"] .calculator-box { background: #1f2937; border-color: var(--border); }
[data-theme="dark"] .tool-card { background: #1f2937; border-color: var(--border); }
[data-theme="dark"] .tool-card:hover { background: #374151; }
[data-theme="dark"] .faq-item { border-color: var(--border); }
[data-theme="dark"] .faq-question { background: #1f2937; }
[data-theme="dark"] .faq-question:hover { background: #374151; }
[data-theme="dark"] .links-box { background: #1f2937; border-color: var(--border); }
[data-theme="dark"] footer { /* footer has own dark bg — no override needed */ }
[data-theme="dark"] .tab-btn { color: var(--text-muted); }
[data-theme="dark"] .tab-btn:hover { background: #374151; }
[data-theme="dark"] .tab-content { background: #1f2937; }
[data-theme="dark"] input, [data-theme="dark"] select, [data-theme="dark"] textarea {
  background: #111827; color: var(--text); border-color: var(--border);
}

/* === Dark Mode Toggle Button (in nav-row-2) === */
.nav-dark-toggle {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-light);
  transition: all .15s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.nav-dark-toggle:hover { color: var(--primary); background: var(--primary-lighter); border-color: var(--primary); }
.nav-dark-toggle .dm-icon { font-size: 14px; }

/* === Floating Action Button === */
.fab-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 8px;
}

.fab-main {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(124,180,80,0.4);
  transition: all .2s;
}
.fab-main:hover { transform: scale(1.08); box-shadow: 0 6px 20px rgba(124,180,80,0.5); }

.fab-menu {
  display: none;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}
.fab-menu.open { display: flex; }

.fab-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: all .15s;
  white-space: nowrap;
}
.fab-item:hover { background: var(--primary-lighter); color: var(--primary); }
.fab-item .fab-icon { font-size: 16px; }

@media (max-width: 600px) {
  .fab-container { bottom: 16px; right: 16px; }
  .fab-main { width: 46px; height: 46px; font-size: 19px; }
}

/* === FAB Toast Notification === */
.fab-toast {
  display: none; position: fixed; bottom: 90px; right: 24px;
  background: #1f2937; color: #fff; padding: 10px 16px;
  border-radius: 8px; font-size: 13px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25); z-index: 1000;
  animation: fabToastIn 0.2s ease-out; pointer-events: none;
}
.fab-toast--success { background: #059669; }
.fab-toast--warn { background: #d97706; }

@keyframes fabToastIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Hide toast when printing */
@media print {
  .fab-container, .fab-toast { display: none !important; }
}

/* === Responsive === */
@media (max-width: 600px) {
  .hero h1 { font-size: 24px; }
  .hero .subtitle { font-size: 14px; }
  h1 { font-size: 22px; }
  h2 { font-size: 18px; }
  .tools-grid { grid-template-columns: 1fr; }
  .calculator-box { padding: 20px; }
}

/* === Long-form Article Body (above calculators) === */
.article-body { line-height: 1.75; font-size: 17px; color: var(--text); max-width: 1200px; margin: 32px auto; }
.article-body h1 { font-size: 32px; margin: 0 0 18px; line-height: 1.25; color: var(--text); }
.article-body h2 { font-size: 24px; margin: 34px 0 12px; color: var(--primary); border-bottom: 2px solid var(--border); padding-bottom: 6px; }
.article-body h3 { font-size: 19px; margin: 24px 0 8px; color: var(--text); }
.article-body p { margin: 0 0 16px; }
.article-body a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.article-body a:hover { color: var(--primary-dark); }
.article-body ul, .article-body ol { margin: 0 0 16px; padding-left: 24px; }
.article-body li { margin-bottom: 8px; }
.article-body strong { color: var(--text); }

/* Related calculators block to prevent orphan pages */
.related-tools { max-width: 1200px; margin: 40px auto 0; }
.related-tools h2 { font-size: 22px; margin-bottom: 14px; color: var(--primary); }
.related-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; align-items: stretch; }
.related-card { display: flex; align-items: center; justify-content: center; text-align: center; padding: 16px 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; text-decoration: none; color: var(--text); font-weight: 600; transition: all .15s; min-height: 64px; }
.related-card:hover { border-color: var(--primary); background: var(--primary-lighter); transform: translateY(-2px); }

/* Blog index cards (vertical title + excerpt layout) */
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
.blog-card { display: flex; flex-direction: column; align-items: flex-start; text-align: left; padding: 20px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; text-decoration: none; color: var(--text); transition: all .15s; min-height: 150px; }
.blog-card h3 { margin: 0 0 10px; font-size: 17px; font-weight: 600; color: var(--primary); line-height: 1.35; }
.blog-card p { margin: 0; font-size: 14px; font-weight: 400; color: var(--text-muted); line-height: 1.6; }
.blog-card:hover { border-color: var(--primary); background: var(--primary-lighter); transform: translateY(-2px); }

.editor-note { margin-top: 32px; padding: 16px 20px; background: var(--bg-card); border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: var(--radius-sm); font-size: 14px; color: var(--text-light); line-height: 1.7; }
.editor-note strong { color: var(--text); }

/* Author / medical review box for E-E-A-T */
.author-box { margin-top: 36px; padding: 20px 22px; background: #f6fffb; border: 1px solid #d1fae5; border-left: 4px solid var(--primary); border-radius: var(--radius-sm); font-size: 14px; line-height: 1.7; }
.author-box strong { color: var(--text); }
.author-box a { color: var(--primary); text-decoration: none; }
.author-box a:hover { text-decoration: underline; }
.author-title { font-weight: 700; font-size: 15px; margin-bottom: 8px; color: var(--text); }
.author-meta { color: var(--text-muted); font-size: 13px; margin-top: 10px; }
.author-reviewed-date { color: var(--text-muted); font-size: 12.5px; margin: 10px 0 0; font-style: italic; }
@media (max-width: 900px) { .related-grid { grid-template-columns: repeat(2, 1fr); } .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .article-body { font-size: 16px; } .article-body h1 { font-size: 26px; } .article-body h2 { font-size: 21px; } .related-grid { grid-template-columns: 1fr; } .blog-grid { grid-template-columns: 1fr; } }

/* === Breadcrumb === */
.breadcrumb { background: var(--bg-card); border-bottom: 1px solid var(--border); padding: 10px 0; font-size: 14px; }
.breadcrumb .container { padding: 0 16px; }
.breadcrumb ol { list-style: none !important; display: flex; flex-wrap: wrap; gap: 6px 2px; margin: 0 !important; padding: 0 !important; align-items: center; }
.breadcrumb ol li { list-style: none !important; color: var(--text-light); display: inline; }
.breadcrumb li:not(:last-child)::after { content: "\203A"; margin: 0 6px; color: var(--border); }
.breadcrumb a { color: var(--primary); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb [aria-current="page"] { color: var(--text); font-weight: 600; }
@media (max-width: 600px) { .breadcrumb { font-size: 13px; } }
