/* Page-specific overrides and layout tuning for etf-education.html */
/* Prevent horizontal scrolling */
html,
body {
    overflow-x: hidden !important;
    max-width: 100% !important;
}

/* Adjust FAQ bullet point to align with H4 heading */
.faq-item::before {
    display: none !important;
    /* Hide the CSS pseudo-element bullet */
}

.faq-item {
    margin-bottom: 2.5rem;
}

.faq-item h4 {
    position: relative;
    padding-left: 0 !important;
    margin-left: 0 !important;
}

.faq-item h4::before {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background-color: #cd2e26;
    border-radius: 50%;
    left: -1.5rem;
    top: 50%;
    transform: translate(-50%, -50%);
}

.faq-item p {
    padding-left: 0 !important;
}

.faq-item ul {
    padding-left: 1rem;
    /* Slight indent for lists */
}

.faq-point {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    padding-left: 0 !important;
    margin: 0 0 0.75rem 0;
    color: #4a4a4a;
    line-height: 1.7;
}

.faq-point::before {
    content: '';
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #cd2e26;
    margin-top: 0.55rem;
}

/* Vertically center hero content */
.hero-grid {
    align-items: center !important;
}

.hero-content {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-self: center !important;
    margin-top: auto !important;
    margin-bottom: auto !important;
}

/* Fix H2 decorative line to span full height */
.prose h2::before {
    top: 0 !important;
    bottom: 0 !important;
    height: 100% !important;
    transform: none !important;
}

/* Add spacing between red line and H2 text */
.prose h2 {
    padding-left: 1.5rem !important;
    /* Increase spacing from red line */
}

/* Make benefits section 2x2 grid */
#etf-benefits .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 2rem;
}

/* Tighter spacing for benefits section to connect with title */
#etf-benefits {
    margin-top: 0 !important;
    /* Remove top margin */
    padding: 0 !important;
    /* Remove all padding to match etf-market-stats */
    background: transparent !important;
    /* Ensure no background color */
}

/* Make market stats section 2x2 grid */
#etf-market-stats .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 2rem;
}

@media (max-width: 768px) {

    #etf-benefits .stats-grid,
    #etf-market-stats .stats-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Reduce top padding on main content container */
.main-content-reduced-padding {
    padding-top: calc(var(--main-content-padding, 4rem) / 2) !important;
}

/* New compact hero class with reduced height */
.hero-compact {
    min-height: 400px !important;
    /* Reduced from default hero height */
    padding: 3rem 0 !important;
    /* Reduced vertical padding */
    padding-top: calc(80px + 3rem) !important;
    /* Add space for fixed navigation + standard padding */
    margin-top: 0 !important;
    /* Reset margin to avoid double spacing */
}

/* Increased max-width for sections */
.container.max-w-7xl {
    max-width: 1400px !important;
}

.prose.max-w-none {
    max-width: 1200px !important;
    margin-left: auto;
    margin-right: auto;
}

/* New hero title class for ETF page - larger and more prominent */
.hero-title-etf {
    font-size: 4rem !important;
    font-weight: 800 !important;
    line-height: 1.1 !important;
    margin-bottom: 0 !important;
    padding-left: 1.5rem !important;
    /* Space from red line */
}

.hero-description-etf {
    font-size: 1.25rem !important;
    /* Reduced for more subtle subtitle */
    margin-top: 0.5rem !important;
    /* Minimal spacing for tight connection */
    font-weight: 400 !important;
    padding-left: 1.5rem !important;
    /* Match title padding */
}

/* Fix hero content alignment */
.hero-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding-left: 0 !important;
    /* Remove extra left padding */
    padding-right: 0 !important;
    /* Balance with left side */
    gap: 0 !important;
    /* Remove any gap between flex items */
}

.hero-content>* {
    flex-shrink: 0;
    /* Prevent items from stretching */
}

/* Balance hero grid padding on both sides */
.hero-grid {
    padding: 0 3rem !important;
    /* Equal padding on both sides */
}

/* Reduce gap between title and Market Overview box in tablet range */
@media (min-width: 768px) and (max-width: 969px) {
    .hero-grid {
        gap: 3rem !important;
        /* Reduce from 6rem to 3rem */
    }

    .hero-cards-wrapper {
        padding-left: 0 !important;
        /* Remove left/right padding to give more space to the card */
        padding-right: 0 !important;
    }
}

@media (max-width: 970px) {
    .hero-grid {
        padding: 0 1.5rem !important;
        /* Reduce padding on mobile */
    }
}

@media (max-width: 767px) {
    .hero-title-etf {
        font-size: 2.5rem !important;
    }

    .hero-description-etf {
        font-size: 1.3rem !important;
    }

    .hero-content {
        padding-right: 0 !important;
        margin-top: 2rem !important;
        /* Add gap between top of hero and content */
    }
}

/* Add gap between FAQ paragraphs */
.faq-item p {
    padding-left: 20px;
    margin-bottom: 1rem !important;
    /* Add gap between paragraphs */
}

.faq-item p:last-child {
    margin-bottom: 0 !important;
    /* Remove gap after last paragraph */
}

/* Larger gap after CTA section */
.cta-section {
    margin-bottom: 6rem !important;
}

/* Fix alignment of h2 inside sections - ensure consistent padding for red line */
section h2.text-3xl {
    margin-left: 0 !important;
    padding-left: 1.5rem !important;
    /* Match other h2 elements */
}

/* Fix Sources & References title to match other h2 titles */
.content-section h2 {
    color: #000000 !important;
    font-size: 2.25rem !important;
    font-weight: 700 !important;
    margin-bottom: 2rem !important;
    text-align: left !important;
    padding-left: 1.5rem !important;
    /* Match other h2 elements */
}

/* Change subsection headings to black */
.content-section h3 {
    color: #000000 !important;
}

/* Harmonize spacing between sections */
.prose h2 {
    margin-top: 4rem !important;
    margin-bottom: 2rem !important;
}

.prose h2:first-child {
    margin-top: 0 !important;
}

.prose section {
    margin-bottom: 3rem !important;
}

/* Consistent spacing for all sections */
section[id] {
    margin-top: 3rem !important;
}

/* Increase gap between Additional Resources and CTA */
.content-section {
    margin-bottom: 4rem !important;
}

/* ------------------------------------------------------------ */
/* Bento visual summary styles (cards + charts) */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.bento-card {
    border-radius: 20px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: default;
}

.bento-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.span-full {
    grid-column: span 2;
}

/* Card Colors */
.card-red {
    background-color: #cd2e26;
    color: white;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16);
}

.card-beige {
    background-color: #eaddcf;
    color: #1a1a1a;
}

.card-dark {
    background-color: #2a2a2a;
    color: white;
}

.card-green {
    background-color: #cbf3f0;
    /* Soft teal/mint */
    color: #1a1a1a;
}

/* Typography */
.bento-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.bento-text {
    font-size: 0.9rem;
    line-height: 1.5;
    opacity: 0.9;
}

.dark-text {
    color: #1a1a1a !important;
}

.card-red .bento-text {
    color: #f7f7f7;
}

.bento-footer-text {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.95rem;
    opacity: 0.8;
}

/* Visual Elements */
.map-visual {
    height: 160px;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.world-map-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.12));
}

.donut-chart-container {
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem;
}

.donut-chart {
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease;
}

.bento-card:hover .donut-chart {
    transform: scale(1.05);
}

.donut-bg {
    fill: none;
    stroke: rgba(0, 0, 0, 0.1);
    stroke-width: 3.8;
}

.card-red .donut-bg {
    stroke: rgba(255, 255, 255, 0.2);
}

.donut-segment {
    fill: none;
    stroke: #2a2a2a;
    stroke-width: 3.8;
    stroke-linecap: round;
}

.red-segment {
    stroke: #cd2e26;
}

.donut-text {
    fill: currentColor;
    font-family: sans-serif;
    font-weight: bold;
    font-size: 0.5em;
    text-anchor: middle;
}

.centered {
    text-align: center;
    align-items: center;
}

/* Types Tree */
.types-badge {
    background: #a8dadc;
    color: #1a1a1a;
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    width: fit-content;
    margin: 0 auto 2rem;
}

.types-tree {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    position: relative;
}

.types-tree::before {
    content: '';
    position: absolute;
    top: -1rem;
    left: 50%;
    width: 2px;
    height: 1rem;
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(-50%);
}

.types-tree::after {
    content: '';
    position: absolute;
    top: 0;
    left: 25%;
    right: 25%;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
}

.tree-node {
    background: white;
    color: #1a1a1a;
    padding: 0.5rem;
    text-align: center;
    border-radius: 8px;
    font-weight: 700;
    margin-bottom: 1.5rem;
    position: relative;
}

.tree-node::before {
    content: '';
    position: absolute;
    top: -1rem;
    /* Connect to horizontal line */
    left: 50%;
    width: 2px;
    height: 1rem;
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(-50%);
}

.tree-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tree-content li {
    font-size: 0.95rem;
    /* Increased size */
    margin-bottom: 0.75rem;
    /* Increased spacing */
    padding-left: 1.25rem;
    position: relative;
    opacity: 1;
    /* Full opacity */
    color: #ffffff;
    /* Force white */
    font-weight: 500;
    /* Slightly bolder */
    line-height: 1.4;
}

.tree-content li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #a8dadc;
    font-size: 1.2em;
    /* Larger bullet */
    top: -2px;
}

/* Bar Chart */
.bar-chart-visual {
    height: 100px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.bar {
    width: 20px;
    background: #f4d6cf;
    border-radius: 4px 4px 0 0;
    transition: height 0.5s ease;
}

.bento-card:hover .bar-1 {
    height: 50%;
}

.bento-card:hover .bar-2 {
    height: 75%;
}

.bento-card:hover .bar-3 {
    height: 95%;
}

.bar-1 {
    height: 38%;
    background: #f4d6cf;
}

.bar-2 {
    height: 58%;
    background: #f2b7ad;
}

.bar-3 {
    height: 80%;
    background: #f48d83;
}

.growth-arrow-bg {
    position: absolute;
    top: 0;
    right: 0;
    width: 130%;
    height: 130%;
    color: rgba(255, 255, 255, 0.18);
    /* Subtle overlay arrow */
    transform: translate(8%, -12%) rotate(-2deg);
    pointer-events: none;
    transition: transform 0.6s ease-out;
}

.growth-arrow-bg svg {
    stroke: currentColor;
    stroke-width: 9;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.75;
}

.bento-card:hover .growth-arrow-bg {
    transform: translate(2%, -16%) scale(1.06) rotate(-2deg);
    color: rgba(255, 255, 255, 0.26);
}

/* Benefits visual (linear infographic) */
.benefits-visual {
    background: #eaddcf;
    border-radius: 24px;
    padding: 3rem 2rem 4rem;
    position: relative;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
    margin-top: 1rem;
}

.benefits-heading {
    text-align: center;
    margin-bottom: 2.5rem;
}

.benefits-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: #111827;
    margin: 0;
}

.benefits-subtitle {
    font-size: 1.1rem;
    font-weight: 600;
    color: #111827;
    margin-top: 0.5rem;
}

.benefits-track {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    align-items: center;
    gap: 1rem;
    padding: 1rem 0 3rem;
}

.benefits-track::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 5%;
    right: 5%;
    border-top: 2px dashed #111827;
    transform: translateY(-50%);
    z-index: 0;
}

.benefit-node {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    z-index: 1;
    min-height: 220px;
}

.benefit-node.up {
    justify-content: flex-start;
}

.benefit-node.down {
    justify-content: flex-end;
}

.benefit-icon {
    width: 80px;
    height: 80px;
    border-radius: 6px;
    display: grid;
    place-items: center;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.benefit-icon.light {
    background: #ffffff;
    color: #141b2f;
}

.benefit-icon.red {
    background: #cd2e26;
    color: #ffffff;
}

.benefit-icon svg {
    width: 36px;
    height: 36px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.4;
}

.benefit-icon.red svg {
    stroke-width: 1.6;
}

.benefit-connector {
    width: 2px;
    height: 42px;
    background: #111827;
}

.benefit-node.up .benefit-connector {
    order: 2;
}

.benefit-node.up .benefit-label {
    order: 3;
}

.benefit-node.down .benefit-connector {
    order: 0;
}

.benefit-label {
    font-weight: 800;
    color: #111827;
    font-size: 1.05rem;
    text-align: center;
}

.benefits-footer {
    text-align: center;
    color: #4b5563;
    font-weight: 600;
    margin-top: 0.5rem;
}

@media (max-width: 900px) {
    .benefits-track {
        grid-template-columns: repeat(2, 1fr);
        row-gap: 2rem;
    }

    .benefit-node {
        min-height: 180px;
    }
}

@media (max-width: 640px) {
    .benefits-visual {
        padding: 2rem 1.5rem 3rem;
    }

    .benefits-track {
        grid-template-columns: 1fr;
        padding: 1rem 0 2rem;
    }

    .benefit-node {
        min-height: 0;
        flex-direction: row;
        justify-content: flex-start;
        gap: 1rem;
    }

    .benefit-node.up .benefit-connector,
    .benefit-node.down .benefit-connector {
        order: 1;
        height: 28px;
    }

    .benefit-label {
        order: 2;
        text-align: left;
    }

    .benefits-track::before {
        display: none;
    }
}

.relative {
    position: relative;
}

.z-10 {
    position: relative;
    z-index: 10;
}

/* Responsive */
@media (max-width: 768px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }

    .span-full {
        grid-column: auto;
    }

    .types-tree {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .types-tree::after,
    .types-tree::before,
    .tree-node::before {
        display: none;
        /* Hide connectors on mobile for simpler stack */
    }
}

/* Split CTA Section Styles */
.cta-split-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 5rem;
    margin-bottom: 6rem !important;
}

@media (min-width: 768px) {
    .cta-split-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.cta-card {
    border-radius: 12px;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    height: 100%;
}

/* Left Card - Contact/Expert (Matches original CTA style) */
.cta-card.primary {
    background: linear-gradient(130deg, rgba(36, 52, 74, 0.95) 0%, rgba(140, 28, 42, 0.92) 55%, rgba(215, 174, 99, 0.35) 100%);
    color: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.cta-card.primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 85% 20%, rgba(215, 174, 99, 0.18) 0%, transparent 55%), radial-gradient(circle at 20% 85%, rgba(255, 255, 255, 0.1) 0%, transparent 45%);
    mix-blend-mode: screen;
    pointer-events: none;
}

.cta-card.primary h3 {
    color: white !important;
    font-size: 1.75rem;
    margin-bottom: 1rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.cta-card.primary p {
    color: rgba(255,255,255,0.92);
    margin-bottom: 2rem;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

.cta-card.primary .btn {
    align-self: flex-start;
    position: relative;
    z-index: 1;
    background: #cd2e26;
    color: #ffffff;
    border-color: #cd2e26;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

.cta-card.primary .btn:hover,
.cta-card.primary .btn:focus {
    background: #b7261f;
    color: #ffffff;
    border-color: #b7261f;
}

/* Right Card - Next Page */
.cta-card.secondary {
    background: white;
    border: 1px solid #ececec;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    text-decoration: none;
    transition: all 0.3s ease;
}

.cta-card.secondary:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
    border-color: #cd2e26;
}

.cta-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    color: #cd2e26;
    margin-bottom: 1rem;
    display: block;
}

.cta-card.secondary h3 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: #1a1b1f !important;
    font-weight: 700;
    line-height: 1.3;
}

.cta-card.secondary p {
    color: #5a5a5a;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.read-more-link {
    font-weight: 700;
    color: #cd2e26;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
    font-size: 1.1rem;
}

.read-more-link svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.cta-card.secondary:hover .read-more-link svg {
    transform: translateX(5px);
}
