/**
 * CFRO Component — Insertable Block Patterns
 * Callouts, Splits, Banners, Cards, Quotes, Stats, FAQ, Lists, Media
 * @package CFRO
 * @since   4.3.0
 */

/* ═══════════════════════════════════════════════
   1. CALLOUT BLOCKS
   ═══════════════════════════════════════════════ */

.cfro-callout {
    overflow: hidden;
}

/* Background tints */
.cfro-callout--info {
    background: var(--cfro-sky-light) !important;
}
.cfro-callout--warning {
    background: var(--cfro-amber-light) !important;
}
.cfro-callout--success {
    background: var(--cfro-sage-pale) !important;
}
.cfro-callout--featured {
    background: var(--cfro-coral-light) !important;
}

/* Icon column — prevent flex shrink */
.cfro-callout__icon-col {
    flex-grow: 0 !important;
    flex-shrink: 0 !important;
    max-width: 24px !important;
    padding-top: 0.125rem;
}

/* SVG icon colors */
.cfro-callout__icon {
    display: block;
    flex-shrink: 0;
}
.cfro-callout__icon--sky    { color: var(--cfro-sky); }
.cfro-callout__icon--amber  { color: var(--cfro-amber); }
.cfro-callout__icon--forest { color: var(--cfro-forest); }
.cfro-callout__icon--coral  { color: var(--cfro-coral); }

/* Content column */
.cfro-callout__content p {
    margin: 0;
}

/* Link styles */
.cfro-callout__link {
    font-size: 0.875rem !important;
}
.cfro-callout__link a {
    text-decoration: none;
    transition: color var(--cfro-transition);
}
.cfro-callout__link a:hover {
    text-decoration: underline;
}
.cfro-callout__link a {
    color: var(--cfro-sky);
}
.cfro-callout__link--coral a {
    color: var(--cfro-coral);
}
.cfro-callout__link--sage a {
    color: var(--cfro-sage);
}
.cfro-callout__link--sage a:hover {
    color: #fff;
}

/* Branded callout label */
.cfro-callout--branded .cfro-callout__label {
    margin: 0 !important;
}

/* ═══════════════════════════════════════════════
   2. 50/50 SPLIT BLOCKS
   ═══════════════════════════════════════════════ */

.cfro-split {
    overflow: hidden;
}

.cfro-split__columns {
    min-height: 0;
}

/* Image fills its column */
.cfro-split__media {
    padding: 0 !important;
}
.cfro-split__media .wp-block-image,
.cfro-split__media .cfro-split__img {
    margin: 0 !important;
    height: 100%;
}
.cfro-split__media .cfro-split__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Faded overlay for dark split */
.cfro-split__img--faded img {
    opacity: 0.8;
}

/* On mobile, stacked image has fixed aspect ratio */
@media (max-width: 781px) {
    .cfro-split__media .cfro-split__img img {
        aspect-ratio: 4/3;
        height: auto;
    }
    .cfro-split__columns--reverse {
        flex-direction: column-reverse !important;
    }
}

/* Text padding on desktop */
@media (min-width: 782px) {
    .cfro-split__text .wp-block-group {
        padding: 2.5rem !important;
    }
}

/* Outline-forest button */
.cfro-btn--outline-forest .wp-block-button__link,
.cfro-btn--outline-forest.wp-block-button__link {
    background: transparent;
    color: var(--cfro-forest);
    border: 1px solid rgba(27,122,90,0.2);
    border-radius: 0.375rem;
    padding: 0.625rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.cfro-btn--outline-forest .wp-block-button__link:hover,
.cfro-btn--outline-forest.wp-block-button__link:hover {
    background: var(--cfro-sage-pale);
    border-color: var(--cfro-forest);
}

/* ═══════════════════════════════════════════════
   3. BANNER / CTA STRIPS
   ═══════════════════════════════════════════════ */

.cfro-banner {
    overflow: hidden;
}

/* White button on coral background */
.cfro-btn--white .wp-block-button__link,
.cfro-btn--white.wp-block-button__link {
    border-radius: 0.375rem;
    padding: 0.625rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s ease;
    white-space: nowrap;
}
.cfro-btn--white .wp-block-button__link:hover {
    background: var(--cfro-cream) !important;
}

/* Responsive banner flex */
@media (max-width: 600px) {
    .cfro-banner--coral {
        text-align: center;
    }
    .cfro-banner--coral .wp-block-buttons {
        width: 100%;
        justify-content: center;
    }
}

/* Event banner cover image gradient */
.cfro-banner--event .wp-block-cover__background {
    background: linear-gradient(to right, rgba(26,58,47,0.95), rgba(26,58,47,0.80), rgba(26,58,47,0.40)) !important;
}

/* ═══════════════════════════════════════════════
   4. CARD GRIDS
   ═══════════════════════════════════════════════ */

/* Feature card header variants */
.cfro-feature-card {
    overflow: hidden;
}
.cfro-feature-card__header--coral {
    background: var(--cfro-coral-light) !important;
}

/* Category tags */
.cfro-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.1875rem 0.5rem;
    border-radius: 0.375rem;
    line-height: 1.4;
}
.cfro-tag--teal   { background: var(--cfro-teal-light);   color: var(--cfro-teal); }
.cfro-tag--violet { background: var(--cfro-violet-light); color: var(--cfro-violet); }
.cfro-tag--amber  { background: var(--cfro-amber-light);  color: var(--cfro-amber); }
.cfro-tag--coral  { background: var(--cfro-coral-light);  color: var(--cfro-coral); }
.cfro-tag--sky    { background: var(--cfro-sky-light);    color: var(--cfro-sky); }
.cfro-tag--rose   { background: var(--cfro-rose-light);   color: var(--cfro-rose); }

/* Responsive card grids */
@media (max-width: 781px) {
    .cfro-cards-three > .wp-block-column,
    .cfro-cards-two > .wp-block-column {
        flex-basis: 100% !important;
    }
}

/* Icon cards 2x2 on tablet, 4 on desktop */
@media (max-width: 1024px) {
    .cfro-icon-cards {
        flex-wrap: wrap !important;
    }
    .cfro-icon-cards > .wp-block-column {
        flex-basis: calc(50% - 0.75rem) !important;
    }
}
@media (max-width: 600px) {
    .cfro-icon-cards > .wp-block-column {
        flex-basis: 100% !important;
    }
}

/* Content card: flex column for consistent height */
.cfro-content-card {
    display: flex;
    flex-direction: column;
}

/* ═══════════════════════════════════════════════
   5. QUOTE / TESTIMONIAL BLOCKS
   ═══════════════════════════════════════════════ */

/* Pull quote — remove default WP quote styles */
.cfro-pull-quote .wp-block-quote {
    border: none !important;
    padding: 0 !important;
    margin: 0;
}
.cfro-pull-quote .wp-block-quote cite {
    font-size: 0.875rem;
    color: var(--cfro-charcoal-light);
    font-style: normal;
    display: block;
    margin-top: 0.75rem;
}

/* Testimonial card quote icon */
.cfro-testimonial-card__quote-icon {
    color: var(--cfro-sage);
    display: block;
    margin-bottom: 0.5rem;
}

/* Avatar circle */
.cfro-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    flex-shrink: 0;
}
.cfro-avatar--teal {
    background: var(--cfro-teal-light);
    color: var(--cfro-teal);
}
.cfro-avatar--coral {
    background: var(--cfro-coral-light);
    color: var(--cfro-coral);
}
.cfro-avatar--violet {
    background: var(--cfro-violet-light);
    color: var(--cfro-violet);
}
.cfro-avatar--forest {
    background: var(--cfro-sage-pale);
    color: var(--cfro-forest);
}

/* Dark testimonial quote icon */
.cfro-testimonial-dark__quote-icon {
    color: rgba(126, 203, 176, 0.4);
    display: block;
}

/* ═══════════════════════════════════════════════
   6. STATS ROWS
   ═══════════════════════════════════════════════ */

/* Responsive stats — 2x2 on mobile */
@media (max-width: 781px) {
    .cfro-stats-row {
        flex-wrap: wrap !important;
    }
    .cfro-stats-row > .wp-block-column {
        flex-basis: calc(50% - 0.75rem) !important;
    }
}
@media (max-width: 480px) {
    .cfro-stats-row > .wp-block-column {
        flex-basis: 100% !important;
    }
}

/* Dark stats – 2-col on mobile */
@media (max-width: 781px) {
    .cfro-stats-dark .wp-block-columns {
        flex-wrap: wrap !important;
    }
    .cfro-stats-dark .wp-block-column {
        flex-basis: calc(50% - 1rem) !important;
        margin-bottom: 1rem;
    }
}

/* ═══════════════════════════════════════════════
   7. FAQ ACCORDION
   ═══════════════════════════════════════════════ */

.cfro-faq .cfro-faq__item {
    border-bottom: 1px solid rgba(27,122,90,0.1);
    margin: 0;
}
.cfro-faq .cfro-faq__item:last-child {
    border-bottom: none;
}

.cfro-faq .cfro-faq__item summary {
    padding: 1rem 0.25rem;
    cursor: pointer;
    color: var(--cfro-charcoal);
    font-weight: 500;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    transition: color var(--cfro-transition);
}
.cfro-faq .cfro-faq__item summary:hover {
    color: var(--cfro-forest);
}

/* Custom chevron */
.cfro-faq .cfro-faq__item summary::-webkit-details-marker {
    display: none;
}
.cfro-faq .cfro-faq__item summary::after {
    content: '';
    width: 0.5rem;
    height: 0.5rem;
    border-right: 2px solid var(--cfro-charcoal-light);
    border-bottom: 2px solid var(--cfro-charcoal-light);
    transform: rotate(45deg);
    flex-shrink: 0;
    margin-left: 1rem;
    transition: transform 0.2s ease;
}
.cfro-faq .cfro-faq__item[open] summary::after {
    transform: rotate(-135deg);
}

.cfro-faq .cfro-faq__item > p,
.cfro-faq .cfro-faq__item > .wp-block-paragraph {
    padding: 0 0.25rem 1rem;
    margin: 0;
}

/* ═══════════════════════════════════════════════
   8. FEATURE LIST WITH ICONS
   ═══════════════════════════════════════════════ */

.cfro-feature-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.cfro-feature-icon--violet { background: var(--cfro-violet-light); color: var(--cfro-violet); }
.cfro-feature-icon--teal   { background: var(--cfro-teal-light);   color: var(--cfro-teal); }
.cfro-feature-icon--coral  { background: var(--cfro-coral-light);  color: var(--cfro-coral); }
.cfro-feature-icon--amber  { background: var(--cfro-amber-light);  color: var(--cfro-amber); }
.cfro-feature-icon--sky    { background: var(--cfro-sky-light);    color: var(--cfro-sky); }
.cfro-feature-icon--forest { background: var(--cfro-sage-pale);    color: var(--cfro-forest); }

.cfro-feature-list__item h4 {
    margin: 0 0 0.25rem !important;
    font-size: 1rem;
}

/* Contact info icons */
.cfro-contact-info__icon {
    color: var(--cfro-forest);
    flex-shrink: 0;
    margin-top: 0.125rem;
}

/* ═══════════════════════════════════════════════
   9. MEDIA EMBEDS
   ═══════════════════════════════════════════════ */

/* Audio player icon */
.cfro-audio-player__icon {
    width: 4rem;
    height: 4rem;
    border-radius: 0.375rem;
    background: var(--cfro-forest);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Audio player progress bar */
.cfro-audio-player__bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--cfro-cream-dark);
    border-radius: 0.375rem;
    height: 3rem;
    padding: 0 1rem;
}
.cfro-audio-player__play {
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    background: var(--cfro-forest);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    padding-left: 2px; /* optical center for play icon */
    transition: background var(--cfro-transition);
}
.cfro-audio-player__play:hover {
    background: var(--cfro-forest-light);
}
.cfro-audio-player__play svg {
    width: 0.875rem;
    height: 0.875rem;
}
.cfro-audio-player__track {
    flex: 1;
    height: 0.375rem;
    background: rgba(27,122,90,0.15);
    border-radius: 9999px;
    overflow: hidden;
}
.cfro-audio-player__progress {
    height: 100%;
    background: var(--cfro-forest);
    border-radius: 9999px;
}
.cfro-audio-player__time {
    font-size: 0.75rem;
    color: var(--cfro-charcoal-light);
    flex-shrink: 0;
}

/* Video placeholder */
.cfro-video-placeholder__aspect {
    position: relative;
    padding-top: 56.25%; /* 16:9 */
}
.cfro-video-placeholder__content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.4);
}
