/* =========================================================================
   Flighta CMS - frontend section styles
   -------------------------------------------------------------------------
   Styles the blocks the page builder renders. Everything here is additive:
   it reuses the tokens and primitives already defined in
   flighta_home_sections.css (fh-section, fh-container, fh-head, fh-card,
   fh-grid, fh-btn) so a CMS-built section is indistinguishable from a
   hand-written one, and nothing existing is overridden.
   ========================================================================= */

/* ---------------------------------------------------------- section shell */

.fh-cms { position: relative; }

.fh-cms[style*="background-image"] {
    background-size: cover;
    background-position: center;
}

.fh-cms__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(-180deg, rgba(16, 24, 40, .55), rgba(16, 24, 40, .72));
    pointer-events: none;
}

.fh-cms > .fh-container { position: relative; z-index: 1; }

/* Spacing scale - deliberately a small set of steps, not free values. */
.fh-cms--pt-none { padding-top: 0; }
.fh-cms--pt-sm   { padding-top: 24px; }
.fh-cms--pt-md   { padding-top: 56px; }
.fh-cms--pt-lg   { padding-top: 88px; }
.fh-cms--pt-xl   { padding-top: 120px; }

.fh-cms--pb-none { padding-bottom: 0; }
.fh-cms--pb-sm   { padding-bottom: 24px; }
.fh-cms--pb-md   { padding-bottom: 56px; }
.fh-cms--pb-lg   { padding-bottom: 88px; }
.fh-cms--pb-xl   { padding-bottom: 120px; }

.fh-cms--align-left   { text-align: right; }
.fh-cms--align-center { text-align: center; }
.fh-cms--align-right  { text-align: left; }

.fh-cms--align-center .fh-head { justify-content: center; text-align: center; }
.fh-cms--align-center .fh-head__bar { margin-inline: auto; }

.fh-container--narrow { max-width: 820px; }
.fh-container--full   { max-width: none; width: 100%; padding-inline: 0; }

/* A section on a dark background inverts its text. */
.fh-section--maroon .fh-cms-rte,
.fh-section--maroon .fh-cms-hero__subtitle,
.fh-section--maroon .fh-cms-card__text { color: rgba(255, 255, 255, .86); }

.fh-section--maroon .fh-cms-hero__title,
.fh-section--maroon .fh-cms-card__title { color: #fff; }

/* ------------------------------------------------------------- rich text */

.fh-cms-rte { color: var(--fh-body); font-size: 16px; line-height: 1.75; }
.fh-cms-rte > *:first-child { margin-top: 0; }
.fh-cms-rte > *:last-child  { margin-bottom: 0; }
.fh-cms-rte h2, .fh-cms-rte h3, .fh-cms-rte h4 { color: var(--fh-ink); margin: 1.4em 0 .5em; line-height: 1.3; }
.fh-cms-rte h2 { font-size: 26px; }
.fh-cms-rte h3 { font-size: 21px; }
.fh-cms-rte h4 { font-size: 18px; }
.fh-cms-rte p  { margin: 0 0 1em; }
.fh-cms-rte ul, .fh-cms-rte ol { margin: 0 0 1em; padding-right: 1.4em; }
.fh-cms-rte li { margin-bottom: .4em; }
.fh-cms-rte a  { color: var(--fh-maroon); text-decoration: underline; }
.fh-cms-rte a:hover { color: var(--fh-btn-hover); }
.fh-cms-rte blockquote {
    margin: 1.2em 0; padding: 12px 20px;
    border-right: 3px solid var(--fh-gold);
    background: var(--fh-line); color: var(--fh-ink);
}

.fh-cms__actions { margin-top: 24px; display: flex; gap: 12px; flex-wrap: wrap; }
.fh-cms--align-center .fh-cms__actions { justify-content: center; }
.fh-cms--align-right  .fh-cms__actions { justify-content: flex-end; }

/* ------------------------------------------------------------------ hero */

.fh-cms-hero { display: grid; gap: 40px; align-items: center; }
.fh-cms-hero--media { grid-template-columns: 1.05fr .95fr; }

.fh-cms-hero__eyebrow {
    display: inline-block; margin-bottom: 12px;
    font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
    color: var(--fh-gold);
}
.fh-cms-hero__title {
    margin: 0 0 14px; font-size: clamp(30px, 4vw, 46px); line-height: 1.15;
    color: var(--fh-ink); font-weight: 700;
}
.fh-cms-hero__subtitle { margin: 0 0 18px; font-size: 18px; line-height: 1.6; color: var(--fh-muted); }
.fh-cms-hero__actions  { margin-top: 26px; display: flex; gap: 12px; flex-wrap: wrap; }
.fh-cms--align-center .fh-cms-hero__actions { justify-content: center; }

.fh-cms-hero__media img { width: 100%; height: auto; border-radius: 14px; display: block; }

/* ----------------------------------------------------------- image block */

.fh-cms-figure { margin: 0; }
.fh-cms-figure img { max-width: 100%; height: auto; display: block; }
.fh-cms--align-center .fh-cms-figure img { margin-inline: auto; }
.fh-cms--align-right  .fh-cms-figure img { margin-right: auto; }
.fh-cms-figure--rounded img { border-radius: 14px; }
.fh-cms-figure--circle img  { border-radius: 50%; aspect-ratio: 1; object-fit: cover; }
.fh-cms-figure figcaption { margin-top: 10px; font-size: 14px; color: var(--fh-muted); }

/* ------------------------------------------------------ text beside image */

.fh-cms-split { display: grid; gap: 44px; align-items: center; }
.fh-cms-split--half       { grid-template-columns: 1fr 1fr; }
.fh-cms-split--third      { grid-template-columns: 2fr 1fr; }
.fh-cms-split--two-thirds { grid-template-columns: 1fr 2fr; }

/* Image on the left: swap the visual order, leaving the DOM in reading order
   so the heading still comes first for a screen reader. */
.fh-cms-split--left .fh-cms-split__text  { order: 2; }
.fh-cms-split--left .fh-cms-split__media { order: 1; }

.fh-cms-split__media { position: relative; }
.fh-cms-split__media img { width: 100%; height: auto; display: block; }
.fh-cms-split__media.fh-cms-figure--rounded img { border-radius: 14px; }
.fh-cms-split__media.fh-cms-figure--circle img  { border-radius: 50%; aspect-ratio: 1; object-fit: cover; }

.fh-cms-split__overlay {
    position: absolute; right: 0; left: 0; bottom: 0;
    padding: 18px 20px; border-radius: 0 0 14px 14px;
    background: linear-gradient(-180deg, rgba(16,24,40,0), rgba(16,24,40,.78));
    color: #fff; font-size: 17px; font-weight: 600;
}

/* ----------------------------------------------------------------- cards */

.fh-cms-card { display: flex; flex-direction: column; height: 100%; }
.fh-cms-card__media { aspect-ratio: 16 / 10; overflow: hidden; }
.fh-cms-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fh-cms-card__icon { display: block; font-size: 34px; line-height: 1; padding: 22px 22px 0; }
.fh-cms-card__title { margin: 0 0 8px; font-size: 18px; font-weight: 700; color: var(--fh-ink); }
.fh-cms-card__text  { margin: 0; color: var(--fh-muted); font-size: 15px; line-height: 1.6; }
.fh-cms-card__link  {
    display: inline-block; margin-top: 14px; font-weight: 600;
    color: var(--fh-maroon); text-decoration: none;
}
.fh-cms-card__link:hover { text-decoration: underline; }

/* ------------------------------------------------------------ statistics */

.fh-cms-stats { text-align: center; }
.fh-cms-stat  { padding: 18px 10px; }
.fh-cms-stat__value {
    display: block; font-size: clamp(28px, 3.4vw, 40px); font-weight: 700;
    color: var(--fh-maroon); line-height: 1.1;
}
.fh-section--maroon .fh-cms-stat__value { color: var(--fh-gold); }
.fh-cms-stat__label { display: block; margin-top: 6px; color: var(--fh-muted); font-size: 15px; }
.fh-section--maroon .fh-cms-stat__label { color: rgba(255,255,255,.8); }

/* ------------------------------------------------------------------- CTA */

.fh-cms-cta { align-items: center; }

/* ---------------------------------------------------------------- banner */

.fh-cms-banner {
    position: relative; min-height: 320px;
    display: flex; align-items: center; justify-content: center;
    padding: 56px 24px; border-radius: 16px; overflow: hidden;
    background-size: cover; background-position: center;
}
.fh-cms-banner__overlay {
    position: absolute; inset: 0;
    background: linear-gradient(-180deg, rgba(16,24,40,.45), rgba(16,24,40,.72));
}
.fh-cms-banner__body { position: relative; z-index: 1; max-width: 720px; text-align: center; }
.fh-cms-banner--media .fh-cms-banner__title,
.fh-cms-banner--media .fh-cms-banner__text { color: #fff; }
.fh-cms-banner__title { margin: 0 0 12px; font-size: clamp(26px, 3.4vw, 38px); font-weight: 700; color: var(--fh-ink); }
.fh-cms-banner__text  { margin: 0 0 22px; font-size: 17px; line-height: 1.6; color: var(--fh-body); }

/* ---------------------------------------------------------- testimonials */

.fh-cms-quote { padding: 26px; display: flex; flex-direction: column; gap: 18px; height: 100%; }
.fh-cms-quote__text {
    margin: 0; font-size: 16px; line-height: 1.7; color: var(--fh-body);
    border: 0; padding: 0; quotes: '"' '"';
}
.fh-cms-quote__text::before { content: open-quote; color: var(--fh-gold); font-size: 28px; line-height: 0; }
.fh-cms-quote__by { display: flex; align-items: center; gap: 12px; margin-top: auto; }
.fh-cms-quote__avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.fh-cms-quote__by strong { display: block; color: var(--fh-ink); font-size: 15px; }
.fh-cms-quote__by small  { color: var(--fh-faint); font-size: 13px; }

/* ------------------------------------------------------------------- FAQ */

.fh-cms-faq { max-width: 860px; }
.fh-cms--align-center .fh-cms-faq { margin-inline: auto; text-align: right; }
.fh-cms-faq__item { border-bottom: 1px solid var(--fh-line); }
.fh-cms-faq__q {
    cursor: pointer; padding: 18px 0 18px 40px; position: relative;
    font-size: 17px; font-weight: 600; color: var(--fh-ink); list-style: none;
}
.fh-cms-faq__q::-webkit-details-marker { display: none; }
.fh-cms-faq__q::after {
    content: '+'; position: absolute; left: 8px; top: 50%; transform: translateY(-50%);
    font-size: 22px; font-weight: 400; color: var(--fh-maroon);
}
.fh-cms-faq__item[open] .fh-cms-faq__q::after { content: '\2013'; }
.fh-cms-faq__q:focus-visible { outline: 2px solid var(--fh-maroon); outline-offset: 2px; }
.fh-cms-faq__a { padding: 0 0 20px; color: var(--fh-body); }

/* --------------------------------------------------------------- gallery */

.fh-cms-gallery { list-style: none; margin: 0; padding: 0; }
.fh-cms-gallery__item { position: relative; overflow: hidden; border-radius: 12px; }
.fh-cms-gallery__item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.fh-cms-gallery__caption {
    position: absolute; right: 0; left: 0; bottom: 0; padding: 12px 14px;
    background: linear-gradient(-180deg, rgba(16,24,40,0), rgba(16,24,40,.8));
    color: #fff; font-size: 14px;
}

/* ----------------------------------------------------------------- video */

.fh-cms-video {
    position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden;
    background: #000 center / cover no-repeat;
}
.fh-cms-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* -------------------------------------------------------- spacer/divider */

.fh-cms-spacer--sm { height: 24px; }
.fh-cms-spacer--md { height: 48px; }
.fh-cms-spacer--lg { height: 80px; }
.fh-cms-spacer--xl { height: 120px; }

.fh-cms-divider { border: 0; border-top: 1px solid var(--fh-line); margin: 0; }
.fh-cms-divider--dashed { border-top-style: dashed; }
.fh-cms-divider--bar {
    border: 0; height: 4px; width: 64px; border-radius: 2px;
    background: var(--fh-gold);
}
.fh-cms--align-center .fh-cms-divider--bar { margin-inline: auto; }

/* ------------------------------------------------------------ responsive */

@media (max-width: 991px) {
    .fh-cms-hero--media,
    .fh-cms-split--half,
    .fh-cms-split--third,
    .fh-cms-split--two-thirds { grid-template-columns: 1fr; }

    /* On one column the image always follows the text, whichever side it was
       on, so the reading order matches the visual order. */
    .fh-cms-split--left .fh-cms-split__text,
    .fh-cms-split--left .fh-cms-split__media { order: initial; }
}

@media (max-width: 767px) {
    .fh-cms--pt-lg, .fh-cms--pt-xl { padding-top: 56px; }
    .fh-cms--pb-lg, .fh-cms--pb-xl { padding-bottom: 56px; }
    .fh-cms-banner { min-height: 240px; padding: 40px 18px; }
    .fh-cms-hero__actions, .fh-cms__actions { flex-direction: column; align-items: stretch; }
    .fh-cms-hero__actions .fh-btn, .fh-cms__actions .fh-btn { width: 100%; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
    .fh-cms * { transition: none !important; animation: none !important; }
}
