/* Advanced Search — interactive 3D filter chapters */

.page-advanced-tree {
    --as-ink: #10231f;
    --as-mist: #eef4f1;
    --as-forest: #145c4c;
    --as-deep: #0c3d33;
    --as-gold: #b8893a;
    --as-gold-soft: #f3e4c4;
}

.page-advanced-tree .site-footer {
    padding-bottom: 5.5rem;
}

.page-advanced-tree .breadcrumbs a,
.page-advanced-tree .site-breadcrumbs a {
    color: var(--as-gold-soft);
}

.page-advanced-tree .breadcrumbs,
.page-advanced-tree .site-breadcrumbs {
    color: rgba(244, 247, 245, 0.75);
}

.as-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 2.5rem 0 2.25rem;
    color: #f4f7f5;
}

.as-hero-atmosphere {
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(155deg, #0c3d33 0%, #145c4c 45%, #c9a45a 130%);
}

.as-hero-atmosphere::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(8, 28, 24, 0.15), rgba(8, 28, 24, 0.55));
}

.as-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(2px);
    opacity: 0.42;
    animation: hx-float 10s ease-in-out infinite;
}

.as-orb--a {
    width: 220px;
    height: 220px;
    top: 10%;
    right: 8%;
    background: radial-gradient(circle at 30% 30%, #f3e4c4, transparent 65%);
}

.as-orb--b {
    width: 140px;
    height: 140px;
    bottom: 14%;
    left: 10%;
    background: radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.35), transparent 70%);
    animation-delay: -3s;
}

.as-floor {
    position: absolute;
    left: -10%;
    right: -10%;
    bottom: -8%;
    height: 42%;
    background:
        linear-gradient(to top, rgba(8, 28, 24, 0.7), transparent),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.07) 0 1px, transparent 1px 56px);
    transform: perspective(650px) rotateX(58deg);
    transform-origin: center bottom;
}

.as-hero-inner {
    position: relative;
    max-width: 820px;
}

.as-eyebrow {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--as-gold-soft);
}

.as-hero h1 {
    margin: 0.4rem 0 0.65rem;
    font-family: 'Poppins', system-ui, -apple-system, sans-serif;
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -0.03em;
}

.as-lead {
    margin: 0 0 1.25rem;
    max-width: 38rem;
    line-height: 1.6;
    color: rgba(244, 247, 245, 0.88);
}

.as-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: 1.35rem;
}

.as-btn-solid,
.as-btn-ghost,
.as-btn-ghost-dark {
    border-radius: 999px;
    font-weight: 700;
    text-decoration: none;
    border: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.as-btn-solid {
    background: var(--as-gold);
    color: #14201c;
}

.as-btn-ghost {
    background: rgba(255, 255, 255, 0.12);
    color: #f4f7f5;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.as-btn-ghost-dark {
    background: rgba(12, 61, 51, 0.08);
    color: var(--as-deep);
    border: 1px solid rgba(20, 92, 76, 0.2);
}

.as-hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.75rem;
    margin: 0 0 1.25rem;
}

.as-hero-stats div {
    min-width: 4.5rem;
}

.as-hero-stats dt {
    margin: 0;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.75;
}

.as-hero-stats dd {
    margin: 0.15rem 0 0;
    font-family: 'Poppins', system-ui, -apple-system, sans-serif;
    font-size: 1.45rem;
    font-weight: 700;
}

.as-page {
    padding: 2rem 0 2.75rem;
    background:
        radial-gradient(ellipse 60% 30% at 85% 4%, rgba(184, 137, 58, 0.1), transparent 55%),
        radial-gradient(ellipse 70% 35% at 12% 0%, rgba(20, 92, 76, 0.08), transparent 55%),
        linear-gradient(180deg, #f7faf8 0%, #ffffff 45%, #eef4f1 100%);
}

.as-form {
    margin-bottom: 2rem;
}

/* Sticky filter rail */
.as-step-rail {
    position: sticky;
    top: 4.75rem;
    z-index: 12;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.4rem;
    margin: 0 0 1.75rem;
    padding: 0.5rem;
    border-radius: 1.35rem;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(16, 35, 31, 0.1);
    box-shadow: 0 16px 36px rgba(12, 40, 34, 0.1);
    backdrop-filter: blur(12px);
}

.as-step-rail-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    border: 0;
    background: transparent;
    color: #5b6b65;
    font: inherit;
    padding: 0.55rem 0.25rem;
    border-radius: 1rem;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.as-step-rail-btn span {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.as-step-rail-btn strong {
    font-family: 'Poppins', system-ui, -apple-system, sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    text-align: center;
}

.as-step-rail-btn small {
    font-size: 0.68rem;
    opacity: 0.8;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.as-step-rail-btn:hover {
    color: var(--as-deep);
    background: rgba(20, 92, 76, 0.06);
}

.as-step-rail-btn.is-active {
    color: #fff;
    background: linear-gradient(160deg, var(--as-forest), var(--as-deep));
    box-shadow: 0 10px 22px rgba(12, 61, 51, 0.22);
    transform: translateY(-1px) scale(1.02);
}

.as-step-rail-btn.is-active small {
    color: rgba(243, 228, 196, 0.95);
}

/* Chapters */
.as-chapters {
    display: grid;
    gap: 1.4rem;
}

.as-chapter {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border-radius: 1.7rem;
    padding: 1.45rem 1.2rem 1.35rem;
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.98) 0%, #f7faf8 55%, #f8f1e3 130%);
    border: 1px solid rgba(16, 35, 31, 0.1);
    box-shadow: 0 22px 48px rgba(12, 40, 34, 0.1);
    transform-style: preserve-3d;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.as-chapter.is-active {
    border-color: rgba(20, 92, 76, 0.28);
    box-shadow: 0 28px 60px rgba(12, 40, 34, 0.16);
}

.as-chapter--hero {
    color: #fff;
    background: linear-gradient(150deg, #0c3d33 0%, #145c4c 50%, #8f6a2f 140%);
    border-color: transparent;
}

.as-chapter-glow {
    position: absolute;
    width: 240px;
    height: 240px;
    top: -70px;
    right: -40px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(243, 228, 196, 0.35), transparent 68%);
    filter: blur(2px);
    animation: hx-float 10s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

.as-chapter-glow--soft {
    left: -50px;
    right: auto;
    bottom: -80px;
    top: auto;
    background: radial-gradient(circle, rgba(20, 92, 76, 0.16), transparent 70%);
    animation-delay: -3.5s;
}

.as-chapter-grid {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 1.25rem;
}

.as-chapter-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0 0 0.55rem;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--as-gold-soft);
}

.as-chapter-kicker--dark {
    color: var(--as-forest);
}

.as-chapter-kicker span {
    display: inline-grid;
    place-items: center;
    min-width: 1.75rem;
    height: 1.75rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(243, 228, 196, 0.35);
}

.as-chapter-kicker--dark span {
    background: linear-gradient(160deg, var(--as-forest), var(--as-deep));
    border-color: transparent;
    box-shadow: 0 8px 16px rgba(12, 61, 51, 0.18);
}

.as-chapter-copy h3 {
    margin: 0 0 0.45rem;
    font-family: 'Poppins', system-ui, -apple-system, sans-serif;
    font-size: clamp(1.4rem, 2.7vw, 1.9rem);
    letter-spacing: -0.02em;
}

.as-chapter-copy > p {
    margin: 0 0 1rem;
    max-width: 40rem;
    line-height: 1.6;
}

.as-chapter--hero .as-chapter-copy > p {
    color: rgba(244, 247, 245, 0.9);
}

.as-chapter:not(.as-chapter--hero) .as-chapter-copy > p {
    color: #5b6b65;
}

.as-chapter-aside {
    display: grid;
    gap: 0.7rem;
    perspective: 900px;
}

.as-float {
    display: grid;
    gap: 0.2rem;
    padding: 0.95rem 1.05rem;
    border-radius: 1rem;
    background: linear-gradient(160deg, #ffffff 0%, #f7faf8 70%, #f3e4c4 150%);
    color: var(--as-ink);
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.14);
    transition: transform 0.25s ease;
}

.as-chapter:not(.as-chapter--hero) .as-float {
    box-shadow: 0 12px 26px rgba(12, 40, 34, 0.08);
    border-color: rgba(16, 35, 31, 0.1);
}

.as-chapter.is-active .as-float:nth-child(1) {
    transform: translateY(-2px) rotateX(2deg);
}

.as-chapter.is-active .as-float:nth-child(2) {
    transform: translateY(0) rotateY(-2deg);
}

.as-chapter.is-active .as-float:nth-child(3) {
    transform: translateY(2px) rotateX(-2deg);
}

.as-float strong {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(16, 35, 31, 0.62);
}

.as-float span {
    font-family: 'Poppins', system-ui, -apple-system, sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--as-deep);
    line-height: 1.35;
}

.as-chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 1rem;
}

.as-chip {
    border: 1px solid rgba(20, 92, 76, 0.18);
    background: #fff;
    color: var(--as-deep);
    font: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    padding: 0.55rem 0.85rem;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.as-chapter--hero .as-chip {
    background: rgba(255, 255, 255, 0.12);
    color: #f4f7f5;
    border-color: rgba(255, 255, 255, 0.28);
}

.as-chip:hover {
    transform: translateY(-2px);
    border-color: rgba(20, 92, 76, 0.4);
}

.as-chapter--hero .as-chip:hover {
    border-color: rgba(243, 228, 196, 0.65);
    background: rgba(255, 255, 255, 0.18);
}

.as-chip.is-selected {
    background: var(--as-deep);
    color: #fff;
    border-color: var(--as-deep);
    box-shadow: 0 8px 18px rgba(12, 61, 51, 0.22);
}

.as-chapter--hero .as-chip.is-selected {
    background: var(--as-gold-soft);
    color: var(--as-deep);
    border-color: transparent;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}

.as-chip:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.as-spec-block + .as-spec-block {
    margin-top: 0.35rem;
}

.as-spec-block h4 {
    margin: 0 0 0.55rem;
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(16, 35, 31, 0.65);
}

.as-chapter--hero .as-spec-block h4 {
    color: rgba(243, 228, 196, 0.9);
}

.as-native-select {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.as-chapter-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    padding-top: 0.25rem;
}

.as-chapter-nav--apply {
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.as-summary-list {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    display: grid;
    gap: 0.55rem;
}

.as-summary-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem 0.85rem;
    border-radius: 0.85rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.as-summary-list span {
    color: rgba(244, 247, 245, 0.75);
    font-size: 0.86rem;
}

.as-summary-list strong {
    color: var(--as-gold-soft);
    text-align: right;
}

.as-secondary {
    display: grid;
    gap: 1.1rem;
}

.as-side-card {
    background: #fff;
    border: 1px solid rgba(20, 92, 76, 0.12);
    border-radius: 1.15rem;
    padding: 1.25rem 1.2rem;
    box-shadow: 0 14px 32px rgba(12, 61, 51, 0.06);
}

.as-side-card h2 {
    margin: 0 0 0.35rem;
    font-family: 'Poppins', system-ui, -apple-system, sans-serif;
    font-size: 1.15rem;
    color: var(--as-deep);
}

.as-side-card > p {
    margin: 0 0 0.9rem;
    color: rgba(16, 35, 31, 0.68);
}

.as-presets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.65rem;
}

.as-preset {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.9rem 1rem;
    border-radius: 1rem;
    text-decoration: none;
    color: var(--as-ink);
    background: linear-gradient(145deg, #f7faf8, #f3e4c4);
    border: 1px solid rgba(184, 137, 58, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.as-preset:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(12, 61, 51, 0.12);
}

.as-preset-label {
    font-family: 'Poppins', system-ui, -apple-system, sans-serif;
    font-weight: 700;
    color: var(--as-deep);
}

.as-preset-meta {
    font-size: 0.84rem;
    color: rgba(16, 35, 31, 0.7);
}

.as-faq-wrap .faq-section {
    margin: 0;
}

.as-faq-wrap .faq-section--compact {
    background: #fff;
    border: 1px solid rgba(20, 92, 76, 0.12);
    border-radius: 1.15rem;
    box-shadow: 0 14px 32px rgba(12, 61, 51, 0.06);
    padding: 1.2rem;
}

.as-dock {
    position: fixed;
    left: 50%;
    bottom: 1rem;
    z-index: 40;
    display: flex;
    gap: 0.45rem;
    transform: translateX(-50%);
    padding: 0.4rem;
    border-radius: 999px;
    background: rgba(12, 61, 51, 0.92);
    box-shadow: 0 16px 40px rgba(12, 61, 51, 0.35);
    backdrop-filter: blur(10px);
}

.as-dock-btn {
    color: #f4f7f5;
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 600;
    padding: 0.55rem 0.95rem;
    border-radius: 999px;
}

.as-dock-btn--primary {
    background: var(--as-gold);
    color: #14201c;
}

/* Shared chips used on search results when editing filters */
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0 0 1rem;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: rgba(20, 92, 76, 0.1);
    color: var(--as-forest);
    font-size: 0.78rem;
    font-weight: 600;
}

.search-edit-filters {
    margin-left: auto;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--as-forest);
    text-decoration: none;
}

.search-edit-filters:hover {
    text-decoration: underline;
}

@media (min-width: 900px) {
    .as-chapter {
        padding: 1.85rem 1.75rem 1.65rem;
    }

    .as-chapter-grid {
        grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.8fr);
        align-items: center;
        gap: 1.75rem;
    }

    .as-secondary {
        grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
        align-items: start;
    }
}

@media (max-width: 1100px) {
    .as-step-rail {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        border-radius: 1.2rem;
    }
}

@media (max-width: 720px) {
    .as-step-rail {
        top: 4.25rem;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        border-radius: 1.1rem;
    }

    .as-step-rail-btn strong {
        font-size: 0.76rem;
    }

    .as-step-rail-btn small {
        display: none;
    }

    .as-chapter {
        padding: 1.25rem 1rem 1.15rem;
    }

    .as-chapter.is-active .as-float {
        transform: none;
    }

    .as-hero-actions .btn {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .as-orb,
    .as-chapter-glow {
        animation: none !important;
    }

    .as-chapter.is-active .as-float,
    .as-chip:hover,
    .as-preset:hover,
    .as-step-rail-btn.is-active {
        transform: none !important;
    }

    .as-chip,
    .as-preset,
    .as-step-rail-btn,
    .as-chapter {
        transition: none !important;
    }
}
