/*  =======================================================
    ELEMENTS BASE.CSS — HTML ELEMENT RESET + BASE
    =======================================================
    Defines base HTML element styling and global utility classes, using [tokens-base.css] only.
    No brand, theme, or component logic.
    ======================================================= */

:root {
    scroll-behavior: smooth;
}

/* === Reset Base Tags === */
html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family-body), sans-serif;
    font-size: var(--font-size-body);
    color: var(--color-text-body);
    background-color: var(--color-bg);
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    margin: 0 0 0.5rem;
    font-weight: var(--font-weight-bold);
    color: var(--color-text-strong);
    font-family: var(--font-family-header), sans-serif;
}

h1 { font-size: var(--font-size-xxl); }
h2 { font-size: var(--font-size-xl); }
h3 { font-size: var(--font-size-lg); }
h4 { font-size: var(--font-size-md); }
h5 { font-size: var(--font-size-sm); }
h6 { font-size: var(--font-size-xs); }

/* Paragraphs */
p {
    margin: 0 0 1rem;
    line-height: 1.6;
    font-size: var(--font-size-body);
    color: var(--color-text-body);
}

/* Links */
a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover {
    color: var(--color-primary-dark);
}

/* Lists */
ul, ol {
    margin: 0 0 1rem;
    padding-left: 1.5rem;
}
li {
    margin-bottom: 0.25rem;
}

/* Buttons */
button {
    font-family: var(--font-family-body), sans-serif;
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-medium);
    border-radius: var(--radius-button);
    transition: all var(--transition-fast);
    cursor: pointer;
}

/* Inputs / Forms */
input, textarea, select {
    font-family: var(--font-family-body), sans-serif;
    font-size: var(--font-size-body);
    border-radius: var(--radius-input);
    border: 1px solid var(--color-border-default);
    padding: var(--padding-sm);
    color: var(--color-text-body);
    background-color: var(--color-bg);
    transition: border-color var(--transition-fast);
}

input::placeholder,
textarea::placeholder {
    color: var(--color-text-muted);
    opacity: var(--opacity-muted);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--color-primary);
}

/* Tables (Base) */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
    background-color: transparent;   /* let component classes decide */
}

th, td {
    padding: var(--padding-sm);
    border: 1px solid var(--color-border-light);
    text-align: left;
}

/* Responsive visibility helpers */
@media (max-width: 768px){
    .hide-sm { display: none !important; }
}
@media (min-width: 769px){
    .show-sm-only { display: none !important; }
}

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

/* HR Divider */
hr {
    border: none;
    height: 1px;
    background-color: var(--color-border-default);
    margin: var(--spacing-md) 0;
}

/* Blockquote */
blockquote {
    margin: var(--spacing-md) 0;
    padding: var(--spacing-sm) var(--spacing-md);
    border-left: 4px solid var(--color-primary);
    background-color: var(--color-surface);
    font-style: italic;
}

/* Code Blocks */
code {
    background-color: var(--color-surface);
    font-family: monospace;
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--color-text-strong);
}

/* Strong / Emphasis */
strong {
    font-weight: var(--font-weight-bold);
}

em {
    font-style: italic;
}

/* Disabled State */
[disabled],
.disabled {
    opacity: var(--opacity-disabled);
    pointer-events: none;
    cursor: not-allowed;
}

/* Utility: Text Muted (bridge to theme/Bootstrap var) */
.text-muted{
    --bs-text-opacity: 1;
    color: var(--bs-secondary-color, var(--color-text-muted)) !important;
}

/* Utility: Strong Text */
.text-strong {
    color: var(--color-text-strong);
    font-weight: var(--font-weight-bold);
}

/* Utility: Body Text */
.text-body {
    color: var(--color-text-body);
    font-weight: var(--font-weight-medium);
}

:root {
    --focus-ring: 0 0 0 3px color-mix(in srgb, var(--color-primary) 25%, transparent);
}

.mt-section{ margin-top: var(--spacing-lg); }
.mb-section{ margin-bottom: var(--spacing-xl); }
.mt-text-gap{ margin-top: var(--spacing-sm); }

/* Small-screen stack helper */
.stack-sm{ display:flex; gap:var(--gap-sm); }
@media (max-width:575.98px){
    .stack-sm{ flex-direction:column; }
    .stack-sm > *{ width:100%; }
}

a:focus-visible, button:focus-visible, [role="button"]:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
    border-color: var(--color-primary);
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}

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

}

/* === Label utilities (token-backed) === */
.label-xs {
    font-size: var(--label-font-size-sm);
    color: var(--color-label);
    font-weight: var(--font-weight-medium);
    letter-spacing: .02em;
}
.label-sm {
    font-size: var(--label-font-size-md);
    color: var(--color-label);
    font-weight: var(--font-weight-bold);
    letter-spacing: .02em;
}
.label-md {
    font-size: var(--label-font-size-lg);
    color: var(--color-label);
    font-weight: var(--font-weight-bold);
}

/* === Quiet link variant (keeps current color, subtle underline) === */
.link-quiet {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: transparent;
    transition: text-decoration-color var(--transition-fast);
}
.link-quiet:hover { text-decoration-color: currentColor; }

/* === A11y helper === */
.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
}

/* === One-line truncation === */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

