/* ============================================================
   Product Category Blocks
   ACF term fields rendered after the product loop on product
   category archives (class-category-blocks.php).

   Stats + Image & Content reuse their own block stylesheets
   (blocks/stats/stats.css, blocks/image-content/image-content.css).
   The rules below cover the category-specific overrides and the
   three sections that have no block equivalent.
   ============================================================ */

/* Shared inner width for the category-only sections */
.category-videos .container,
.category-areas .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---- Image & Content: blue band on category pages (design) ---- */
.image-content-block.image-content-block--category {
    background-color: var(--nikwax-blue, #1b4298);
}

/* Orange play arrow on the CTA, matching the design */
.image-content-block--category .image-content-block__cta {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.image-content-block--category .image-content-block__cta::after {
    content: "";
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 9px solid var(--golden-yellow, #fcbf00);
}

/* ============================================================
   How-To Videos — green band, 3-up video grid
   ============================================================ */
.category-videos {
    background-color: var(--nikwax-green, #007e40);
    padding: clamp(30px, 5vw, 70px) 0;
}

.category-videos__heading {
    text-align: center;
    color: #fff;
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 800;
    margin: 0 0 clamp(30px, 5vw, 50px);
}

.category-videos__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.category-videos__embed {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    overflow: hidden;
}

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

.category-videos__content {
    margin-top: 18px;
    text-align: center;
}

.category-videos__content,
.category-videos__content * {
    color: #fff;
}

.category-videos__content > :first-child {
    margin-top: 0;
}

.category-videos__content h2,
.category-videos__content h3,
.category-videos__content h4 {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 8px;
    line-height: 1.2;
}

.category-videos__content p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

@media screen and (max-width: 992px) {
    .category-videos__grid { grid-template-columns: 1fr 1fr; }
}

@media screen and (max-width: 600px) {
    .category-videos__grid { grid-template-columns: 1fr; }
}

.category-videos__grid.slick-initialized {
    display: block;
    position: relative;
    padding: 0 45px;
}

.category-videos__grid .slick-track {
    display: flex;
}

.category-videos__grid .slick-slide {
    height: auto;
}

.category-videos__grid .category-videos__item {
    height: 100%;
}

.category-videos__slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    background: none;
    border: none;
    margin: 0;
    cursor: pointer;
    line-height: 0;
    padding: 0;
}

.category-videos__slider-arrow--prev {
    left: 0;
}

.category-videos__slider-arrow--next {
    right: 0;
}

.category-videos__slider-arrow--prev .category-videos__slider-arrow-icon {
    transform: rotate(180deg);
}

.category-videos__slider-arrow-icon {
    display: block;
    width: 22px;
    height: auto;
}

.category-videos__slider-arrow.slick-disabled {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
}

/* ============================================================
   Product Areas — blue band, heading + chevrons + intro copy
   ============================================================ */
.category-areas {
    background-color: var(--nikwax-blue, #1b4298);
    padding: clamp(30px, 5vw, 70px) 0;
}

.category-areas__content,
.category-areas__content * {
    color: #fff;
}

.category-areas__content h1,
.category-areas__content h2 {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 800;
    margin: 0 0 20px;
    text-align: center;
}

/* Orange chevrons after the heading, matching the design */
.category-areas__content h1::after,
.category-areas__content h2::after {
    content: " \25B6\FE0E\25B6\FE0E\25B6\FE0E";
    color: var(--golden-yellow, #fcbf00);
    font-size: 0.7em;
    letter-spacing: 4px;
    vertical-align: middle;
}

.category-areas__content p {
    text-align: center;
    max-width: 780px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ============================================================
   Product Category Cards — coloured cards row
   ============================================================ */
.category-cards__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}

.category-cards__card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 440px;
    padding: 32px 30px;
    background-color: var(--nikwax-green, #007e40);
    background-size: cover;
    background-position: center;
    color: #fff;
    overflow: hidden;
}

/* Fallback brand colours until a bg_image is uploaded (image overrides these) */
.category-cards__card:nth-child(1) { background-color: #007e40; }
.category-cards__card:nth-child(2) { background-color: #512f7d; }
.category-cards__card:nth-child(3) { background-color: #0078ba; }
.category-cards__card:nth-child(4) { background-color: #1b4298; justify-content: space-between; }

.category-cards__title {
    margin: 0;
    font-size: clamp(1.4rem, 2vw, 1.9rem);
    font-weight: 800;
    color: #fff;
    z-index: 1;
    text-align: center;
}

.category-cards__product {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 0;
    z-index: 1;
}

.category-cards__card:last-of-type .category-cards__product{
    position: absolute;
    left: 0;
    bottom: -15px;
}

.category-cards__product img {
    max-height: 500px;
    width: auto;
    object-fit: contain;
}

.category-cards__btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    align-self: flex-start;
    border: 1px solid rgba(255, 255, 255, 0.9);
    color: #fff;
    text-decoration: none;
    padding: 12px 20px;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    transition: background-color 0.2s ease, color 0.2s ease;
    z-index: 1;
    margin: 0 auto;
}

.category-cards__btn:hover {
    background-color: #fff !important;
    color: var(--nikwax-blue, #1b4298);
}

.category-cards__card:last-of-type .category-cards__btn{
    background-color: var(--nikwax-blue);
}

.category-cards__btn-arrow {
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 8px solid var(--golden-yellow, #fcbf00);
}

@media screen and (max-width: 992px) {
    .category-cards__grid { grid-template-columns: 1fr 1fr; }
}

@media screen and (max-width: 560px) {
    .category-cards__grid { grid-template-columns: 1fr; }
    .category-cards__card { min-height: 360px; }
}