:root {
  --bg: #f4f1ea;
  --surface: #fffaf2;
  --primary: #3b3733;
  --accent: #c7a97b;
  --text: #2b2825;
  --radius: 16px;
}

body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.container {
  width: min(1100px, 92%);
  margin: auto;
}

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 2px solid var(--accent);
}

.nav-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

/* Featured */
.featured {
  display: grid;
  gap: 1rem;
  margin: 2rem 0;
}

.featured img {
  width: 100%;
  border-radius: var(--radius);
}

.featured-content {
  background: var(--surface);
  padding: 2rem;
  border-radius: var(--radius);
}

/* Cards */
.post-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .3s ease;
}

.card:hover {
  transform: translateY(-6px);
}

.card img {
  width: 100%;
}

.card-content {
  padding: 1.2rem;
}

/* Chips */
.categories {
  display: flex;
  gap: .5rem;
  margin-bottom: 1.5rem;
}

.chip {
  background: transparent;
  border: 1px solid var(--accent);
  padding: .4rem .9rem;
  border-radius: 999px;
  cursor: pointer;
}

.chip.active {
  background: var(--primary);
  color: white;
}

/* Buttons */
.btn {
  background: var(--primary);
  color: white;
  padding: .7rem 1.2rem;
  border-radius: var(--radius);
  text-decoration: none;
}

/* Search */
.search-bar input {
  width: 100%;
  padding: .8rem;
  border-radius: var(--radius);
  border: 1px solid #ddd;
  margin: 1.5rem 0;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 2rem 0;
}

:root {
  --bg: #f4f1ea;
  --surface: #fffaf2;
  --primary: #3b3733;
  --accent: #c7a97b;
  --text: #2b2825;
  --radius: 14px;
}

body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.container {
  width: min(1100px, 92%);
  margin: auto;
}

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 2px solid var(--accent);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Nav */
.nav {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.nav a {
  text-decoration: none;
  color: var(--primary);
  position: relative;
}

.nav a.active::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 2px;
  background: var(--accent);
  bottom: -4px;
  left: 0;
}

/* Footer */
.site-footer {
  background: var(--surface);
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 2px solid var(--accent);
}

.footer-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.footer-links {
  list-style: none;
  padding: 0;
}

.sub-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
}

/* Buttons */
.btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: .6rem 1.2rem;
  border-radius: var(--radius);
  cursor: pointer;
}

/* Back to top */
.back-to-top {
  background: var(--primary);
  color: white;
  border: none;
  padding: .5rem .9rem;
  border-radius: 50%;
}

/* Accessibility */
.skip-link {
  position: absolute;
  left: -999px;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
  background: black;
  color: white;
  padding: .5rem 1rem;
}

.visually-hidden {
  position: absolute;
  left: -9999px;
}

/* Hero Section */
.home-hero {
  text-align: center;
  margin: 3rem 0 1rem;
}

.hero-subtitle {
  color: #6b645c;
  font-size: 1.1rem;
}

/* Intro Paragraph */
.home-intro {
  text-align: center;
  margin-bottom: 2.5rem;
  font-size: 1rem;
  color: #5f5850;
}

/* Featured Posts Section */
.featured-posts h2 {
  margin-bottom: 1.5rem;
  color: var(--primary);
  text-align: center;
}

.featured-posts .post-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* ------------------------
   Contact Page
------------------------- */

.contact-form {
  max-width: 600px;
  margin: 2rem auto;
  background: var(--surface);
  padding: 2rem;
  border-radius: var(--radius);
  border: 1px solid #e2d8c7;
}

.contact-form button {
  background: var(--primary);
  color: var(--surface);
  font-weight: 600;
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
}

.contact-form button:hover {
  background: var(--accent);
  color: var(--text);
}

.card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.form-success {
  background: #e6ffed;
  color: #067d32;
  border: 1px solid #b7ebc6;
  padding: 12px;
  margin-bottom: 20px;
  border-radius: 6px;
  font-weight: 600;
}

.newsletter-form {
  display: flex;
  gap: 0.5rem;
}

.newsletter-form input {
  flex: 1;
  padding: 0.6rem;
  border: 1px solid #d8cfc0;
  background: #f5f1e8;
}

.newsletter-form button {
  background: #3f3a34;
  color: #fff;
  border: none;
  padding: 0 1rem;
  cursor: pointer;
}

.success-message {
  background: #e6f4ea;
  padding: 1rem;
  border-radius: 6px;
}

.error-message {
  background: #fdecea;
  padding: 1rem;
  border-radius: 6px;
}

.error {
  color: #d93025;
  font-size: 0.85rem;
  display: block;
  margin-bottom: 10px;
}

.form-success {
  background: #e6ffed;
  color: #067d32;
  border: 1px solid #b7ebc6;
  padding: 12px;
  margin-bottom: 20px;
  border-radius: 6px;
  font-weight: 600;
}

input, textarea {
  display: block;
  margin-bottom: 5px;
  padding: 6px;
  border: 1px solid #d8cfc0;
  border-radius: 4px;
  background: #f5f1e8;
}

/* Waffle Icon Menu */
.waffle-menu-container {
  position: relative;
  display: inline-block;
}

#waffle-button {
  background: #f5f1e8;
  border: 1px solid #3c2f2f;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 1.25rem;
  border-radius: 0.25rem;
}

#waffle-button:focus {
  outline: 2px solid #1a73e8;
}

.waffle-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: #fdf6e3;
  border: 1px solid #3c2f2f;
  padding: 0.5rem 0;
  margin: 0;
  list-style: none;
  display: none; /* Hidden by default */
  min-width: 150px;
  z-index: 100;
  border-radius: 0.25rem;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.waffle-menu li a {
  display: block;
  padding: 0.5rem 1rem;
  color: #3c2f2f;
  text-decoration: none;
}

.waffle-menu li a:hover,
.waffle-menu li a:focus {
  background-color: #e0d6c1;
  outline: none;
}
/* --- Light Mode --- */
:root {
  --bg-color: #f5f0e6;      /* beige background */
  --text-color: #222;        /* darker text for readability */
  --secondary-text: #555;    /* for meta info, dates, excerpts */
  --accent-color: #c49e70;   /* links, buttons, highlights */
  --card-bg: #fff;           /* card background */
}

/* --- Dark Mode --- */
body.dark-mode {
  --bg-color: #1e1e1e;       /* dark background */
  --text-color: #f5f5f5;     /* main text white */
  --secondary-text: #cccccc; /* meta info, dates, smaller text */
  --accent-color: #ffcc66;   /* warm accent on dark */
  --card-bg: #2c2c2c;        /* card background */
}

/* Apply variables */
body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: 'Helvetica', sans-serif;
}

/* Links */
a, .nav a, .read-more, .waffle-menu a {
  color: var(--accent-color);
}

a:hover, .nav a:hover, .read-more:hover {
  color: lighten(var(--accent-color), 10%);
  text-decoration: underline;
}

/* Secondary text: meta info, post dates, authors */
.meta, .blog-meta, .post-grid p, .card-excerpt {
  color: var(--secondary-text);
}

/* Cards */
.card {
  background-color: var(--card-bg);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  border-radius: 8px;
}

/* Headings */
h1, h2, h3 {
  color: var(--text-color);
}

/* Forms */
input, textarea, select {
  background-color: var(--card-bg);
  color: var(--text-color);
  border: 1px solid #ccc;
}

input::placeholder, textarea::placeholder {
  color: var(--secondary-text);
}

/* Buttons */
button {
  background-color: var(--accent-color);
  color: var(--bg-color);
}

/* Waffle Menu */
.waffle-menu {
  background-color: var(--card-bg);
  border: 1px solid #ccc;
  color: var(--text-color);
}
.waffle-menu a {
  color: var(--text-color);
}

/* Footer text */
footer, footer p, footer a {
  color: var(--secondary-text);
}

footer a:hover {
  color: var(--accent-color);
}

/* Waffle icon */
.waffle-icon {
  color: var(--text-color);  /* ensures it shows on dark mode */
  font-size: 1.5rem;
}

/* Waffle hover/focus */
.waffle-menu-container button:hover,
.waffle-menu-container button:focus {
  color: var(--accent-color);
}

/* Footer headings */
footer h1,
footer h2,
footer h3,
footer h4,
footer h5,
footer h6 {
  color: var(--text-color); /* use the main text color in dark mode */
}

/* Footer headings slightly muted */
footer h2 {
  color: var(--secondary-text);
}

/* Waffle button icon */
.waffle-menu-container button#waffle-button {
  background-color: var(--card-bg); /* ensure button background is visible */
  color: var(--text-color);         /* icon color */
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
}

/* Hover/focus for accessibility */
.waffle-menu-container button#waffle-button:hover,
.waffle-menu-container button#waffle-button:focus {
  background-color: var(--accent-color);
  color: var(--bg-color);
  outline: none;
}

/* Dropdown menu */
.waffle-menu {
  display: none;                 /* hidden by default */
  position: absolute;
  top: 100%;                     /* below the button */
  left: 0;
  background-color: var(--card-bg); /* dark mode card background */
  border: 1px solid #444;        /* subtle border */
  border-radius: 5px;
  list-style: none;
  padding: 0.5rem 0;
  z-index: 999;
}

/* Each link inside dropdown */
.waffle-menu li a {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--text-color);
  text-decoration: none;
}

/* Hover/focus state */
.waffle-menu li a:hover,
.waffle-menu li a:focus {
  background-color: var(--accent-color);
  color: var(--bg-color);
}

#post-count {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted, #555);
}

/* Footer fade-in */
@keyframes fadeInUp {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

.site-footer .fade-in {
  opacity: 0;
  animation: fadeInUp 0.8s forwards;
}

.site-footer .footer-about { animation-delay: 0.2s; }
.site-footer nav { animation-delay: 0.4s; }
.site-footer .footer-newsletter { animation-delay: 0.6s; }
.site-footer .sub-footer { animation-delay: 0.8s; }

/* Optional: newsletter hover effect */
.newsletter-form button {
  transition: background 0.2s, transform 0.2s;
}

.newsletter-form button:hover {
  background: #ffcc00; /* adjust for dark mode */
  transform: scale(1.05);
}

/* Back-to-top button fade in/out handled in JS */