/* MGL Green Brand Variables */
:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --text: #343a40;
  --muted: #6c757d;
  --brand-light: #4caf50;   /* light green */
  --brand: #2e7d32;          /* mgl-green */
  --brand-strong: #1b5e20;   /* mgl-dark-green */
  --accent: #4caf50;         /* align accent to green */
  --ring: rgba(46, 125, 50, 0.25);
  --radius: 12px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", Arial, sans-serif;
  background: #ffffff;
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }

.container {
  width: 100%;
  max-width: 1100px;
  padding: 0 20px;
  margin: 0 auto;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 1px, 1px);
  white-space: nowrap; border: 0;
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(27, 94, 32, 0.95);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; font-weight: 700; }
.logo { width: 32px; height: 32px; object-fit: contain; }
.brand-text { letter-spacing: 0.4px; color: #fff; }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; }
.nav-toggle .bar { display: block; width: 22px; height: 2px; background: #fff; margin: 5px 0; transition: transform .2s ease, opacity .2s ease; }

.nav-list { display: flex; align-items: center; gap: 18px; list-style: none; margin: 0; padding: 0; }
.nav-list a { color: #fff; text-decoration: none; opacity: 0.95; }
.nav-list a:hover { opacity: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 40px; padding: 0 16px; border-radius: 10px;
  text-decoration: none; color: #fff;
  border: 2px solid rgba(255,255,255,0.3);
  background: transparent;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { transform: translateY(-1px); border-color: rgba(255,255,255,0.6); color: #fff; }
.btn:focus { outline: none; box-shadow: 0 0 0 4px var(--ring); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.btn-ghost { background: transparent; border-color: rgba(255,255,255,0.35); color: #fff; }
.btn-small { height: 34px; padding: 0 12px; border-radius: 8px; font-size: 14px; }

/* Hero (green gradient) */
.hero { padding: 84px 0 40px; position: relative; background: linear-gradient(135deg, var(--brand-light) 0%, var(--brand) 60%, var(--brand-strong) 100%); color: #fff; }
.hero-inner { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: center; }
.hero h1 { font-size: 44px; line-height: 1.05; margin: 0 0 14px; letter-spacing: -0.02em; font-family: 'Quicksand', var(--font-secondary, 'Poppins'), sans-serif; }
.hero p { color: rgba(255,255,255,0.92); margin: 0 0 22px; }
.cta-group { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-illustration { width: 100%; height: 260px; border-radius: 16px; background:
  radial-gradient(120px 80px at 20% 30%, rgba(255,255,255,0.22), transparent 60%),
  radial-gradient(160px 100px at 80% 70%, rgba(255,255,255,0.22), transparent 60%),
  linear-gradient(180deg, rgba(255,255,255,0.15), rgba(255,255,255,0.08));
  border: 1px solid rgba(255,255,255,0.3);
  box-shadow: 0 20px 60px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.2);
}

/* Hero image media */
.hero-image-media {
  width: 100%;
  height: auto;
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 20px 60px rgba(0,0,0,0.12);
}

/* Sections */
.section { padding: 56px 0; }
.section.alt { background: #f8f9fa; border-top: 1px solid #e9ecef; border-bottom: 1px solid #e9ecef; }
.section h2 { font-size: 28px; margin: 0 0 16px; letter-spacing: -0.01em; color: var(--brand-strong); }
.section p { color: var(--muted); }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 20px; }
.feature { padding: 18px; border-radius: 14px; border: 1px solid #e9ecef; background: #ffffff; box-shadow: 0 2px 10px rgba(0,0,0,0.04); }
.feature h3 { margin: 0 0 6px; font-size: 18px; color: var(--brand-strong); }
.feature p { margin: 0; font-size: 15px; }

.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.product-card { padding: 18px; border-radius: 14px; border: 1px solid #e9ecef; background: #ffffff; box-shadow: 0 2px 10px rgba(0,0,0,0.04); }
.product-media { height: 140px; border-radius: 10px; margin-bottom: 12px; background:
  radial-gradient(80px 60px at 25% 25%, rgba(76, 175, 80, 0.18), transparent 60%),
  radial-gradient(100px 80px at 70% 70%, rgba(46, 125, 50, 0.18), transparent 60%),
  linear-gradient(180deg, rgba(0,0,0,0.02), rgba(0,0,0,0.01));
  border: 1px solid #e9ecef;
}

/* Join form (not in use currently) */
.join-form { margin-top: 14px; max-width: 560px; }
.form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
label { font-weight: 600; color: var(--text); }
input, textarea {
  color: var(--text); background: #ffffff; border: 2px solid #dee2e6;
  border-radius: 10px; padding: 10px 12px; font-size: 16px; outline: none;
}
input:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring); }
.form-note { color: var(--muted); font-size: 14px; margin-top: 8px; }

/* Footer */
.site-footer { padding: 26px 0; background: #ffffff; border-top: 1px solid #e9ecef; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.footer-links { display: flex; gap: 16px; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--brand-strong); }

/* Social icons */
.social-icon {
  width: 18px;
  height: 18px;
  margin-right: 8px;
  vertical-align: -3px;
  color: var(--brand-strong);
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Responsive */
@media (max-width: 920px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-illustration { height: 200px; }
}
@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav-list { position: absolute; right: 20px; top: 64px; flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px; border-radius: 12px; background: rgba(27,94,32,0.98); border: 1px solid rgba(255,255,255,0.2); display: none; }
  .nav-list.open { display: flex; }
  .features, .product-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; }
}

/* Product media images */
.product-media-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #e9ecef;
  margin-bottom: 12px;
}

/* Ingredients Calculator */
.calc-controls { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-top: 8px; margin-bottom: 14px; }
.calc-mode label { margin-right: 12px; color: var(--text); font-weight: 500; }
.calc-search input { width: 320px; max-width: 100%; padding: 10px 12px; border-radius: 10px; border: 2px solid #dee2e6; outline: none; font-size: 16px; }
.calc-search input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring); }
.calc-results { border: 1px solid #e9ecef; border-radius: 12px; padding: 14px; background: #fff; }
.calc-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px 14px; }
.calc-list.single { grid-template-columns: 1fr; }
.calc-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 999px; background: #f8f9fa; border: 1px solid #e9ecef; color: #212529; }
.calc-pill .badge { background: var(--brand); color: #fff; padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.calc-heading { margin: 6px 0 10px; color: var(--brand-strong); font-weight: 700; }
.calc-empty { color: var(--muted); font-style: italic; }

/* Calculator discovery UI */
.calc-suggest { position: absolute; background: #fff; border: 1px solid #e9ecef; border-radius: 10px; margin-top: 6px; width: 320px; max-width: calc(100% - 0px); box-shadow: 0 10px 24px rgba(0,0,0,0.08); z-index: 10; }
.calc-suggest.hidden { display: none; }
.calc-suggest-item { padding: 8px 10px; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.calc-suggest-item:hover { background: #f8f9fa; }
.calc-suggest .label { font-size: 12px; color: #6c757d; padding: 6px 10px; }

.calc-cats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.calc-chip { border: 1px solid #e9ecef; background: #f8f9fa; color: #212529; border-radius: 999px; padding: 6px 10px; cursor: pointer; }
.calc-chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }

.calc-browse { margin-top: 14px; }
.browse-tabs { display: flex; gap: 8px; margin-bottom: 10px; }
.browse-tab { border: 1px solid #e9ecef; background: #fff; color: #212529; border-radius: 8px; padding: 8px 12px; cursor: pointer; }
.browse-tab.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.browse-panel.hidden { display: none; }

@media (max-width: 720px) {
  .calc-list { grid-template-columns: 1fr; }
}

/* Calculator picker */
.calc-picker { margin-bottom: 12px; }
#calcPicker { width: 100%; max-width: 520px; padding: 10px 12px; border-radius: 10px; border: 2px solid #dee2e6; background: #fff; font-size: 16px; }
#calcPicker:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring); outline: none; }

/* Ingredient description in results */
.calc-desc { display: block; color: var(--muted); font-size: 14px; margin-top: 4px; max-width: 70ch; }

/* Blog */
.blog-controls { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 8px 0 16px; }
.blog-search input { width: 320px; max-width: 100%; padding: 10px 12px; border-radius: 10px; border: 2px solid #dee2e6; font-size: 16px; }
.blog-search input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring); outline: none; }
.blog-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.blog-tag { border: 1px solid #e9ecef; background: #f8f9fa; color: #212529; border-radius: 999px; padding: 6px 10px; cursor: pointer; font-size: 14px; }
.blog-tag.active { background: var(--brand); border-color: var(--brand); color: #fff; }

.blog-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.blog-card { background: #fff; border: 1px solid #e9ecef; border-radius: 14px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,0.04); display: flex; flex-direction: column; }
.blog-card img { width: 100%; height: 180px; object-fit: cover; display: block; }
.blog-card .card-body { padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.blog-card h3 { margin: 0; font-size: 18px; color: var(--brand-strong); }
.blog-card .meta { font-size: 13px; color: var(--muted); }
.blog-card .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.blog-card .tags .blog-tag { font-size: 12px; padding: 4px 8px; }
.blog-card .read-more { margin-top: 8px; align-self: flex-start; color: #212529; border-color: #e9ecef; }

.blog-detail.hidden { display: none; }
.blog-detail { background: #fff; border: 1px solid #e9ecef; border-radius: 14px; padding: 18px; box-shadow: 0 2px 10px rgba(0,0,0,0.04); }
.blog-detail h1 { margin-top: 0; }
.blog-detail .detail-hero { width: 100%; height: 360px; object-fit: cover; border-radius: 12px; border: 1px solid #e9ecef; margin-bottom: 12px; }
.blog-detail .detail-tags { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 14px; }
.blog-detail .detail-body { color: #212529; }

@media (max-width: 920px) { .blog-list { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) { .blog-list { grid-template-columns: 1fr; } }

/* WordPress content styles (for imported blog HTML) */
.blog-detail .detail-body .wp-block-image { margin: 16px 0; }
.blog-detail .detail-body .wp-block-image img { width: 100%; height: auto; border-radius: 12px; border: 1px solid #e9ecef; box-shadow: 0 2px 10px rgba(0,0,0,0.04); display: block; }
/* Avoid blowing up small logos marked as size-full; constrain to a reasonable width */
.blog-detail .detail-body .wp-block-image.size-full img {
  width: auto;
  max-width: 480px;
  height: auto;
}
.blog-detail .detail-body figure.alignleft { float: left; margin: 6px 16px 10px 0; max-width: 50%; }
.blog-detail .detail-body figure.alignright { float: right; margin: 6px 0 10px 16px; max-width: 50%; }
.blog-detail .detail-body figure.aligncenter { margin: 12px auto; text-align: center; max-width: 100%; }
.blog-detail .detail-body .wp-element-caption, .blog-detail .detail-body figcaption { color: var(--muted); font-size: 13px; margin-top: 6px; }
.blog-detail .detail-body .is-style-rounded img { border-radius: 999px; }
.blog-detail .detail-body .size-large img { max-width: 100%; }
.blog-detail .detail-body .size-medium img { max-width: 75%; }
.blog-detail .detail-body .size-small img { max-width: 50%; }
/* Clear floats at end of content */
.blog-detail .detail-body::after { content: ""; display: block; clear: both; }

/* Responsive images injected by content fixer */
.mgl-img{max-width:100%;height:auto;display:block}