/* =========================================================
   FIBER FOUNDRY HOMEPAGE V2
   ========================================================= */

/* ---------- Page foundation ---------- */

.ff-home-v2 {
  --ff-dark: #141414;
  --ff-subtle: #171717;
  --ff-red: #cf2e2e;
  --ff-white: #ffffff;
  --ff-muted: rgba(255, 255, 255, 0.76);
  --ff-line: #cf2e2e;
  --ff-content-width: 1180px;

  background: var(--ff-dark);
  color: var(--ff-white);
  overflow-x: clip;
}

.ff-home-v2,
.ff-home-v2 * {
  box-sizing: border-box;
}

/* ---------- Content widths ---------- */

.ff-home-v2 .alignwide,
.ff-home-v2 .ff-product-grid {
  width: min(var(--ff-content-width), calc(100% - 3rem));
  max-width: var(--ff-content-width);
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Section spacing ---------- */

.ff-home-v2 .ff-hero,
.ff-home-v2 .ff-section {
  padding: clamp(3.5rem, 6vw, 5.75rem) 0;
  margin: 0;
}

/* ---------- Section backgrounds ---------- */

.ff-home-v2 .ff-hero,
.ff-home-v2 .ff-products-section,
.ff-home-v2 .ff-markets-section {
  background: var(--ff-dark);
  color: var(--ff-white);
}

.ff-home-v2 .ff-prep-section,
.ff-home-v2 .ff-story-section,
.ff-home-v2 .ff-benefit-strip {
  background: var(--ff-subtle);
  color: var(--ff-white);
}

/* ---------- General text colors ---------- */

.ff-home-v2 h1,
.ff-home-v2 h2,
.ff-home-v2 h3,
.ff-home-v2 p,
.ff-home-v2 a {
  color: inherit;
}

/* ---------- Section headings ---------- */

.ff-home-v2 h2 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.05;
  margin-bottom: 1rem;
}

.ff-home-v2 .ff-eyebrow {
  color: var(--ff-red);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  margin-bottom: 0.8rem;
}

.ff-home-v2 .ff-products-section > .ff-eyebrow,
.ff-home-v2 .ff-products-section > h2,
.ff-home-v2 .ff-products-section > .ff-section-intro,
.ff-home-v2 .ff-prep-section > .ff-eyebrow,
.ff-home-v2 .ff-prep-section > h2 {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Introductory text ---------- */

.ff-home-v2 .ff-lead,
.ff-home-v2 .ff-section-intro {
  color: var(--ff-muted);
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  line-height: 1.65;
  max-width: 62ch;
}

/* ---------- Column text alignment ---------- */

.ff-home-v2 .wp-block-column,
.ff-home-v2 .wp-block-column p,
.ff-home-v2 .wp-block-column h2,
.ff-home-v2 .wp-block-column h3 {
  text-align: left;
}

/* =========================================================
   HERO
   ========================================================= */

.ff-home-v2 .ff-hero-title {
  font-size: clamp(2.75rem, 4vw, 4.5rem);
  line-height: 1;
  letter-spacing: -0.045em;
  max-width: none;
  margin-top: 0;
  margin-bottom: 1.5rem;
}

.ff-home-v2 .ff-hero-title-white {
  color: var(--ff-white);
  white-space: nowrap;
}

.ff-home-v2 .ff-hero-title-red {
  color: var(--ff-red);
  white-space: nowrap;
}

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

.ff-home-v2 .ff-hero .wp-block-image {
  width: 100%;
  max-width: 100%;
  margin: 0;
}

.ff-home-v2 .ff-hero .wp-block-image img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

/* =========================================================
   BORDERED COLUMNS — DESKTOP
   ========================================================= */

.ff-home-v2 .ff-bordered-columns {
  gap: 0;
  border-top: 1px solid var(--ff-line);
  border-bottom: 1px solid var(--ff-line);
  margin-top: 2.5rem;
  margin-bottom: 0;
}

.ff-home-v2 .ff-bordered-columns > .wp-block-column {
  min-width: 0;
  padding: 1.6rem 1.75rem;
  margin: 0;
  border: 0;
}

/* Vertical dividers between desktop columns */

.ff-home-v2
  .ff-bordered-columns
  > .wp-block-column
  + .wp-block-column {
  border-left: 1px solid var(--ff-line);
}

/* =========================================================
   BENEFIT STRIP
   ========================================================= */

.ff-home-v2 .ff-benefit-strip {
  padding: 0;
  margin: 0;
}

.ff-home-v2 .ff-benefit-columns {
  margin-top: 0;
}

.ff-home-v2 .ff-benefit-columns > .wp-block-column {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 5rem;
}

.ff-home-v2 .ff-benefit-columns p {
  color: var(--ff-white);
  text-align: center;
  margin: 0;
}

/* =========================================================
   PREPARATION STEPS
   ========================================================= */

.ff-home-v2 .ff-prep-steps h3 {
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
}

.ff-home-v2 .ff-prep-steps p:not(.ff-step-number) {
  color: var(--ff-muted);
  margin-bottom: 0;
}

.ff-home-v2 .ff-step-number {
  color: var(--ff-red);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

/* =========================================================
   PRODUCT GRID — DESKTOP
   ========================================================= */

.ff-home-v2 .ff-product-grid {
  gap: 0;
}

.ff-home-v2 .products {
  margin-top: 2.75rem;
}

.ff-home-v2 .products li.product {
  color: var(--ff-white);
  text-align: left;
}

.ff-home-v2 .products li.product img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  margin-bottom: 1.25rem;
}

.ff-home-v2 .products li.product .woocommerce-loop-product__title,
.ff-home-v2 .products li.product .price {
  color: var(--ff-white);
  text-align: left;
}

.ff-home-v2 .products li.product .price {
  margin-bottom: 1rem;
}

/* =========================================================
   PLACEHOLDERS AND IMAGE AREAS
   ========================================================= */

.ff-home-v2 .ff-image-placeholder,
.ff-home-v2 .ff-calendar-placeholder {
  display: grid;
  place-items: center;
  min-height: 18rem;
  padding: 2rem;
  background: var(--ff-subtle);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  color: var(--ff-muted);
}

.ff-home-v2 .ff-calendar-placeholder {
  min-height: 15rem;
}

.ff-home-v2 .ff-story-image {
  min-height: 18rem;
}

/* =========================================================
   TABLET — 781PX AND BELOW
   ========================================================= */

@media (max-width: 781px) {

  /* ---------- Content width ---------- */

  .ff-home-v2 .alignwide,
  .ff-home-v2 .ff-product-grid {
    width: min(var(--ff-content-width), calc(100% - 2rem));
  }

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

  .ff-home-v2 .ff-hero-title {
    font-size: clamp(2.5rem, 11vw, 4rem);
  }

  .ff-home-v2 .ff-hero-title-white,
  .ff-home-v2 .ff-hero-title-red {
    white-space: normal;
  }

  /* ---------- General two-column sections ---------- */

  .ff-home-v2 .ff-benefit-columns,
  .ff-home-v2 .ff-prep-steps {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Remove desktop borders before creating tablet borders */

  .ff-home-v2
    .ff-bordered-columns
    > .wp-block-column,
  .ff-home-v2
    .ff-bordered-columns
    > .wp-block-column
    + .wp-block-column {
    border-top: 0;
    border-left: 0;
  }

  /* Vertical divider on the second item in each tablet row */

  .ff-home-v2
    .ff-bordered-columns
    > .wp-block-column:nth-child(even) {
    border-left: 1px solid var(--ff-line);
  }

  /* Horizontal divider above the second tablet row */

  .ff-home-v2
    .ff-bordered-columns
    > .wp-block-column:nth-child(n + 3) {
    border-top: 1px solid var(--ff-line);
  }

  /* ---------- Product grid: three directly to one ---------- */

  .ff-home-v2 .ff-product-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .ff-home-v2 .ff-product-grid > .wp-block-column {
    width: 100%;
    max-width: 100%;
    flex-basis: auto;
    border-top: 0;
    border-left: 0;
  }

  /*
   * Product cards use one column on tablet, so they receive
   * horizontal dividers instead of the general two-column borders.
   */

  .ff-home-v2
    .ff-product-grid.ff-bordered-columns
    > .wp-block-column:nth-child(even),
  .ff-home-v2
    .ff-product-grid.ff-bordered-columns
    > .wp-block-column:nth-child(n + 3),
  .ff-home-v2
    .ff-product-grid.ff-bordered-columns
    > .wp-block-column
    + .wp-block-column {
    border-left: 0;
    border-top: 0;
  }

  .ff-home-v2
    .ff-product-grid.ff-bordered-columns
    > .wp-block-column
    + .wp-block-column {
    border-top: 1px solid var(--ff-line);
  }

  /* WooCommerce Product Collection block fallback */

  .ff-home-v2 .wc-block-product-template {
    grid-template-columns: minmax(0, 1fr);
    --wc-store-products--columns: 1;
  }
}

/* =========================================================
   PHONE — 480PX AND BELOW
   ========================================================= */

@media (max-width: 480px) {

  /* ---------- Content width ---------- */

  .ff-home-v2 .alignwide,
  .ff-home-v2 .ff-product-grid {
    width: calc(100% - 2rem);
  }

  /* ---------- All bordered sections become one column ---------- */

  .ff-home-v2 .ff-benefit-columns,
  .ff-home-v2 .ff-prep-steps {
    grid-template-columns: minmax(0, 1fr);
  }

  /*
   * Reset every desktop and tablet border before rebuilding
   * the single-column dividers.
   */

  .ff-home-v2
    .ff-bordered-columns
    > .wp-block-column,
  .ff-home-v2
    .ff-bordered-columns
    > .wp-block-column:nth-child(even),
  .ff-home-v2
    .ff-bordered-columns
    > .wp-block-column:nth-child(n + 3),
  .ff-home-v2
    .ff-bordered-columns
    > .wp-block-column
    + .wp-block-column {
    border-top: 0;
    border-left: 0;
  }

  /* Horizontal divider between every stacked column */

  .ff-home-v2
    .ff-bordered-columns
    > .wp-block-column
    + .wp-block-column {
    border-top: 1px solid var(--ff-line);
  }

  /* ---------- Full-width buttons ---------- */

  .ff-home-v2 .wp-block-buttons,
  .ff-home-v2 .wp-block-button {
    width: 100%;
  }

  .ff-home-v2 .wp-block-button__link {
    width: 100%;
    text-align: center;
  }
}