/* ================================ SECTIONS ================================ */
section {
    background: var(--color-bg);
    display: flex;
    flex-direction: column;
    justify-content: center;   /* vertical centering */
    align-items: center;       /* horizontal centering */
    min-height: 100vh;
    padding: 2rem 2rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity var(--transition-duration) ease-out, transform var(--transition-duration) ease-out;
}

section.visible { 
    opacity: 1; 
    transform: translateY(0); 
}

.section-label {
    display: inline-flex;
    align-items: center;
    padding: 0 1rem;
    font-family: 'Lazare Grotesk Trial', Arial, sans-serif !important;
    font-weight: bold;
    font-size: 2.5rem;
    letter-spacing: 1.7px;
    color: var(--color-accent-start);
    background: transparent; /* show background image underneath */
    border-radius: 8px; /* keep subtle rounding if needed */
    height: auto;
    line-height: 1.2;
    margin-bottom: 6.5rem; /* larger desktop spacing between label and title */
    margin-left: auto;  /* center label horizontally */
    margin-right: auto; /* center label horizontally */
}

main > section { margin-bottom: 7vh; }

main > section:last-child { margin-bottom: 0 !important; }

@media (max-width: 900px) {
    main > section { margin-bottom: 14vw; }
}

@media (max-width: 700px) {
    section {
        padding: 1.3rem 0.5rem;
        min-height: 80vh;
    }

    .section-label {
        font-size: 1.7rem !important;
        line-height: 1.3 !important;
        padding: 0 0.7rem !important;
        max-width: 90% !important;
        text-align: center !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        margin-left: auto !important;
        margin-right: auto !important;
        margin-bottom: 3rem !important; /* even larger space on mobile */
    }
}

@media (max-width: 600px) {
    main > section { margin-bottom: 14vw; }
}

/* Cards layout for features/proof */
.cards {
    margin-top: clamp(2rem, 6vw, 5rem); /* increase space below headings */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    width: 100%;
}

.card {
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(7,28,48,0.5);
    border-radius: 10px;
    padding: 1.25rem;
}

[data-theme="light"] .card {
    border-color: rgba(7,28,48,0.12);
    background: rgba(44,116,179,0.04);
}

.card h2 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

/* Center card content for Why and Proof sections */
#why .card,
#proof .card {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Center any direct text in the grid wrapper as well */
#why .cards,
#proof .cards {
    text-align: center;
}

/* Explicitly center headings and paragraphs inside cards */
#why .card h2,
#why .card p,
#proof .card h2,
#proof .card p {
    text-align: center;
}

/* Background images for Why and Proof sections */
#why, #proof {
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding-left: 0;   /* allow full-bleed background */
    padding-right: 0;  /* allow full-bleed background */
}

/* Center all section headings */
main > section h1 {
    text-align: center;
}

#why {
    background-image: url('../StockNavImages/ki.jpg');
}

#proof {
    background-image: url('../StockNavImages/pro.jpg');
}

/* Ensure image sections are readable in light mode */
[data-theme="light"] #why,
[data-theme="light"] #proof {
    color: #ffffff;
}

/* Make labels readable over images in light mode */
[data-theme="light"] #why .section-label,
[data-theme="light"] #proof .section-label {
    color: #ffffff;
}

/* Improve card contrast on image sections in light mode */
[data-theme="light"] #why .card,
[data-theme="light"] #proof .card {
    background: rgba(0,0,0,0.35);
    border-color: rgba(255,255,255,0.22);
}

/* Dark mode: make section headings white over image backgrounds */
[data-theme="dark"] #why h1,
[data-theme="dark"] #proof h1 {
    color: #ffffff;
}

/* Dark mode: mirror light-mode readability for entire section */
[data-theme="dark"] #why,
[data-theme="dark"] #proof {
    color: #ffffff;
}

/* Dark mode: make the top section labels white too */
[data-theme="dark"] #why .section-label,
[data-theme="dark"] #proof .section-label {
    color: #ffffff;
}

/* Center headings and labels for Why/Proof */
#why .section-label,
#proof .section-label {
    display: block;         /* allow auto margins to center */
    width: fit-content;     /* shrink to label width */
    margin-left: auto;
    margin-right: auto;
}

#why h1,
#proof h1 {
    text-align: center;
}

/* If a paragraph directly follows the H1, center it too */
#why h1 + p,
#proof h1 + p {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}
