/* Rules pages (rules*.html; rules-outdoor.html is generated by scripts/wfdf_rules.py) */
.rules h3 {
    margin-top: 40px;
    margin-bottom: 16px;
    scroll-margin-top: 16px;
}
.rules .ruleList, .rules .ruleList ol {
    list-style: none;
    margin: 0;
    color: var(--color-muted);
}
.rules .ruleList ol {
    padding-left: 24px;
}
.rules .ruleList li {
    margin: 0 0 8px;
}
.rules .ruleList ol li:first-child {
    margin-top: 8px;
}
.rules li[id]:target > .ruleText, .rules details:target > summary {
    background: #fff3c4;
}
/* Headings link to themselves (#id URL to copy); a # appears on hover */
.rules h3 .headingLink {
    color: inherit;
    text-decoration: none;
}
.rules h3 .headingLink::after {
    content: "#";
    margin-left: 8px;
    color: var(--color-muted);
    opacity: 0;
}
.rules h3 .headingLink:hover::after, .rules h3 .headingLink:focus-visible::after {
    opacity: 1;
}
.ruleNumber {
    font-weight: bold;
    text-decoration: none;
    margin-right: 6px;
}
.rules .ruleNumber {
    color: var(--color-dark);
}
.rulesSource {
    font-size: 14px;
}
.rulesToggle {
    font: inherit;
    font-size: 14px;
    padding: 6px 14px;
    color: var(--color-dark);
    background: #f2f2f2;
    border: 1px solid var(--color-grey);
    border-radius: 4px;
    cursor: pointer;
}
.rulesToggle:hover {
    background: var(--color-light);
}
.rules .rulesContents {
    list-style: none;
}
.rulesFigure {
    margin: 16px 0;
}
.rulesFigure img {
    display: block;
    width: 100%;
    max-width: 600px;
}
.rulesFigure figcaption {
    font-size: 14px;
}
.rulesTableWrap {
    overflow-x: auto;
    margin: 0 0 24px;
}
.text .rulesTable {
    border-collapse: collapse;
    font-size: 14px;
    margin: 0;
}
.rulesTable th, .rulesTable td {
    text-align: left;
    vertical-align: top;
    padding: 6px 16px 6px 0;
    border-bottom: 1px solid #e0e0e0;
}
.rulesTable th {
    color: var(--color-dark);
}
.rules .rulesNutshell, /* Key rules block at the top of rules-indoor/mixed/5v5.md: navy panel like the rules choice cards */
.rules .rulesSummary {
    max-width: 600px;
    box-sizing: border-box;
    margin: 0 0 24px;
    padding: 16px 20px 6px;
    background: var(--color-accent);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 15px;
    line-height: 1.5;
    text-align: left;
}
.rules .rulesSummary::before {
    content: "Key rules";
    display: block;
    margin-bottom: 8px;
    font-family: PrimaryFont;
    font-size: 22px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #fff;
}
.rules .rulesSummary li {
    position: relative;
    margin: 0;
    padding: 10px 0 10px 150px;
    list-style: none;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
}
.rules .rulesSummary li::marker {
    content: none;
}
.rules .rulesSummary strong {
    color: #fff;
}
.rules .rulesSummary li > strong:first-child {
    position: absolute;
    left: 0;
    top: 11px;
    width: 140px;
    font-family: PrimaryFont;
    font-weight: normal;
    font-size: 15px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    opacity: 0.75;
}
@media only screen and (max-width: 500px) {
    .rules .rulesSummary li {
        padding-left: 0;
    }
    .rules .rulesSummary li > strong:first-child {
        position: static;
        display: block;
        width: auto;
    }
}
.rules:has(> .rulesChoice) {
    container-type: inline-size;
}
.rulesChoice {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    max-width: 1200px;
    margin: 0 0 24px;
}
.text a.rulesChoiceItem.rulesChoiceBase {
    grid-column: 1 / -1;
    aspect-ratio: 3 / 1;
    background-position: center 75%;
}
.text a.rulesChoiceItem:not(.rulesChoiceBase) {
    aspect-ratio: 16 / 9;
}
.text a.rulesChoiceItem.rulesChoiceWide {
    grid-column: 1 / -1;
    aspect-ratio: 4 / 1;
}
.rulesChoiceBase .rulesChoiceTitle {
    font-size: 28px;
}
@container (max-width: 600px) {
    .rulesChoice {
        grid-template-columns: 1fr;
    }
    .text a.rulesChoiceItem.rulesChoiceBase {
        aspect-ratio: 16 / 9;
    }
    .text a.rulesChoiceItem:not(.rulesChoiceBase) {
        aspect-ratio: 3 / 1;
    }
    .text a.rulesChoiceItem.rulesChoiceWide {
        aspect-ratio: 3 / 1;
    }
}
.text a.rulesChoiceItem.rulesChoiceShort {
    aspect-ratio: auto;
    min-height: 88px;
    padding-right: 184px;
}
.text a.rulesChoiceItem > .rulesChoiceLogo {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    height: 40px;
    padding: 8px 12px;
    background: #fff;
    border-radius: 4px;
}
.text a.rulesChoiceItem {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    aspect-ratio: 4 / 3;
    padding: 14px 16px;
    background-color: var(--color-accent);
    background-size: cover;
    background-position: center;
    border-radius: 4px;
    overflow: hidden;
    color: #fff;
    font-size: 14px;
    line-height: 1.4;
    text-align: left;
    text-decoration: none;
}
.text a.rulesChoiceItem::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(28, 48, 126, 0.9), rgba(28, 48, 126, 0.55) 40%, rgba(28, 48, 126, 0.1) 75%);
    transition: background-color 0.2s;
}
.text a.rulesChoiceItem:hover::before {
    background-color: rgba(28, 48, 126, 0.3);
}
.rulesChoiceItem > * {
    position: relative;
}
.text a.rulesChoiceItem > .rulesChoiceSeason {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 2px 8px;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}
.rulesChoiceTitle {
    display: block;
    margin-bottom: 2px;
    font-size: 20px;
    font-weight: bold;
}

.annotation {
    margin: 8px 0;
    background: #f2f2f2;
    border-left: 4px solid var(--color-grey);
    border-radius: 4px;
    font-size: 14px;
}
.annotation[open] {
    border-left-color: var(--color-dark);
}
.annotation summary {
    padding: 6px 12px;
    cursor: pointer;
    color: var(--color-dark);
}
.annotationLabel {
    font-weight: bold;
    margin-right: 4px;
}
.annotationBody {
    padding: 0 12px 4px;
}
.text .annotationBody p, .text .annotationBody ul {
    margin: 0 0 12px;
}
.text .annotationBody ul {
    padding-left: 20px;
    list-style-position: outside;
}
.annotationRow {
    display: flex;
    gap: 12px;
    border-top: 1px solid #e0e0e0;
    padding-top: 8px;
}
.annotationRow:first-child {
    border-top: none;
    padding-top: 0;
}
.annotationRowLabel {
    flex: 0 0 64px;
    font-weight: bold;
    color: var(--color-dark);
}
.annotationRowText {
    flex: 1;
    min-width: 0;
}

.ruleDefinitions {
    margin: 0 0 24px;
    color: var(--color-muted);
}
.ruleDefinitions dt {
    font-weight: bold;
    color: var(--color-dark);
}
.ruleDefinitions dd {
    margin: 0 0 12px 24px;
}
.text .ruleDefinitions p, .text .ruleDefinitions ul {
    margin: 0 0 6px;
}
.text .ruleDefinitions ul {
    padding-left: 20px;
    list-style-position: outside;
}

.signalGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 24px 16px;
    margin: 24px 0;
}
.text .signal {
    margin: 0;
    font-size: 14px;
    text-align: left;
}
.signal img {
    display: block;
    height: 140px;
    max-width: 100%;
    object-fit: contain;
    margin: 0 auto 8px;
}
.signal figcaption > * {
    display: block;
}
.signalCalls {
    color: var(--color-muted);
    font-style: italic;
}

.rulesSidebar {
    position: sticky;
    top: 16px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
}
.rulesSidebarList {
    list-style: none;
    padding: 0;
    margin: 0 0 32px;
    font-size: 14px;
    line-height: 1.7;
}
.rulesSidebarList a {
    color: var(--color-dark);
    text-decoration: none;
}
.rulesSidebarList a:hover {
    text-decoration: underline;
}
@media only screen and (max-width: 600px) {
    /* justified text leaves big gaps in a narrow column */
    .rules {
        text-align: left;
    }
    .rules .ruleList ol {
        padding-left: 12px;
    }
    .rules .rulesContents {
        margin-top: 16px;
        line-height: 1.7;
    }
    .signalGrid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px 12px;
    }
    .signal img {
        height: 110px;
    }
    .annotationRow {
        flex-direction: column;
        gap: 0;
    }
}
@media only screen and (min-width: 940px) {
    .rules .rulesContents {
        display: none;
    }
}
