/* Green Agro — site-level styles layered on top of the Modernist design system.
   Keeps _ds/modernist styles.css (public/assets/modernist.css) untouched. */

body { margin: 0; }
a { color: var(--color-accent); text-decoration: none; }
a:hover { color: var(--color-accent-600); }

/* Show photographs and avatars in their real colors — the design system's
   default grayscale treatment (filter:grayscale(1)) is turned off here. */
.grayscale { filter: none !important; }

.ga-navlink { color: var(--color-text); font-size: 14px; text-decoration: none; }
.ga-navlink:hover { color: var(--color-accent); }
.ga-navlink[aria-current="page"] { color: var(--color-accent); }

/* Image placeholder — stands in for the design's <image-slot> photos. */
.img-ph {
  display: flex; align-items: center; justify-content: center; text-align: center;
  background: color-mix(in srgb, var(--color-text) 10%, var(--color-bg));
  border: 1px solid var(--color-divider);
  color: color-mix(in srgb, var(--color-text) 62%, transparent);
  font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 12px; line-height: 1.4;
  background-image:
    linear-gradient(135deg, color-mix(in srgb, var(--color-text) 7%, transparent) 25%, transparent 25%),
    linear-gradient(225deg, color-mix(in srgb, var(--color-text) 7%, transparent) 25%, transparent 25%);
  background-size: 22px 22px;
}
.img-ph.circle { border-radius: 50%; }

/* Circular avatar fallback — initials on a solid brand-tinted disc, so an
   empty photo reads as an intentional avatar, not a blank white circle. */
.avatar-fallback {
  background: linear-gradient(140deg, var(--color-accent-2-500), var(--color-accent-600));
  background-image: linear-gradient(140deg, var(--color-accent-2-500), var(--color-accent-600));
  color: #fff;
  border: none;
  font-family: var(--font-heading);
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* Constrain the outer page width and gutters used across every artboard. */
.ga-container { max-width: 1200px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 72px); }

/* ══════════════════════════════════════════════════════════════════════
   Responsive — collapse the fixed multi-column grids on smaller screens.
   These override the inline grid-template-columns on tagged containers.
   ══════════════════════════════════════════════════════════════════════ */

/* Never let the page scroll sideways. */
html, body { max-width: 100%; overflow-x: hidden; }

/* Tablet and below: two-column splits become a single column. */
@media (max-width: 860px) {
  .r-2col   { grid-template-columns: 1fr !important; }
  .r-footer { grid-template-columns: 1fr 1fr !important; gap: 28px !important; }
}

/* Phones: stat rows to 2 columns, forms and footer to a single column. */
@media (max-width: 560px) {
  .r-stats  { grid-template-columns: repeat(2, 1fr) !important; justify-content: stretch !important; }
  .r-form2  { grid-template-columns: 1fr !important; }
  .r-footer { grid-template-columns: 1fr !important; }
}

/* ══════════════════════════════════════════════════════════════════════
   Navbar — inline on desktop, hamburger drawer on mobile.
   ══════════════════════════════════════════════════════════════════════ */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--color-bg);
  display: flex; align-items: center; gap: 20px;
  padding: 14px clamp(20px, 5vw, 72px);
  border-bottom: 2px solid var(--color-divider);
}
.ga-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.ga-logo { width: 38px; height: 38px; border-radius: 9px; overflow: hidden; flex-shrink: 0; display: block; }
.ga-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.nav-brand { font-family: var(--font-heading); font-weight: 800; font-size: 19px; letter-spacing: -0.02em; color: var(--color-text); }

.ga-nav-menu { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.ga-nav-links { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.ga-nav-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.ga-lang { display: flex; border: 1px solid var(--color-divider); font-size: 12px; font-weight: 600; }
.ga-cart { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; color: var(--color-text); text-decoration: none; flex-shrink: 0; }
.ga-cart-count { position: absolute; top: 2px; right: 2px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--color-accent-700); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.ga-nav-btn { white-space: nowrap; flex-shrink: 0; }

/* Desktop: center the page links between the logo and the action buttons. */
@media (min-width: 901px) {
  .ga-nav-links { flex: 1; justify-content: center; }
}

/* Hamburger button (three lines → X) */
.ga-burger { width: 44px; height: 44px; padding: 12px 10px; background: none; border: 1px solid var(--color-divider); cursor: pointer; flex-shrink: 0; flex-direction: column; justify-content: space-between; }
.ga-burger span { display: block; height: 2px; width: 100%; background: var(--color-text); border-radius: 2px; transition: transform .25s ease, opacity .2s ease; }
.ga-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.ga-burger.open span:nth-child(2) { opacity: 0; }
.ga-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Hidden on desktop; the desktop cart lives inside the actions group */
.ga-burger, .ga-cart-mobile { display: none; }

@media (max-width: 900px) {
  .nav { flex-wrap: wrap; gap: 12px; }
  .ga-brand { margin-right: auto; }
  .ga-burger { display: inline-flex; }
  .ga-cart-mobile { display: inline-flex; }
  .ga-cart-desktop { display: none; }

  .ga-nav-menu {
    order: 3; flex-basis: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    max-height: 0; overflow: hidden; opacity: 0;
    transition: max-height .3s ease, opacity .2s ease;
  }
  .ga-nav-menu.open { max-height: 85vh; overflow-y: auto; opacity: 1; padding-top: 6px; }

  .ga-nav-links { flex-direction: column; align-items: stretch; gap: 0; }
  .ga-nav-links .ga-navlink { padding: 13px 4px; border-bottom: 1px solid var(--color-divider); font-size: 15px; }

  .ga-nav-actions { flex-direction: column; align-items: stretch; gap: 12px; padding: 14px 0 6px; }
  .ga-nav-actions .ga-lang { align-self: flex-start; }
  .ga-nav-actions .ga-greeting { padding: 4px; }
  .ga-nav-btn { width: 100%; text-align: center; justify-content: center; }
}

/* Admin tables can scroll horizontally instead of overflowing the card. */
.card > .table { display: table; }
@media (max-width: 720px) {
  .admin-main .card { overflow-x: auto; }
  .admin-main .table { min-width: 560px; }
}

/* ══════════════════════════════════════════════════════════════════════
   Night mode — dark theme, applied when <html data-theme="dark">.
   Retunes only the core tokens + the light tint pairs that are used as
   (light background / dark text) badges, so they invert cleanly.
   ══════════════════════════════════════════════════════════════════════ */
:root[data-theme="dark"] {
  --color-bg: #0b1f14;
  --color-surface: #102a1c;
  --color-text: #f4f0e2;
  --color-divider: color-mix(in srgb, #f4f0e2 20%, transparent);

  /* Brighter gold so accent text/badges stay legible on a dark ground. */
  --color-accent-700: #e2c24f;

  /* Gold tint badge (tag-accent, drawer thumb) → dark tint / light ink. */
  --color-accent-100: #2a2413;
  --color-accent-800: #f4d35e;

  /* Green tint badge + flash messages → dark tint / light ink. */
  --color-accent-2-100: #0a2e14;
  --color-accent-2-800: #8fc7a2;

  /* Neutral tint badge → dark tint / light ink. */
  --color-neutral-100: #1c2018;
  --color-neutral-800: #d1d6c8;
}

/* Softer image placeholders on dark. */
:root[data-theme="dark"] .img-ph { border-color: var(--color-divider); }

/* ══════════════════════════════════════════════════════════════════════
   Language switch (EN / LO / TH) — drives the hidden Google Translate widget.
   ══════════════════════════════════════════════════════════════════════ */
.ga-lang button, .ga-lang a {
  padding: 6px 10px; background: none; border: none; cursor: pointer;
  font: inherit; color: var(--color-text); opacity: 0.55; line-height: 1;
  text-decoration: none;
}
.ga-lang button:hover, .ga-lang a:hover { opacity: 0.85; }
.ga-lang button.active, .ga-lang a.active { background: var(--color-text); color: var(--color-bg); opacity: 1; }

/* Keep the Google Translate widget functional but visually removed — the
   custom EN/LO/TH switch above stands in for it, and Google's own top
   banner is suppressed so it never shifts the page down. */
#google_translate_element { position: absolute; left: -9999px; top: 0; height: 0; overflow: hidden; }
.goog-te-banner-frame.skiptranslate, .goog-te-gadget-icon, #goog-gt-tt, .goog-te-balloon-frame { display: none !important; }
.goog-te-gadget { font-size: 0 !important; }
body { top: 0 !important; }

/* Theme toggle button in the nav. */
.ga-theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0;
  background: none; border: 1px solid var(--color-divider); cursor: pointer;
  color: var(--color-text); line-height: 0;
}
.ga-theme-toggle:hover { background: color-mix(in srgb, var(--color-text) 8%, transparent); }
.ga-theme-toggle .ga-icon-sun  { display: none; }
.ga-theme-toggle .ga-icon-moon { display: block; }
:root[data-theme="dark"] .ga-theme-toggle .ga-icon-sun  { display: block; }
:root[data-theme="dark"] .ga-theme-toggle .ga-icon-moon { display: none; }

/* ══════════════════════════════════════════════════════════════════════
   "Green Agro.html" artboard — deep forest-green bands (nav, hero, footer)
   with cream text and gold accents. Applied in both light and night mode.
   ══════════════════════════════════════════════════════════════════════ */
:root { --ga-forest: #0b3d1a; --ga-forest-deep: #06140c; --ga-cream: #f4f0e2; }

/* Dark ink on the (brighter) gold primary button for legibility everywhere. */
.btn-primary, .btn-primary:hover, .btn-primary:active { color: #102018; }

/* --- Navbar: forest-green bar with cream links + gold hover --- */
.nav { background: var(--ga-forest); border-bottom-color: rgba(244,240,226,.16); }
.nav .nav-brand,
.nav .ga-navlink,
.nav .ga-cart,
.nav .ga-theme-toggle,
.nav .ga-greeting { color: var(--ga-cream); }
.nav .ga-navlink:hover,
.nav .ga-navlink[aria-current="page"] { color: #f4d35e; }
.nav .ga-cart-count { background: #f4d35e; color: var(--ga-forest); }
.nav .ga-burger span { background: var(--ga-cream); }
.nav .ga-burger,
.nav .ga-theme-toggle,
.nav .ga-lang { border-color: rgba(244,240,226,.32); }
.nav .ga-lang button, .nav .ga-lang a { color: var(--ga-cream); }
.nav .ga-lang button.active, .nav .ga-lang a.active { background: var(--ga-cream); color: var(--ga-forest); }
.nav .ga-theme-toggle:hover { background: rgba(244,240,226,.12); }
.nav .btn-secondary { border-color: rgba(244,240,226,.4); color: var(--ga-cream); }
.nav .btn-secondary:hover { background: rgba(244,240,226,.12); }
@media (max-width: 900px) {
  .nav .ga-nav-links .ga-navlink { border-bottom-color: rgba(244,240,226,.16); }
}

/* --- Homepage hero: full-bleed forest band --- */
.ga-hero { background: var(--ga-forest); color: var(--ga-cream); }
.ga-hero-inner { max-width: 1200px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 72px); }
.ga-hero h1 { color: var(--ga-cream); }
.ga-hero .btn-secondary { border-color: rgba(244,240,226,.4); color: var(--ga-cream); }
.ga-hero .btn-secondary:hover { background: rgba(244,240,226,.12); }
.ga-hero .img-ph {
  background: rgba(244,240,226,.06);
  border-color: rgba(244,240,226,.22);
  color: rgba(244,240,226,.6);
  background-image:
    linear-gradient(135deg, rgba(244,240,226,.06) 25%, transparent 25%),
    linear-gradient(225deg, rgba(244,240,226,.06) 25%, transparent 25%);
}

/* --- Footer: deep forest band --- */
.ga-footer { background: var(--ga-forest-deep); color: var(--ga-cream); border-top: none; }
.ga-footer a { color: var(--ga-cream); }
.ga-footer a:hover { color: #f4d35e; }
.ga-footer h6 { color: var(--ga-cream); }
.ga-footer .ga-foot-muted { color: rgba(244,240,226,.68); }
.ga-footer p { color: rgba(244,240,226,.72); }
.ga-footer .tag-outline { border-color: rgba(244,240,226,.4); color: var(--ga-cream); }
.ga-footer .hr { background: rgba(244,240,226,.16); }

/* ══════════════════════════════════════════════════════════════════════
   Swiper sliders (home page) — themed to the forest / accent palette
   ══════════════════════════════════════════════════════════════════════ */
.ga-products-swiper,
.ga-projects-swiper,
.ga-team-swiper {
  --swiper-theme-color: var(--color-accent);
  --swiper-navigation-size: 22px;
  padding-bottom: 46px;
}

/* Cards inside product slides stretch to equal height. */
.ga-products-swiper .swiper-slide { height: auto; display: flex; }
.ga-products-swiper .swiper-slide > .card { width: 100%; }

/* Navigation arrows as compact circular buttons over the images. */
.ga-products-swiper .swiper-button-prev,
.ga-products-swiper .swiper-button-next,
.ga-projects-swiper .swiper-button-prev,
.ga-projects-swiper .swiper-button-next {
  top: 38%;
  width: 42px; height: 42px;
  background: var(--color-bg);
  border: 1px solid var(--color-divider);
  border-radius: 50%;
  color: var(--color-accent);
  box-shadow: 0 6px 18px rgba(0,0,0,.14);
  transition: background .15s ease, color .15s ease;
}
.ga-products-swiper .swiper-button-prev:hover,
.ga-products-swiper .swiper-button-next:hover,
.ga-projects-swiper .swiper-button-prev:hover,
.ga-projects-swiper .swiper-button-next:hover {
  background: var(--color-accent); color: var(--color-bg);
}
.ga-products-swiper .swiper-button-prev::after,
.ga-products-swiper .swiper-button-next::after,
.ga-projects-swiper .swiper-button-prev::after,
.ga-projects-swiper .swiper-button-next::after { font-size: 16px; font-weight: 800; }
.swiper-button-disabled { opacity: .3; pointer-events: none; }

/* Pagination bullets sit just below the slides. */
.ga-products-swiper .swiper-pagination,
.ga-projects-swiper .swiper-pagination,
.ga-team-swiper .swiper-pagination { bottom: 8px; }

/* Hero slideshow — pagination overlays the image; cream on the forest band. */
.ga-hero-swiper { --swiper-theme-color: var(--ga-cream); }
.ga-hero-swiper .swiper-pagination { bottom: 12px; }
.ga-hero-swiper .swiper-pagination-bullet {
  background: var(--ga-cream); opacity: .45;
  box-shadow: 0 1px 3px rgba(0,0,0,.35);
}
.ga-hero-swiper .swiper-pagination-bullet-active { opacity: 1; }

/* Hide arrows on small screens; free-swipe is enough there. */
@media (max-width: 640px) {
  .ga-products-swiper .swiper-button-prev,
  .ga-products-swiper .swiper-button-next,
  .ga-projects-swiper .swiper-button-prev,
  .ga-projects-swiper .swiper-button-next { display: none; }
}
