/**
 * Aradel — Shared Layer
 * File: aradel-shared/assets/aradel-shared.css
 *
 * Covers genuinely shared systems only:
 *   1.  Gradient presets       ([data-gradient] attribute selectors)
 *   2.  Statement band         (.ar-band)
 *   3.  Accordion              (.ar-acc)
 *   4.  Anchor rail            (.ar-rail)
 *   5.  Responsive — tablet    (≤ 1024px)
 *   6.  Responsive — mobile    (≤ 640px)
 *   7.  Reduced motion
 *
 * Module-specific wrapper spacing stays in governance CSS and page-modules CSS.
 * These rules are intentionally scope-neutral — they match any element carrying
 * the shared class/attribute.
 *
 * Design tokens (matching aradel-design-system.css):
 *   Brand red:    #C1000F
 *   Vivid red:    #F32D17
 *   Sherpa blue:  #01303A
 *   Earth green:  #005A4E
 *   Soft green:   #9FD4BE
 *   Orange:       #F36417
 *   Font:         Nunito Sans
 */


/* =============================================================
   1. GRADIENT PRESETS
   Universal — any element may carry data-gradient to receive
   the corresponding background. Scoped only to known preset keys.
   ============================================================= */

[data-gradient="ar_gradient_red_blue"] {
    background: linear-gradient(
        135deg,
        #C1000F 0%,
        #01303A 100%
    ) !important;
}

[data-gradient="ar_gradient_red_red_blue"] {
    background: linear-gradient(
        135deg,
        #C1000F 0%,
        #F32D17 40%,
        #01303A 100%
    ) !important;
}

[data-gradient="ar_gradient_red_orange"] {
    background: linear-gradient(
        135deg,
        #C1000F 0%,
        #F36417 100%
    ) !important;
}

[data-gradient="ar_gradient_blue_green"] {
    background: linear-gradient(
        135deg,
        #01303A 0%,
        #005A4E 100%
    ) !important;
}

[data-gradient="ar_gradient_blue_green_soft"] {
    background: linear-gradient(
        135deg,
        #01303A 0%,
        #005A4E 60%,
        #9FD4BE 100%
    ) !important;
}

[data-gradient="ar_gradient_accent_vivid_red_orange"] {
    background: linear-gradient(
        135deg,
        #F32D17 0%,
        #F36417 100%
    ) !important;
}

[data-gradient="ar_gradient_soft_gray_red"] {
    background: linear-gradient(
        135deg,
        #F0F0F0 0%,
        #F8D8D2 100%
    ) !important;
}

[data-gradient="ar_gradient_soft_gray_blue"] {
    background: linear-gradient(
        135deg,
        #F0F0F0 0%,
        #DCE7EA 100%
    ) !important;
}

[data-gradient="ar_gradient_soft_blue_white"] {
    background: linear-gradient(
        135deg,
        #DCE7EA 0%,
        #FFFFFF 100%
    ) !important;
}

[data-gradient="ar_gradient_soft_green_white"] {
    background: linear-gradient(
        135deg,
        #DDF0E8 0%,
        #FFFFFF 100%
    ) !important;
}

[data-gradient="ar_gradient_soft_red_orange"] {
    background: linear-gradient(
        135deg,
        #F8DEDA 0%,
        #FAE5D8 100%
    ) !important;
}

[data-gradient="ar_muted"] {
    background: #F0F3F4 !important;
}

/* none = no background override; element retains its own background */


/* =============================================================
   2. STATEMENT BAND
   Short branded block rendered between a section heading and
   accordion / body content. Carries the main gradient energy.
   ============================================================= */

.ar-band {
    margin-bottom: 40px;
    border-radius: 12px;
    overflow: hidden;
}

.ar-band__inner {
    padding: 32px 48px;
}

.ar-band__text {
    margin: 0;
    font-family: var(--ads-font, "Nunito Sans", system-ui, sans-serif);
    font-size: 18px;
    font-weight: 400;
    line-height: 27px;
    color: #fff;
}

/* Muted variant: light tinted surface, dark text */
.ar-band--light-surface .ar-band__text,
.ar-band[data-gradient="ar_muted"] .ar-band__text {
    color: #01303A;
}

/* None variant: transparent surface, plain paragraph feel */
.ar-band[data-gradient="none"] {
    background: transparent !important;
    border-radius: 0;
    margin-bottom: 24px;
}

.ar-band[data-gradient="none"] .ar-band__inner {
    padding: 0 0 4px;
}

.ar-band[data-gradient="none"] .ar-band__text {
    color: #000;
}


/* =============================================================
   3. ACCORDION
   ARIA-safe expand/collapse pattern.
   Trigger shows chevron (closed) or minus (open).
   Panel uses measured height transitions for smooth animation.
   ============================================================= */

/* ── List + item structure ───────────────────────────────────────────────── */

.ar-acc {
    width: 100%;
    --ar-acc-motion-duration: 350ms;
    --ar-acc-motion-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

.ar-acc__list {
    margin: 0;
    padding: 0;
}

.ar-acc__item {
    border-top: 1px solid rgba(0, 0, 0, 0.10);
}

.ar-acc__item:first-child {
    border-top: none;
}

/* ── Trigger button ──────────────────────────────────────────────────────── */

.ar-acc__trigger {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    width: 100%;
    padding: 28px 0;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
}

.ar-acc__trigger:focus {
    outline: none;
}

.ar-acc__trigger:focus-visible {
    outline: 2px solid var(--ads-brand-red, #C1000F);
    outline-offset: 4px;
    border-radius: 2px;
}

/* ── Title ───────────────────────────────────────────────────────────────── */

.ar-acc__title {
    font-family: var(--ads-font, "Nunito Sans", system-ui, sans-serif);
    font-size: 24px;
    font-weight: 600;
    line-height: 36px;
    letter-spacing: 0.01em;
    color: #000;
    transition: color 0.2s ease;
}

.ar-acc__item.is-open .ar-acc__title {
    color: var(--ads-brand-red, #C1000F);
}

/* ── Icon group ──────────────────────────────────────────────────────────── */

.ar-acc__icon {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-top: 4px;
    color: #A1A0A0;
    transition: color 0.2s ease;
    position: relative;
}

.ar-acc__item.is-open .ar-acc__icon {
    color: var(--ads-brand-red, #C1000F);
}

.ar-acc__icon-chevron {
    position: absolute;
    transition: opacity 0.2s ease, transform 0.25s ease;
    opacity: 1;
    transform: rotate(0deg);
}

.ar-acc__item.is-open .ar-acc__icon-chevron {
    opacity: 0;
    transform: rotate(90deg);
}

.ar-acc__icon-minus {
    position: absolute;
    transition: opacity 0.2s ease;
    opacity: 0;
}

.ar-acc__item.is-open .ar-acc__icon-minus {
    opacity: 1;
}

/* ── Panel ───────────────────────────────────────────────────────────────── */

.ar-acc__panel {
    overflow: hidden;
    height: auto;
    transition: height var(--ar-acc-motion-duration) var(--ar-acc-motion-ease);
}

.ar-acc__panel[hidden] {
    display: none !important;
}

/* ── Body content ────────────────────────────────────────────────────────── */

.ar-acc__body {
    padding: 0 64px 32px 0;
    font-family: var(--ads-font, "Nunito Sans", system-ui, sans-serif);
    font-size: 18px;
    line-height: 27px;
    color: #000;
}

.ar-acc__body p {
    margin: 0 0 12px;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
}

.ar-acc__body p:last-child {
    margin-bottom: 0;
}

.ar-acc__body ul,
.ar-acc__body ol {
    margin: 0 0 16px;
    padding-left: 24px;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
}

.ar-acc__body a {
    color: var(--ads-brand-red, #C1000F);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.ar-acc__body a:hover {
    color: var(--ads-brand-blue, #01303A);
}

.ar-acc__body strong {
    font-weight: 700;
    color: #000;
}

/* ── Optional file / link rows ───────────────────────────────────────────── */

.ar-acc__file-link,
.ar-acc__extra-link {
    margin-top: 16px;
    margin-bottom: 0;
}

.ar-acc__download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--ads-brand-red, #C1000F);
    text-decoration: none;
}

.ar-acc__download:hover {
    color: var(--ads-brand-blue, #01303A);
}

.ar-acc__icon-download {
    flex: 0 0 auto;
    display: inline-block;
    vertical-align: middle;
}


/* =============================================================
   4. ANCHOR RAIL
   Segmented pill track. Active tab carries brand gradient.
   Scrolls horizontally on mobile.
   ============================================================= */

.ar-rail {
    position: relative;
    top: auto;
    z-index: 1;
    width: 100%;
}

.ar-rail__inner {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding-left: 112px;
    padding-right: 112px;
    box-sizing: border-box;
    overflow: visible;
}

.ar-rail__list {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(max-content, 1fr);
    align-items: center;
    gap: 0;
    margin: 0;
    padding: 4px;
    list-style: none;
    background: #F0F3F4;
    border-radius: 20px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.ar-rail__item {
    display: flex;
    min-width: 0;
}

.ar-rail__link {
    width: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 56px;
    min-height: 56px;
    padding: 0 20px;
    border-radius: 16px;
    font-family: var(--ads-font, "Nunito Sans", system-ui, sans-serif);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--ads-brand-blue, #01303A);
    background: transparent;
    transition:
        background 200ms ease,
        color 200ms ease,
        box-shadow 200ms ease;
    white-space: nowrap;
    text-align: center;
    cursor: pointer;
}

.ar-rail__list.is-measuring {
    position: absolute;
    left: 0;
    top: 0;
    width: max-content;
    min-width: max-content;
    visibility: hidden;
    pointer-events: none;
    overflow: visible;
    display: flex;
    z-index: -1;
}

.ar-rail__list.is-measuring .ar-rail__item,
.ar-rail__list.is-scrollable-mode .ar-rail__item {
    flex: 0 0 auto;
    width: auto;
    min-width: max-content;
}

.ar-rail__list.is-measuring .ar-rail__link,
.ar-rail__list.is-scrollable-mode .ar-rail__link {
    flex: 0 0 auto;
    width: auto;
    min-width: max-content;
    overflow-wrap: normal;
}

.ar-rail.is-scrollable .ar-rail__inner {
    overflow-x: hidden;
    overflow-y: visible;
}

.ar-rail.is-scrollable .ar-rail__list {
    display: flex;
    gap: 6px;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
    touch-action: pan-x;
}

.ar-rail.is-scrollable .ar-rail__list::-webkit-scrollbar {
    display: none;
}

.ar-rail.is-scrollable .ar-rail__item {
    scroll-snap-align: start;
}

.ar-rail.is-scrollable .ar-rail__item,
.ar-rail.is-scrollable .ar-rail__link {
    flex: 0 0 auto;
    width: auto;
    min-width: max-content;
}

.ar-rail.is-scrollable .ar-rail__link {
    white-space: nowrap;
    overflow-wrap: normal;
}

.ar-rail__link:hover:not(.is-active) {
    background: rgba(1, 48, 58, 0.08);
    color: var(--ads-brand-blue, #01303A);
    text-decoration: none;
}

.ar-rail__link:focus {
    outline: none;
}

.ar-rail__link:focus-visible {
    outline: 2px solid var(--ads-brand-red, #C1000F);
    outline-offset: 2px;
}

/* Active state: brand gradient pill */
.ar-rail__link.is-active {
    background: linear-gradient(135deg, #C1000F 0%, #01303A 100%);
    color: #fff;
    box-shadow: 0 2px 10px rgba(193, 0, 15, 0.30);
    z-index: 1;
}


/* =============================================================
   5. RESPONSIVE — TABLET (≤ 1024px)
   ============================================================= */

@media ( max-width: 1024px ) {

    .ar-rail__inner {
        padding-left: 64px;
        padding-right: 64px;
    }

    .ar-rail__list {
        width: 100%;
        min-width: 0;
    }

    .ar-rail__link {
        padding: 0 16px;
        font-size: 13px;
        letter-spacing: 0.08em;
        line-height: 1.2;
    }

    .ar-rail.is-scrollable .ar-rail__item {
        scroll-snap-align: start;
    }

    .ar-rail.is-scrollable .ar-rail__link {
        white-space: nowrap;
    }

    .ar-band:not([data-gradient="none"]) .ar-band__inner {
        padding: 28px 36px;
    }

    .ar-band__text {
        font-size: 18px;
        line-height: 28px;
    }

    .ar-acc__title {
        font-size: 20px;
        line-height: 32px;
    }
}


/* =============================================================
   6. RESPONSIVE — MOBILE (≤ 640px)
   ============================================================= */

@media ( max-width: 640px ) {

    .ar-rail__inner {
        padding-left: 24px;
        padding-right: 24px;
    }

    .ar-rail__link {
        height: 44px;
        min-height: 44px;
        padding: 0 16px;
        font-size: 12px;
        letter-spacing: 0.08em;
    }

    .ar-rail__list {
        border-radius: 18px;
    }

    .ar-rail.is-scrollable .ar-rail__link {
        justify-content: flex-start;
    }

    .ar-band__inner {
        padding: 24px 24px;
    }

    .ar-band__text {
        font-size: 17px;
        line-height: 26px;
    }

    .ar-acc__trigger {
        padding: 22px 0;
        gap: 16px;
    }

    .ar-acc__title {
        font-size: 18px;
        line-height: 28px;
    }

    .ar-acc__body {
        padding: 0 0 24px;
        font-size: 16px;
        line-height: 25px;
    }

    .ar-acc__body p {
        font-size: inherit;
        line-height: inherit;
    }
}


/* =============================================================
   7. REDUCED MOTION
   ============================================================= */

@media ( prefers-reduced-motion: reduce ) {

    .ar-rail__link,
    .ar-acc__panel,
    .ar-acc__icon-chevron,
    .ar-acc__icon-minus,
    .ar-acc__title,
    .ar-acc__icon {
        transition: none;
    }
}
