/* ==========================================================================
   First Agro: site styles
   Brand orange (from the logo) carries headings and the "Fresh Ideas" tab;
   field green (from the Zero Pesticide badge) carries structure: nav, footer.
   Product photos are shot on white, so every surface they sit on stays white.
   ========================================================================== */

:root {
  --paper: #ffffff;
  --ink: #22301c;
  --ink-soft: #56614f;
  --line: #e4e8dd;
  --dots: #eab07c;

  --orange: #e67817;       /* logo and tab fill; not for text on white (3:1) */
  --orange-head: #c4590a;  /* large headings, 4.4:1 */
  --orange-text: #b54f08;  /* links and small text, 5.1:1 */

  --field: #2f5420;
  --field-deep: #24411a;
  --leaf: #5e9629;
  --sprout: #f3f6ee;
  --on-field-soft: #d9e6cc;
  --on-field-accent: #f6b26b;

  --font-display: "Baloo 2", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Mukta", "Segoe UI", system-ui, -apple-system, sans-serif;

  --container: 1160px;
  --gutter: clamp(16px, 4vw, 32px);
  --radius: 14px;
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-gutter: stable;
}
html:has(dialog[open]) { overflow: hidden; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; height: auto; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

p { margin: 0 0 1em; text-wrap: pretty; }

a {
  color: var(--orange-text);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
a:hover { color: var(--orange-head); text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--leaf);
  outline-offset: 3px;
  border-radius: 4px;
}

address { font-style: normal; }

.container {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -100px;
  z-index: 100;
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--field);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 8px; color: #fff; }

main { padding-bottom: 104px; }

/* ---------- Header ---------- */

.site-header { position: relative; z-index: 10; }

.masthead {
  position: relative;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* The logo is a sticker: it hangs over the green nav band, as it always has. */
.brand {
  position: absolute;
  left: -8px;
  top: 10px;
  width: 170px;
  z-index: 2;
  border-radius: 12px;
}
.brand img { width: 100%; }

.social {
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.social a {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--ink-soft);
  transition: background-color 0.15s, color 0.15s;
}
.social a:hover { background: var(--sprout); color: var(--field); }

.menu-toggle { display: none; }

.site-nav { background: var(--field); }
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-block: 0;
  padding: 0 0 0 180px;
  list-style: none;
}
.site-nav a {
  position: relative;
  display: block;
  padding: 16px 10px 14px;
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.6;
  text-decoration: none;
}
.site-nav a:hover { color: var(--on-field-accent); }
.site-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 0;
  height: 4px;
  border-radius: 4px 4px 0 0;
  background: var(--orange);
}
.site-nav a:focus-visible { outline-color: var(--on-field-accent); outline-offset: -4px; }

@media (max-width: 1180px) {
  .masthead { height: 76px; }
  .brand { top: 6px; left: -4px; width: 100px; }
  .social--header { display: none; }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 18px 10px 14px;
    border: 0;
    border-radius: 999px;
    background: var(--field);
    color: #fff;
    font: 600 1rem/1 var(--font-body);
    cursor: pointer;
  }
  .menu-toggle:hover { background: var(--field-deep); }

  .site-nav { border-top: 6px solid var(--field); }
  .js .site-nav:not(.is-open) ul { display: none; }
  .site-nav ul {
    flex-direction: column;
    padding: 4px 0 16px;
  }
  .site-nav li + li { border-top: 1px solid rgba(255, 255, 255, 0.12); }
  .site-nav a { padding: 12px 0 12px 16px; font-size: 1.125rem; }
  .site-nav a[aria-current="page"]::after {
    left: 0;
    right: auto;
    top: 12px;
    bottom: 12px;
    width: 4px;
    height: auto;
    border-radius: 0 4px 4px 0;
  }
}

/* ---------- Page heads ---------- */

.page-head { padding-top: 56px; }

.page-head h1,
.page-title {
  color: var(--orange-head);
  font-size: clamp(2.25rem, 1.7rem + 2vw, 3rem);
  font-weight: 800;
  margin-bottom: 0.3em;
}

.intro {
  max-width: 60ch;
  color: var(--ink-soft);
  font-size: 1.3125rem;
  line-height: 1.55;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
  color: var(--ink-soft);
  font-size: 1rem;
}
.breadcrumb li + li::before {
  content: "/";
  content: "/" / "";
  margin-right: 8px;
  color: #9aa394;
}
.breadcrumb a { font-weight: 600; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

.subnav ul {
  display: flex;
  gap: 4px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--line);
}
.subnav a {
  display: block;
  margin-bottom: -1px;
  padding: 8px 14px;
  border-bottom: 3px solid transparent;
  color: var(--ink-soft);
  font-weight: 600;
  text-decoration: none;
}
.subnav a:hover { color: var(--ink); }
.subnav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--orange); }

/* ---------- Reading text ---------- */

.prose { max-width: 68ch; }
.prose a, .intro a { overflow-wrap: anywhere; }
.prose h2 { color: var(--ink); font-size: 1.75rem; }

.with-aside {
  display: grid;
  grid-template-columns: minmax(0, 68ch) minmax(0, 388px);
  justify-content: space-between;
  align-items: start;
  gap: 64px;
}
.aside-figure { position: sticky; top: 32px; }

@media (max-width: 900px) {
  .with-aside { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .aside-figure { position: static; max-width: 320px; }
}

/* ---------- Home ---------- */

.page-home main { padding-bottom: 88px; }

.home-hero {
  display: grid;
  grid-template-columns: 300px minmax(0, 640px);
  gap: 56px;
  align-items: start;
}

/* The orange tab hangs from the nav band */
.fresh-tab {
  justify-self: end;
  display: grid;
  justify-items: center;
  gap: 10px;
  width: 236px;
  padding: 18px 20px 24px;
  border-radius: 0 0 22px 22px;
  background: #e67817;
}
.fresh-tab .fresh-rule { width: 100%; }

.home-intro { padding-top: 48px; }
.home-intro h1 {
  color: var(--orange-head);
  font-size: clamp(2.5rem, 1.6rem + 3.4vw, 3.75rem);
  font-weight: 800;
  line-height: 1.05;
  margin-bottom: 0.25em;
}
.lede {
  max-width: 30ch;
  color: var(--field);
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 1.1rem + 1vw, 1.875rem);
  font-weight: 600;
  line-height: 1.25;
}
.home-intro .actions { margin: 28px 0 0; }

.button {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 10px 26px;
  border-radius: 999px;
  background: var(--field);
  color: #fff;
  font-size: 1.0625rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s;
}
.button:hover { background: var(--field-deep); color: #fff; }

.home-banner { margin-top: 40px; }
.home-banner img { margin-inline: auto; }

@media (max-width: 900px) {
  .home-hero { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .fresh-tab { width: 196px; padding: 14px 16px 18px; gap: 8px; border-radius: 0 0 18px 18px; }
  .home-intro { padding-top: 32px; }
}

/* ---------- Product tiles ---------- */

.tile-grid-wrap { overflow: hidden; margin-top: 32px; }

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  margin: 0 -1px -1px 0;
  padding: 0;
  list-style: none;
}
.tile {
  border-right: 1px dotted var(--dots);
  border-bottom: 1px dotted var(--dots);
}

.tile-link,
.tile-static {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  height: 100%;
  padding: 28px 16px 26px;
  border: 0;
  background: var(--paper);
  color: inherit;
  font: inherit;
  text-align: center;
  text-decoration: none;
}
.tile-link { cursor: pointer; }
.tile-link:focus-visible { outline-offset: -6px; }

.tile img {
  width: 180px;
  margin-bottom: 14px;
  transition: transform 0.25s ease;
}
.tile-name {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.3125rem;
  font-weight: 600;
  line-height: 1.25;
}
.tile-more {
  color: var(--orange-text);
  font-size: 0.9375rem;
  font-style: italic;
}
.tile-link:hover .tile-name { color: var(--orange-head); }
.tile-link:hover .tile-more { text-decoration: underline; text-underline-offset: 0.2em; }

@media (prefers-reduced-motion: no-preference) {
  .tile-link:hover img { transform: translateY(-4px); }
}

@media (max-width: 1180px) {
  .tile-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
}

@media (max-width: 560px) {
  .tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile-link, .tile-static { padding: 20px 10px 18px; }
  .tile img { margin-bottom: 8px; }
  .tile-name { font-size: 1.125rem; }
}

/* A category with a single product shows it in full, no extra click */
.feature {
  display: grid;
  grid-template-columns: fit-content(460px) minmax(0, 62ch);
  justify-content: start;
  align-items: start;
  gap: 56px;
  margin-top: 24px;
  padding-top: 32px;
  border-top: 1px dotted var(--dots);
}
.feature h2 { color: var(--ink); font-size: 1.75rem; }

@media (max-width: 800px) {
  .feature { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}

/* Browse other categories */
.page-product main { padding-bottom: 0; }

.more-produce {
  margin-top: 72px;
  padding: 48px 0 104px;
  background: var(--sprout);
}
.more-produce h2 { color: var(--ink); font-size: 1.5rem; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.chips a {
  display: inline-block;
  padding: 7px 16px;
  border: 1px solid #d3dbc9;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
}
.chips a:hover { border-color: var(--leaf); color: var(--field); }
.chips a[aria-current="page"] { border-color: var(--field); background: var(--field); color: #fff; }

/* ---------- Product details dialog ---------- */

.product-dialog {
  width: min(680px, 100% - 32px);
  max-height: min(88vh, 900px);
  max-height: min(88dvh, 900px);
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 24px 64px rgba(20, 35, 15, 0.35);
  overflow: hidden;
}
.product-dialog[open] { display: flex; flex-direction: column; }
.product-dialog:focus-visible { outline: none; }
.product-dialog::backdrop { background: rgba(28, 42, 22, 0.62); }

.dialog-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 28px 40px 12px;
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 0 0 1px var(--line);
  color: var(--ink);
  cursor: pointer;
}
.dialog-close:hover { background: var(--sprout); }

.dialog-media {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
  padding: 8px 0 20px;
  border-bottom: 1px dotted var(--dots);
}
.dialog-media img { width: auto; max-height: 240px; }

.dialog-body h2 {
  color: var(--orange-head);
  font-size: 2rem;
  font-weight: 800;
}

.dialog-pager {
  flex: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
}
.pager-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 50%;
  min-height: 48px;
  padding: 6px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font: 600 1rem/1.3 var(--font-body);
  text-align: left;
  cursor: pointer;
}
.pager-btn small {
  display: block;
  color: var(--ink-soft);
  font-size: 0.8125rem;
  font-weight: 500;
}
.pager-next { margin-left: auto; text-align: right; }
.pager-btn svg { flex: none; color: var(--orange-text); }
.pager-btn:hover { background: var(--sprout); }

@media (prefers-reduced-motion: no-preference) {
  .product-dialog[open]:not([data-instant]) { animation: dialog-in 0.22s cubic-bezier(0.2, 0.8, 0.2, 1); }
  .product-dialog[open]:not([data-instant])::backdrop { animation: fade-in 0.22s ease-out; }
}
@keyframes dialog-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } }
@keyframes fade-in { from { opacity: 0; } }

@media (max-width: 560px) {
  .product-dialog { width: calc(100% - 16px); max-height: calc(100dvh - 16px); border-radius: 16px; }
  .dialog-scroll { padding: 20px 20px 8px; }
  .dialog-body h2 { font-size: 1.625rem; }
}

/* ---------- Customer benefits ---------- */

.benefits { margin: 40px 0 48px; }
.benefits > h2 { max-width: 32ch; color: var(--ink); font-size: 1.625rem; }

.benefit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px 56px;
  margin-top: 24px;
}
.benefit { padding-top: 16px; border-top: 3px solid var(--leaf); }
.benefit h3 { margin-bottom: 0.3em; color: var(--field); font-size: 1.375rem; }
.benefit p { margin: 0; }

@media (max-width: 760px) {
  .benefit-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Management ---------- */

.people { margin-top: 40px; }
.person {
  display: grid;
  grid-template-columns: 180px minmax(0, 68ch);
  align-items: start;
  gap: 40px;
}
.person + .person { margin-top: 48px; padding-top: 48px; border-top: 1px solid var(--line); }
.person-photo { position: sticky; top: 24px; border-radius: var(--radius); }

@media (max-width: 700px) {
  .person { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .person-photo { position: static; width: 140px; }
}

/* ---------- News ---------- */

.news-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 64px;
  padding-top: 56px;
}
.news-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
.news-list li {
  display: grid;
  justify-items: start;
  gap: 4px;
  padding: 14px 0 16px;
  border-bottom: 1px solid var(--line);
}
.news-date {
  padding: 0 10px;
  border-radius: 999px;
  background: var(--sprout);
  color: var(--field);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.7;
}
.news-list a {
  color: var(--ink);
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.45;
  text-decoration: none;
}
.news-list a:hover { color: var(--orange-text); text-decoration: underline; }

@media (max-width: 800px) {
  .news-columns { grid-template-columns: minmax(0, 1fr); gap: 40px; }
}

/* ---------- Contact ---------- */

.address-card {
  display: inline-block;
  margin-top: 16px;
  padding: 24px 28px;
  border-left: 4px solid var(--orange);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--sprout);
  font-size: 1.1875rem;
  line-height: 1.6;
}
.address-card p { margin-bottom: 0.75em; }
.address-card .address-email { margin: 0; font-weight: 600; }

.contact-banner { margin-top: 40px; }
.contact-banner img { margin-inline: auto; }

/* ---------- Footer ---------- */

.site-footer {
  position: relative;
  background: var(--field);
  color: var(--on-field-soft);
}

.footer-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "nav social"
    "legal legal";
  align-items: center;
  gap: 24px 32px;
  padding: 64px 0 28px;
}

/* The badge sits on the edge of the footer, mirroring the logo up top */
.footer-badge {
  position: absolute;
  top: -49px;
  right: 0;
  width: 114px;
}

.footer-nav { grid-area: nav; }
.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer-nav a { color: #fff; font-weight: 500; text-decoration: none; }
.footer-nav a:hover { color: var(--on-field-accent); text-decoration: underline; }

.social--footer { grid-area: social; }
.social--footer a { background: rgba(255, 255, 255, 0.1); color: #fff; }
.social--footer a:hover { background: rgba(255, 255, 255, 0.2); color: #fff; }

.footer-legal {
  grid-area: legal;
  margin: 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 0.875rem;
}

.site-footer :focus-visible { outline-color: var(--on-field-accent); }

@media (max-width: 700px) {
  .footer-inner {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "nav" "social" "legal";
    padding-top: 72px;
  }
  .footer-badge { right: auto; left: 0; width: 96px; top: -42px; }
  .footer-nav ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; }
  .footer-nav a { display: inline-block; padding: 6px 0; }
}
