/* Formula 1 guide -- copied from the NHL page's nhl.css, recoloured in
   F1 red on carbon black. Only f1/index.php uses this file. */

:root {
    --navy: #15151e;
    --navy-light: #26262f;
    --red: #e10600;
    --red-dark: #8a0400;
    --white: #f5f7fa;
    --muted: #b5b5bd;
}

* {
    box-sizing: border-box;
}

/* The background is a drawn pattern: a small chequered flag in faint red,
   repeated across the page. It's an SVG picture written right into the CSS. */
body {
    margin: 0;
    font-family: system-ui, sans-serif;
    line-height: 1.6;
    color: var(--white);
    background-color: var(--navy);
    /* First layer: the dark page fades into red at the very bottom, mirroring the header */
    background-image: linear-gradient(180deg, transparent calc(100% - 20rem), var(--red-dark)),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='%23e10600' fill-opacity='0.13'%3E%3Crect x='20' y='20' width='3' height='62'/%3E%3Crect x='23' y='20' width='12' height='10'/%3E%3Crect x='47' y='20' width='12' height='10'/%3E%3Crect x='35' y='30' width='12' height='10'/%3E%3Crect x='59' y='30' width='12' height='10'/%3E%3Crect x='23' y='40' width='12' height='10'/%3E%3Crect x='47' y='40' width='12' height='10'/%3E%3C/g%3E%3C/svg%3E");
}

a {
    color: #ff6b6b;
}

/* ---------- Header with the drivers ---------- */

header {
    text-align: center;
    padding: 2.5rem 1rem 1.5rem;
    background: linear-gradient(180deg, var(--red-dark), transparent);
    /* Red stripe along the bottom, like the start line on a track */
    border-bottom: 6px solid var(--red);
}

.eyebrow {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: clamp(2.1rem, 7vw, 3.5rem);
    font-weight: bold;
    line-height: 1.1;
    color: #000;
}

h1 {
    margin: 0.2rem 0;
    font-size: clamp(1.8rem, 6vw, 3rem);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-shadow: 3px 3px 0 var(--red);
}

.tagline {
    margin: 0 0 2rem;
    color: var(--muted);
}

.players {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
}

.player {
    position: relative; /* lets the bio card sit on top of the photo */
    margin: 0;
    width: 260px;
    border: 4px solid var(--white);
    border-radius: 10px;
    overflow: hidden;
    background: var(--navy-light);
    cursor: pointer;
}

.player img {
    display: block;
    width: 100%;
    height: 300px;
    object-fit: cover; /* crops both photos to the same size */
    object-position: top;
}

.player figcaption {
    padding: 0.6rem;
    font-weight: bold;
    background: var(--red);
}

.player figcaption span {
    display: block;
    font-weight: normal;
    font-size: 0.85rem;
}

/* The bio card: hidden until you hover (mouse) or tap/focus (phone, keyboard) */
.bio {
    position: absolute;
    inset: 0;
    padding: 1rem;
    text-align: left;
    background: rgba(21, 21, 30, 0.94);
    opacity: 0;
    transition: opacity 0.25s;
}

.player:hover .bio,
.player:focus .bio {
    opacity: 1;
}

.bio h3 {
    margin: 0 0 0.5rem;
    color: #ff6b6b;
}

.bio ul {
    margin: 0;
    padding-left: 1.1rem;
    font-size: 0.92rem;
}

.bio li {
    margin-bottom: 0.4rem;
}

.hint {
    margin: 1rem 0 0;
    font-size: 0.85rem;
    color: var(--muted);
}

/* ---------- Site menu (same links as the other pages) ---------- */

.site-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1.5rem;
    padding: 0.6rem 1rem;
    background: var(--navy);
    font-size: 0.9rem;
    font-weight: 600;
}

.site-nav a {
    color: var(--muted);
    text-decoration: none;
}

.site-nav a[aria-current="page"] {
    color: var(--white);
}

/* ---------- Jump menu ---------- */

.jump {
    position: sticky; /* stays at the top of the screen while you scroll */
    top: 0;
    z-index: 1;
    display: flex;
    flex-wrap: wrap; /* links drop to a second row on phones */
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--navy);
    border-bottom: 2px solid var(--red);
}

.jump a {
    padding: 0.3rem 0.8rem;
    color: var(--white);
    text-decoration: none;
    font-size: 0.9rem;
    border: 1px solid var(--red);
    border-radius: 999px;
}

.jump a:hover {
    background: var(--red);
}

/* ---------- Guide sections ---------- */

/* Two columns of boxes side by side; boxes in the same row get the same height */
main {
    max-width: 70rem;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* With 7 boxes the last one is on its own, so let it fill the whole row */
section:last-child {
    grid-column: 1 / -1;
}

/* On narrow screens there's no room for two, so go back to one column */
@media (max-width: 48rem) {
    main {
        grid-template-columns: 1fr;
    }
}

section {
    margin: 0;
    padding: 1.25rem 1.5rem;
    background: rgba(38, 38, 47, 0.92);
    border-left: 6px solid var(--red);
    border-radius: 8px;
    scroll-margin-top: 4.5rem; /* so the sticky menu doesn't cover the heading */
}

h2 {
    margin-top: 0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.icon {
    margin-right: 0.3rem;
}

section li {
    margin-bottom: 0.5rem;
}

.watch {
    padding: 0.6rem 0.8rem;
    background: rgba(225, 6, 0, 0.15);
    border-radius: 6px;
    font-size: 0.92rem;
}

.top {
    font-size: 0.85rem;
    color: var(--muted);
}

/* ---------- Footer ---------- */

footer {
    max-width: 46rem;
    margin: 0 auto;
    padding: 1rem 1rem 2.5rem;
    font-size: 0.8rem;
    color: var(--muted);
    text-align: center;
}

footer a {
    color: var(--muted);
}

footer .credit {
    font-size: 0.95rem;
    font-weight: bold;
    color: var(--white);
}
