/**
 * Modern CSS Reset
 * Comprehensive reset for consistent cross-browser rendering.
 * Includes smooth scrolling, border-box model, and accessibility defaults.
 */

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

/* Smooth scrolling and text scaling */
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    tab-size: 4;
}

/* Body reset */
body {
    line-height: 1.7;
    min-height: 100vh;
}

/* HTML5 display-role reset for older browsers */
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
menu,
nav,
section,
summary {
    display: block;
}

/* Headings reset */
h1, h2, h3, h4, h5, h6 {
    font-size: inherit;
    font-weight: inherit;
}

/* Remove list styles */
ol,
ul,
menu {
    list-style: none;
}

/* Remove blockquote and q quotes */
blockquote,
q {
    quotes: none;
}

blockquote::before,
blockquote::after,
q::before,
q::after {
    content: '';
    content: none;
}

/* Table reset */
table {
    border-collapse: collapse;
    border-spacing: 0;
}

/* Images and media - responsive by default */
img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Form elements inherit font */
input,
button,
textarea,
select,
optgroup {
    font: inherit;
    color: inherit;
    letter-spacing: inherit;
}

/* Button reset */
button {
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

/* Anchor reset */
a {
    text-decoration: none;
    color: inherit;
}

/* Textarea resize control */
textarea {
    resize: vertical;
}

/* Remove input number spinners */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* Remove search input clear button and decoration */
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
}

/* Focus outline for accessibility */
:focus-visible {
    outline: 2px solid #1B3A5C;
    outline-offset: 2px;
}

/* Remove default focus outline when not using keyboard */
:focus:not(:focus-visible) {
    outline: none;
}

/* Remove default appearance on iOS (체크박스/라디오 제외) */
input:not([type="checkbox"]):not([type="radio"]),
textarea {
    -webkit-appearance: none;
    appearance: none;
}

/* Prevent text overflow */
p,
h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
}

/* Remove animation for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Hidden utility */
[hidden] {
    display: none !important;
}
