/* ============================================
   FermentSimply — Global Stylesheet
   Aesthetic: Warm, organic, editorial
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=Source+Sans+3:wght@300;400;500;600;700&display=swap');

:root {
  --color-bg: #FBF8F3;
  --color-bg-alt: #F3EDE4;
  --color-surface: #FFFFFF;
  --color-text: #2D2A26;
  --color-text-muted: #6B6560;
  --color-heading: #1A1714;
  --color-accent: #C06B2D;
  --color-accent-hover: #A55A22;
  --color-accent-light: #F5E6D3;
  --color-border: #E5DDD3;
  --color-footer-bg: #2D2A26;
  --color-footer-text: #D4CDC4;
  --font-heading: 'DM Serif Display', Georgia, serif;
  --font-body: 'Source Sans 3', 'Segoe UI', sans-serif;
  --max-width: 1140px;
  --content-width: 740px;
  --radius: 6px;
  --shadow-sm: 0 1px 3px rgba(45,42,38,0.06);
  --shadow-md: 0 4px 12px rgba(45,42,38,0.08);
  --shadow-lg: 0 8px 24px rgba(45,42,38,0.1);
  --transition: 0.25s ease;
}

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

html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-accent-hover); }

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--color-heading);
  line-height: 1.25;
  font-weight: 400;
}
h1 { font-size: 2.4rem; margin-bottom: 0.6em; }
h2 { font-size: 1.7rem; margin: 1.8em 0 0.5em; }
h3 { font-size: 1.3rem; margin: 1.4em 0 0.4em; }
p { margin-bottom: 1.1em; }

ul, ol { margin: 0 0 1.2em 1.4em; }
li { margin-bottom: 0.4em; }

/* ---- CONTAINER ---- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* ---- HEADER / NAV ---- */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.logo {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--color-heading);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo img, .logo svg { height: 36px; width: auto; }
.logo span { color: var(--color-accent); }
.nav-menu { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; align-items: center; }
.nav-menu > li { position: relative; }
.nav-menu > li > a {
  color: var(--color-text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: color var(--transition);
  padding: 8px 12px;
  border-radius: var(--radius);
  display: block;
  white-space: nowrap;
}
.nav-menu > li > a:hover { color: var(--color-accent); background: var(--color-bg-alt); }

/* Dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown > a::after { content: ' ▾'; font-size: 0.7em; }
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  min-width: 220px;
  padding: 8px 0;
  z-index: 200;
  list-style: none;
  margin: 4px 0 0;
}
.nav-dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu li a {
  display: block;
  padding: 8px 18px;
  color: var(--color-text);
  font-size: 0.88rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  transition: background var(--transition), color var(--transition);
}
.dropdown-menu li a:hover { background: var(--color-bg-alt); color: var(--color-accent); }

/* Tools nav highlight */
.nav-menu .tools-link a {
  background: var(--color-accent);
  color: #fff !important;
  border-radius: var(--radius);
}
.nav-menu .tools-link a:hover {
  background: var(--color-accent-hover);
}

.menu-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-heading);
  margin: 5px 0;
  transition: var(--transition);
}

/* ---- BREADCRUMBS ---- */
.breadcrumbs {
  padding: 14px 0;
  font-size: 0.82rem;
  color: var(--color-text-muted);
}
.breadcrumbs a { color: var(--color-text-muted); }
.breadcrumbs a:hover { color: var(--color-accent); }
.breadcrumbs .sep { margin: 0 6px; }

/* ---- HERO (Homepage) ---- */
.hero {
  background: linear-gradient(135deg, var(--color-accent-light) 0%, var(--color-bg) 100%);
  padding: 72px 0 64px;
  text-align: center;
  border-bottom: 1px solid var(--color-border);
}
.hero h1 { font-size: 2.8rem; margin-bottom: 0.3em; }
.hero .tagline {
  font-size: 1.15rem;
  color: var(--color-text-muted);
  max-width: 600px;
  margin: 0 auto 1.6em;
  line-height: 1.6;
}
.hero .cta-btn {
  display: inline-block;
  background: var(--color-accent);
  color: #fff;
  padding: 12px 32px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  transition: background var(--transition), transform var(--transition);
}
.hero .cta-btn:hover { background: var(--color-accent-hover); transform: translateY(-1px); color: #fff; }

/* ---- MAIN LAYOUT ---- */
.page-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
  padding: 48px 0 64px;
}
.page-content { max-width: var(--content-width); }
.page-full { max-width: var(--content-width); margin: 0 auto; padding: 48px 0 64px; }

/* ---- ARTICLE STYLES ---- */
.article-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 2em;
  padding-bottom: 1em;
  border-bottom: 1px solid var(--color-border);
}
.article-meta .author { font-weight: 600; color: var(--color-text); }

.article-content h2 { border-bottom: 2px solid var(--color-accent-light); padding-bottom: 0.3em; }
.article-content blockquote {
  border-left: 3px solid var(--color-accent);
  margin: 1.5em 0;
  padding: 0.8em 1.2em;
  background: var(--color-bg-alt);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--color-text-muted);
}
.article-content .tip-box {
  background: var(--color-accent-light);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 1.5em 0;
  font-size: 0.95rem;
}
.article-content .tip-box strong { color: var(--color-accent); }

/* ---- AD PLACEHOLDERS ---- */
.ad-placeholder {
  background: var(--color-bg-alt);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  margin: 1.5em 0;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- SIDEBAR ---- */
.sidebar {}
.sidebar-widget {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}
.sidebar-widget h3 {
  font-size: 1.05rem;
  margin: 0 0 1em;
  padding-bottom: 0.5em;
  border-bottom: 2px solid var(--color-accent-light);
}
.sidebar-widget ul { list-style: none; margin: 0; padding: 0; }
.sidebar-widget li { margin-bottom: 0.6em; }
.sidebar-widget li a {
  color: var(--color-text);
  font-size: 0.9rem;
  display: block;
  padding: 4px 0;
}
.sidebar-widget li a:hover { color: var(--color-accent); padding-left: 4px; }

/* ---- CARD GRID (Homepage, Category) ---- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
  margin: 2em 0;
}
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 28px;
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card .card-category {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-accent);
  font-weight: 600;
  margin-bottom: 8px;
}
.card h3 { font-size: 1.2rem; margin: 0 0 0.5em; }
.card h3 a { color: var(--color-heading); }
.card h3 a:hover { color: var(--color-accent); }
.card p { font-size: 0.9rem; color: var(--color-text-muted); margin-bottom: 0.8em; }
.card .read-more {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-accent);
}

/* ---- CATEGORY HUB ---- */
.category-header {
  background: var(--color-bg-alt);
  padding: 48px 0;
  text-align: center;
  border-bottom: 1px solid var(--color-border);
}
.category-header p {
  max-width: 620px;
  margin: 0.5em auto 0;
  color: var(--color-text-muted);
}

/* ---- SECTION BLOCKS ---- */
.section-block {
  padding: 56px 0;
  border-bottom: 1px solid var(--color-border);
}
.section-block:last-child { border-bottom: none; }
.section-title {
  text-align: center;
  margin-bottom: 0.3em;
}
.section-subtitle {
  text-align: center;
  color: var(--color-text-muted);
  max-width: 560px;
  margin: 0 auto 2em;
}

/* ---- FOOTER ---- */
.site-footer {
  background: var(--color-footer-bg);
  color: var(--color-footer-text);
  padding: 56px 0 32px;
  margin-top: 64px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer-col h4 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 1em;
}
.footer-col p { font-size: 0.88rem; line-height: 1.6; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 0.5em; }
.footer-col a { color: var(--color-footer-text); font-size: 0.88rem; }
.footer-col a:hover { color: var(--color-accent); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  text-align: center;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.4);
}

/* ---- POLICY PAGES ---- */
.policy-content h2 { font-size: 1.4rem; margin-top: 2em; }
.policy-content h3 { font-size: 1.15rem; }
.policy-content ul { margin-bottom: 1.2em; }

/* ---- CONTACT FORM ---- */
.contact-form { max-width: 520px; }
.contact-form label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--color-heading);
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  margin-bottom: 16px;
  background: var(--color-surface);
  transition: border-color var(--transition);
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--color-accent);
}
.contact-form textarea { min-height: 140px; resize: vertical; }
.contact-form button {
  background: var(--color-accent);
  color: #fff;
  border: none;
  padding: 12px 32px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background var(--transition);
}
.contact-form button:hover { background: var(--color-accent-hover); }

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .page-layout { grid-template-columns: 1fr; }
  .sidebar { order: 2; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .nav-menu { display: none; }
  .nav-menu.active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 16px 24px;
    gap: 4px;
    box-shadow: var(--shadow-md);
  }
  .nav-menu.active > li > a { padding: 10px 12px; }
  .dropdown-menu { position: static; box-shadow: none; border: none; padding: 0 0 0 16px; min-width: auto; margin: 0; }
  .nav-dropdown:hover .dropdown-menu,
  .nav-menu.active .dropdown-menu { display: block; }
  .nav-dropdown > a::after { content: ''; }
  .menu-toggle { display: block; }
  .hero h1 { font-size: 2rem; }
  h1 { font-size: 1.8rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .nav-menu .tools-link a { text-align: center; }
}

/* ---- ARTICLE ILLUSTRATION ---- */
.article-illustration {
  width: 100%;
  max-height: 320px;
  background: var(--color-bg-alt);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5em;
  display: flex;
  align-items: center;
  justify-content: center;
}
.article-illustration svg { width: 100%; height: auto; max-height: 320px; }

/* ---- TOOL PAGES ---- */
.tool-container {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 32px;
  margin: 2em 0;
  box-shadow: var(--shadow-sm);
}
.tool-container h2 {
  margin-top: 0;
  border-bottom: none;
}
.tool-form label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--color-heading);
}
.tool-form input[type="number"],
.tool-form input[type="text"],
.tool-form select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 1rem;
  margin-bottom: 16px;
  background: var(--color-bg);
  transition: border-color var(--transition);
}
.tool-form input:focus,
.tool-form select:focus { outline: none; border-color: var(--color-accent); }
.tool-form .input-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 640px) {
  .tool-form .input-group { grid-template-columns: 1fr; }
}
.tool-btn {
  display: inline-block;
  background: var(--color-accent);
  color: #fff;
  padding: 12px 28px;
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: background var(--transition);
  font-family: var(--font-body);
}
.tool-btn:hover { background: var(--color-accent-hover); }
.tool-result {
  margin-top: 24px;
  padding: 20px;
  background: var(--color-accent-light);
  border-radius: var(--radius);
  border: 1px solid var(--color-accent);
  display: none;
}
.tool-result.active { display: block; }
.tool-result h3 { color: var(--color-accent); margin: 0 0 0.5em; font-size: 1.2rem; }
.tool-result .result-value {
  font-size: 1.8rem;
  font-family: var(--font-heading);
  color: var(--color-heading);
  margin: 0.3em 0;
}
.tool-result p { font-size: 0.92rem; color: var(--color-text-muted); margin: 0.3em 0; }

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin: 2em 0;
}
.tool-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 28px;
  text-align: center;
  transition: box-shadow var(--transition), transform var(--transition);
}
.tool-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.tool-card .tool-icon { font-size: 2.4rem; margin-bottom: 12px; }
.tool-card h3 { font-size: 1.15rem; margin: 0 0 0.4em; }
.tool-card h3 a { color: var(--color-heading); }
.tool-card h3 a:hover { color: var(--color-accent); }
.tool-card p { font-size: 0.88rem; color: var(--color-text-muted); margin-bottom: 1em; }
.tool-card .read-more { font-size: 0.85rem; font-weight: 600; }
