/**
 * Base Styles - Munazil Real Homes
 * Reset, typography, and foundational styles
 * Mobile-first approach
 */

/* ===== RESET & BOX SIZING ===== */

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

/* ===== ROOT & BODY ===== */

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    font-size: var(--text-base);
    font-weight: var(--font-normal);
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    min-height: 100vh;
}

/* ===== TYPOGRAPHY ===== */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    color: var(--text-primary);
    margin-bottom: var(--space-4);
}

h1 {
    font-size: var(--text-3xl);
    margin-bottom: var(--space-6);
}

h2 {
    font-size: var(--text-2xl);
    margin-bottom: var(--space-5);
}

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

h4 {
    font-size: var(--text-lg);
}

h5,
h6 {
    font-size: var(--text-base);
}

/* Responsive heading sizes */
@media (min-width: 768px) {
    h1 {
        font-size: var(--text-4xl);
    }

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

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

@media (min-width: 1024px) {
    h1 {
        font-size: var(--text-5xl);
    }
}

p {
    margin-bottom: var(--space-4);
    line-height: var(--leading-relaxed);
}

/* Large readable body text on mobile */
p.lead {
    font-size: var(--text-lg);
    color: var(--text-secondary);
}

strong,
b {
    font-weight: var(--font-semibold);
}

small {
    font-size: var(--text-sm);
}

/* ===== LINKS ===== */

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary-dark);
}

a:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ===== LISTS ===== */

ul,
ol {
    margin-bottom: var(--space-4);
    padding-left: var(--space-6);
}

li {
    margin-bottom: var(--space-2);
    line-height: var(--leading-relaxed);
}

ul.unstyled,
ol.unstyled {
    list-style: none;
    padding-left: 0;
}

/* ===== IMAGES ===== */

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

/* ===== BUTTONS ===== */

button {
    font-family: var(--font-primary);
    cursor: pointer;
    border: none;
    background: none;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* ===== FORMS ===== */

input,
textarea,
select {
    font-family: var(--font-primary);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
}

input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ===== UTILITY CLASSES ===== */

/* 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-width: 0;
}

/* Text utilities */
.text-center {
    text-align: center;
}

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

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

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

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

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

/* Font weight utilities */
.font-normal {
    font-weight: var(--font-normal);
}

.font-medium {
    font-weight: var(--font-medium);
}

.font-semibold {
    font-weight: var(--font-semibold);
}

.font-bold {
    font-weight: var(--font-bold);
}

/* Display utilities */
.hidden {
    display: none;
}

.block {
    display: block;
}

.inline-block {
    display: inline-block;
}

.flex {
    display: flex;
}

.grid {
    display: grid;
}

/* Responsive utilities */
@media (max-width: 767px) {
    .hide-mobile {
        display: none;
    }
}

@media (min-width: 768px) {
    .hide-desktop {
        display: none;
    }
}

/* Spacing utilities */
.mb-0 {
    margin-bottom: 0;
}

.mb-2 {
    margin-bottom: var(--space-2);
}

.mb-4 {
    margin-bottom: var(--space-4);
}

.mb-6 {
    margin-bottom: var(--space-6);
}

.mb-8 {
    margin-bottom: var(--space-8);
}

.mt-0 {
    margin-top: 0;
}

.mt-2 {
    margin-top: var(--space-2);
}

.mt-4 {
    margin-top: var(--space-4);
}

.mt-6 {
    margin-top: var(--space-6);
}

.mt-8 {
    margin-top: var(--space-8);
}

/* ===== ACCESSIBILITY ===== */

/* Focus visible for keyboard navigation */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@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;
    }
}