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

/* Skip navigation for accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: #000;
  color: #fff;
  padding: 8px;
  z-index: 100;
  text-decoration: none;
  border-radius: 4px;
}

.skip-link:focus {
  top: 6px;
}

/* Enhanced focus styles for accessibility */
*:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

a:focus,
button:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
  background-color: rgba(102, 126, 234, 0.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: #2c3e50;
  background: #fafafa;
}

/* Ensure all main content text is dark by default */
main {
  color: #2c3e50;
}

p {
  color: #495057;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --text: #e5e7eb;
    --surface: #111827;
    --muted: #9ca3af;
    --brand: #8ea8ff;
  }
  body {
    background: var(--bg);
    color: var(--text);
  }
  .main-nav {
    background: var(--surface);
    border-bottom-color: #1f2937;
  }
  .nav-links a {
    color: var(--text);
  }
  .nav-links a:hover,
  .nav-links a.active {
    background: rgba(142, 168, 255, 0.12);
    color: var(--brand);
  }
  main {
    background: var(--surface);
  }
  h1,
  h2,
  h3 {
    color: var(--text);
  }
  .highlight-box {
    background: #0b1220;
    border-left-color: #34d399;
  }
  .recipe-card,
  .category-card,
  .ingredients,
  .article-content,
  .featured-article,
  .blog-card {
    background: #0b1220;
    border-color: #1f2937;
  }
  .references-list {
    background: #0b1220;
    border-left-color: var(--brand);
  }
  footer {
    background: #0b1220;
  }
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 2rem 0;
  text-align: center;
}

/* Hero header with image */
.hero-header {
  position: relative;
  min-height: 50vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.4) 0%,
    rgba(118, 75, 162, 0.4) 100%
  );
}

.hero-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 2rem 0;
}

.hero-content h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-content .subtitle {
  font-size: 1.3rem;
  margin-bottom: 2rem;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
}

.hero-content .stat-highlight {
  background: rgba(255, 255, 255, 0.15);
  padding: 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

h1 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 1.5rem;
}

.stat-highlight {
  background: rgba(255, 255, 255, 0.1);
  padding: 1rem;
  border-radius: 8px;
  font-weight: 600;
  backdrop-filter: blur(10px);
}

/* Navigation styles */
.main-nav {
  background: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid #e9ecef;
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.site-logo a {
  text-decoration: none;
  display: flex;
  align-items: center;
}

.site-logo h2 {
  color: #2c3e50;
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: #2c3e50;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.nav-links a:hover {
  color: #667eea;
  background: rgba(102, 126, 234, 0.1);
}

.nav-links a.active {
  color: #667eea;
  background: rgba(102, 126, 234, 0.1);
}

@media (max-width: 768px) {
  .nav-content {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .nav-links {
    gap: 1rem;
  }

  .nav-links a {
    font-size: 1rem;
    padding: 0.4rem 0.8rem;
  }
}

main {
  background: white;
  padding: 3rem 0;
}

.section {
  margin-bottom: 3rem;
}

h2 {
  color: #2c3e50;
  font-size: 1.8rem;
  margin-bottom: 1rem;
  /* Removed decorative left border sitewide */
}

/* Optional utility: add a left rule to headings when desired */
.rule-heading {
  border-left: 4px solid #667eea;
  padding-left: 1rem;
}

h3 {
  color: #34495e;
  font-size: 1.3rem;
  margin: 1.5rem 0 0.8rem 0;
}

.highlight-box {
  background: #f8f9fa;
  border-left: 4px solid #28a745;
  padding: 1.5rem;
  margin: 1.5rem 0;
  border-radius: 0 8px 8px 0;
}

.highlight-box strong {
  color: #28a745;
}

/* Newsletter card */
.newsletter-card {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 2.5rem 2rem;
  margin: 2rem 0;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.newsletter-card h3 {
  color: #2c3e50;
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.newsletter-card p {
  color: #6c757d;
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.newsletter-form {
  max-width: 400px;
  margin: 0 auto;
}

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.recipe-card {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
}

.recipe-card:hover {
  transform: translateY(-2px);
}

.recipe-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 0.5rem;
}

.recipe-time {
  color: #6c757d;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.ingredients {
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 6px;
  margin: 1rem 0;
}

.ingredients h4 {
  margin-bottom: 0.5rem;
  color: #495057;
}

ul {
  padding-left: 1.2rem;
  margin-bottom: 1rem;
}

li {
  margin-bottom: 0.3rem;
}

.quick-facts {
  background: linear-gradient(135deg, #ff6b6b, #ffa726);
  color: white;
  padding: 2rem;
  border-radius: 12px;
  margin: 2rem 0;
}

.quick-facts h3 {
  color: white;
  margin-bottom: 1rem;
}

.facts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.fact-item {
  background: rgba(255, 255, 255, 0.2);
  padding: 1rem;
  border-radius: 8px;
  backdrop-filter: blur(10px);
}

.cta-section {
  background: #2c3e50;
  color: white;
  padding: 3rem 0;
  text-align: center;
}

.cta-section h2 {
  color: white;
  border-left: none;
  padding-left: 0;
}

footer {
  background: #34495e;
  color: #ffffff;
  padding: 2rem 0;
  text-align: center;
}

.footer-content {
  font-size: 0.9rem;
  color: #ffffff !important;
}

.footer-content * {
  color: #ffffff !important;
}

.privacy-notice {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: #ffffff !important;
}

.privacy-notice * {
  color: #ffffff !important;
}

/* Footer link styles */
.footer-content a {
  color: #b3c7ff;
  text-decoration: none;
}

.footer-content a:hover {
  text-decoration: underline;
}

.footer-links {
  margin-top: 1rem;
}

.last-updated {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
}

/* Print button styling (hidden in print via print.css) */
.print-button {
  background: #667eea;
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
}

.print-button:hover {
  background: #5766d9;
}

@media (max-width: 768px) {
  .hero-header {
    min-height: 40vh;
  }

  .hero-content h1 {
    font-size: 2.2rem;
  }

  .hero-content .subtitle {
    font-size: 1.1rem;
  }

  .hero-content .stat-highlight {
    padding: 1rem;
    font-size: 0.9rem;
  }

  h1 {
    font-size: 1.8rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .recipe-grid {
    grid-template-columns: 1fr;
  }

  .facts-grid {
    grid-template-columns: 1fr;
  }

  .recipe-header .recipe-title {
    font-size: 2rem;
  }

  .recipe-header .recipe-subtitle {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }

  .related-recipes {
    padding: 1.5rem;
    margin-top: 2rem;
  }

  .related-recipes h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
  }

  .recipe-links {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .recipe-link {
    padding: 1rem;
  }
}

.reference-category {
  margin-bottom: 2rem;
}

.reference-category h3 {
  color: #667eea;
  font-size: 1.2rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid #e9ecef;
  padding-bottom: 0.5rem;
}

.references-list {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 8px;
  border-left: 4px solid #667eea;
}

.references-list li {
  margin-bottom: 1rem;
  line-height: 1.5;
}

.references-list strong {
  color: #2c3e50;
}

.references-list em {
  color: #6c757d;
}

.references-list a {
  color: #667eea;
  text-decoration: none;
  font-weight: 500;
}

.references-list a:hover {
  text-decoration: underline;
}

.references-container {
  margin: 1.5rem 0;
}

/* Generic table styles (used in guides and data tables) */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

thead th {
  background: #f8f9fa;
  color: #2c3e50;
}

th,
td {
  border: 1px solid #e9ecef;
  padding: 0.6rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

tbody tr:nth-child(even) {
  background: #fcfdff;
}

/* Checklist bullets with checkmarks */
.checklist {
  list-style: none;
  padding-left: 0;
}

.checklist li {
  position: relative;
  padding-left: 1.4rem;
}

.checklist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0.05rem;
  color: #28a745;
  font-weight: 700;
}

@media (prefers-color-scheme: dark) {
  thead th {
    background: #0b1220;
    color: var(--text);
  }
  th,
  td {
    border-color: #1f2937;
  }
  tbody tr:nth-child(even) {
    background: #0b1220;
  }
}

/* Newsletter section (compact, subtle) */
.newsletter {
  background: transparent;
  border: none;
  border-top: 1px solid #eef1ff;
  border-radius: 0;
  padding: 12px 0 0 0;
  margin: 1.5rem 0 0.75rem 0;
  text-align: center;
}

.newsletter h3 {
  margin-bottom: 0.5rem;
  color: #2c3e50;
  font-size: 1.1rem;
  font-weight: 700;
}

.newsletter p {
  margin-bottom: 1rem;
  color: #6c757d;
  font-size: 0.95rem;
}

/* Center and size the embedded Beehiiv iframe */
.newsletter .beehiiv-embed,
.newsletter iframe {
  display: block;
  width: 100% !important;
  max-width: 380px;
  min-height: 140px;
  margin: 0 auto;
  border: 0;
  background: transparent;
}

@media (max-width: 480px) {
  .newsletter #beehiiv-subscribe-form {
    width: 100% !important;
    max-width: 100% !important;
    padding: 10px !important;
  }
}

/* Breadcrumb styles */
.breadcrumb {
  padding: 1rem 0;
  font-size: 0.9rem;
  color: #666;
}

.breadcrumb a {
  color: #667eea;
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* Recipe page specific styles */
.recipe-title a {
  color: #2c3e50;
  text-decoration: none;
  font-weight: 600;
}

.recipe-title a:hover {
  color: #667eea;
}

.recipe-stats-mini {
  color: #6c757d;
  font-size: 0.9rem;
  margin: 0.5rem 0;
}

.recipe-description {
  margin: 1rem 0;
  color: #495057;
  line-height: 1.5;
}

.recipe-highlights {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.highlight-tag {
  background: #667eea;
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
}

/* Recipe page header styles */
.recipe-header {
  text-align: center;
  margin-bottom: 2rem;
}

.recipe-header .recipe-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.recipe-header .recipe-subtitle {
  font-size: 1.2rem;
  color: #6c757d;
  margin-bottom: 2rem;
  font-weight: 400;
  line-height: 1.4;
}

/* Recipe page image styles */
.recipe-image {
  margin: 2rem 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.recipe-image img {
  width: 100%;
  height: auto;
  max-height: 400px;
  display: block;
  object-fit: cover;
}

/* Related recipes section */
.related-recipes {
  margin-top: 3rem;
  padding: 2rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  color: white;
}

.related-recipes h3 {
  text-align: center;
  color: white;
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 2rem;
}

.recipe-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  max-width: 800px;
  margin: 0 auto;
}

.recipe-link {
  display: block;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.5;
}

.recipe-link:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  color: rgba(255, 255, 255, 0.95);
}

.recipe-link strong {
  font-size: 1.2rem;
  font-weight: 700;
  color: white;
  display: block;
  margin-bottom: 0.5rem;
}

/* Category grid */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.category-card {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.category-card h3 {
  color: #2c3e50;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.category-card ul {
  list-style: none;
  padding: 0;
}

.category-card li {
  padding: 0.5rem 0;
  border-bottom: 1px solid #f8f9fa;
}

.category-card li:last-child {
  border-bottom: none;
}

.category-card a {
  color: #667eea;
  text-decoration: none;
  font-weight: 500;
}

.category-card a:hover {
  text-decoration: underline;
}
