:root {
  color-scheme: light;
  --ink: #38261e;
  --muted: #6f6960;
  --line: #d9d0c6;
  --paper: #fffdf8;
  --cream: #f3f0eb;
  --tan: #a9825f;
  --brown: #7b5634;
  --brown-dark: #4d3423;
  --green: #6f7353;
  --green-dark: #545a3a;
  --soft: #eeece6;
  --shadow: 0 18px 45px rgba(54, 40, 30, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(247, 244, 239, .98), rgba(240, 238, 233, .95)),
    repeating-linear-gradient(0deg, rgba(84, 69, 55, .024) 0 1px, transparent 1px 92px);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

button, input, select, textarea { font: inherit; }

button {
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #60412a, var(--brown-dark));
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  min-height: 42px;
  padding: 10px 17px;
}

button:hover { background: linear-gradient(180deg, #513720, #3f2a1d); }

button.secondary, .site-nav button, .admin-tab {
  background: rgba(255, 253, 248, .9);
  border: 1px solid var(--line);
  color: var(--ink);
}

.site-nav button.active, .admin-tab.active, .admin-link {
  background: var(--green-dark);
  border-color: var(--green-dark);
  color: #fff;
}

.hidden { display: none !important; }
.bot-field { display: none !important; }

.site-header {
  align-items: center;
  background: rgba(255, 253, 248, 0.97);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 12px clamp(14px, 4vw, 44px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand-lockup {
  align-items: center;
  color: var(--ink);
  display: flex;
  gap: 12px;
  min-width: 230px;
  text-decoration: none;
}

.brand-lockup img, footer img, #adminLogo, #heroLogo, #contactLogo {
  background: #eee8df;
  border: 1px solid var(--line);
  border-radius: 50%;
  object-fit: cover;
}

.brand-lockup img { height: 54px; width: 54px; }
.brand-lockup strong { display: block; font-size: 1rem; }
.brand-lockup small { color: var(--muted); display: block; font-size: 0.78rem; }

.site-nav {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.site-nav button { min-height: 36px; padding: 8px 11px; }
.menu-btn { display: none; }

.page { display: none; }
.page.active { display: block; }

.hero {
  background: #f1eee8;
  position: relative;
  text-align: center;
}

.hero > img {
  display: block;
  height: auto;
  object-fit: contain;
  width: 100%;
}

.hero-copy {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  left: 0;
  margin: 0 auto;
  max-width: none;
  padding: 0 clamp(18px, 4vw, 44px) 32px;
  position: absolute;
  right: 0;
  bottom: 4px;
  text-align: center;
  width: calc(100% - 32px);
}

.hero-copy .button-row {
  display: flex;
  justify-content: center;
}

#heroLogo,
#homeFarmName,
#homeTagline,
#homeIntro {
  display: none;
}

h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(2.4rem, 8vw, 5.7rem); line-height: 0.98; margin-bottom: 8px; }
h2 { font-size: clamp(1.7rem, 4vw, 3rem); line-height: 1.06; margin-bottom: 10px; }
h3 { margin-bottom: 8px; }

.eyebrow {
  color: var(--brown);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.content-wrap {
  margin: 0 auto;
  max-width: 1180px;
  padding: clamp(24px, 5vw, 54px) clamp(16px, 4vw, 38px);
}

.readable { max-width: 880px; }
.readable p { color: var(--muted); font-size: 1.08rem; }

.section-title { margin-bottom: 20px; }
.section-title.compact { margin-bottom: 12px; }

.info-grid, .card-grid, .gallery-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gallery-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

article, .form-card, .contact-intro, .admin-panel, .admin-sidebar {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

article,
.form-card,
.contact-intro,
.admin-panel,
.admin-sidebar {
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, .34), rgba(242, 239, 233, .16)),
    repeating-linear-gradient(0deg, rgba(84, 69, 55, .018) 0 1px, transparent 1px 64px);
}

article, .form-card, .contact-intro, .admin-panel, .admin-sidebar { padding: 20px; }
article p, .contact-intro p, .muted { color: var(--muted); }

.card-img, .gallery-img, .post-img, .preview-img {
  background: var(--soft);
  border-radius: 14px;
  display: block;
  height: 210px;
  object-fit: cover;
  width: 100%;
}

.gallery-img { height: 180px; }
.post-img { height: 260px; }
.preview-img { height: 190px; margin-top: 10px; }

.upload-box {
  align-items: center;
  background: #fffdf8;
  border: 1px dashed var(--brown);
  border-radius: 16px;
  display: grid;
  gap: 10px;
  justify-items: center;
  min-height: 220px;
  overflow: hidden;
  padding: 14px;
}

.upload-box img {
  border-radius: 12px;
  display: block;
  max-height: 220px;
  object-fit: cover;
  width: 100%;
}

.upload-placeholder {
  align-items: center;
  background: linear-gradient(135deg, #f0eee8, #e6dfd6);
  border-radius: 12px;
  color: var(--muted);
  display: flex;
  font-weight: 800;
  justify-content: center;
  min-height: 150px;
  width: 100%;
}

.button-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.split {
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(260px, 0.45fr) minmax(0, 1fr);
}

#contactLogo, #adminLogo { height: 86px; width: 86px; }

.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

label {
  color: var(--ink);
  display: grid;
  font-weight: 800;
  gap: 7px;
}

input, select, textarea {
  background: #fffdf9;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  min-height: 42px;
  padding: 10px 12px;
  width: 100%;
}

textarea { min-height: 120px; resize: vertical; }

fieldset {
  border: 1px solid var(--line);
  border-radius: 14px;
  margin: 16px 0;
  padding: 14px;
}

legend { font-weight: 900; padding: 0 8px; }
.check-grid { display: grid; gap: 9px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.check-grid label, .toggle-label { align-items: center; display: flex; gap: 8px; }
.check-grid input, .toggle-label input { min-height: auto; width: auto; }

.status-text { color: var(--green); font-weight: 800; }
.status-text.error { color: #9c3328; }

.post-list { display: grid; gap: 18px; }
.post-card { display: grid; gap: 18px; grid-template-columns: 280px 1fr; }
.post-card .post-img { height: 100%; min-height: 210px; }

.admin-shell {
  display: grid;
  gap: 20px;
  grid-template-columns: 260px minmax(0, 1fr);
  margin: 0 auto;
  max-width: 1400px;
  padding: clamp(18px, 4vw, 36px);
}

.admin-sidebar {
  align-self: start;
  display: grid;
  gap: 10px;
  position: sticky;
  top: 96px;
}

.admin-sidebar button { border-radius: 12px; justify-content: flex-start; text-align: left; }

.admin-panel { min-width: 0; }

.admin-section { display: none; }
.admin-section.active { display: block; }

.manager-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(300px, 0.42fr) minmax(0, 0.58fr);
}

.item-list { display: grid; gap: 10px; }
.list-item {
  background: #fffdf9;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 12px;
}

.list-item button { min-height: 34px; padding: 6px 10px; }
.list-actions { display: flex; flex-wrap: wrap; gap: 6px; }

.table-wrap { overflow: auto; }
table { border-collapse: collapse; min-width: 940px; width: 100%; }
th, td { border-bottom: 1px solid var(--line); padding: 10px; text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; }

.filters { margin-bottom: 16px; }
.pill {
  background: #e8e5dc;
  border: 1px solid #c6b9ab;
  border-radius: 999px;
  color: #4d3423;
  display: inline-flex;
  font-weight: 800;
  padding: 4px 9px;
}

footer {
  align-items: center;
  background: linear-gradient(135deg, #4d3423, #6a4a2f);
  color: #fff;
  display: flex;
  gap: 12px;
  justify-content: center;
  padding: 24px;
}

footer img { height: 58px; width: 58px; }
footer span { color: #efe8df; display: block; }

.login-dialog {
  border: 0;
  border-radius: 18px;
  max-width: 430px;
  padding: 0;
  width: calc(100% - 28px);
}

.login-dialog::backdrop { background: rgba(51, 40, 37, 0.42); }

@media (max-width: 1050px) {
  .info-grid, .card-grid, .gallery-grid, .split, .admin-shell, .manager-grid {
    grid-template-columns: 1fr;
  }

  .admin-sidebar { position: static; }
  .post-card { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .site-header { align-items: stretch; flex-direction: column; }
  .menu-btn { display: block; }
  .site-nav { display: none; justify-content: stretch; }
  .site-nav.open { display: grid; }
  .site-nav button, .button-row button { width: 100%; }
  .grid.two, .grid.three, .check-grid { grid-template-columns: 1fr; }
  .hero > img {
    height: auto;
    object-fit: contain;
  }
  .hero-copy {
    bottom: 8px;
    padding-bottom: 18px;
    width: 100%;
  }
}
