/* Home page — only what styles.css does not already give the hero, the
   navigation cards and the footer. */

/* The logos are drawn on white and the event one is blue, so they sit on a
   white plate in both themes: on the navy hero, or in dark mode, they would
   disappear otherwise. */
:root {
    --logo-plate: #ffffff;
}

.landing-hero {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.landing-hero .competition-info {
    flex: 1;
}

.hero-logo {
    order: 1;
    flex: none;
    width: auto;
    height: 150px;
    padding: 0.75rem 1rem;
    background: var(--logo-plate);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: 1;
}

.landing-hero .competition-info h2 {
    margin-bottom: 0.75rem;
}

.landing-lead {
    color: rgb(255 255 255 / 0.8);
    font-size: 1.05rem;
    max-width: 40rem;
}

.landing-scores-card .nav-icon {
    background: linear-gradient(135deg, var(--iro-navy), var(--iro-navy-light));
    color: #fff;
}

.landing-pdf-card .nav-icon {
    background: linear-gradient(135deg, var(--iro-red), #f06368);
    color: #fff;
}

.landing-timetable-card .nav-icon {
    background: linear-gradient(135deg, var(--iro-sand), var(--iro-sand-light));
    color: var(--iro-navy);
}

/* --- find your draw number -------------------------------------------- */
/* The box itself and its result cards live in slots.css, shared with the
   timetable page. Here only its place on the landing page. */
.landing-finder {
    margin-bottom: 3rem;
}

/* --- useful numbers ----------------------------------------------------- */
.landing-contacts {
    margin-bottom: 3rem;
}

.landing-organisers {
    margin-bottom: 1rem;
    text-align: center;
}

.landing-organisers h3 {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* Sized to the logos, not to the page: a full-width white band glares in the
   dark theme. multiply drops the off-white box the Kgt logo comes in. */
.organiser-logos {
    display: inline-flex;
    align-items: center;
    gap: 3rem;
    padding: 1.25rem 2.5rem;
    background: var(--logo-plate);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.organiser-logos img {
    display: block;
    width: auto;
    mix-blend-mode: multiply;
}

.organiser-wide {
    height: 56px;
}

.organiser-round {
    height: 96px;
}

.landing-contacts h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    /* The timetable links to ./#places-title: the heading must land below
       the sticky header, not under it. */
    scroll-margin-top: calc(var(--header-h) + 0.5rem);
}

.landing-contacts h3 i {
    color: var(--accent-color);
}

.contact-list {
    list-style: none;
    display: grid;
    /* Due colonne su desktop: a tre l'etichetta andava a capo accanto al
       numero. min(100%, …) evita che la colonna sbordi sui telefoni. */
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
    gap: 1rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    min-width: 0;
}

.contact-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--primary-color);
    font-size: 1.25rem;
}

.contact-icon.emergency {
    background: var(--error-color);
    color: #fff;
}

.contact-icon.emergency-vet {
    background: rgb(229 52 58 / 0.12);
    color: var(--error-color);
}

.contact-label {
    flex: 1;
    min-width: 0;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.contact-label small {
    display: block;
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.contact-number {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: var(--primary-color);
    text-decoration: none;
    padding: 0.4rem 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.contact-number:hover {
    border-color: var(--primary-color);
    background: var(--bg-hover);
}

/* --- useful places ------------------------------------------------------ */
/* Same list as the numbers, with a position where the number would be: the
   coordinates are the link, so they stay readable for a satnav. The labels
   carry an address, so the button drops under the label well before the
   phone breakpoint instead of squeezing it into a column of single words. */
.landing-places .contact-item {
    flex-wrap: wrap;
}

.landing-places .contact-label {
    flex: 1 1 14rem;
}

.place-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.875rem;
}

.place-link i {
    color: var(--accent-color);
}

@media (max-width: 480px) {
    /* Beside a 150px number button the label broke word by word ("Veterinary
       / emergency", seven lines at 320). The button drops under the label, in
       line with its text, as the places already did; the label keeps the
       whole row beside the icon. */
    .landing-contacts .contact-item {
        flex-wrap: wrap;
        row-gap: 0.35rem;
    }

    .landing-contacts .contact-label {
        flex: 1 1 calc(100% - 38px - 0.75rem);
    }

    .landing-contacts .contact-number {
        margin-left: calc(38px + 0.75rem);
    }

    .contact-item {
        gap: 0.75rem;
        padding: 0.75rem;
    }

    .contact-icon {
        width: 38px;
        height: 38px;
    }

    .contact-number {
        padding: 0.35rem 0.6rem;
        font-size: 0.9rem;
    }
}

/* --- phones ------------------------------------------------------------- */
/* The draw-number box is what a competitor opens the site for, so on a phone
   the hero shrinks to its heading and the box keeps only what it needs:
   the title already says what you get, so the explanation drops its tail. */
@media (max-width: 640px) {
    .hero-section {
        margin-bottom: 1rem;
    }

    .landing-hero {
        gap: 1rem;
    }

    .hero-logo {
        height: 84px;
        padding: 0.4rem 0.5rem;
    }

    .landing-hero .competition-info h2 {
        margin-bottom: 0.4rem;
    }

    .organiser-logos {
        gap: 1.5rem;
        padding: 1rem 1.5rem;
    }

    .organiser-wide {
        height: 36px;
    }

    .organiser-round {
        height: 72px;
    }

    .landing-lead {
        font-size: 0.95rem;
        line-height: 1.4;
    }

    .landing-finder {
        margin-bottom: 1.5rem;
    }

    .finder-more {
        display: none;
    }

    .landing-contacts {
        margin-bottom: 1.5rem;
    }

    .landing-contacts h3 {
        font-size: 1.125rem;
        margin-bottom: 0.75rem;
    }

    .contact-list {
        gap: 0.6rem;
    }
}

/* A phone on its side: the header scrolls away (styles.css) and the hint's
   tail, now under the input (slots.css), goes as in portrait: it has to
   start on the first screen. */
@media (orientation: landscape) and (max-height: 500px) {
    .finder-more {
        display: none;
    }
}
