/* ======================================================================
   Marketing / landing pages CSS.
   Previously lived inline in layouts/landings/home/marketing.html.erb.
   Loaded via stylesheet_link_tag "marketing" in that same layout.
   This file covers the public pages (home, about, contact, farmers,
   institutions, insights, solutions). Authenticated app has its own
   stylesheet (application.css); design system views use tailwind.css
   scoped under .ds-root.
   ====================================================================== */

/* ---------- Body / reset ----------
   Note: do NOT add `.marketing-body a { color: inherit }` here.
   It has higher specificity than .m-btn-primary etc. and breaks
   button text color when buttons live inside contexts with
   `color: #fff` (the hero, the cta band). Each link/button class
   declares its own color explicitly. */
.marketing-body { background: #fff; color: #333; }
.marketing-body main { display: block; }

/* ---------- Marketing nav ---------- */
.marketing-nav {
  position: sticky; top: 0; z-index: 100;
  background: #fff; border-bottom: 1px solid #eee;
  padding: 0.85rem 0;
}
.marketing-nav-container {
  max-width: 1200px; margin: 0 auto; padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 2rem;
}
.marketing-nav-logo {
  font-size: 1.25rem; font-weight: 700; color: #333;
  text-decoration: none; flex-shrink: 0;
}
.marketing-nav-links {
  display: flex; align-items: center; gap: 1.5rem;
}
.marketing-nav-link {
  color: #444; font-size: 0.95rem; font-weight: 500;
  text-decoration: none; padding: 0.5rem 0;
  background: none; border: none; cursor: pointer;
  font-family: inherit;
  display: inline-flex; align-items: center; gap: 0.3rem;
}
.marketing-nav-link:hover { color: #4a90d9; }
.marketing-nav-link.is-accent { font-weight: 700; color: #4a90d9; }

/* Dropdowns (desktop hover, click for keyboard / touch) */
.marketing-nav-dropdown { position: relative; }
.marketing-nav-dropdown-menu {
  display: none; position: absolute; top: 100%; left: 0;
  background: #fff; border: 1px solid #eee; border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  min-width: 240px; padding: 0.5rem 0; margin-top: 0.5rem;
}
.marketing-nav-dropdown:hover .marketing-nav-dropdown-menu,
.marketing-nav-dropdown.open .marketing-nav-dropdown-menu {
  display: block;
}
.marketing-nav-dropdown-menu a {
  display: block; padding: 0.6rem 1.25rem;
  color: #444; font-size: 0.9rem; text-decoration: none;
}
.marketing-nav-dropdown-menu a:hover {
  background: #f5f9fd; color: #4a90d9;
}

.marketing-nav-cta {
  background: #4a90d9; color: #fff !important;
  padding: 0.55rem 1.1rem; border-radius: 6px;
  font-size: 0.9rem; font-weight: 600; text-decoration: none;
  display: inline-flex; align-items: center; gap: 0.4rem;
  transition: background 0.2s;
}
.marketing-nav-cta:hover { background: #3578c0; color: #fff !important; }

/* Language dropdown — desktop trigger looks like a small pill button.
   Reuses the .marketing-nav-dropdown structure for click toggle behavior. */
.marketing-nav-lang-dropdown {
  margin-left: 0.5rem; padding-left: 0.75rem;
  border-left: 1px solid #eee;
}
.marketing-nav-lang-trigger {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: #fff; border: 1px solid #e3e3e3;
  border-radius: 6px; padding: 0.4rem 0.7rem;
  font-size: 0.8rem; font-weight: 600; color: #444;
  cursor: pointer; font-family: inherit;
}
.marketing-nav-lang-trigger:hover {
  background: #f5f9fd; border-color: #4a90d9; color: #4a90d9;
}
.marketing-nav-lang-menu {
  right: 0; left: auto;
  min-width: 130px;
}
.marketing-nav-lang-menu a {
  display: flex !important; align-items: center; gap: 0.5rem;
  padding: 0.55rem 0.85rem !important;
  font-size: 0.85rem; font-weight: 500;
}

/* Inline SVG flag — small rectangular badge next to language label */
.marketing-flag {
  width: 1.1rem; height: 0.78rem;
  flex-shrink: 0; border-radius: 1px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
  display: inline-block; vertical-align: middle;
}

/* Mobile lang buttons keep the inline pill style with flag */
.marketing-nav-mobile-lang a {
  display: inline-flex !important; align-items: center; gap: 0.4rem;
}

.marketing-nav-hamburger {
  display: none; background: none; border: none;
  font-size: 1.5rem; color: #333; cursor: pointer; padding: 0.25rem;
}

/* Mobile slide-out */
.marketing-nav-mobile { display: none; }

@media (max-width: 900px) {
  .marketing-nav-links { display: none; }
  .marketing-nav-hamburger { display: block; }
  .marketing-nav-mobile {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: #fff; z-index: 200; padding: 1.5rem;
    overflow-y: auto;
  }
  .marketing-nav-mobile.open { display: block; }
  .marketing-nav-mobile-close {
    position: absolute; top: 1rem; right: 1rem;
    background: none; border: none; font-size: 1.75rem; cursor: pointer;
  }
  .marketing-nav-mobile-cards {
    display: grid; grid-template-columns: 1fr; gap: 1rem;
    margin-top: 3rem; margin-bottom: 2rem;
  }
  .marketing-nav-mobile-card {
    display: block; padding: 1.5rem;
    border: 2px solid #4a90d9; border-radius: 12px;
    color: #333; text-decoration: none;
  }
  .marketing-nav-mobile-card strong {
    display: block; font-size: 1.1rem; margin-bottom: 0.4rem;
  }
  .marketing-nav-mobile-card span {
    font-size: 0.85rem; color: #888;
  }
  .marketing-nav-mobile-links a {
    display: block; padding: 0.85rem 0;
    border-bottom: 1px solid #eee;
    color: #333; font-size: 1.05rem; text-decoration: none;
  }
  .marketing-nav-mobile-lang {
    margin-top: 1.5rem; display: flex; gap: 0.5rem;
  }
  .marketing-nav-mobile-lang a {
    padding: 0.4rem 0.75rem; border: 1px solid #ddd; border-radius: 4px;
    color: #444; text-decoration: none; font-size: 0.85rem;
  }
  .marketing-nav-mobile-lang a.active { background: #4a90d9; color: #fff; border-color: #4a90d9; }
}

/* ---------- Shared section/container/typography ---------- */
.m-container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.m-section { padding: 4rem 0; }
.m-section-alt { background: #fafafa; }
.m-section h2 {
  font-size: 1.85rem; font-weight: 700; color: #333;
  text-align: center; margin: 0 0 0.75rem 0;
}
.m-section-subtitle {
  text-align: center; font-size: 1rem; color: #666;
  max-width: 700px; margin: 0 auto 2.5rem auto; line-height: 1.5;
}

/* ---------- Hero (used by landing pages) ---------- */
.m-hero {
  background: linear-gradient(135deg, #4a90d9 0%, #2c6ca8 100%);
  color: #fff; padding: 5rem 1.5rem;
}
.m-hero-content {
  max-width: 900px; margin: 0 auto; text-align: center;
}
.m-hero-content h1 {
  font-size: 2.4rem; font-weight: 700; line-height: 1.2;
  margin: 0 0 1rem 0;
}
.m-hero-content p {
  font-size: 1.1rem; opacity: 0.95; line-height: 1.5;
  max-width: 720px; margin: 0 auto 1.75rem auto;
}
.m-hero-ctas {
  display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center;
}
@media (max-width: 600px) {
  .m-hero { padding: 3.5rem 1.5rem; }
  .m-hero-content h1 { font-size: 1.8rem; }
  .m-hero-content p { font-size: 1rem; }
}

.m-btn-primary {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: #fff; color: #4a90d9;
  padding: 0.85rem 1.6rem; border-radius: 6px;
  font-weight: 600; font-size: 1rem; text-decoration: none;
  transition: transform 0.2s;
}
.m-btn-primary:hover { transform: translateY(-2px); color: #2c6ca8; }
.m-btn-secondary {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: transparent; color: #fff;
  border: 2px solid #fff; padding: 0.7rem 1.45rem;
  border-radius: 6px; font-weight: 600; font-size: 1rem;
  text-decoration: none;
}
.m-btn-secondary:hover { background: #fff; color: #4a90d9; }
.m-btn-blue {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: #4a90d9; color: #fff;
  padding: 0.85rem 1.6rem; border-radius: 6px;
  font-weight: 600; font-size: 1rem; text-decoration: none;
}
.m-btn-blue:hover { background: #3578c0; color: #fff; }
.m-btn-outline {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: transparent; color: #4a90d9;
  border: 2px solid #4a90d9; padding: 0.7rem 1.45rem;
  border-radius: 6px; font-weight: 600; font-size: 1rem;
  text-decoration: none;
}
.m-btn-outline:hover { background: #4a90d9; color: #fff; }

/* ---------- Feature cards (3-col grid used on landing/sub pages) ---------- */
.m-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.75rem; max-width: 1100px; margin: 0 auto; }
.m-feature-card {
  background: #fff; border: 1px solid #e8e8e8; border-radius: 12px;
  padding: 2rem; transition: transform 0.2s, box-shadow 0.2s;
}
.m-feature-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}
.m-feature-icon {
  font-size: 1.75rem; color: #4a90d9; margin-bottom: 1rem;
}
.m-feature-card h3 {
  font-size: 1.15rem; font-weight: 700; color: #333;
  margin: 0 0 0.5rem 0;
}
.m-feature-badge {
  display: inline-block; background: #e3f2e1; color: #2c5f3f;
  padding: 0.2rem 0.7rem; border-radius: 999px;
  font-size: 0.75rem; font-weight: 600; margin-bottom: 0.75rem;
}
.m-feature-card p {
  color: #666; font-size: 0.95rem; line-height: 1.55;
  margin: 0 0 1rem 0;
}
.m-feature-link {
  color: #4a90d9; font-weight: 600; font-size: 0.9rem;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 0.3rem;
}
.m-feature-link:hover { text-decoration: underline; }
@media (max-width: 900px) {
  .m-features { grid-template-columns: 1fr; }
}

/* ---------- Sub-page intro / feature list pattern ---------- */
.m-page-intro {
  max-width: 800px; margin: 0 auto 3rem auto;
  text-align: center;
}
.m-page-intro h1 {
  font-size: 2.1rem; font-weight: 700; color: #333;
  line-height: 1.25; margin: 0 0 1.25rem 0;
}
.m-page-intro p {
  font-size: 1.05rem; color: #555; line-height: 1.65;
  margin: 0;
}
.m-feature-list {
  max-width: 900px; margin: 0 auto;
  display: grid; gap: 1.5rem;
}
.m-feature-list-item {
  background: #fff; border-left: 4px solid #4a90d9;
  padding: 1.5rem 1.75rem; border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.m-feature-list-item h3 {
  font-size: 1.1rem; font-weight: 700; color: #333;
  margin: 0 0 0.5rem 0;
}
.m-feature-list-item p {
  color: #666; font-size: 0.95rem; line-height: 1.55;
  margin: 0;
}

/* ---------- Logos (placeholder boxes) ---------- */
.m-logo-strip {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: center; gap: 2.5rem;
}
.m-logo-placeholder {
  height: 2.5rem; min-width: 7rem; padding: 0 1rem;
  border-radius: 4px; background: #e9e9e9;
  display: flex; align-items: center; justify-content: center;
  color: #888; font-size: 0.75rem; font-weight: 500;
  filter: grayscale(1); opacity: 0.7;
  transition: filter 0.2s, opacity 0.2s;
}
.m-logo-placeholder:hover { filter: grayscale(0); opacity: 1; }
.m-logo-label {
  text-align: center; font-size: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.15em;
  color: #888; margin: 0 0 1.5rem 0;
}

/* ---------- Related insight callout ---------- */
.m-related {
  max-width: 800px; margin: 2.5rem auto 0 auto;
  background: #f8fafd; border-left: 4px solid #4a90d9;
  padding: 1.25rem 1.5rem; border-radius: 6px;
}
.m-related-label {
  font-size: 0.7rem; text-transform: uppercase;
  letter-spacing: 0.15em; color: #4a90d9;
  font-weight: 700; margin-bottom: 0.4rem;
}
.m-related a {
  color: #333; font-weight: 600; text-decoration: none;
  font-size: 1rem;
}
.m-related a:hover { color: #4a90d9; }

/* ---------- CTA section (full-width blue) ---------- */
.m-cta-band {
  background: #4a90d9; color: #fff;
  padding: 3rem 1.5rem; text-align: center;
  margin-top: 3rem;
}
.m-cta-band h2 {
  color: #fff; font-size: 1.5rem; margin: 0 0 1rem 0;
}

/* ---------- Marketing footer (4-column) ---------- */
.m-footer {
  background: #1d2730; color: #aaa;
  padding: 3rem 1.5rem 2rem 1.5rem; margin-top: 4rem;
}
.m-footer-grid {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 2.5rem;
}
@media (max-width: 768px) {
  .m-footer-grid { grid-template-columns: 1fr 1fr; }
}
.m-footer-col strong {
  color: #fff; font-size: 1.1rem;
  display: block; margin-bottom: 0.5rem;
}
.m-footer-col h4 {
  font-size: 0.85rem; color: #fff; font-weight: 700;
  margin: 0 0 1rem 0; text-transform: uppercase;
  letter-spacing: 0.05em;
}
.m-footer-col a {
  display: block; color: #aaa; text-decoration: none;
  font-size: 0.9rem; padding: 0.3rem 0;
}
.m-footer-col a:hover { color: #fff; }
.m-footer-col p {
  font-size: 0.85rem; color: #aaa; margin: 0.4rem 0;
}
.m-footer-bottom {
  max-width: 1200px; margin: 2rem auto 0 auto;
  padding-top: 1.5rem; border-top: 1px solid #333;
  display: flex; justify-content: space-between;
  align-items: center; flex-wrap: wrap; gap: 1.5rem;
  color: #888; font-size: 0.85rem;
}
.m-footer-bottom a {
  color: #aaa; text-decoration: none; margin: 0 0.4rem;
}
.m-footer-bottom a:hover { color: #fff; }
.m-footer-bottom-logos {
  display: flex; gap: 0.75rem; align-items: center;
}
.m-footer-bottom-logos .m-logo-placeholder {
  height: 1.75rem; min-width: 4.5rem; opacity: 0.5;
}

/* ---------- Customer logos partial wrapper ---------- */
.m-customer-logos {
  padding: 2.5rem 0; background: #fff;
}
.m-customer-logos.is-bordered {
  border-top: 1px solid #f0f0f0;
  border-bottom: 1px solid #f0f0f0;
}
.m-customer-logos.is-alt { background: #fafafa; }

/* ---------- Contact form (used on /contact and as embed on home) ---------- */
.m-contact-form input[type="text"],
.m-contact-form input[type="email"],
.m-contact-form select,
.m-contact-form textarea {
  width: 100%; padding: 0.85rem 1rem;
  border: 1px solid #ddd; border-radius: 6px;
  background: #fff; color: #333; font-size: 0.95rem;
  font-family: inherit; margin-bottom: 0.75rem;
}
.m-contact-form select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23666' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
}
.m-contact-form .m-form-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem;
}
.m-contact-form button {
  width: 100%; margin-top: 0.5rem;
  background: #4a90d9; color: #fff;
  border: none; padding: 0.95rem 1.5rem;
  border-radius: 6px; font-size: 1rem; font-weight: 600;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  transition: background 0.2s;
}
.m-contact-form button:hover { background: #3578c0; }
@media (max-width: 600px) {
  .m-contact-form .m-form-row { grid-template-columns: 1fr; }
}

/* ---------- Cookie consent banner (shared/_cookie_consent.html.erb) ---------- */
.cc-root { display: none; }
.cc-root.cc-visible { display: block; }

.cc-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(20, 30, 20, 0.55);
}

.cc-banner {
  position: fixed; z-index: 9001;
  left: 1.25rem; bottom: 1.25rem;
  width: 320px; max-width: calc(100vw - 2.5rem);
  background: #fff; border-radius: 10px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
  padding: 1.25rem 1.25rem 1rem 1.25rem;
}
.cc-banner h3 {
  margin: 0 0 0.6rem 0;
  font-size: 1.05rem; font-weight: 700; color: #1d2730;
}
.cc-banner p {
  margin: 0 0 0.9rem 0;
  font-size: 0.88rem; color: #555; line-height: 1.45;
  padding-bottom: 0.9rem; border-bottom: 1px solid #eee;
}
.cc-banner p a { color: #2c5f3f; text-decoration: underline; }

.cc-actions {
  display: flex; flex-direction: column; gap: 0.5rem;
}
.cc-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.7rem 1rem; border-radius: 6px; border: none; cursor: pointer;
  font-size: 0.9rem; font-weight: 600; font-family: inherit;
  transition: background 0.15s;
}
.cc-btn-green { background: #2c5f3f; color: #fff; }
.cc-btn-green:hover { background: #234a31; }
.cc-btn-gray { background: #eee; color: #444; }
.cc-btn-gray:hover { background: #ddd; }

@media (max-width: 600px) {
  .cc-banner {
    left: 0; right: 0; bottom: 0; width: auto;
    max-width: none; border-radius: 10px 10px 0 0;
  }
}

/* Preferences modal */
.cc-modal {
  display: none;
  position: fixed; inset: 0; z-index: 9002;
  align-items: center; justify-content: center;
  padding: 1rem;
}
.cc-root.cc-modal-open .cc-modal { display: flex; }
.cc-root.cc-modal-open .cc-banner { display: none; }

.cc-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(20, 30, 20, 0.55);
}
.cc-modal-content {
  position: relative;
  background: #fff; border-radius: 10px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  width: 100%; max-width: 520px;
  max-height: calc(100vh - 2rem);
  display: flex; flex-direction: column;
}
.cc-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem; border-bottom: 1px solid #eee;
}
.cc-modal-header h3 {
  margin: 0; font-size: 1rem; font-weight: 700; color: #1d2730;
}
.cc-modal-close {
  background: none; border: none; cursor: pointer;
  width: 28px; height: 28px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #666; font-size: 1.2rem; line-height: 1;
}
.cc-modal-close:hover { background: #f2f2f2; color: #333; }

.cc-modal-body {
  padding: 1.25rem; overflow-y: auto;
}
.cc-intro-title {
  font-size: 0.95rem; font-weight: 700; color: #1d2730;
  margin-bottom: 0.35rem;
}
.cc-intro-text {
  font-size: 0.88rem; color: #555; line-height: 1.5;
  margin: 0 0 1.25rem 0;
}

.cc-item {
  background: #f7f7f7; border-radius: 8px;
  padding: 0.85rem 1rem; margin-bottom: 0.75rem;
}
.cc-item-header {
  display: flex; align-items: center; gap: 0.6rem;
  cursor: pointer; user-select: none;
}
.cc-item-chevron {
  color: #777; font-size: 0.9rem;
  transition: transform 0.15s;
}
.cc-item.is-collapsed .cc-item-chevron { transform: rotate(180deg); }
.cc-item-name {
  flex: 1; font-size: 0.92rem; font-weight: 600; color: #1d2730;
}
.cc-item-desc {
  margin: 0.55rem 0 0 1.5rem;
  font-size: 0.85rem; color: #666; line-height: 1.5;
}
.cc-item.is-collapsed .cc-item-desc { display: none; }

/* Cookie-consent toggle switch */
.cc-toggle {
  position: relative; display: inline-block;
  width: 40px; height: 22px; flex-shrink: 0;
}
.cc-toggle input {
  opacity: 0; width: 0; height: 0;
}
.cc-toggle-slider {
  position: absolute; inset: 0; cursor: pointer;
  background: #bbb; border-radius: 22px;
  transition: background 0.15s;
}
.cc-toggle-slider::before {
  content: ""; position: absolute; height: 16px; width: 16px;
  left: 3px; top: 3px; background: #fff; border-radius: 50%;
  transition: transform 0.15s;
}
.cc-toggle input:checked + .cc-toggle-slider { background: #2c5f3f; }
.cc-toggle input:checked + .cc-toggle-slider::before { transform: translateX(18px); }
.cc-toggle input:disabled + .cc-toggle-slider { cursor: not-allowed; opacity: 0.7; }

.cc-modal-footer {
  display: flex; gap: 0.5rem; flex-wrap: wrap;
  padding: 1rem 1.25rem; border-top: 1px solid #eee;
  justify-content: space-between; align-items: center;
}
.cc-modal-footer-left {
  display: flex; gap: 0.5rem; flex-wrap: wrap;
}
.cc-modal-footer .cc-btn {
  padding: 0.6rem 0.95rem; font-size: 0.85rem;
}
@media (max-width: 500px) {
  .cc-modal-footer { flex-direction: column; align-items: stretch; }
  .cc-modal-footer-left { flex-direction: column; }
  .cc-modal-footer .cc-btn { width: 100%; }
}
