/*
 * Lottery results accordion.
 *
 * Reproduces the look of the hand-built Elementor accordion (nested accordion +
 * nested tabs + ElementsKit buttons) so the generated version is visually
 * identical, without depending on Elementor's per-element generated CSS.
 *
 * Every rule is scoped under .stdavids-lottery, and headings and buttons carry
 * their element name too: the theme and the Elementor kit both style bare h2 and
 * button elements from stylesheets that load after this one, so the component
 * needs the extra specificity to hold its own values.
 *
 * Breakpoints follow Elementor's defaults: 1024px (tablet) and 767px (mobile).
 */

.stdavids-lottery {
    --stdavids-lottery-purple: var(--e-global-color-stdavidspurple, #5B2D87);
    --stdavids-lottery-teal: var(--e-global-color-stdavidsteal, #25B39D);
    --stdavids-lottery-blue: var(--e-global-color-stdavidsblue, #00437A);
    --stdavids-lottery-grey: #F1F2F3;
    --stdavids-lottery-draw-text: #71737A;

    width: 100%;
}

/* --- Year / section accordion ------------------------------------------ */

.stdavids-lottery .stdavids-lottery__section {
    margin: 0 0 14px;
}

.stdavids-lottery .stdavids-lottery__section:last-child {
    margin-bottom: 0;
}

.stdavids-lottery .stdavids-lottery__section-title {
    display: flex;
    align-items: center;
    padding: 16px 32px;
    background-color: var(--stdavids-lottery-purple);
    color: #fff;
    border-radius: 24px;
    cursor: pointer;
    list-style: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Hide the native disclosure triangle in every engine. */
.stdavids-lottery .stdavids-lottery__section-title::-webkit-details-marker {
    display: none;
}

.stdavids-lottery .stdavids-lottery__section-title::marker {
    content: "";
}

.stdavids-lottery .stdavids-lottery__section-title:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -4px;
}

.stdavids-lottery .stdavids-lottery__section-title-text {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.3;
    color: #fff;
}

.stdavids-lottery .stdavids-lottery__panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 10px;
}

/* --- Month tabs --------------------------------------------------------- */

.stdavids-lottery .stdavids-lottery__tabs {
    display: flex;
    flex-direction: row;
    gap: 34px;
    align-items: flex-start;
}

.stdavids-lottery .stdavids-lottery__tablist {
    display: flex;
    flex: 0 0 240px;
    flex-direction: column;
    flex-wrap: wrap;
    gap: 10px;
}

.stdavids-lottery .stdavids-lottery__tabpanels {
    flex: 1 1 auto;
    min-width: 0;
}

.stdavids-lottery button.stdavids-lottery__tab {
    width: 100%;
    margin: 0;
    padding: 14px 17px;
    border: 0;
    border-radius: 42px;
    background-color: var(--stdavids-lottery-grey);
    color: var(--stdavids-lottery-blue);
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    line-height: 16px;
    letter-spacing: normal;
    text-align: center;
    text-transform: none;
    box-shadow: none;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.stdavids-lottery button.stdavids-lottery__tab:hover,
.stdavids-lottery button.stdavids-lottery__tab:focus,
.stdavids-lottery button.stdavids-lottery__tab[aria-expanded="true"] {
    background-color: var(--stdavids-lottery-teal);
    color: #fff;
}

/* --- Month panel -------------------------------------------------------- */

.stdavids-lottery .stdavids-lottery__tabpanel {
    background-color: var(--stdavids-lottery-teal);
    border-radius: 12px;
}

.stdavids-lottery .stdavids-lottery__tabpanel[hidden] {
    display: none;
}

.stdavids-lottery .stdavids-lottery__tabpanel-inner,
.stdavids-lottery .stdavids-lottery__text-section {
    display: flex;
    flex-direction: column;
    gap: 13px;
    padding: 10px;
}

.stdavids-lottery .stdavids-lottery__text-section {
    background-color: var(--stdavids-lottery-teal);
    border-radius: 12px;
}

.stdavids-lottery h2.stdavids-lottery__month-heading {
    margin: 20px 0 8px;
    padding: 0;
    color: #fff;
    font-family: inherit;
    /* The parent theme forces `.post-entry h2` sizes with !important. */
    font-size: 32px !important;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
}

.stdavids-lottery .stdavids-lottery__text-content {
    color: #fff;
    text-align: center;
}

.stdavids-lottery .stdavids-lottery__text-content > :last-child {
    margin-bottom: 0;
}

/* --- Draw buttons ------------------------------------------------------- */

.stdavids-lottery .stdavids-lottery__draw {
    text-align: center;
}

.stdavids-lottery .stdavids-lottery__draw-link {
    display: inline-flex;
    align-items: center;
    width: auto;
    margin: 0;
    padding: 20px 24px;
    border: 0;
    border-radius: 10px;
    background-color: #fff;
    color: var(--stdavids-lottery-draw-text);
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    line-height: 16px;
    text-decoration: none;
    transition: 0.4s ease-in;
}

.stdavids-lottery a.stdavids-lottery__draw-link:hover,
.stdavids-lottery a.stdavids-lottery__draw-link:focus {
    background-color: var(--stdavids-lottery-blue);
    color: #fff;
    text-decoration: none;
}

/* A draw listed before its PDF is available. */
.stdavids-lottery .stdavids-lottery__draw-link--empty {
    cursor: default;
}

.stdavids-lottery .stdavids-lottery__draw-icon {
    flex: 0 0 auto;
    width: 12px;
    height: 12px;
    margin-left: 10px;
}

/* --- Tablet ------------------------------------------------------------- */

@media (max-width: 1024px) {
    .stdavids-lottery h2.stdavids-lottery__month-heading {
        font-size: 36px !important;
    }

    .stdavids-lottery .stdavids-lottery__draw-link {
        padding: 14px 15px;
    }

    .stdavids-lottery .stdavids-lottery__draw-icon {
        width: 10px;
        height: 10px;
    }
}

/* --- Mobile ------------------------------------------------------------- */

/*
 * Each month's results sit directly beneath its own button. Dissolving the two
 * wrappers lets the buttons and panels share one flex context, where the order
 * set on each element interleaves them.
 */
@media (max-width: 767px) {
    .stdavids-lottery .stdavids-lottery__tabs {
        flex-direction: column;
        /* Stacked, both the buttons and the panels run the full width. */
        align-items: stretch;
        gap: 10px;
    }

    .stdavids-lottery .stdavids-lottery__tablist,
    .stdavids-lottery .stdavids-lottery__tabpanels {
        display: contents;
    }

    .stdavids-lottery button.stdavids-lottery__tab,
    .stdavids-lottery .stdavids-lottery__tabpanel {
        order: var(--stdavids-lottery-order, 0);
    }

    .stdavids-lottery .stdavids-lottery__tabpanel-inner {
        padding: 8px 8px 24px;
    }

    .stdavids-lottery h2.stdavids-lottery__month-heading {
        font-size: 26px !important;
    }

    .stdavids-lottery .stdavids-lottery__section-title {
        padding: 14px 20px;
    }

    .stdavids-lottery .stdavids-lottery__section-title-text {
        font-size: 20px;
    }
}
