/* Fun version of the terms: one collapsible card per rule, as wide as the page's
   green banner. Open a card to read it (and play its clip). */

.fun-tldr {
    margin: 2rem 0 1.5rem;
    padding: 20px 24px;
    border: 2px dashed var(--accent, #0d6efd);
    border-radius: 12px;
}

.fun-tldr h2 {
    margin: 0 0 0.75rem;
    font-size: 1.2rem;
}

.fun-tldr ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.fun-tldr li {
    margin: 0 0 0.35rem;
}

.fun-tldr li span {
    display: inline-block;
    width: 1.6em;
}

/* Contents as chips that wrap, instead of a long numbered list. */
.fun-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 2rem;
}

.fun-chips a {
    padding: 4px 12px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 999px;
    font-size: 0.88rem;
    text-decoration: none;
    color: inherit;
}

.fun-chips a:hover,
.fun-chips a:focus-visible {
    border-color: var(--accent, #0d6efd);
    color: var(--accent, #0d6efd);
}

/* ---- The rule cards ---- */
.fun-rule {
    margin: 0 0 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.02);
    scroll-margin-top: 90px;
}

.fun-rule[open] {
    background: #fff;
    border-color: var(--accent, #0d6efd);
}

.fun-rule > summary {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    cursor: pointer;
    list-style: none;
}

.fun-rule > summary::-webkit-details-marker {
    display: none;
}

/* Chevron that turns when the card opens. */
.fun-rule > summary::after {
    content: "";
    flex: none;
    width: 9px;
    height: 9px;
    margin-left: auto;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    opacity: 0.6;
}

.fun-rule[open] > summary::after {
    transform: rotate(-135deg);
}

.fun-rule > summary:focus-visible {
    outline: 2px solid var(--accent, #0d6efd);
    outline-offset: 2px;
    border-radius: 12px;
}

.fun-rule h2 {
    margin: 0;
    font-size: 1.1rem;
}

.fun-rule-num {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: var(--accent, #0d6efd);
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
}

.fun-rule-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    align-items: center;
    padding: 0 18px 18px;
}

.fun-rule-text p:last-child {
    margin-bottom: 0;
}

.fun-aside {
    padding-left: 12px;
    border-left: 3px solid var(--accent, #0d6efd);
    font-style: italic;
}

.fun-rule-media {
    min-width: 0;
}

/* The clips come in different sizes: scale each one down to its column (and to
   240px tall at most), keeping its proportions from the width/height attributes. */
.fun-clip {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 240px;
    margin: 0 auto;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.06);
}

.fun-outro {
    margin: 2.5rem auto 0;
    text-align: center;
}

.fun-outro p {
    margin: 1rem 0;
    font-size: 1.1rem;
}

.fun-outro-link {
    display: inline-block;
    padding: 8px 18px;
    border: 1px solid var(--accent, #0d6efd);
    border-radius: 999px;
    text-decoration: none;
}

@media (min-width: 768px) {
    .fun-rule-body {
        grid-template-columns: 1fr 240px;
        gap: 1.5rem;
        padding: 0 24px 22px 64px;  /* text lines up with the title, after the number */
    }

    .fun-rule--plain .fun-rule-body {
        grid-template-columns: 1fr;
    }
}
