/**
 * RUH-E-KHUSHBU — Base Styles & Typography
 * Mobile-first, Bengali-primary typography, accessible focus states.
 */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--font-bn);
    font-size: var(--text-body);
    line-height: var(--lh-bengali);
    color: var(--color-text);
    background-color: var(--color-ivory);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Safe area padding for iOS */
.pb-safe {
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.pt-safe {
    padding-top: env(safe-area-inset-top, 0px);
}

main {
    flex: 1 0 auto;
    width: 100%;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display-bn);
    color: var(--color-forest);
    line-height: var(--lh-tight);
    font-weight: 600;
}

.font-en-display {
    font-family: var(--font-display-en);
}

.font-en-ui {
    font-family: var(--font-body-en);
}

.font-bn-display {
    font-family: var(--font-display-bn);
}

.font-bn {
    font-family: var(--font-bn);
}

h1, .h1 { font-size: var(--text-h1); }
h2, .h2 { font-size: var(--text-h2); }
h3, .h3 { font-size: var(--text-h3); }
h4, .h4 { font-size: var(--text-h4); }

p {
    line-height: var(--lh-bengali);
    margin-bottom: var(--space-4);
}
p:last-child {
    margin-bottom: 0;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-colors);
}

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

button, input, select, textarea {
    font-family: inherit;
    font-size: 16px; /* Prevents iOS zoom on focus */
    color: inherit;
}

button {
    background: none;
    border: none;
    cursor: pointer;
    touch-action: manipulation;
}

ul, ol {
    list-style: none;
}

/* Accessible focus outline (Design.md §8) */
:focus-visible {
    outline: 2px solid var(--color-gold);
    outline-offset: 2px;
}

/* Screen reader only */
.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;
}

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