/*
 * Base reset + typography. Mobile-first; tablet and desktop only override where needed.
 */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility; }

body {
    margin: 0;
    background: var(--rm-bg);
    color: var(--rm-text);
    font-family: var(--rm-font-b);
    font-size: var(--rm-fs-md);
    line-height: var(--rm-lh-base);
    /* Reserve space below content for the fixed bottom nav on mobile. */
    padding-bottom: var(--rm-bottomnav-h);
}

@media (min-width: 1024px) {
    body { padding-bottom: 0; }
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--rm-font-h);
    line-height: var(--rm-lh-tight);
    margin: 0 0 var(--rm-sp-4);
    color: var(--rm-text);
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0.01em;
}

h1 { font-size: var(--rm-fs-3xl); font-weight: 700; }
h2 { font-size: var(--rm-fs-2xl); font-weight: 600; }
h3 { font-size: var(--rm-fs-xl);  font-weight: 600; }
h4 { font-size: var(--rm-fs-lg);  font-weight: 600; }
h5 { font-size: var(--rm-fs-md);  font-weight: 600; }
h6 { font-size: var(--rm-fs-sm);  font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

@media (min-width: 1024px) {
    h1 { font-size: var(--rm-fs-4xl); }
    h2 { font-size: var(--rm-fs-3xl); }
}

p { margin: 0 0 var(--rm-sp-4); }

a {
    color: var(--rm-red);
    text-decoration: none;
}
a:hover, a:focus { color: var(--rm-red-dark); text-decoration: underline; }

img, svg, video { max-width: 100%; height: auto; display: block; }

ul, ol { padding-left: var(--rm-sp-5); margin: 0 0 var(--rm-sp-4); }

hr {
    border: 0;
    border-top: 1px solid var(--rm-border);
    margin: var(--rm-sp-5) 0;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

/* Inputs */
input[type="text"], input[type="search"], input[type="email"], input[type="tel"],
input[type="number"], input[type="password"], select, textarea {
    width: 100%;
    min-height: var(--tap);
    padding: var(--rm-sp-3) var(--rm-sp-4);
    border: 1px solid var(--rm-border);
    border-radius: var(--radius-sm);
    background: var(--rm-surface-1);
    color: var(--rm-text);
    transition: border-color var(--rm-dur-fast) var(--rm-ease), box-shadow var(--rm-dur-fast) var(--rm-ease);
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--rm-red);
    box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.18);
}

/* Skip link for keyboard accessibility */
.screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0);
    white-space: nowrap; border: 0;
}
.skip-link:focus {
    position: fixed; top: 8px; left: 8px;
    width: auto; height: auto; clip: auto;
    padding: var(--rm-sp-2) var(--rm-sp-4);
    background: var(--rm-black); color: var(--rm-text-on-dark);
    border-radius: var(--radius-sm); z-index: var(--rm-z-toast);
}

/* Focus ring on interactive elements that don't carry their own */
a:focus-visible, button:focus-visible, [role="button"]:focus-visible {
    outline: 2px solid var(--rm-red);
    outline-offset: 2px;
}
