/* ==========================================================================
   FAQ Block Styles — Rotech Rural
   ========================================================================== */

/* --------------------------------------------------------------------------
   Design tokens (scoped, theme-overridable)
   -------------------------------------------------------------------------- */
.rotech-faq-block {
    --faq-red: #EC2227;
    --faq-green: #7DB160;
    --faq-dark: #1B1B1B;
    --faq-text: #212529;
    --faq-grey-light: #EFEFEF;
    --faq-grey-mid: #DDDDDD;
    --faq-item-bg: var(--faq-grey-light);
    --faq-link-color: var(--faq-red);
    --faq-tag-bg: var(--faq-dark);
    --faq-heading-font: kon-tiki-aloha-jf, sans-serif;
}

/* --------------------------------------------------------------------------
   Block wrapper
   -------------------------------------------------------------------------- */
.rotech-faq-block {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 0 48px;
}

/* Inside Stackable columns (or any Stackable container), let the
   parent control width — the column already constrains it.
   width: 100% counters the flex collapse from .stk-block-content. */
.stk-inner-blocks .rotech-faq-block {
    max-width: none;
    width: 100%;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.rotech-faq-block__preheading {
    font-family: 'montserrat', sans-serif;
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--faq-link-color);
    margin: 0 0 4px;
    line-height: 1.3;
}

.rotech-faq-block__heading {
    font-family: var(--faq-heading-font);
    font-weight: 400;
    text-transform: uppercase;
    font-size: 1.8rem;
    color: var(--faq-dark);
    letter-spacing: 0.02em;
    line-height: 1.1;
    margin: 0 0 8px;
}

.rotech-faq-block__subheading {
    font-size: 0.95rem;
    color: #666;
    margin: 0 0 24px;
    line-height: 1.5;
}

.rotech-faq-block__subheading a {
    color: var(--faq-link-color);
    font-weight: 600;
    text-decoration: none;
}

.rotech-faq-block__subheading a:hover {
    text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Filter tabs ('all' mode)
   -------------------------------------------------------------------------- */
.rotech-faq-block__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--faq-grey-mid);
    max-width: 1200px;
}

.rotech-faq-block__filter-tab {
    font-family: 'montserrat', sans-serif;
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 8px 18px;
    border: 1px solid var(--faq-grey-mid);
    border-radius: 2px;
    background: white;
    color: var(--faq-text);
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.2;
}

.rotech-faq-block__filter-tab:hover {
    border-color: var(--faq-red);
    color: var(--faq-red);
}

.rotech-faq-block__filter-tab.is-active {
    background: var(--faq-red);
    border-color: var(--faq-red);
    color: white;
}

/* --------------------------------------------------------------------------
   Category groups ('all' mode)
   -------------------------------------------------------------------------- */
.rotech-faq-block__category-group {
    margin-bottom: 32px;
}

.rotech-faq-block__category-group[hidden] {
    display: none;
}

.rotech-faq-block__category-heading {
    font-family: 'montserrat', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--faq-dark);
    margin-bottom: 12px;
    padding-bottom: 4px;
}

/* --------------------------------------------------------------------------
   FAQ item
   -------------------------------------------------------------------------- */
.rotech-faq-block__item {
    background: var(--faq-item-bg);
    border-radius: 2px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.rotech-faq-block__item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* --------------------------------------------------------------------------
   Question button
   -------------------------------------------------------------------------- */
.rotech-faq-block__question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 18px 24px;
    border: none;
    background: none;
    font: inherit;
    cursor: pointer;
    text-align: left;
    -webkit-appearance: none;
    appearance: none;
}

.rotech-faq-block__question h3,
.rotech-faq-block__question h4 {
    font-family: var(--faq-heading-font);
    font-weight: 400;
    font-size: 1.15rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--faq-dark);
    flex: 1;
    line-height: 1.2;
    margin: 0;
}

/* --------------------------------------------------------------------------
   Chevron
   -------------------------------------------------------------------------- */
.rotech-faq-block__chevron {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    margin-left: 16px;
    color: #999;
    transition: transform 0.3s ease;
}

.rotech-faq-block__item.is-open .rotech-faq-block__chevron {
    transform: rotate(180deg);
}

/* --------------------------------------------------------------------------
   Answer panel
   -------------------------------------------------------------------------- */
.rotech-faq-block__answer[hidden] {
    display: none;
}

.rotech-faq-block__answer {
    padding: 0 24px 20px;
}

.rotech-faq-block__answer-inner {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #444;
    border-top: 1px solid var(--faq-grey-mid);
    padding-top: 16px;
}

.rotech-faq-block__answer-inner p {
    margin: 0 0 12px;
}

.rotech-faq-block__answer-inner p:last-child {
    margin-bottom: 0;
}

.rotech-faq-block__answer-inner a {
    color: var(--faq-link-color);
    font-weight: 600;
    text-decoration: none;
}

.rotech-faq-block__answer-inner a:hover {
    text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Category tag
   -------------------------------------------------------------------------- */
.rotech-faq-block__tag {
    display: inline-block;
    font-family: 'montserrat', sans-serif;
    font-weight: 700;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 3px 10px;
    border-radius: 2px;
    background: var(--faq-tag-bg);
    color: #fff;
    margin-top: 10px;
    margin-right: 6px;
}

/* --------------------------------------------------------------------------
   Product page variant — white item backgrounds
   When the block sits inside a grey-background section on product pages,
   items flip to white so they stand out against the section bg.
   -------------------------------------------------------------------------- */
.rotech-faq-block[data-mode="product"] {
    --faq-item-bg: #fff;
}

/* ==========================================================================
   Product-category accent colours
   Match body classes from category-colors.scss — override the FAQ link colour
   and tag background on product pages so the block picks up the category palette.
   ========================================================================== */

/* End Assemblies — red (#EC2227) */
body.staytight-end-assemblies .rotech-faq-block,
body.rr-product-category-staytight-end-assemblies .rotech-faq-block,
body.rr-product-category-complete-end-assemblies .rotech-faq-block,
body.rr-product-category-steel-fence-posts .rotech-faq-block {
    --faq-link-color: #EC2227;
    --faq-tag-bg: #EC2227;
}

/* Gate Hinges — green (#7DB160) */
body.hinge-sets .rotech-faq-block,
body.rr-product-category-hinge-sets .rotech-faq-block {
    --faq-link-color: #7DB160;
    --faq-tag-bg: #7DB160;
}

/* Gate Latches — yellow (#F0CA53) */
body.gate-latches .rotech-faq-block,
body.rr-product-category-gate-latches .rotech-faq-block {
    --faq-link-color: #F0CA53;
    --faq-tag-bg: #F0CA53;
}

/* RailTight — blue (#4C99D1) */
body.railtight .rotech-faq-block,
body.rr-product-category-railtight .rotech-faq-block {
    --faq-link-color: #4C99D1;
    --faq-tag-bg: #4C99D1;
}

/* Fittings & Accessories — grey (#6E6E6E) */
body.fence-fittings-accessories .rotech-faq-block,
body.rr-product-category-fence-fittings-accessories .rotech-faq-block {
    --faq-link-color: #6E6E6E;
    --faq-tag-bg: #6E6E6E;
}

/* Stockyard Fittings — orange (#E38137) */
body.stockyard-fittings .rotech-faq-block,
body.rr-product-category-stockyard-fittings .rotech-faq-block {
    --faq-link-color: #E38137;
    --faq-tag-bg: #E38137;
}

/* Tools — new blue (#0047BB) */
body.tools .rotech-faq-block,
body.rr-product-category-tools .rotech-faq-block {
    --faq-link-color: #0047BB;
    --faq-tag-bg: #0047BB;
}

/* Post Caps — purple (#744F94) */
body.post-caps .rotech-faq-block,
body.rr-product-category-post-caps .rotech-faq-block {
    --faq-link-color: #744F94;
    --faq-tag-bg: #744F94;
}

/* Chain Accessories — black (#1B1B1B) */
body.chain-accessories .rotech-faq-block,
body.rr-product-category-chain-accessories .rotech-faq-block {
    --faq-link-color: #1B1B1B;
    --faq-tag-bg: #1B1B1B;
}

/* Twist Tight — black (#1B1B1B) */
body.twist-tight .rotech-faq-block,
body.rr-product-category-twist-tight .rotech-faq-block {
    --faq-link-color: #1B1B1B;
    --faq-tag-bg: #1B1B1B;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 600px) {
    .rotech-faq-block__question {
        padding: 14px 16px;
    }

    .rotech-faq-block__answer {
        padding: 0 16px 16px;
    }

    .rotech-faq-block__heading {
        font-size: 1.5rem;
    }

    .rotech-faq-block__filters {
        gap: 6px;
    }

    .rotech-faq-block__filter-tab {
        font-size: 0.72rem;
        padding: 6px 12px;
    }
}
