/* ==========================================================================
   IHOP Kids Eat Free & Restaurant Menu Guide - Modern Responsive Stylesheet
   Designed for Fast Performance, Mobile UX & AdSense Optimization
   ========================================================================== */

:root {
  --primary: #1d4ed8;
  --primary-dark: #1e3a8a;
  --primary-light: #eff6ff;
  --accent: #dc2626;
  --accent-hover: #b91c1c;
  --accent-light: #fef2f2;
  --success: #15803d;
  --success-light: #f0fdf4;
  --warning: #b45309;
  --warning-light: #fffbeb;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --transition: all 0.25s ease-in-out;
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  min-width: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-family);
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-main);
  background-color: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  position: relative;
}

img, picture, svg, video {
  max-width: 100%;
  height: auto;
  display: block;
}

h1, h2, h3, h4, h5, h6, p, a, li, span, th, td {
  overflow-wrap: break-word;
  word-wrap: break-word;
}


/* Reading Progress Bar */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--primary));
  width: 0%;
  z-index: 1000;
  transition: width 0.1s ease-out;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: #0f172a;
  font-weight: 700;
  line-height: 1.3;
  margin-top: 1.8rem;
  margin-bottom: 0.8rem;
}

h1 { font-size: 2.25rem; letter-spacing: -0.02em; }
h2 { font-size: 1.75rem; border-bottom: 2px solid var(--border-light); padding-bottom: 0.5rem; margin-top: 2.4rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.15rem; }

p {
  margin-bottom: 1.25rem;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

ul, ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.5rem;
}

/* Featured Images & Figures */
.featured-image-box {
  margin: 1.5rem 0 2rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
}

.featured-image-box img {
  width: 100%;
  max-height: 440px;
  object-fit: cover;
  display: block;
}

.featured-image-caption {
  background: #f8fafc;
  padding: 8px 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-light);
  font-style: italic;
}

/* Scorecard / Review Box */
.review-scorecard {
  background: linear-gradient(135deg, #eff6ff, #f8fafc);
  border: 2px solid #bfdbfe;
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.8rem;
  margin: 2rem 0;
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1.5rem;
  align-items: center;
}

.score-badge {
  text-align: center;
  background: var(--primary);
  color: white;
  padding: 1.2rem 1rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.score-number {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1;
}

.score-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.9;
  margin-top: 4px;
}

.score-details h3 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
}

.score-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.metric-item {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.metric-item strong {
  color: var(--text-main);
  display: block;
}

/* Pros & Cons Box */
.pros-cons-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 2rem 0;
}

.pros-card, .cons-card {
  padding: 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid;
}

.pros-card {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.cons-card {
  background: #fef2f2;
  border-color: #fecaca;
}

.pros-card h4 {
  color: #166534;
  margin: 0 0 0.8rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cons-card h4 {
  color: #991b1b;
  margin: 0 0 0.8rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pros-card ul, .cons-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.pros-card li {
  padding-left: 24px;
  position: relative;
  margin-bottom: 0.6rem;
  font-size: 0.92rem;
  color: #14532d;
}

.pros-card li::before {
  content: "✓";
  position: absolute;
  left: 0;
  font-weight: 800;
  color: #15803d;
}

.cons-card li {
  padding-left: 24px;
  position: relative;
  margin-bottom: 0.6rem;
  font-size: 0.92rem;
  color: #7f1d1d;
}

.cons-card li::before {
  content: "✗";
  position: absolute;
  left: 0;
  font-weight: 800;
  color: #b91c1c;
}

/* ==========================================================================
   INTERACTIVE CALCULATOR WIDGET (TOOL FOR ADSENSE APPROVAL)
   ========================================================================== */
.calculator-card {
  background: linear-gradient(135deg, #ffffff, #f0fdf4);
  border: 2px solid #86efac;
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin: 2.2rem 0;
  box-shadow: var(--shadow-md);
}

.calc-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.calc-badge {
  display: inline-block;
  background: #15803d;
  color: white;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 9999px;
  margin-bottom: 0.5rem;
}

.calc-title {
  margin: 0 0 0.4rem;
  font-size: 1.6rem;
  color: #0f172a;
}

.calc-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0;
}

.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.calc-group {
  margin-bottom: 1.25rem;
}

.calc-label {
  display: block;
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 0.4rem;
  color: #1e293b;
}

.calc-select, .calc-input {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-family: inherit;
  background: white;
  transition: var(--transition);
}

.calc-select:focus, .calc-input:focus {
  border-color: #15803d;
  outline: none;
  box-shadow: 0 0 0 3px rgba(21,128,61,0.15);
}

.calc-result-box {
  background: #ffffff;
  border: 2px dashed #22c55e;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  margin-top: 1.5rem;
}

.savings-highlight {
  font-size: 2.2rem;
  font-weight: 900;
  color: #15803d;
  line-height: 1.1;
  margin: 0.5rem 0;
}

.calc-summary-stats {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1rem 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
  font-size: 0.95rem;
}

.calc-btn-action {
  background: #15803d;
  color: white;
  font-size: 1.05rem;
  font-weight: 700;
  border: none;
  padding: 12px 28px;
  border-radius: 9999px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(21,128,61,0.25);
  transition: var(--transition);
  display: inline-block;
  margin-top: 0.5rem;
  width: 100%;
}

.calc-btn-action:hover {
  background: #166534;
  transform: translateY(-2px);
}

/* Top Notification / Notice Bar */
.top-bar {
  background-color: #0f172a;
  color: #e2e8f0;
  font-size: 0.85rem;
  padding: 6px 0;
}

.top-bar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.top-bar-notice {
  display: flex;
  align-items: center;
  gap: 6px;
}

.top-bar-links {
  display: flex;
  gap: 14px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.top-bar-links a {
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.82rem;
  transition: var(--transition);
}

.top-bar-links a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Main Header */
.site-header {
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 999;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none !important;
  flex-shrink: 0;
}

.logo-badge {
  background: var(--accent);
  color: white;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 1.25rem;
  box-shadow: 0 2px 6px rgba(220,38,38,0.3);
}

.logo-text span {
  color: var(--accent);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  gap: 1rem;
  flex-wrap: nowrap;
  position: relative;
}

.nav-menu {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 0.55rem;
  padding: 0;
  margin: 0;
  white-space: nowrap;
  flex-wrap: nowrap;
}

.nav-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  padding: 6px 9px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background-color: var(--primary-light);
  text-decoration: none;
}

.nav-cta {
  background-color: var(--accent);
  color: white !important;
  font-weight: 700;
  padding: 7px 15px;
  border-radius: 9999px;
  box-shadow: 0 2px 6px rgba(220,38,38,0.25);
  transition: var(--transition);
  font-size: 0.86rem;
  white-space: nowrap;
}

.nav-cta:hover {
  background-color: var(--accent-hover);
  transform: translateY(-1px);
}

/* Mobile Toggle */
.mobile-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
}

/* Breadcrumbs */
.breadcrumb-wrap {
  padding: 0.85rem 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.breadcrumb-wrap a {
  color: var(--text-muted);
}

.breadcrumb-wrap a:hover {
  color: var(--primary);
}

.breadcrumb-separator {
  margin: 0 7px;
  color: var(--text-light);
}

/* Layout Grid: Content + Sidebar */
.main-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2.2rem;
  padding: 1.5rem 0 3.5rem;
}

.main-content {
  background: var(--bg-card);
  padding: 2.2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

/* Full Width Layout for Legal Pages & Calculator */
.full-width-content {
  grid-column: 1 / -1;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

/* Post Meta / Author Header */
.post-header {
  margin-bottom: 2rem;
}

.post-badge {
  display: inline-block;
  background-color: var(--primary-light);
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 12px;
  border-radius: 9999px;
  margin-bottom: 0.75rem;
}

.post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.author-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #cbd5e1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  color: #334155;
}

/* Table of Contents */
.toc-box {
  background: var(--primary-light);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin: 1.75rem 0 2.25rem;
}

.toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.toc-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin: 0;
}

.toc-list {
  margin: 1rem 0 0;
  padding-left: 1.25rem;
}

.toc-list li {
  margin-bottom: 0.4rem;
}

.toc-list a {
  color: var(--primary-dark);
  font-weight: 500;
}

/* Highlights Box / Callout Cards */
.callout {
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-md);
  margin: 1.75rem 0;
  border-left: 4px solid;
}

.callout-tip {
  background-color: var(--success-light);
  border-color: var(--success);
  color: #14532d;
}

.callout-info {
  background-color: var(--primary-light);
  border-color: var(--primary);
  color: #1e3a8a;
}

.callout-warning {
  background-color: var(--warning-light);
  border-color: var(--warning);
  color: #78350f;
}

.callout-title {
  font-weight: 700;
  margin-bottom: 0.35rem;
  font-size: 1rem;
}

/* Menu Grid Cards */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 1.75rem 0;
}

.menu-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
}

.menu-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.card-thumb {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  display: block;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.card-badge {
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--accent-light);
  color: var(--accent);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.card-title {
  font-size: 1.2rem;
  margin: 0 0 0.5rem;
  color: #0f172a;
}

.card-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 1rem;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
  font-size: 0.88rem;
}

.card-price {
  font-weight: 700;
  color: var(--success);
}

.card-cals {
  color: var(--text-muted);
}

/* Styled Responsive Tables */
.table-responsive {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5rem 0;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.custom-table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  text-align: left;
  background: white;
}

.custom-table th {
  background: #f1f5f9;
  color: #0f172a;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 12px 16px;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}

.custom-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.95rem;
}

.custom-table tr:nth-child(even) {
  background-color: #f8fafc;
}

.custom-table tr:hover {
  background-color: #f1f5f9;
}

.status-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.tag-free {
  background: #dcfce7;
  color: #166534;
}

.tag-available {
  background: #e0e7ff;
  color: #3730a3;
}

/* FAQ Accordion */
.faq-wrap {
  margin: 2rem 0;
}

.faq-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 0.85rem;
  background: white;
  overflow: hidden;
}

.faq-question {
  width: 100%;
  background: none;
  border: none;
  padding: 1.1rem 1.4rem;
  text-align: left;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: var(--transition);
}

.faq-question:hover {
  background-color: #f8fafc;
  color: var(--primary);
}

.faq-icon {
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--text-muted);
  transition: transform 0.25s ease;
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  padding: 0 1.4rem;
}

.faq-answer p {
  padding-bottom: 1.2rem;
  margin: 0;
  color: var(--text-main);
  line-height: 1.65;
}

/* Author Box */
.author-box {
  display: flex;
  gap: 1.25rem;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-top: 3rem;
  align-items: center;
}

.author-img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
}

.author-info h4 {
  margin: 0 0 0.3rem;
}

.author-info p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Sidebar Styles */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.sidebar-widget {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.widget-title {
  font-size: 1.15rem;
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-light);
  color: #0f172a;
}

.deal-highlight-card {
  background: linear-gradient(135deg, #1e40af, #3b82f6);
  color: white;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
}

.deal-highlight-card h3 {
  color: white;
  margin-top: 0;
}

.deal-highlight-card p {
  font-size: 0.95rem;
  opacity: 0.9;
}

.deal-highlight-card .btn {
  background: var(--accent);
  color: white;
  font-weight: 700;
  display: inline-block;
  padding: 9px 20px;
  border-radius: 9999px;
  margin-top: 0.5rem;
  text-decoration: none;
}

.sidebar-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-links li {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border-light);
}

.sidebar-links li:last-child {
  border-bottom: none;
}

.sidebar-links a {
  color: var(--text-main);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-links a:hover {
  color: var(--primary);
  text-decoration: none;
}

/* Disclaimer Banner */
.disclaimer-banner {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 0.85rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin: 2rem 0;
  line-height: 1.6;
}

/* Contact Form */
.contact-form {
  margin-top: 1.5rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  font-size: 0.92rem;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}

textarea.form-control {
  min-height: 140px;
  resize: vertical;
}

.btn-submit {
  background: var(--primary);
  color: white;
  border: none;
  padding: 12px 28px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.btn-submit:hover {
  background: var(--primary-dark);
}

/* Footer */
.site-footer {
  background-color: #0f172a;
  color: #94a3b8;
  padding: 3.5rem 0 2rem;
  margin-top: 3rem;
  font-size: 0.92rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid #334155;
}

.footer-col h4 {
  color: #f8fafc;
  font-size: 1.1rem;
  margin: 0 0 1.2rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 0.6rem;
}

.footer-links a {
  color: #94a3b8;
  text-decoration: none;
}

.footer-links a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 1.5rem;
  font-size: 0.85rem;
}

.footer-legal-notice {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 1rem;
  line-height: 1.6;
}

/* Back to Top */
#back-to-top {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 44px;
  height: 44px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow-md);
  z-index: 99;
}

#back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

#back-to-top:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}


/* Author Profile Page Styles */
.author-bio-card {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2rem;
  align-items: start;
  margin-bottom: 2rem;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 2rem;
}

.author-skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.author-articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES (Mobile-First Polish for All Screen Sizes)
   ========================================================================== */

/* ── Prevent any accidental horizontal scroll on any viewport ── */
html, body {
  max-width: 100%;
  overflow-x: hidden;
  position: relative;
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES (Zero-Overflow Mobile-First Architecture)
   ========================================================================== */

/* ── Global Container Width Guard ── */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ── Prevent Grid Items from Blowing Out Layout (Crucial CSS Grid Fix) ── */
.main-layout,
.main-content,
.full-width-content,
article,
section,
.sidebar,
.review-scorecard,
.pros-cons-box,
.calculator-card,
.menu-grid,
.footer-grid,
.author-bio-card {
  min-width: 0 !important;
  max-width: 100% !important;
}

/* ── Tablet & Small Laptops (max-width: 1080px) ────────────────── */
@media (max-width: 1080px) {
  .site-header {
    position: sticky;
    top: 0;
    z-index: 999;
  }
  .header-inner {
    position: relative;
    justify-content: space-between;
  }
  .mobile-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    order: 2;
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    font-size: 1.35rem;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
  }
  nav[aria-label="Primary Navigation"] {
    position: static;
    order: 3;
    width: 0;
    height: 0;
    margin: 0;
    padding: 0;
  }
  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    background: #ffffff;
    flex-direction: column;
    padding: 0.75rem 1rem 1.25rem;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.15);
    border-top: 1px solid var(--border-color);
    border-bottom: 3px solid var(--primary);
    max-height: calc(100vh - 70px);
    overflow-y: auto;
    z-index: 1000;
  }
  .nav-menu.open {
    display: flex !important;
  }
  .nav-link {
    width: 100%;
    padding: 12px 14px;
    font-size: 0.98rem;
    border-bottom: 1px solid var(--border-light);
    display: block;
    border-radius: 4px;
  }
  .nav-cta {
    width: 100%;
    text-align: center;
    margin-top: 0.75rem;
    padding: 12px;
    display: block;
  }
  .top-bar-links {
    display: none;
  }
}

/* ── Tablet Portrait (max-width: 992px) ───────────────────────── */
@media (max-width: 992px) {
  .main-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }
  .pros-cons-box {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .review-scorecard {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 1rem;
  }
  .calc-grid {
    grid-template-columns: 1fr;
  }
  .full-width-content {
    max-width: 100%;
  }
}

/* ── Standard Mobile Phones (max-width: 768px) ─────────────────── */
@media (max-width: 768px) {
  html, body {
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }
  body {
    font-size: 16px;
    line-height: 1.6;
  }
  .container {
    padding: 0 12px !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  .header-inner {
    padding: 0.5rem 0;
  }
  .brand-logo {
    font-size: 1.15rem;
    gap: 6px;
    max-width: calc(100% - 50px);
  }
  .logo-badge {
    width: 32px;
    height: 32px;
    font-size: 1rem;
    border-radius: 7px;
  }
  .logo-text {
    font-size: 1.15rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mobile-toggle {
    width: 38px;
    height: 38px;
    padding: 0;
    font-size: 1.25rem;
  }

  /* Typography */
  h1 {
    font-size: 1.48rem !important;
    line-height: 1.28 !important;
    margin-top: 1rem !important;
    margin-bottom: 0.5rem !important;
    word-break: break-word !important;
  }
  h2 {
    font-size: 1.24rem !important;
    line-height: 1.32 !important;
    margin-top: 1.5rem !important;
    padding-bottom: 0.35rem !important;
    word-break: break-word !important;
  }
  h3 {
    font-size: 1.1rem !important;
  }
  .lead {
    font-size: 1rem !important;
    line-height: 1.58 !important;
  }

  /* Top Notice Bar */
  .top-bar {
    font-size: 0.76rem;
    padding: 5px 0;
  }
  .top-bar-inner {
    justify-content: center;
    padding: 0 8px;
  }
  .top-bar-notice {
    font-size: 0.76rem;
    text-align: center;
    justify-content: center;
    line-height: 1.4;
  }

  /* Breadcrumbs */
  .breadcrumb-wrap {
    font-size: 0.78rem;
    padding: 0.5rem 0;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  /* Layout and Main Content */
  .main-layout {
    display: block !important;
    padding: 0.5rem 0 2rem !important;
    width: 100% !important;
  }
  .main-content {
    display: block !important;
    width: 100% !important;
    padding: 1rem 0.85rem !important;
    border-radius: var(--radius-md) !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05) !important;
  }

  /* Featured Image Box */
  .featured-image-box {
    margin: 0.85rem 0 1.15rem;
    border-radius: var(--radius-md);
    width: 100%;
    overflow: hidden;
  }
  .featured-image-box img {
    max-height: 200px;
    width: 100%;
    object-fit: cover;
  }
  .featured-image-caption {
    padding: 6px 10px;
    font-size: 0.78rem;
  }

  /* Post Meta Info */
  .post-header {
    margin-bottom: 1rem;
  }
  .post-badge {
    font-size: 0.7rem;
    padding: 3px 8px;
  }
  .post-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    padding-bottom: 0.75rem;
    font-size: 0.8rem;
  }

  /* Scorecard Review Box */
  .review-scorecard {
    display: block !important;
    padding: 1rem !important;
    border-radius: var(--radius-md) !important;
    margin: 1.15rem 0 !important;
    text-align: center !important;
  }
  .score-badge {
    display: inline-block !important;
    padding: 0.75rem 1.5rem !important;
    margin-bottom: 0.85rem !important;
  }
  .score-number {
    font-size: 2.1rem !important;
  }
  .score-metrics {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.5rem !important;
    text-align: left !important;
  }

  /* Pros & Cons */
  .pros-cons-box {
    display: block !important;
    margin: 1.15rem 0 !important;
  }
  .pros-card, .cons-card {
    display: block !important;
    width: 100% !important;
    padding: 1rem !important;
    border-radius: var(--radius-md) !important;
    margin-bottom: 0.85rem !important;
  }

  /* Table of Contents */
  .toc-box {
    padding: 0.9rem 1rem;
    margin: 1.15rem 0;
  }
  .toc-title {
    font-size: 0.98rem;
  }

  /* Callout Boxes */
  .callout {
    padding: 0.9rem 1rem;
    margin: 1.15rem 0;
    font-size: 0.92rem;
  }

  /* Table: Flawless touch-scrolling without page blowout */
  .table-responsive {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    margin: 1rem 0 !important;
    border-radius: var(--radius-sm) !important;
  }
  .custom-table {
    min-width: 440px !important;
  }
  .custom-table th, .custom-table td {
    padding: 8px 10px !important;
    font-size: 0.82rem !important;
  }

  /* Menu Grid Cards */
  .menu-grid {
    display: block !important;
    margin: 1.15rem 0 !important;
  }
  .menu-card {
    display: block !important;
    width: 100% !important;
    padding: 1rem !important;
    margin-bottom: 1rem !important;
  }
  .card-thumb {
    height: 160px !important;
    width: 100% !important;
  }

  /* Author Profile & Bottom Box */
  .author-box {
    flex-direction: column;
    text-align: center;
    padding: 1.15rem 0.85rem;
    gap: 0.65rem;
  }
  .author-bio-card {
    display: block !important;
    text-align: center !important;
    padding: 1.15rem 0.85rem !important;
  }
  .author-skills-grid, .author-articles-grid {
    display: block !important;
  }
  .author-skills-grid > div, .author-articles-grid > div {
    margin-bottom: 0.75rem !important;
    width: 100% !important;
  }

  /* Sidebar on Mobile */
  .sidebar {
    display: block !important;
    width: 100% !important;
    margin-top: 1.5rem !important;
  }
  .sidebar-widget {
    margin-bottom: 1.25rem !important;
    width: 100% !important;
  }

  /* Calculator Mobile Styles */
  .calculator-card {
    padding: 1rem 0.85rem !important;
    margin: 1.15rem 0 !important;
    border-radius: var(--radius-md) !important;
    width: 100% !important;
  }
  .calc-title {
    font-size: 1.24rem !important;
  }
  .calc-subtitle {
    font-size: 0.85rem !important;
  }
  .savings-highlight {
    font-size: 1.9rem !important;
  }
  .calc-summary-stats {
    flex-direction: column !important;
    gap: 0.35rem !important;
    text-align: center !important;
  }
  .calc-btn-action {
    width: 100% !important;
    padding: 11px !important;
    font-size: 0.95rem !important;
  }
  .calc-tabs {
    display: flex !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 4px !important;
    padding-bottom: 2px !important;
  }
  .calc-tab {
    flex: 0 0 auto !important;
    padding: 7px 11px !important;
    font-size: 0.78rem !important;
  }
  .calc-steps {
    flex-wrap: wrap !important;
    gap: 2px !important;
  }
  .calc-step {
    flex: 1 1 30% !important;
    font-size: 0.7rem !important;
    padding: 5px 2px !important;
    border-right: none !important;
    border-bottom: 1px solid white !important;
  }
  .tip-slider-grid {
    display: block !important;
  }
  .result-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.5rem !important;
  }
  .result-tile {
    padding: 9px 5px !important;
  }
  .result-tile .tile-val {
    font-size: 1.25rem !important;
  }

  /* Footer */
  .footer-grid {
    display: block !important;
  }
  .footer-col {
    margin-bottom: 1.5rem !important;
  }
  .footer-bottom {
    flex-direction: column !important;
    text-align: center !important;
    gap: 0.4rem !important;
  }
  .footer-legal-notice {
    font-size: 0.76rem !important;
  }

  /* Floating Back to Top */
  #back-to-top {
    width: 38px;
    height: 38px;
    font-size: 0.95rem;
    bottom: 1rem;
    right: 1rem;
  }
}

/* ── Small Mobile Screens (max-width: 480px) ───────────────────── */
@media (max-width: 480px) {
  body {
    font-size: 15px;
  }
  .container {
    padding: 0 10px !important;
  }
  .brand-logo {
    font-size: 1rem;
    gap: 5px;
  }
  .logo-badge {
    width: 28px;
    height: 28px;
    font-size: 0.88rem;
    border-radius: 6px;
  }
  .logo-text {
    font-size: 1rem;
  }
  .mobile-toggle {
    width: 36px;
    height: 36px;
    font-size: 1.15rem;
  }
  h1 {
    font-size: 1.32rem !important;
  }
  h2 {
    font-size: 1.15rem !important;
  }
  .score-metrics {
    grid-template-columns: 1fr !important;
    gap: 0.4rem !important;
  }
  .result-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.45rem !important;
  }
  .result-tile .tile-val {
    font-size: 1.15rem !important;
  }
  .card-thumb {
    height: 140px !important;
  }
}

/* ── Very Small Screens (max-width: 360px) ─────────────────────── */
@media (max-width: 360px) {
  .brand-logo {
    font-size: 0.92rem;
  }
  .logo-text {
    font-size: 0.92rem;
  }
  h1 {
    font-size: 1.2rem !important;
  }
  .main-content {
    padding: 0.85rem 0.6rem !important;
  }
  .result-grid {
    grid-template-columns: 1fr !important;
  }
}

/* -- UX polish: smooth anchor scrolling + offset for sticky header -- */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
section[id], div[id="faqs"] { scroll-margin-top: 90px; }
