/*
 * Company reviews — flexiblocks layout `company_reviews`.
 * Markup: inc/company-reviews.php · Script: js/company-reviews.js
 * Colours use the flexiblocks tokens (flexiblocks.css), with fallbacks.
 * Fonts inherit from the theme.
 */

.company-reviews {
    --cr-bg: var(--fb-green, #495037);
    --cr-text: #f3f0e8;
    --cr-muted: #d6d2c5;
    --cr-line: #c9c6b8;
    --cr-star: var(--fb-gold, #c9b97a);

    background: var(--cr-bg);
    color: var(--cr-text);
    padding: 96px 24px;
}

.company-reviews__inner {
    max-width: 860px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    text-align: center;
}

/* The theme sets h1/h2 to olive with !important (and caps mobile portrait
   headings at 1.2em !important), which would make this heading invisible
   on the olive band — hence the !important overrides here. */
.company-reviews h2.company-reviews__heading {
    margin: 0;
    font-weight: 300;
    font-size: 30px !important;
    line-height: 1.25;
    color: var(--cr-text) !important;
}

/* Stars */
.company-reviews__stars {
    display: inline-flex;
    gap: 4px;
}

.company-reviews__star.is-filled { fill: var(--cr-star); }
.company-reviews__star.is-empty  { fill: none; stroke: var(--cr-star); stroke-width: 1.2; }

/* Stage: arrows + quote */
.company-reviews__stage {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 24px;
}

/* All slides share one grid cell, so the block keeps the height of the
   longest review and the page doesn't jump as the slides change. */
.company-reviews__slides {
    flex: 1;
    min-width: 0;
    display: grid;
}

.company-reviews__slide {
    grid-area: 1 / 1;
    margin: 0;
    min-height: 170px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
}

.company-reviews__slide[aria-hidden="true"] {
    opacity: 0;
    visibility: hidden;
}

.company-reviews__quote {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
}

.company-reviews__quote::before,
.company-reviews__quote::after {
    content: none; /* theme blockquote decoration off */
}

.company-reviews__quote p {
    margin: 0;
    font-size: 19px;
    line-height: 1.7;
    font-weight: 300;
    font-style: normal;
    color: var(--cr-text);
    overflow-wrap: break-word;
}

.company-reviews__cite {
    font-size: 11px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--cr-muted);
}

/* Arrows — just the chevrons, no box. Still a 44px tap target. */
.company-reviews__btn {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--cr-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, transform 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.company-reviews__btn:hover,
.company-reviews__btn:focus-visible {
    background: transparent;
    color: var(--cr-star);
}

.company-reviews__btn--prev:hover { transform: translateX(-3px); }
.company-reviews__btn--next:hover { transform: translateX(3px); }

/* Dots — 26px wide so 11+ fit on a 360px phone; wrap if there are more */
.company-reviews__dots {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 100%;
}

.company-reviews__dot {
    width: 26px;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.company-reviews__dot::before {
    content: "";
    display: block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    border: 1px solid var(--cr-line);
    box-sizing: border-box;
}

.company-reviews__dot[aria-current="true"]::before {
    background: var(--cr-text);
    border-color: var(--cr-text);
}

/* "Read more" — only shown on phones when a long review is cut short */
.company-reviews__more {
    align-self: center;
    min-height: 44px;
    padding: 0 8px;
    margin: -12px 0 -8px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--cr-text);
    font-family: inherit;
    font-size: 11px;
    line-height: 1;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    text-decoration: underline;
    text-underline-offset: 5px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.company-reviews__more[hidden] { display: none; }

/* Rating line */
.company-reviews__summary {
    margin: 0;
    font-size: 16px;
    color: #e2ded3;
}

.company-reviews__summary a {
    color: inherit;
    text-underline-offset: 5px;
}

/* Focus */
.company-reviews__btn:focus-visible,
.company-reviews__dot:focus-visible,
.company-reviews__more:focus-visible,
.company-reviews__summary a:focus-visible {
    outline: 2px solid var(--cr-text);
    outline-offset: 3px;
}

/* Gentle fade when a slide changes */
@media (prefers-reduced-motion: no-preference) {
    .company-reviews__slide { transition: opacity 0.4s ease, visibility 0.4s ease; }
}

/* Phones: arrows drop below the quote */
@media (max-width: 768px) {
    .company-reviews { padding: 72px 20px; }
    .company-reviews h2.company-reviews__heading { font-size: 26px !important; }
    .company-reviews__quote p { font-size: 17px; line-height: 1.65; }

    .company-reviews__stage {
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
    }

    .company-reviews__slides { flex-basis: 100%; order: -1; }
    .company-reviews__slide { min-height: 0; justify-content: flex-start; }

    /* Long testimonials are cut to 9 lines on phones so the block stays
       about a screen tall; "Read more" opens the full review. */
    .company-reviews__quote p {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 9;
        line-clamp: 9;
        overflow: hidden;
    }

    .company-reviews__slide.is-expanded .company-reviews__quote p {
        display: block;
        -webkit-line-clamp: unset;
        line-clamp: none;
        overflow: visible;
    }
}

/* 320–360px phones: narrower dots so 11 still fit on one line */
@media (max-width: 360px) {
    .company-reviews__dot { width: 24px; }
}
