/* ===========================================================================
   SunMaster Produce Inc. — site styles
   Palette: taken from the logo — sun orange-red, leaf green, charcoal
            wordmark — on a warm cream ground.
   Type:    Fraunces (display serif) + Figtree (body sans).
   =========================================================================== */

:root {
  /* Brand colours sampled from static/img/Logo.png */
  --sun:        #f73502;   /* the sun + "Sun" wordmark */
  --sun-400:    #ff6a3d;   /* orange on dark backgrounds */
  --sun-600:    #d92e00;   /* buttons / orange text (AA contrast) */
  --sun-700:    #b32600;
  --sun-100:    #ffede5;

  --leaf:       #509e04;   /* the green hill arc */
  --leaf-300:   #a9d27c;
  --leaf-700:   #3b7a06;   /* green text / links (AA contrast) */
  --leaf-800:   #2d5e07;
  --leaf-100:   #eef6e4;

  --charcoal:   #0a1619;   /* "Master" wordmark */
  --charcoal-2: #172a2e;

  --amber:      #f5b800;   /* yellow pepper */

  --cream:    #fbf7ee;
  --paper:    #ffffff;
  --ink:      #1b262a;
  --muted:    #5b6769;
  --line:     #e9e2d4;

  --shadow-sm: 0 1px 3px rgba(10,22,25,.08);
  --shadow-md: 0 12px 32px -12px rgba(10,22,25,.26);
  --shadow-lg: 0 30px 60px -24px rgba(10,22,25,.34);

  --radius:    18px;
  --radius-sm: 12px;
  --maxw:      1140px;
  --header-h:  84px;

  --serif: "Fraunces", Georgia, serif;
  --sans:  "Figtree", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }
::selection { background: var(--sun-100); color: var(--charcoal); }
:focus-visible { outline: 3px solid rgba(80,158,4,.55); outline-offset: 2px; }

.container { width: min(var(--maxw), 92vw); margin-inline: auto; }

a { color: var(--leaf-700); text-decoration: none; transition: color .15s; }
a:hover { color: var(--sun-600); }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.01em;
  margin: 0 0 .5em;
  color: var(--charcoal);
}
h1 { font-size: clamp(2.4rem, 6vw, 4.1rem); }
h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
h3 { font-size: 1.35rem; }

p { margin: 0 0 1rem; }

.eyebrow {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .78rem;
  font-weight: 700;
  color: var(--sun-600);
  margin: 0 0 .9rem;
}

/* ---------- Buttons ------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--sans); font-weight: 600; font-size: 1rem;
  padding: .8rem 1.6rem; border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--sun-600); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--sun-700); color: #fff; box-shadow: var(--shadow-md); }
.btn-ghost { background: transparent; color: var(--charcoal); border-color: var(--charcoal); }
.btn-ghost:hover { background: var(--charcoal); color: #fff; }
.btn-sm { padding: .5rem 1rem; font-size: .9rem; }

/* ---------- Header / nav -------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251,247,238,.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-h);
}
.brand { display: flex; align-items: center; }
.brand-logo { display: block; height: 62px; width: auto; }

.site-nav { display: flex; align-items: center; gap: 1.6rem; }
.site-nav a { font-weight: 600; color: var(--charcoal); font-size: .98rem; }
.site-nav a:hover, .site-nav a.active { color: var(--sun-600); }
.nav-cta {
  background: var(--leaf-700); color: #fff !important;
  padding: .5rem 1.1rem; border-radius: 999px;
}
.nav-cta:hover { background: var(--leaf-800); }

.nav-toggle, .nav-burger { display: none; }

/* ---------- Flash messages ------------------------------------------------ */
.flash-stack { margin-top: 1rem; display: grid; gap: .6rem; }
.flash {
  padding: .85rem 1.2rem; border-radius: var(--radius-sm);
  font-weight: 500; border: 1px solid;
}
.flash-success { background: var(--leaf-100); border-color: var(--leaf-300); color: var(--leaf-800); }
.flash-danger  { background: var(--sun-100); border-color: #f5b39e; color: var(--sun-700); }
.flash-warning { background: #fff6da; border-color: var(--amber); color: #6e5200; }

/* ---------- Hero ---------------------------------------------------------- */
.hero, .page-hero { position: relative; }
.hero {
  overflow: hidden;
  background:
    radial-gradient(700px 500px at 100% 100%, rgba(247,53,2,.10), transparent 60%),
    radial-gradient(700px 600px at 0% 110%, rgba(80,158,4,.14), transparent 55%),
    var(--cream);
  padding-bottom: clamp(4.5rem, 9vw, 7rem);
}
/* The logo's green arc, rising into the white section below */
.hero::after, .page-hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: clamp(28px, 4vw, 56px);
  background: url("../img/horizon.svg") center bottom / 100% 100% no-repeat;
  pointer-events: none;
}
/* Photo keeps its top (the logo in the image) when the height is capped */
.hero-media img {
  display: block; width: 100%;
  height: clamp(260px, 56.25vw, 74vh);
  object-fit: cover; object-position: 50% 15%;
}
.hero-body {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: minmax(0, 620px) 1fr; gap: 2.5rem; align-items: end;
  margin-top: calc(-1 * clamp(3rem, 12vw, 13rem));
}
.hero-card {
  background: var(--paper); border-radius: 24px; box-shadow: var(--shadow-lg);
  border-top: 4px solid var(--sun);
  padding: clamp(1.6rem, 3.5vw, 2.75rem);
}
.hero h1 { font-size: clamp(2.1rem, 4.2vw, 3.3rem); margin-bottom: 1rem; }
.hero h1 em { font-style: italic; color: var(--sun); }
.hero-lead { font-size: 1.2rem; color: var(--muted); max-width: 42ch; margin-bottom: 2rem; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero-stats { justify-content: flex-end; margin: 0 0 .75rem; }

/* ---------- Generic section ---------------------------------------------- */
.section { padding: clamp(3.5rem, 7vw, 6rem) 0; }
.section-head { max-width: 60ch; margin-bottom: 2.5rem; }
.section--tint { background: var(--charcoal); color: #e8ecec; }
.section--tint h2, .section--tint h3 { color: #fff; }
.section--tint .eyebrow { color: var(--sun-400); }
.section--paper { background: var(--paper); }

/* ---------- Feature / value cards ---------------------------------------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }

.card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.8rem;
  box-shadow: var(--shadow-sm); transition: transform .18s, box-shadow .18s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.card .icon {
  width: 52px; height: 52px; border-radius: 14px; margin-bottom: 1.1rem;
  display: grid; place-items: center;
  background: var(--leaf-100); color: var(--leaf-700);
}
.card:nth-child(even) .icon { background: var(--sun-100); color: var(--sun-600); }
.card .icon .i { width: 26px; height: 26px; }
.card h3 { color: var(--charcoal); }
.card p { color: var(--muted); margin: 0; }

/* ---------- Pepper varieties --------------------------------------------- */
.pepper-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4rem; }
.pepper-card {
  border-radius: var(--radius); overflow: hidden; background: var(--paper);
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  transition: transform .18s, box-shadow .18s;
}
.pepper-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.pepper-photo { aspect-ratio: 5 / 3; overflow: hidden; background: var(--leaf-100); }
.pepper-photo img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.pepper-card:hover .pepper-photo img { transform: scale(1.05); }
.pepper-card .body { padding: 1.1rem 1.3rem 1.4rem; }
.pepper-card h3 { margin-bottom: .25rem; }
.pepper-card p { color: var(--muted); margin: 0; font-size: .95rem; }

/* ---------- Split / about ------------------------------------------------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.split-visual {
  aspect-ratio: 5/4; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-md);
}
.split-visual img { display: block; width: 100%; height: 100%; object-fit: cover; }
.split-visual--wide { aspect-ratio: 16 / 9; }
.split-visual--product { background: #fff; border: 1px solid var(--line); }
.split-visual--product img { object-fit: contain; padding: 1.5rem; }
.stat-row { display: flex; gap: 2.5rem; margin-top: 1.5rem; flex-wrap: wrap; }
.stat .num { font-family: var(--serif); font-size: 2.4rem; font-weight: 700; color: var(--sun-600); line-height: 1; }
.stat .lbl { color: var(--muted); font-size: .9rem; }

/* ---------- Careers ------------------------------------------------------- */
.page-hero {
  background:
    radial-gradient(700px 400px at 90% -20%, rgba(247,53,2,.16), transparent 60%),
    radial-gradient(600px 420px at 0% 130%, rgba(80,158,4,.14), transparent 60%),
    var(--cream);
  padding: clamp(3rem, 7vw, 5rem) 0 clamp(4rem, 8vw, 6rem);
}
.page-hero .eyebrow { color: var(--sun-600); }

.job-list { display: grid; gap: 1.1rem; max-width: 820px; margin-inline: auto; }
.job-card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.5rem 1.7rem;
  display: flex; justify-content: space-between; align-items: center; gap: 1.5rem;
  box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s, border-color .15s;
}
.job-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--leaf-300); }
.job-card h3 { margin: 0 0 .4rem; }
.job-card .meta { display: flex; gap: .6rem; flex-wrap: wrap; }
.job-card .summary { color: var(--muted); margin: .55rem 0 0; }

.tag {
  display: inline-flex; align-items: center; font-size: .8rem; font-weight: 600;
  padding: .25rem .7rem; border-radius: 999px; background: var(--leaf-100);
  color: var(--leaf-700);
}
.tag--type { background: var(--sun-100); color: var(--sun-700); }

.empty {
  text-align: center; max-width: 520px; margin: 2rem auto; color: var(--muted);
  background: var(--paper); border: 1px dashed var(--line);
  border-radius: var(--radius); padding: 3rem 2rem;
}

/* ---------- Job detail ---------------------------------------------------- */
.prose { max-width: 720px; margin-inline: auto; }
.prose .meta { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.prose h2 { font-size: 1.5rem; margin-top: 2rem; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: .4rem; }
.prose li::marker { color: var(--leaf); }
.apply-box {
  margin-top: 2.5rem; padding: 1.8rem; border-radius: var(--radius);
  background: var(--leaf-100); border: 1px solid var(--leaf-300);
}
.apply-box .fine-print { margin: 1rem 0 0; font-size: .88rem; color: var(--muted); }

/* ---------- Contact ------------------------------------------------------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; }
.contact-item { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.3rem; }
.contact-item .ico {
  flex: none; width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--sun-100); color: var(--sun-600);
}
.contact-item .ico .i { width: 22px; height: 22px; }
/* The address shows through until (or if) the embedded map loads over it */
.map-block {
  position: relative; border-radius: var(--radius); overflow: hidden; min-height: 360px;
  border: 1px solid var(--line); background: var(--leaf-100);
  display: grid; place-items: center; color: var(--leaf-700); font-weight: 600;
}
.map-block iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- CTA strip ----------------------------------------------------- */
.cta-strip {
  background:
    radial-gradient(560px 260px at 50% 135%, rgba(247,53,2,.6), transparent 70%),
    linear-gradient(135deg, var(--charcoal-2), var(--charcoal));
  color: #fff; border-radius: var(--radius); padding: clamp(2.5rem,5vw,3.5rem);
  text-align: center; margin: 3rem auto;
}
.cta-strip h2 { color: #fff; }
.cta-strip p { color: rgba(255,255,255,.85); max-width: 50ch; margin: 0 auto 1.8rem; }
.cta-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.cta-strip .btn-ghost { color: #fff; border-color: rgba(255,255,255,.7); }
.cta-strip .btn-ghost:hover { background: #fff; color: var(--charcoal); }

/* ---------- Footer -------------------------------------------------------- */
.site-footer { background: var(--charcoal); color: #c5cfd0; margin-top: 4rem; }
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2rem;
  padding: 3rem 0 2rem;
}
.footer-grid h4 { color: #fff; font-family: var(--sans); font-size: .8rem; text-transform: uppercase; letter-spacing: .14em; margin-bottom: .8rem; }
.footer-grid p { margin: 0 0 .4rem; font-size: .95rem; }
.footer-grid a { color: #c5cfd0; }
.footer-grid a:hover { color: var(--sun-400); }
.brand--footer { display: inline-flex; }
.brand--footer .brand-logo { height: 76px; }
.footer-tag { margin-top: .8rem; color: #8c9a9c; max-width: 30ch; }
.footer-base {
  border-top: 1px solid rgba(255,255,255,.1); padding: 1.2rem 0;
  font-size: .85rem; color: #8c9a9c;
  display: flex; justify-content: space-between; gap: .5rem 1.5rem; flex-wrap: wrap;
}
.footer-base a { color: #c5cfd0; }
.footer-base a:hover { color: var(--sun-400); }

/* ===========================================================================
   ADMIN
   =========================================================================== */
.admin-body { background: #f4f2ec; }

.auth-wrap { min-height: 70vh; display: grid; place-items: center; padding: 3rem 1rem; }
.auth-card {
  width: min(420px, 92vw); background: var(--paper); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 2.5rem; border: 1px solid var(--line);
  border-top: 4px solid var(--sun);
}
.auth-card .brand { justify-content: center; margin-bottom: 1.25rem; }
.auth-card .brand-logo { height: 96px; }
.auth-card h1 { font-size: 1.6rem; text-align: center; margin-bottom: 1.5rem; }

.admin-shell { padding: 2.5rem 0 4rem; }
.admin-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem;
}
.admin-top h1 { margin: 0; font-size: 2rem; }
.admin-top .who { color: var(--muted); font-size: .95rem; }

.table-wrap { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; box-shadow: var(--shadow-sm); }
table.jobs { width: 100%; border-collapse: collapse; }
table.jobs th, table.jobs td { padding: .95rem 1.1rem; text-align: left; border-bottom: 1px solid var(--line); }
table.jobs th { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); background: #faf8f2; }
table.jobs tr:last-child td { border-bottom: none; }
table.jobs td .row-title { font-weight: 600; color: var(--charcoal); }
.status-pill { font-size: .78rem; font-weight: 600; padding: .2rem .6rem; border-radius: 999px; white-space: nowrap; }
.status-on  { background: var(--leaf-100); color: var(--leaf-700); }
.status-off { background: #eef0f0; color: var(--muted); }
.row-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.row-actions form { display: inline; margin: 0; }

.linkbtn { background: none; border: none; cursor: pointer; font: inherit; color: var(--leaf-700); padding: .35rem .6rem; border-radius: 8px; font-weight: 600; font-size: .88rem; }
.linkbtn:hover { background: var(--leaf-100); }
.linkbtn.danger { color: var(--sun-700); }
.linkbtn.danger:hover { background: var(--sun-100); }

/* ---------- Forms --------------------------------------------------------- */
.form-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow-sm); max-width: 760px; }
.field { margin-bottom: 1.3rem; }
.field label { display: block; font-weight: 600; margin-bottom: .4rem; color: var(--charcoal); }
.field input[type=text], .field input[type=password], .field textarea, .field select {
  width: 100%; padding: .75rem .9rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font: inherit; background: #fff; color: var(--ink);
}
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--leaf); outline-offset: 0; border-color: var(--leaf); }
.field textarea { resize: vertical; min-height: 120px; }
.field .hint { font-size: .85rem; color: var(--muted); margin-top: .35rem; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.3rem; }
.check-row { display: flex; align-items: center; gap: .6rem; }
.check-row input { width: 18px; height: 18px; accent-color: var(--leaf-700); }
.form-actions { display: flex; gap: .8rem; margin-top: 1.5rem; }

/* ---------- Responsive ---------------------------------------------------- */
@media (max-width: 860px) {
  :root { --header-h: 72px; }
  .brand-logo { height: 52px; }

  .hero-body, .split, .contact-grid { grid-template-columns: 1fr; }
  .hero-stats { justify-content: flex-start; gap: 1.5rem; }
  .grid-3, .pepper-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .field-grid { grid-template-columns: 1fr; }

  .nav-burger {
    display: block; width: 30px; height: 30px; position: relative; cursor: pointer;
  }
  .nav-burger span, .nav-burger span::before, .nav-burger span::after {
    content: ""; position: absolute; left: 0; right: 0; height: 2px; background: var(--charcoal);
    transition: transform .2s, background .2s;
  }
  .nav-burger span { top: 14px; }
  .nav-burger span::before { top: -7px; }
  .nav-burger span::after { top: 7px; }
  .nav-toggle:checked + .nav-burger span { background: transparent; }
  .nav-toggle:checked + .nav-burger span::before { transform: translateY(7px) rotate(45deg); }
  .nav-toggle:checked + .nav-burger span::after { transform: translateY(-7px) rotate(-45deg); }

  .site-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: flex-start;
    background: var(--cream); padding: 1.2rem 4vw 1.5rem; gap: 1rem;
    border-bottom: 1px solid var(--line); box-shadow: var(--shadow-md);
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .2s, transform .2s, visibility .2s;
  }
  .nav-toggle:checked ~ .site-nav { opacity: 1; visibility: visible; transform: none; }
}
@media (max-width: 520px) {
  .grid-3, .pepper-grid, .grid-2, .footer-grid { grid-template-columns: 1fr; }
  .job-card { flex-direction: column; align-items: flex-start; }
  .hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
  .hero-stats .num { font-size: 2rem; }
}
