/* ==========================================================================
   Device rules for the public site (phone, tablet, iOS and Safari)
   Loaded last. Found by the Plan 25 audit (docs/mobile/public-baseline.json):
   the public site has no horizontal overflow at any size, but iOS Safari zooms
   the page when a 15px field is focused, several links are under 44px tall, and
   the sticky header takes 19 percent of a landscape phone. Fluid units only;
   colours come from the --pub-* tokens.
   ========================================================================== */

:root {
    color-scheme: light dark;
}

[data-theme="light"] {
    color-scheme: light;
}

[data-theme="dark"] {
    color-scheme: dark;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-tap-highlight-color: color-mix(in srgb, var(--pub-red-text) 12%, transparent);
}

a,
button,
summary,
[role="button"],
label,
input,
select,
textarea {
    touch-action: manipulation;
}

/* iOS Safari zooms the whole page when a focused field is under 16px (1rem) */
@media (pointer: coarse), (max-width: 40rem) {
    .pub-input,
    .pub-select,
    .pub-select-compact,
    .pub-newsletter-input,
    .pub-textarea,
    input:not([type="checkbox"], [type="radio"], [type="hidden"], [type="submit"], [type="button"]),
    select,
    textarea {
        font-size: 1rem;
    }

    /* The compact cabin pill is styled with a three-class selector in pub-search.css: match its specificity */
    .pub-search-card .pub-select.pub-select-compact {
        font-size: 1rem;
        min-height: 2.75rem;
        height: 2.75rem;
    }

    /* Tap targets of at least 2.75rem for the small links in cards and the footer */
    .pub-promo-link,
    .pub-social-link,
    .pub-legal-link {
        display: inline-flex;
        align-items: center;
        min-height: 2.75rem;
        min-width: 2.75rem;
    }
}

/* Landscape phones: a sticky header would take about a fifth of the screen */
@media (max-height: 30rem) {
    .pub-header {
        position: static;
    }
}
