/* ═══════════════════════════════════════════════════════════════════════════
   Gaonhae — BASE
   Reset, element defaults and the page container. No component styling here,
   and no literal values — everything comes from tokens.css, which must load
   first. Safe to include on any page, website or portal.
   ═══════════════════════════════════════════════════════════════════════════ */

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    font-family: var(--font-main);
    line-height: var(--leading-normal);
    color: var(--ink);
    background-color: var(--surface);
    /* Belt and braces against sideways scroll. Individual overflow bugs still
       need fixing at source — this only stops one escaping to production. */
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

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

/* <picture> is only a format-picker wrapper — it must never become a sizing box
   of its own. Without this, a <picture> inside a flex or grid parent becomes the
   flex item instead of the <img>, and the image is sized by the wrapper rather
   than by its own aspect ratio (this rendered the nav logo stretched).
   `display: contents` removes the wrapper from the box tree so the <img> lays
   out exactly as it did before it was wrapped. */
picture {
    display: contents;
}

/* Any rule that sets only `height` on an image MUST also set `width: auto`.
   The width/height HTML attributes map to presentational width/height, so a
   height-only rule leaves the attribute width in place and stretches the image. */
img[width][height] {
    width: auto;
}

/* Long unbreakable strings (emails, URLs) must not widen their container. */
a[href^="mailto:"],
a[href^="tel:"] {
    overflow-wrap: anywhere;
}

:focus-visible {
    outline: 3px solid var(--brand-blue-ink);
    outline-offset: 2px;
}

.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-pad);
}

/* Visually hidden but available to screen readers. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
