/* ---------------------------------------------------------------
   Sunshine Orchard
   One hand-written stylesheet. No preprocessor, no build step.
   Edit it directly; it is the whole design system.
   --------------------------------------------------------------- */

/* --- Fonts -------------------------------------------------- */

@font-face {
  font-family: "Bree Serif";
  src: url("/assets/fonts/bree-serif-regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Signika";
  src: url("/assets/fonts/signika-light.woff") format("woff");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Signika";
  src: url("/assets/fonts/signika-regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Signika";
  src: url("/assets/fonts/signika-bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* --- Tokens ------------------------------------------------- */

:root {
  --green-deep: #3d5616;
  --green: #6b8445;
  --green-pale: #e8edda;
  --tan: #c6a67e;
  --tan-pale: #f0e4d2;
  --brown: #5d3e18;
  --ink: #2b1800;
  --ink-soft: #5a4a38;
  --cream: #fbf6ec;
  --paper: #fffdf8;
  --plum: #7a2342;
  --rule: #e3d8c4;

  --icon-external: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cg fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.3 7.7 7.7 2.3'/%3E%3Cpath d='M4.4 2.3h3.3v3.3'/%3E%3C/g%3E%3C/svg%3E");

  --serif: "Bree Serif", Georgia, "Times New Roman", serif;
  --sans: "Signika", "Avenir Next", "Segoe UI", system-ui, sans-serif;

  /* Two horizontal tracks, and only two:
       --measure  every block of running text, boxed or not. A callout, the
                  FAQ and the contact cards are already set apart by their
                  own design, so they must not also differ in width.
       --wrap     the page gutter, used by grids of things (variety cards,
                  the about layout) which are not text and do not compete
                  with the reading column. */
  --measure: 38rem;
  --wrap: 68rem;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(43, 24, 0, .06), 0 6px 18px rgba(43, 24, 0, .07);

  color-scheme: light;
}

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

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  font-size: clamp(1.0625rem, 0.99rem + 0.35vw, 1.1875rem);
  line-height: 1.7;
}

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

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.2;
  color: var(--green-deep);
  margin: 0 0 .5em;
  text-wrap: balance;
}

h1 { font-size: clamp(1.9rem, 1.45rem + 2.1vw, 2.9rem); }
h2 { font-size: clamp(1.45rem, 1.25rem + 0.95vw, 1.95rem); }
h3 { font-size: clamp(1.2rem, 1.1rem + 0.5vw, 1.4rem); }

p { margin: 0 0 1.1em; }

a {
  color: var(--green-deep);
  text-decoration-color: var(--tan);
  text-underline-offset: .18em;
  text-decoration-thickness: .08em;
}

a:hover,
a:focus-visible {
  color: var(--plum);
  text-decoration-color: currentColor;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--green-deep);
  color: #fff;
  padding: .6em 1em;
  z-index: 10;
}
.skip-link:focus { left: 0; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

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

.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding-block: 1.1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: .85rem;
  text-decoration: none;
  color: inherit;
}

.brand__mark {
  width: 58px;
  height: 58px;
  border-radius: var(--radius);
  flex: none;
}

.brand__words { display: block; }

.brand__name {
  display: block;
  font-family: var(--serif);
  font-size: 1.6rem;
  line-height: 1.05;
  color: var(--green-deep);
  letter-spacing: .005em;
}

.brand__tagline {
  display: block;
  font-size: .82rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: .2rem;
}

.site-nav {
  min-width: 0; /* without this the ul refuses to wrap and overflows */
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (max-width: 34rem) {
  .site-header__inner { gap: .75rem; }
  .site-nav ul { gap: .1rem 1.1rem; }
}

.site-nav a {
  display: block;
  padding: .3rem 0;
  font-size: .98rem;
  text-decoration: none;
  color: var(--ink-soft);
  border-bottom: 2px solid transparent;
}

.site-nav a:hover,
.site-nav a:focus-visible { color: var(--green-deep); }

.site-nav a[aria-current="page"] {
  color: var(--green-deep);
  border-bottom-color: var(--tan);
}

/* --- Hero --------------------------------------------------- */

/* Full-bleed band. It runs edge to edge, so no corner radius and no padding:
   the space below comes from .home-intro. */
.hero__image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 1;
  max-height: 420px; /* stops it dominating on very wide screens */
  object-fit: cover;
  object-position: center 45%;
  background: var(--tan-pale); /* shows only while the photo loads */
}

/* 4:1 is a sliver on a phone, so let it deepen as the screen narrows. */
@media (max-width: 40rem) {
  .hero__image { aspect-ratio: 2.4 / 1; }
}

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

.page-head {
  background: var(--tan-pale);
  border-bottom: 1px solid var(--rule);
  padding-block: clamp(1.75rem, 1.2rem + 2.2vw, 3rem);
}

.page-head h1 { margin-bottom: 0; }

.page-head__standfirst {
  max-width: var(--measure);
  margin: .7rem 0 0;
  color: var(--ink-soft);
  font-size: 1.05em;
}

.page-body { padding-block: clamp(2rem, 1.4rem + 2.4vw, 3.5rem); }

/* Whatever lands first or last in the page body must not add its own margin on
   top of the container's padding -- otherwise a page that opens with a callout
   starts lower than one that opens with prose, and the content line jumps as
   you move between pages. */
.page-body > :first-child { margin-top: 0; }
.page-body > :last-child { margin-bottom: 0; }

/* --- Prose -------------------------------------------------- */

.prose { max-width: var(--measure); }
.prose > :last-child { margin-bottom: 0; }

.prose h2 { margin-top: 2em; }
.prose h2:first-child { margin-top: 0; }

.lede {
  font-size: 1.15em;
  font-weight: 400;
  color: var(--brown);
}

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

.home-intro { padding-block: clamp(2.25rem, 1.5rem + 3vw, 4rem); }

.home-intro__grid {
  display: grid;
  gap: clamp(1.5rem, 1rem + 2.5vw, 3rem);
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  align-items: start;
}

/* The cards ride alongside the long prose column and stay put while it scrolls. */
.home-intro__side {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: sticky;
  top: 1.5rem;
}

@media (max-width: 48rem) {
  .home-intro__side { position: static; }
}

@media (max-width: 48rem) {
  .home-intro__grid { grid-template-columns: 1fr; }
}

.home-intro__aside {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.4rem 1.5rem;
}

.home-intro__aside--second {
  background: var(--green-pale);
  border-color: #cfdcb4;
}

.home-intro__aside h2 {
  font-size: 1.25rem;
  margin-bottom: .4em;
}

.home-intro__aside p { font-size: .98rem; }
.home-intro__aside > :last-child { margin-bottom: 0; }

/* --- Buttons & calls to action ------------------------------ */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1rem;
  align-items: center;
  margin-top: 1.75rem;
}

.button {
  display: inline-block;
  background: var(--green-deep);
  color: #fff;
  font-family: var(--serif);
  font-size: 1rem;
  padding: .62em 1.25em;
  border-radius: var(--radius);
  text-decoration: none;
  border: 1px solid var(--green-deep);
}

.button:hover,
.button:focus-visible {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.button--quiet {
  background: transparent;
  color: var(--green-deep);
  border-color: var(--tan);
}

.button--quiet:hover,
.button--quiet:focus-visible {
  background: var(--tan-pale);
  color: var(--green-deep);
  border-color: var(--tan);
}

/* --- Callout ------------------------------------------------ */

.callout {
  background: var(--green-pale);
  border: 1px solid #cfdcb4;
  border-left: 5px solid var(--green);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  margin: 2rem 0;
  /* Deliberately wider than --measure. A callout carries short, scannable
     copy rather than long-form reading, and the extra width lets it sit
     closer to the grids it introduces. */
  max-width: 48rem;
}

.callout h2,
.callout h3 { margin-top: 0; }
.callout > :last-child { margin-bottom: 0; }

/* --- Product sections --------------------------------------- */

.product {
  display: grid;
  gap: clamp(1.25rem, .8rem + 2vw, 2.5rem);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  align-items: start;
  padding-block: clamp(1.75rem, 1.2rem + 2vw, 2.75rem);
  border-top: 1px solid var(--rule);
  scroll-margin-top: 1rem;
}

.product:first-of-type { border-top: 0; padding-top: 0; }

.product:nth-of-type(even) .product__media { order: 2; }

@media (max-width: 46rem) {
  .product { grid-template-columns: 1fr; }
  .product:nth-of-type(even) .product__media { order: 0; }
}

.product__media img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
}

@media (min-width: 46.01rem) {
  .product__media {
    position: sticky;
    top: 1.5rem;
  }
}

.product__body > :first-child { margin-top: 0; }
.product__body > :last-child { margin-bottom: 0; }

/* --- Variety guide ------------------------------------------ */

.season { margin-bottom: clamp(2.25rem, 1.6rem + 2.5vw, 3.5rem); }

.season__head {
  border-bottom: 2px solid var(--tan);
  padding-bottom: .5rem;
  margin-bottom: 1.5rem;
}

.season__head h2 { margin-bottom: .15em; }

.season__head p {
  margin: 0;
  color: var(--ink-soft);
  max-width: var(--measure);
}

.variety-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(14.5rem, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

.variety {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.variety__photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--tan-pale);
}

.variety__photo--none {
  display: grid;
  place-items: center;
  font-family: var(--serif);
  color: var(--brown);
  opacity: .5;
  font-size: .9rem;
}

.variety__body {
  padding: 1.1rem 1.25rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
  flex: 1;
}

.variety__name {
  margin: 0;
  font-size: 1.3rem;
}

.variety__window {
  font-size: .83rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--brown);
  font-weight: 400;
}

.variety__body p {
  margin: .5rem 0 0;
  font-size: .98rem;
}

/* --- FAQ ---------------------------------------------------- */

.faq { max-width: var(--measure); }

.faq__item {
  border-bottom: 1px solid var(--rule);
}

.faq__item summary {
  cursor: pointer;
  list-style: none;
  padding: 1.05rem 2.25rem 1.05rem 0;
  position: relative;
  font-family: var(--serif);
  font-size: clamp(1.1rem, 1.03rem + 0.35vw, 1.27rem);
  color: var(--green-deep);
}

.faq__item summary::-webkit-details-marker { display: none; }

.faq__item summary::after {
  content: "";
  position: absolute;
  right: .4rem;
  top: 50%;
  width: .6rem;
  height: .6rem;
  margin-top: -.45rem;
  border-right: 2px solid var(--tan);
  border-bottom: 2px solid var(--tan);
  transform: rotate(45deg);
  transition: transform .15s ease;
}

.faq__item[open] summary::after {
  transform: rotate(-135deg);
  margin-top: -.15rem;
}

.faq__item summary:hover { color: var(--plum); }

.faq__answer { padding: 0 0 1.25rem; }
.faq__answer > :last-child { margin-bottom: 0; }

/* --- Gallery ------------------------------------------------ */

.gallery {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

.about-gallery .gallery {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 52rem) {
  .about-gallery .gallery {
    grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  }
}

.gallery__thumb {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: zoom-in;
}

.gallery__thumb:hover img,
.gallery__thumb:focus-visible img { opacity: .82; }

.gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  transition: opacity .15s ease;
}

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

.contact-cards {
  display: grid;
  gap: 1.25rem;
  /* One per row. Side by side inside the text measure, the email address and
     the Facebook URL are forced to break mid-word, which looks broken. */
  grid-template-columns: 1fr;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
  max-width: var(--measure);
}

.contact-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.35rem 1.5rem;
}

.contact-card h2 {
  font-size: 1.2rem;
  margin-bottom: .35em;
}

.contact-card p { margin-bottom: .5em; }
.contact-card > :last-child { margin-bottom: 0; }

.contact-card__value {
  font-family: var(--serif);
  font-size: 1.05rem;
  word-break: break-word;
}

/* --- External links ----------------------------------------- */

/* Anything that takes the visitor off the site says so.
   The arrow is drawn as a masked SVG rather than the U+2197 glyph: neither
   Bree Serif nor Signika contains that character, so it fell back to a system
   font whose hairline stroke looked nothing like the type beside it. Masking
   lets it inherit currentColor and keep one weight everywhere.

   Wrapped in @supports because without mask support the same rule would paint
   a solid currentColor square. No icon is better than a block. */
@supports (mask-image: none) or (-webkit-mask-image: none) {
  .external::after {
    content: "";
    display: inline-block;
    width: .68em;
    height: .68em;
    margin-left: .22em;
    vertical-align: -.02em;
    background-color: currentColor;
    -webkit-mask: var(--icon-external) center / contain no-repeat;
    mask: var(--icon-external) center / contain no-repeat;
  }

  /* Bree Serif is heavier than the body face, so the arrow needs a little
     more presence to sit with it. */
  .button.external::after,
  .contact-card__value .external::after {
    width: .74em;
    height: .74em;
  }

  /* The button has no underline to sit against and more room to breathe. */
  .button.external::after { margin-left: .36em; }
}

/* --- About page --------------------------------------------- */

.about-layout {
  display: grid;
  gap: clamp(1.75rem, 1.2rem + 2.5vw, 3rem);
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  align-items: start;
}

@media (max-width: 52rem) {
  .about-layout { grid-template-columns: 1fr; }
}

.about-gallery {
  position: sticky;
  top: 1.5rem;
  scroll-margin-top: 1.5rem;
}

@media (max-width: 52rem) {
  .about-gallery { position: static; }
}

.about-gallery__heading {
  font-size: 1.25rem;
  border-bottom: 2px solid var(--tan);
  padding-bottom: .35rem;
}


/* --- Lightbox ------------------------------------------------
   Opening and closing run on the CSS :target selector, so it works with
   JavaScript turned off. assets/js/lightbox.js adds the Escape key on top,
   which CSS cannot do. ------------------------------------------- */

.lightbox {
  display: none;
}

.lightbox:target {
  display: grid;
  place-items: center;
  position: fixed;
  inset: 0;
  z-index: 50;
  padding: clamp(1rem, .6rem + 2vw, 2.5rem);
  background: rgba(26, 18, 4, .93);
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  cursor: zoom-out;
}

.lightbox__figure {
  position: relative;
  margin: 0;
  /* Shrink to the photo rather than filling the overlay, so that every pixel
     that is not the photo or its caption belongs to the backdrop and closes
     on click. */
  width: fit-content;
  max-width: min(60rem, 100%);
}

.lightbox__figure img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 78vh;
  border-radius: var(--radius);
}

.lightbox__figure figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem 1.5rem;
  margin-top: .85rem;
  color: #f2ece0;
  font-size: .94rem;
}

.lightbox__close {
  color: #fff;
  font-family: var(--serif);
  text-decoration-color: var(--tan);
  flex: none;
}

.lightbox__close:hover,
.lightbox__close:focus-visible { color: var(--tan); }

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

.site-footer {
  background: var(--green-deep);
  color: #e6e9dd;
  margin-top: clamp(2.5rem, 1.8rem + 3vw, 4.5rem);
  padding-block: clamp(2.25rem, 1.6rem + 2.5vw, 3.25rem);
  font-size: .96rem;
}

.site-footer__inner {
  display: grid;
  gap: 2rem clamp(1.5rem, 1rem + 2vw, 3rem);
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 2fr);
  align-items: start;
}

@media (max-width: 52rem) {
  .site-footer__inner { grid-template-columns: 1fr; }
}

.site-footer h2 {
  color: #fff;
  font-size: 1.1rem;
  margin-bottom: .5em;
}

.site-footer h2 a { color: inherit; text-decoration-color: var(--tan); }

.site-footer a { color: #e6e9dd; }

.site-footer a:hover,
.site-footer a:focus-visible { color: #fff; text-decoration-color: #fff; }

.site-footer__about p { max-width: var(--measure); }

.site-footer__nav {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
}

.site-footer__nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer__nav li { margin-bottom: .35rem; }

.site-footer__meta {
  grid-column: 1 / -1;
  border-top: 1px solid rgba(255, 255, 255, .18);
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-footer__mngrown {
  width: 104px;
  height: auto;
  /* The artwork is white on transparency, so it needs the dark footer behind
     it -- do not put it on a light background. */
  opacity: .92;
}

.site-footer__copyright { margin: 0; opacity: .85; }

/* --- Utilities ---------------------------------------------- */

.page-note { margin-top: clamp(2rem, 1.6rem + 1.6vw, 2.75rem); }

.section-heading {
  margin-top: clamp(2.25rem, 1.7rem + 2.2vw, 3.25rem);
  border-bottom: 2px solid var(--tan);
  padding-bottom: .4rem;
}

.center-measure {
  max-width: var(--measure);
  margin-inline: auto;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

@media print {
  .site-nav,
  .skip-link { display: none; }
  body { background: #fff; }
}
