/**
 * reset.css — modern CSS reset scoped to the ICE child theme.
 *
 * Single responsibility: normalize browser defaults. No design tokens, no
 * component styles. Driven by CSS variables from variables.css.
 *
 * @package ICE_GeneratePress_Child
 * @since   1.0.0
 */

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

html {
        -webkit-text-size-adjust: 100%;
        -moz-text-size-adjust: 100%;
        text-size-adjust: 100%;
        scroll-behavior: smooth;
        /* Prevent horizontal scroll at the root level. */
        overflow-x: hidden;
}

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

body {
        margin: 0;
        padding: 0;
        font-family: var(--ice-font-body);
        font-size: var(--ice-fs-base);
        font-weight: var(--ice-fw-medium);
        line-height: var(--ice-lh-normal);
        color: var(--ice-body);
        background-color: var(--ice-light); /* soft gray body background (wpbeginner-style) */
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        text-rendering: optimizeLegibility;
        overflow-x: hidden;
}

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

img {
        border-style: none;
}

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

button {
        background: none;
        border: 0;
        cursor: pointer;
        padding: 0;
}

a {
        color: var(--ice-accent);
        text-decoration: none;
        transition: color var(--ice-t-fast);
}

a:hover {
        color: var(--ice-accent-dark);
        text-decoration: underline;
}

ul,
ol {
        margin: 0;
        padding: 0;
        list-style: none;
}

ul[class],
ol[class] {
        list-style: none;
}

p,
h1,
h2,
h3,
h4,
h5,
h6,
figure,
blockquote,
dl,
dd {
        margin: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
        font-family: var(--ice-font-heading);
        color: var(--ice-title);
        font-weight: var(--ice-fw-bold);
        line-height: var(--ice-lh-tight);
        letter-spacing: var(--ice-ls-tight);
        text-wrap: balance;
}

p {
        text-wrap: pretty;
}

hr {
        border: 0;
        border-top: 1px solid var(--ice-border);
        margin: var(--ice-spacing-xl) 0;
}

table {
        width: 100%;
        border-collapse: collapse;
        border-spacing: 0;
}

th,
td {
        text-align: left;
        padding: var(--ice-spacing-xs) var(--ice-spacing-sm);
        border-bottom: 1px solid var(--ice-border);
}

th {
        font-weight: var(--ice-fw-semibold);
        color: var(--ice-title);
}

code,
kbd,
pre,
samp {
        font-family: var(--ice-font-mono);
        font-size: 0.95em;
}

pre {
        background: var(--ice-light);
        padding: var(--ice-spacing-sm);
        border-radius: var(--ice-btn-radius-sm);
        overflow-x: auto;
}

blockquote {
        margin: 0 0 var(--ice-spacing-md);
        padding: var(--ice-spacing-sm) var(--ice-spacing-md);
        border-left: 4px solid var(--ice-accent);
        background: var(--ice-light);
        font-style: italic;
        color: var(--ice-title);
}

blockquote p:last-child {
        margin: 0;
}

::selection {
        background: var(--ice-accent);
        color: var(--ice-primary);
}

/* ----- Visible focus indicator (WCAG 2.4.7) ----- */
:focus-visible {
        outline: var(--ice-focus-width) solid var(--ice-focus-color);
        outline-offset: var(--ice-focus-offset);
        border-radius: 2px;
}

/* ----- Screen reader text (a11y) ----- */
.screen-reader-text,
.ice-skip-link {
        position: absolute !important;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
}

.ice-skip-link:focus {
        top: 0;
        left: 0;
        width: auto;
        height: auto;
        padding: var(--ice-spacing-xs) var(--ice-spacing-md);
        margin: var(--ice-spacing-xs);
        background: var(--ice-primary);
        color: var(--ice-white);
        clip: auto;
        font-weight: var(--ice-fw-semibold);
        z-index: var(--ice-z-modal);
}

/* ----- WordPress core alignment helpers ----- */
.alignleft   { float: left;  margin: 0 var(--ice-spacing-md) var(--ice-spacing-md) 0; }
.alignright  { float: right; margin: 0 0 var(--ice-spacing-md) var(--ice-spacing-md); }
.aligncenter { display: block; margin-left: auto; margin-right: auto; clear: both; }
.alignwide   { max-width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); }
.alignfull   { max-width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); }

/* Clear floats after WP blocks. */
.entry-content::after,
.ice-entry-content::after {
        content: "";
        display: table;
        clear: both;
}

/* ----- WordPress caption ----- */
.wp-caption {
        max-width: 100%;
}

.wp-caption .wp-caption-text {
        margin: 0;
        padding: var(--ice-spacing-xs) 0;
        font-size: var(--ice-fs-sm);
        color: var(--ice-gray);
        text-align: center;
}

/* ----- WordPress sticky ----- */
.sticky {
        display: block;
}

/* ----- WordPress gallery default look ----- */
.gallery {
        display: grid;
        gap: var(--ice-spacing-xs);
}

.gallery-columns-2 { grid-template-columns: repeat(2, 1fr); }
.gallery-columns-3 { grid-template-columns: repeat(3, 1fr); }
.gallery-columns-4 { grid-template-columns: repeat(4, 1fr); }
.gallery-columns-5 { grid-template-columns: repeat(5, 1fr); }
.gallery-columns-6 { grid-template-columns: repeat(6, 1fr); }
.gallery-columns-7 { grid-template-columns: repeat(7, 1fr); }
.gallery-columns-8 { grid-template-columns: repeat(8, 1fr); }
.gallery-columns-9 { grid-template-columns: repeat(9, 1fr); }
