/*
    reset.css
    A modern CSS reset to ensure consistent styling across different browsers.
    This helps in building designs from a clean slate without browser-specific defaults interfering.
    It removes default margins, paddings, and sets sensible defaults for common elements.
*/

/* Box sizing reset: Inherit box-sizing from `html` for all elements,
   including `::before` and `::after`. */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Remove default margin and padding from common elements */
body,
h1, h2, h3, h4, h5, h6,
p,
blockquote,
pre,
dl, dd,
ol, ul,
figure, figcaption,
hr,
fieldset, legend {
    margin: 0;
    padding: 0;
}

/* Set default font size for root element to ensure 1rem = 16px */
html {
    font-size: 100%;
    /* Prevent text resizing on iOS in landscape mode */
    -webkit-text-size-adjust: 100%;
}

/* Remove default list styles (bullets/numbers) from unordered and ordered lists */
ol,
ul {
    list-style: none;
}

/* Make images, pictures, videos, canvas, and SVG elements responsive by default.
   They will not exceed their parent's width and will maintain their aspect ratio. */
img,
picture,
video,
canvas,
svg {
    display: block; /* Ensures they behave like block elements for layout */
    max-width: 100%; /* Prevents them from overflowing their containers */
    height: auto;    /* Maintains aspect ratio when scaling */
}

/* Improve media defaults for images */
img {
    font-style: italic; /* Display italic text if image fails to load */
    vertical-align: middle; /* Aligns image vertically with text baseline */
}

/* Inherit font styles from parent elements for form elements */
input,
button,
textarea,
select {
    font: inherit; /* Ensures form elements use the defined body font */
}

/* Remove default text decoration from anchor tags and inherit color */
a {
    text-decoration: none; /* No underline by default */
    color: inherit; /* Links will use the text color of their parent */
}

/* Ensure long words break and wrap to the next line instead of overflowing */
p,
h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word; /* Prevents text from breaking out of its container */
}

/* Remove default button styles to allow for custom styling */
button {
    background: none;
    color: inherit;
    border: none;
    padding: 0;
    font: inherit;
    cursor: pointer; /* Indicate it's clickable */
    outline: inherit; /* Inherit outline style */
}

/* Remove default fieldset and legend borders and padding */
fieldset, legend {
    border: 0;
    padding: 0;
}

/* Ensure table cells and borders collapse properly */
table {
    border-collapse: collapse;
    border-spacing: 0;
}

/* Remove default padding from table cells */
td, th {
    padding: 0;
}

/* Enable smooth scrolling behavior for anchor links */
html {
    scroll-behavior: smooth;
}
