/* Schoolvoetbal Spelregels - Plugin Styles
   Alle regels met .spelregels-container prefix voor hogere specificity
   zodat WordPress theme styles niet interfereren.
*/

:root {
    --spelregels-icon-bg: var(--wp--preset--color--custom-very-light-blue, #def1fb);
    --spelregels-icon-color: var(--wp--preset--color--custom-primary-blue, #003d7c);
    --spelregels-border: var(--wp--preset--color--custom-borders, #dddddd);
    --spelregels-title: var(--wp--preset--color--custom-text-primary, #333333);
    --spelregels-details-bg: var(--wp--preset--color--custom-background-light-gray, #f8f8f8);
    --spelregels-highlight-bg: #fef9e6;
    --spelregels-highlight-border: var(--wp--preset--color--custom-accent-green, #6cbe57);
}

/* ───── Container ───── */
.spelregels-container {
    background: var(--wp--preset--color--custom-white, #ffffff);
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 61, 124, 0.08);
    overflow: hidden;
    font-size: 0;
}

/* ───── Regel row (details of div element) ───── */
.spelregels-container .regel-row {
    border-top: 1px solid var(--spelregels-border);
    border-bottom: none;
    margin: 0;
    padding: 0;
    font-size: 1rem;
}

/* Statische row: geen cursor, geen hover */
.spelregels-container .regel-row--static .regel-header {
    cursor: default;
}

.spelregels-container .regel-row:first-child {
    border-top: none;
}

.spelregels-container .regel-row:first-child > .regel-header {
    padding-top: 18px;
}

.spelregels-container .regel-row:last-child > .regel-header {
    padding-bottom: 18px;
}

/* Reset native details/summary markers */
.spelregels-container details.regel-row > summary {
    list-style: none;
}

.spelregels-container details.regel-row > summary::-webkit-details-marker {
    display: none;
}

.spelregels-container details.regel-row > summary::marker {
    display: none;
    content: "";
}

.spelregels-container details.regel-row > summary:focus {
    outline: none;
}

/* Open state: geen achtergrond op mobiel (dat doet de details-inner al) */

/* ───── Header (summary): MOBIEL EERST ─────
   Mobiel grid:
   [icon ] [title  ] [chevron]
   [     ] [chip   ] [       ]
*/
.spelregels-container .regel-header {
    display: grid;
    grid-template-columns: 42px 1fr auto;
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 12px;
    row-gap: 2px;
    padding: 12px 16px;
    margin: 0;
    cursor: pointer;
    transition: background 0.15s ease;
}

/* Hover alleen op apparaten met echte muis, niet op statische rows */
@media (hover: hover) {
    .spelregels-container details.regel-row > summary.regel-header:hover {
        background: rgba(108, 190, 87, 0.04);
    }
}

/* Icon: kolom 1, spant beide rijen als er een chip is */
.spelregels-container .regel-icon {
    grid-column: 1;
    grid-row: 1 / 3;
    width: 42px;
    height: 42px;
    background: var(--spelregels-icon-bg);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
    align-self: center;
    margin: 0;
    padding: 0;
}

/* Title: kolom 2, rij 1 */
.spelregels-container .regel-title {
    grid-column: 2;
    grid-row: 1;
    font-weight: 600;
    color: var(--spelregels-title);
    font-size: 1rem;
    margin: 0;
    padding: 0;
}

/* Chevron: kolom 3 (altijd uiterst rechts), rij 1 */
.spelregels-container .regel-chevron {
    grid-column: 3;
    grid-row: 1;
    color: var(--wp--preset--color--custom-text-secondary, #666666);
    transition: transform 0.25s ease;
    font-size: 0.75rem;
    flex-shrink: 0;
    opacity: 0.6;
    margin: 0;
    padding: 0;
}

.spelregels-container details.regel-row[open] .regel-chevron {
    transform: rotate(180deg);
}

/* Chip: kolom 2, rij 2 — links onder de titel
   Mobiel: platte tekst (geen achtergrond/border)
   Desktop: badge-stijl via media query
*/
.spelregels-container .regel-chip {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
    background: transparent;
    padding: 0;
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--wp--preset--color--custom-text-secondary, #666666);
    font-weight: 400;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: none;
    margin: 0;
}

.spelregels-container .regel-chip--blauw {
    color: var(--wp--preset--color--custom-primary-blue, #003d7c);
}

.spelregels-container .regel-chip--groen {
    color: var(--wp--preset--color--custom-dark-green, #5ba249);
}

.spelregels-container .regel-chip::before {
    content: "\21B3";
    opacity: 0.5;
    font-weight: normal;
}

/* ───── Details panel (content) ───── */
.spelregels-container .regel-details {
    padding: 2px 16px 12px 16px;
    margin: 0;
    color: var(--wp--preset--color--custom-text-secondary, #666666);
    font-size: 0.9rem;
}

.spelregels-container .regel-details-inner {
    background: var(--spelregels-details-bg);
    border-radius: 8px;
    padding: 10px 14px;
    margin: 0;
}

.spelregels-container .regel-details p {
    margin: 0 0 6px 0;
    padding: 0;
}

.spelregels-container .regel-details p:last-child {
    margin-bottom: 0;
}

.spelregels-container .regel-details ul {
    margin: 6px 0 0 0;
    padding: 0 0 0 20px;
}

.spelregels-container .regel-details li {
    margin: 0 0 3px 0;
    padding: 0;
}

.spelregels-container .regel-details li:last-child {
    margin-bottom: 0;
}

.spelregels-container .regel-details strong {
    color: var(--wp--preset--color--custom-primary-blue, #003d7c);
    font-weight: 600;
}

/* ───── Highlight box ───── */
.spelregels-container .highlight-box {
    background: var(--spelregels-highlight-bg);
    border-left: 3px solid var(--spelregels-highlight-border);
    padding: 10px 12px;
    margin: 10px 0 0 0;
    border-radius: 0 6px 6px 0;
    font-size: 0.85rem;
    color: var(--wp--preset--color--custom-text-primary, #333333);
}

.spelregels-container .highlight-box strong {
    color: var(--wp--preset--color--custom-dark-green, #5ba249);
}

/* ───── Desktop (≥500px) ─────
   Desktop grid: alles op 1 rij
   [icon] [title] [chip] [chevron]
*/
@media (min-width: 500px) {
    .spelregels-container .regel-header {
        grid-template-columns: 42px 1fr auto auto;
        grid-template-rows: auto;
        padding: 14px 20px;
    }

    .spelregels-container .regel-icon {
        grid-row: 1;
    }

    .spelregels-container .regel-chip {
        grid-column: 3;
        grid-row: 1;
        justify-self: end;
        background: var(--wp--preset--color--custom-background-light-gray, #f8f8f8);
        padding: 3px 10px;
        font-weight: 600;
        font-size: 0.78rem;
        border: 1px solid var(--wp--preset--color--custom-borders, #dddddd);
    }

    .spelregels-container .regel-chip--blauw {
        background: var(--wp--preset--color--custom-very-light-blue, #def1fb);
        border-color: rgba(0, 61, 124, 0.15);
    }

    .spelregels-container .regel-chip--groen {
        background: var(--wp--preset--color--custom-light-green, #e6f4e2);
        border-color: rgba(91, 162, 73, 0.2);
    }

    .spelregels-container .regel-chip::before {
        display: none;
    }

    .spelregels-container .regel-chevron {
        grid-column: 4;
    }

    .spelregels-container .regel-details {
        padding: 2px 20px 14px 74px;
    }

    .spelregels-container .regel-details-inner {
        background: transparent;
        padding: 0;
    }

    /* Desktop: licht groene achtergrond op header bij open */
    .spelregels-container details.regel-row[open] > summary.regel-header {
        background: rgba(108, 190, 87, 0.04);
    }
}

/* ───── Print modus: alles open, geen interactie ───── */
.spelregels-container--print {
    padding: 15px 0;
}

.spelregels-container--print .regel-row {
    border-top: 1px solid var(--spelregels-border);
}

.spelregels-container--print .regel-row:first-child {
    border-top: 1px solid var(--spelregels-border);
}

.spelregels-container--print .regel-header {
    cursor: default;
}

.spelregels-container--print .regel-details {
    display: block;
}
