/*
 * base.css — EV Enterprise Theme Base Styles
 * Reset, typography, accessibility foundations.
 */

/* ── Box-sizing reset ──────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Root / Body ───────────────────────────────── */
html {
    font-size: var(--font-size-base);
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--background);
    color: var(--foreground);
    font-family: var(--font-family);
    font-weight: var(--font-weight-normal);
    font-size: 1rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Accessibility: Skip link ──────────────────── */
.skip-to-content {
    position: absolute;
    top: -100%;
    left: 1rem;
    z-index: 9999;
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: var(--primary-foreground);
    border-radius: var(--radius);
    font-weight: var(--font-weight-semibold);
    text-decoration: none;
    transition: top var(--transition-fast);
}

.skip-to-content:focus {
    top: 1rem;
}

/* ── Focus Ring ────────────────────────────────── */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

/* ── Typography ────────────────────────────────── */
h1,
h2,
h3,
h4,
h5,
h6 {
    line-height: 1.25;
    color: var(--foreground);
}

h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: var(--font-weight-bold);
}

h2 {
    font-size: clamp(1.5rem, 3.5vw, 2.25rem);
    font-weight: var(--font-weight-bold);
}

h3 {
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    font-weight: var(--font-weight-semibold);
}

h4 {
    font-size: 1.125rem;
    font-weight: var(--font-weight-semibold);
}

h5 {
    font-size: 1rem;
    font-weight: var(--font-weight-semibold);
}

h6 {
    font-size: 0.875rem;
    font-weight: var(--font-weight-semibold);
}

p {
    line-height: 1.75;
    color: var(--foreground);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary);
    text-decoration: underline;
}

strong,
b {
    font-weight: var(--font-weight-semibold);
}

em,
i {
    font-style: italic;
}

ul,
ol {
    padding-left: 1.5rem;
}

li+li {
    margin-top: 0.25rem;
}

img,
video,
svg {
    max-width: 100%;
    height: auto;
    display: block;
}

img {
    loading: lazy;
    /* HTML attribute handled in PHP; here for completeness */
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

th {
    font-weight: var(--font-weight-semibold);
    background: var(--muted);
    color: var(--foreground);
}

/* ── Forms ─────────────────────────────────────── */
input,
textarea,
select {
    font-family: inherit;
    font-size: 1rem;
    font-weight: var(--font-weight-normal);
    line-height: 1.5;
    background: var(--input-background);
    color: var(--foreground);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.625rem 0.875rem;
    width: 100%;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    appearance: none;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--ring);
}

input::placeholder,
textarea::placeholder {
    color: var(--muted-foreground);
}

label {
    font-size: 0.875rem;
    font-weight: var(--font-weight-medium);
    color: var(--foreground);
    display: block;
    margin-bottom: 0.375rem;
}

button {
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
}

/* ── Horizontal Rule ───────────────────────────── */
hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2rem 0;
}

/* ── WordPress core classes ────────────────────── */
.alignleft {
    float: left;
    margin-right: 1.5rem;
    margin-bottom: 1rem;
}

.alignright {
    float: right;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 1rem;
}

.wp-caption {
    max-width: 100%;
}

.wp-caption-text {
    font-size: 0.8125rem;
    color: var(--muted-foreground);
    margin-top: 0.25rem;
}

.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    height: 1px;
    overflow: hidden;
    position: absolute;
    width: 1px;
    word-wrap: normal;
}