/**
 * Dominican Bridge Design System - Base Styles
 * Reset, typography, and foundational styles
 */

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Disable text selection site-wide */
body {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

input, textarea, select, [contenteditable] {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Base */
html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bone);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 400;
    line-height: 1.3;
    color: var(--navy);
}

h1 {
    font-size: clamp(var(--text-4xl), 5vw, 44px);
}

h2 {
    font-size: clamp(var(--text-2xl), 4vw, var(--text-3xl));
}

h3 {
    font-size: var(--text-xl);
}

p {
    line-height: 1.6;
}

a {
    color: var(--blue);
    text-decoration: none;
    transition: color var(--transition-base);
}

a:hover {
    color: var(--navy);
}

/* Subtle border radius on all interactive/container elements */
.btn, .card, .card-image, .badge, .filter-btn, .filter-select,
.form-input, .form-textarea, .form-select,
.alert, .toast, .modal-content, .empty-state,
.recently-viewed-item, .event-card {
    border-radius: var(--radius-xs);
}

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

/* Lazy Loading Placeholder */
img[loading="lazy"] {
    background: linear-gradient(90deg, var(--bone) 0%, var(--border) 50%, var(--bone) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

img[loading="lazy"][src] {
    animation: none;
    background: none;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Image wrapper for aspect ratio preservation during lazy load */
.img-lazy-wrapper {
    position: relative;
    overflow: hidden;
    background: var(--bone);
}

.img-lazy-wrapper::before {
    content: '';
    display: block;
    padding-top: 56.25%; /* 16:9 default aspect ratio */
}

.img-lazy-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.img-lazy-wrapper--square::before {
    padding-top: 100%;
}

.img-lazy-wrapper--portrait::before {
    padding-top: 133.33%; /* 3:4 */
}

/* Lists */
ul, ol {
    list-style: none;
}

/* Focus States */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 2px;
}

/* Remove default outline since we're using focus-visible */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) {
    outline: none;
}

/* Skip Link - defined in components.css */

/* Selection */
::selection {
    background: var(--blue);
    color: var(--white);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bone);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* Utility Classes */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-center {
    text-align: center;
}

.text-mid {
    color: var(--text-mid);
}

.text-light {
    color: var(--text-light);
}
