/* =========================================
   1. VARIABLES & RESET
   ========================================= */
:root {
    /* Brand Colors */
    --brand-green: #6e9675;          /* Sage Green */
    --brand-green-hover: #5a7d60;    /* Darker Green for hover */
    --brand-cream: #faf9f6;          /* Off-white background */
    --brand-text: #333333;           /* Dark Grey text */
    --brand-text-light: #555555;     /* Lighter Grey for descriptions */

    /* Typography */
    --brand-font-serif: "Times New Roman", Times, serif;
    --brand-font-sans: "Open Sans", Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--brand-cream);
    color: var(--brand-text);
    font-family: var(--brand-font-sans);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased; /* Smoother text on Mac */
}

/* =========================================
   2. GENERAL LAYOUT UTILITIES
   ========================================= */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: 60px;
}

.page-header h1 {
    font-family: var(--brand-font-serif);
    font-size: 3em;
    color: #2c2c2c;
    margin-bottom: 10px;
}

.page-header p {
    font-size: 1.2em;
    color: #666;
    max-width: 700px;
    margin: 0 auto;
}

/* =========================================
   3. TESTS LAYOUT (MASONRY FIX)
   ========================================= */
/* This replaces the CSS Grid with CSS Columns (Masonry)
   to fix the large gap issue when expanding cards. */
.tests-grid {
    display: flex;       /* Enables Flexbox layout */
    flex-wrap: wrap;     /* Allows items to wrap to next line */
    gap: 30px;           /* Space between cards */
    justify-content: center; /* Centers cards if the row isn't full */
}
/* =========================================
   4. TEST CARD STYLES
   ========================================= */
.test-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    border-top: 5px solid var(--brand-green);

    /* Layout Logic */
    display: flex;
    flex-direction: column;
    width: calc(33.333% - 30px); /* 3 cards per row */
    box-sizing: border-box;

    /* IMPORTANT: This ensures the card stretches to fill the row height */
    height: 100%;

    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.test-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.test-card h2 {
    font-family: var(--brand-font-serif), sans-serif;
    font-size: 1.8em;
    margin-top: 0;
    margin-bottom: 15px;
    color: #2c2c2c;
    line-height: 1.2;
}

.test-desc {
    font-size: 0.95em;
    color: var(--brand-text-light);
    margin-bottom: 20px;

    /* REMOVED: flex-grow: 1; */
    /* This allows the button to sit naturally under the text */
}
/* =========================================
   5. INTERPRETATION & DETAILS (Toggle)
   ========================================= */
details {
    margin-bottom: 20px;
    cursor: pointer;
}

summary {
    font-weight: 600;
    color: var(--brand-green);
    outline: none;
    list-style: none; /* Removes default triangle in some browsers */
}

/* Custom triangle indicator */
summary::-webkit-details-marker {
    display: none;
}
summary::after {
    content: " ▼";
    font-size: 0.8em;
    vertical-align: middle;
}
details[open] summary::after {
    content: " ▲";
}

.interpretation-box {
    background-color: #f4f8f5;
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
    font-size: 0.9em;
    border-left: 3px solid var(--brand-green);
    color: #444;
}

.interpretation-box strong {
    display: block;
    margin-bottom: 8px;
    color: var(--brand-green);
    font-family: var(--brand-font-serif);
    font-size: 1.1em;
}

.interpretation-box ul {
    margin: 0;
    padding-left: 20px;
}

.interpretation-box li {
    margin-bottom: 5px;
}

/* =========================================
   6. BUTTONS
   ========================================= */
.btn-test {
    display: block;
    width: 100%;
    padding: 14px 0;
    margin-top: auto; /* Keeps it at bottom if you want, OR remove this to let it float up */
    background-color: var(--brand-green);
    color: white;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    border-radius: 6px;
    transition: background-color 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-test:hover {
    background-color: var(--brand-green-hover);
}

/* =========================================
   7. FOOTER / DISCLAIMER
   ========================================= */
.disclaimer {
    margin-top: 50px;
    font-size: 1.3em;
    color: #888;
    font-style: italic;
    padding: 0 20px;
}

.disclaimer__title {
    color: black;
    font-style: normal;
}

.disclaimer a {
    color: var(--brand-green);
    text-decoration: none;
    border-bottom: 1px dotted var(--brand-green);
}

.disclaimer a:hover {
    border-bottom: 1px solid var(--brand-green);
}

/* =========================================
   8. RESPONSIVE MEDIA QUERIES
   ========================================= */

/* Tablets and smaller laptops */
@media (max-width: 1000px) {
    .tests-grid {
        column-count: 2; /* Switch to 2 columns */
    }

    .page-header h1 {
        font-size: 2.5em;
    }

    .test-card {
        width: calc(50% - 30px); /* 2 cards per row on tablets */
    }
}

/* Mobile Devices */
@media (max-width: 600px) {
    .test-card {
        width: 100%; /* 1 card per row on mobile */
    }

    .tests-grid {
        column-count: 1; /* Switch to single column stack */
    }

    .container {
        padding: 20px 15px;
    }

    .page-header h1 {
        font-size: 2em;
    }

    .test-.test-card {
        background: #ffffff;
        border-radius: 12px;
        padding: 30px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.05);
        border-top: 5px solid var(--brand-green);

        /* EQUAL HEIGHT MAGIC */
        display: flex;
        flex-direction: column; /* Stacks content vertically */
        width: calc(33.333% - 30px); /* 3 cards per row (minus gap) */
        box-sizing: border-box;

        /* Animation */
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }card {
        padding: 20px;
    }
}