/* ==========================================================
   Windset Farms – New Homepage
   Loaded on the front page only (see functions.php)
   ========================================================== */

/* ----------------------------------------------------------
   1. Hero – looping self-hosted background video
   ---------------------------------------------------------- */
.ws-home-hero {
  position: relative;
  width: 100%;
  height: 700px;
  overflow: hidden;
  background-color: #2d3a1c;
  background-size: cover;       /* poster (hero_video_fallback) shows before / instead of the video */
  background-position: center;
}

.ws-home-hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;        /* fill the full width, crop to the section height */
  object-position: center;
}

/* ----------------------------------------------------------
   2. Intro – heading, copy, video, button
   ---------------------------------------------------------- */
.ws-home-intro {
  background: #fff;
  padding: 80px 0 90px;
  text-align: center;
}

.ws-home-intro__inner {
  width: 100%;
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 20px;
}

.ws-home-intro__title {
  text-wrap: balance;        /* even line lengths when the ACF title has no <br> */
  font-family: 'Recoleta', serif;
  font-weight: 600;         /* Recoleta SemiBold (registered in main.css) */
  font-size: 118px;
  line-height: 1.08;
  letter-spacing: -0.5px;
  color: #5b5b5d;
  margin: 0 0 40px;
}

.ws-home-intro__title sup {
  font-family: 'sofia-pro', sans-serif;
  font-size: 0.3em;
  top: -1.6em;
}

.ws-home-intro__copy {
  font-family: 'TiemposText', Georgia, serif;
  font-size: 20px;
  line-height: 1.9;
  color: #666;
  max-width: 760px;
  margin: 0 auto 60px;
}

/* Video thumbnail – opens the lightbox */
.ws-home-intro__video {
  position: relative;
  display: block;
  width: 100%;
  max-width: 730px;
  margin: 0 auto 45px;
  padding: 0;
  border: 0;
  background: #000;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  cursor: pointer;
}

.ws-home-intro__video img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease, opacity 0.3s ease;
}

.ws-home-intro__video:hover img,
.ws-home-intro__video:focus-visible img {
  transform: scale(1.03);
  opacity: 0.9;
}

.ws-home-intro__video:focus-visible {
  outline: 3px solid #d61920;
  outline-offset: 4px;
}

/* Play button overlay (translucent circle, as in the mockup) */
.ws-video-trigger__play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 90px;
  height: 90px;
  margin: -45px 0 0 -45px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease, background 0.2s ease;
}

.ws-video-trigger__play::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  margin: -18px 0 0 -11px;
  border-style: solid;
  border-width: 18px 0 18px 30px;
  border-color: transparent transparent transparent #4a4a4a;
}

.ws-home-intro__video:hover .ws-video-trigger__play,
.ws-home-intro__video:focus-visible .ws-video-trigger__play {
  transform: scale(1.08);
  background: rgba(255, 255, 255, 0.85);
}

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ----------------------------------------------------------
   Video lightbox (16:9 YouTube embed)
   ---------------------------------------------------------- */
.ws-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;               /* above the sticky header (999) and admin bar */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.ws-lightbox[hidden] {
  display: none;
}

.ws-lightbox.is-open {
  opacity: 1;
}

.ws-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  cursor: pointer;
}

.ws-lightbox__dialog {
  position: relative;
  width: min(1100px, 100%, calc((100vh - 120px) * 16 / 9));   /* fit width and height */
  transform: scale(0.96);
  transition: transform 0.2s ease;
}

.ws-lightbox.is-open .ws-lightbox__dialog {
  transform: scale(1);
}

.ws-lightbox__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.ws-lightbox__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.ws-lightbox__close {
  position: absolute;
  top: -46px;
  right: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  font-size: 30px;
  line-height: 40px;
  cursor: pointer;
}

.ws-lightbox__close:hover {
  color: #f44336;
}

/* Materialize gives focused buttons a background – keep the X clean */
.ws-lightbox__close:focus {
  background: none;
  outline: none;
}

.ws-lightbox__close:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: 2px;
}

html.ws-lightbox-open,
html.ws-lightbox-open body {
  overflow: hidden;             /* no page scroll behind the lightbox */
}

/* Button uses the theme .btn styles as-is */
.ws-home-intro__cta {
  margin: 0;
}

/* ----------------------------------------------------------
   3. Sustainability – tomato background, founders photo, copy
   (sizes taken from the 1440px PSD)
   ---------------------------------------------------------- */
.ws-home-sustain {
  position: relative;
  background-color: #fff;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center top;
  padding: 90px 0 80px;
  overflow: hidden;
}

.ws-home-sustain__title {
  text-wrap: balance;
  max-width: 7.4em;          /* three lines like the PSD: "Innovation / Rooted in / Sustainability" */
  font-family: 'Recoleta', serif;
  font-weight: 700;
  font-size: 110px;
  line-height: 1;
  color: #fff;
  text-align: center;
  margin: 0 auto 82px;
  padding: 0 20px;
  box-sizing: content-box;   /* padding outside the 7.4em line length */
}

/* Photo bleeds off the left edge and lines up with the content column */
.ws-home-sustain__photo {
  position: relative;
  width: calc(50% + 66px);   /* = 786px at 1440 */
  max-width: 100%;
  margin: 0;
}

.ws-home-sustain__photo img {
  display: block;
  width: 100%;
  height: auto;
}

.ws-home-sustain__photo figcaption {
  position: absolute;
  right: 59px;
  bottom: 34px;
  font-family: 'Recoleta', serif;
  font-weight: 600;
  font-size: 26px;
  line-height: 1;
  color: #fff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
}

.ws-home-sustain__inner {
  width: 100%;
  max-width: 1090px;          /* 1050 content + 20px gutters */
  margin: 0 auto;
  padding: 0 20px;
}

.ws-home-sustain__content {
  max-width: 425px;
  padding-top: 72px;
}

.ws-home-sustain__subtitle {
  text-wrap: balance;
  font-family: 'Recoleta', serif;
  font-weight: 600;
  font-size: 56px;
  line-height: 60px;
  color: #e9242d;
  margin: 0 0 40px;
}

.ws-home-sustain__content p {
  font-family: 'TiemposText', Georgia, serif;
  font-size: 20px;
  line-height: 36px;
  letter-spacing: -0.02em;
  color: #231f20;
  margin: 0 0 36px;
}

.ws-home-sustain__content p sup {
  font-size: 0.6em;
  line-height: 0;
}

.ws-home-sustain__content .btn {
  margin-top: 14px;
}

/* ----------------------------------------------------------
   4. Greenhouse Grown – heading + existing product grid
   ---------------------------------------------------------- */
.ws-home-products {
  background: #fff;
  padding: 90px 0 20px;
}

.ws-home-products__header {
  max-width: 1090px;
  margin: 0 auto;
  padding: 0 20px;
  text-align: center;
}

.ws-home-products__title {
  text-wrap: balance;        /* even line lengths when the ACF title has no <br> */
  max-width: 7em;            /* two lines like the PSD: "Greenhouse / Grown" */
  font-family: 'Recoleta', serif;
  font-weight: 700;
  font-size: 110px;
  line-height: 1;
  color: #6d6e71;
  margin: 0 auto 50px;
}

.ws-home-products__copy {
  font-family: 'TiemposText', Georgia, serif;
  font-size: 20px;
  line-height: 36px;
  color: #6d6e71;
  max-width: 720px;
  margin: 0 auto;
}

.ws-home-products__copy sup {
  font-size: 0.6em;
  line-height: 0;
}

/* Legacy grid (cc_do_product_grid) – tighten to the PSD layout */
.ws-home-products .section-product-grid {
  max-width: 1050px;
  margin: 60px auto 90px;
}

/* ----------------------------------------------------------
   5. Fresh Flavor – food photo header + recipe cards
   Cards reuse the archive classes (.section-grid .grid-post) from
   main.css for the course ribbon colours; overrides below match the PSD.
   ---------------------------------------------------------- */
.ws-home-recipes {
  background: #fff;
  padding: 0 0 90px;
}

.ws-home-recipes__hero {
  width: 100%;
  aspect-ratio: 1440 / 1181;
  min-height: 640px;
  background-color: #fff;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center bottom;
}

.ws-home-recipes__header {
  max-width: 1090px;
  margin: 0 auto;
  padding: 100px 20px 0;
  text-align: center;
}

.ws-home-recipes__title {
  font-family: 'Recoleta', serif;
  font-weight: 700;
  font-size: 110px;
  line-height: 1;
  color: #6d6e71;
  margin: 0 0 50px;
}

.ws-home-recipes__copy {
  font-family: 'TiemposText', Georgia, serif;
  font-size: 20px;
  line-height: 36px;
  color: #6d6e71;
  max-width: 740px;
  margin: 0 auto 40px;
}

.ws-home-recipes__copy sup {
  font-size: 0.6em;
  line-height: 0;
}

/* Cards */
.ws-home-recipes__cards {
  max-width: 1119px;
  margin: 36px auto 0;
  padding: 0 20px;
}

.ws-home-recipes__cards .row {
  margin-left: -10px;
  margin-right: -10px;
}

.ws-home-recipes__cards .row .col {
  padding: 0 10px;
}

.ws-home-recipes .grid-post {
  max-width: none;
  height: 328px;
  margin: 0 0 20px;
  border: 1px solid #ddd;
  border-radius: 3px;
  overflow: hidden;
  background: #fff;
  transition: box-shadow 0.2s ease-in;
}

.ws-home-recipes .grid-post:hover {
  box-shadow: 0 0 15px 0 #dddddd;
}

.ws-home-recipes .post-thumb {
  height: 205px;
}

.ws-home-recipes .post-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
}

.ws-home-recipes .post-title {
  font-family: 'sofia-pro', sans-serif;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  color: #333;
  padding: 14px 14px 0;
  height: auto;
  -webkit-line-clamp: 3;
}

.ws-home-recipes .category-wrapper {
  top: 18px;
  max-width: 130px;
}

.ws-home-recipes .category-wrapper a {
  width: 130px;
}

.ws-home-recipes .category {
  min-width: 130px;
  padding: 3px 10px;
  font-size: 11px;
  line-height: 18px;
  letter-spacing: 0.02em;
}

.ws-home-recipes .category.recipe-series {
  padding: 0;
  min-width: 0;
  background: none;
  line-height: 0;
}

.ws-home-recipes .recipe-series img {
  display: block;
  width: 130px;
  max-width: 130px;
  height: auto;
}

/* ----------------------------------------------------------
   6. Get Social – heading, icons, EmbedSocial feed
   ---------------------------------------------------------- */
.ws-home-social {
  background: #fff;
  padding: 80px 0 70px;
}

.ws-home-social__header {
  max-width: 1090px;
  margin: 0 auto;
  padding: 0 20px;
  text-align: center;
}

.ws-home-social__title {
  font-family: 'Recoleta', serif;
  font-weight: 700;
  font-size: 110px;
  line-height: 1;
  color: #6d6e71;
  margin: 0 0 36px;
}

.ws-home-social__icons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 70px;
}

.ws-home-social__icons .social-link {
  display: block;
  width: 52px;
  height: 52px;
  transition: transform 0.2s ease;
}

.ws-home-social__icons .social-link:hover {
  transform: scale(1.08);
}

.ws-home-social__icons img {
  display: block;
  width: 100%;
  height: auto;
}

/* Full-width feed, as in the PSD */
.ws-home-social__feed {
  width: 100%;
}

/* ACF textarea copy arrives as <p> tags inside the copy wrappers */
.ws-home-intro__copy p,
.ws-home-products__copy p,
.ws-home-recipes__copy p {
  font: inherit;
  line-height: inherit;
  color: inherit;
  margin: 0 0 1em;
}

.ws-home-intro__copy p:last-child,
.ws-home-products__copy p:last-child,
.ws-home-recipes__copy p:last-child {
  margin-bottom: 0;
}

.ws-home-intro__copy sup,
.ws-home-products__copy sup,
.ws-home-recipes__copy sup {
  font-size: 0.6em;
  line-height: 0;
}

/* ----------------------------------------------------------
   4b. Homepage slider (Slick) – full-width image slides
   Arrows/dots reuse the theme's Slick styles in main.css,
   repositioned here.
   ---------------------------------------------------------- */
.ws-home-slider {
  position: relative;
  width: 100%;
  margin: 60px 0;
  background: #fff;
}

/* Every slide gets the PSD band ratio (1440 x 563) so mixed image sizes
   don't make the slider jump; images are cropped to fill (centre). */
.ws-home-slider__slide img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1440 / 563;
  object-fit: cover;
  object-position: center;
}

.ws-home-slider__slide a {
  display: block;
}

/* main.css pads every .slick-slide by 60px – full bleed here */
.ws-home-slider .slick-slide {
  padding: 0;
}

/* Before Slick initialises, show only the first slide (no stacked flash) */
.ws-home-slider .js-ws-slider:not(.slick-initialized) .ws-home-slider__slide + .ws-home-slider__slide {
  display: none;
}

.ws-home-slider .slick-arrow {
  top: 50%;
  margin-top: -24px;
  padding: 0;
  background: rgba(0, 0, 0, 0.15);
  transition: background 0.2s ease, opacity 0.2s ease;
  opacity: 0.85;
}

.ws-home-slider .slick-arrow:hover,
.ws-home-slider .slick-arrow:focus-visible {
  background: rgba(0, 0, 0, 0.4);
  opacity: 1;
}

.ws-home-slider .slick-arrow:focus {
  outline: none;
}

.ws-home-slider .slick-prev { left: 30px; }
.ws-home-slider .slick-next { right: 30px; }

.ws-home-slider .slick-dots {
  bottom: 20px;
  left: 0;
  right: 0;
  margin: 0;
  padding: 0;
  text-align: center;
}

.ws-home-slider .slick-dots li {
  margin: 0 6px !important;
  cursor: pointer;
}

/* ----------------------------------------------------------
   Responsive
   ---------------------------------------------------------- */
@media only screen and ( max-width: 992px ) {
  .ws-home-hero { height: 560px; }
  .ws-home-intro__title { font-size: 84px; }

  .ws-home-sustain { background-size: 100% auto; }
  .ws-home-sustain__title { font-size: 80px; margin-bottom: 60px; }
  .ws-home-sustain__photo { width: calc(100% - 40px); }
  .ws-home-sustain__content { max-width: 560px; padding-top: 50px; }

  .ws-home-products__title { font-size: 80px; margin-bottom: 36px; }

  .ws-home-recipes__header { padding-top: 70px; }
  .ws-home-recipes__title { font-size: 80px; margin-bottom: 36px; }

  .ws-home-social__title { font-size: 80px; }
}

@media only screen and ( max-width: 600px ) {
  .ws-home-hero { height: 420px; }
  .ws-home-intro { padding: 50px 0 60px; }
  .ws-home-intro__title { font-size: 52px; margin-bottom: 25px; }
  .ws-home-intro__copy { font-size: 17px; margin-bottom: 40px; }

  .ws-home-sustain { padding: 60px 0 60px; }
  .ws-home-sustain__title { font-size: 50px; margin-bottom: 40px; }
  .ws-home-sustain__photo { width: 100%; }
  .ws-home-sustain__photo figcaption { right: 20px; bottom: 16px; font-size: 20px; }
  .ws-home-sustain__subtitle { font-size: 40px; line-height: 44px; margin-bottom: 24px; }
  .ws-home-sustain__content p { font-size: 17px; line-height: 30px; margin-bottom: 26px; }

  .ws-home-products { padding-top: 60px; }
  .ws-home-products__title { font-size: 50px; margin-bottom: 24px; }
  .ws-home-products__copy { font-size: 17px; line-height: 30px; }
  .ws-home-products .section-product-grid { margin: 40px auto 60px; }

  .ws-home-slider { margin: 30px 0; }
  .ws-home-slider__slide img { aspect-ratio: 4 / 3; }  /* taller band on phones */
  .ws-home-slider .slick-dots { position: absolute; top: auto; bottom: 10px; margin: 0; }  /* main.css makes dots position:relative on mobile, which left a black bar under the slides */
  .ws-home-slider .slick-dots li { width: 10px; height: 10px; margin: 0 5px !important; }

  .ws-home-recipes { padding-bottom: 50px; }
  .ws-home-recipes__hero { aspect-ratio: auto; min-height: 560px; }
  .ws-home-recipes__header { padding-top: 50px; }
  .ws-home-recipes__title { font-size: 50px; margin-bottom: 24px; }
  .ws-home-recipes__copy { font-size: 17px; line-height: 30px; margin-bottom: 30px; }

  .ws-home-social { padding: 50px 0 40px; }
  .ws-home-social__title { font-size: 50px; margin-bottom: 24px; }
  .ws-home-social__icons { margin-bottom: 40px; }
  .ws-home-social__icons .social-link { width: 44px; height: 44px; }
}
