/**
 * JiyaneDesign - Base Styles & Reset
 * Modern CSS reset, typography system, and foundational styles
 */

/* ===== MODERN CSS RESET ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

@media (min-width: 768px) {
    html {
        scroll-padding-top: 180px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

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

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

h1 {
    font-size: clamp(var(--text-4xl), 5vw, var(--text-6xl));
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(var(--text-3xl), 4vw, var(--text-5xl));
    letter-spacing: -0.01em;
}

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

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

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

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

p {
    margin-bottom: var(--space-4);
    max-width: 65ch;
}

p:last-child {
    margin-bottom: 0;
}

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

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

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

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

em,
i {
    font-style: italic;
}

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

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

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

/* ===== MEDIA ===== */
img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

img {
    font-style: italic;
    /* Alt text styling */
    background-repeat: no-repeat;
    background-size: cover;
}

/* ===== FORM ELEMENTS ===== */
input,
button,
textarea,
select {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

input,
textarea,
select {
    width: 100%;
}

/* Remove default button styles */
button,
[type='button'],
[type='reset'],
[type='submit'] {
    -webkit-appearance: button;
    background-color: transparent;
    background-image: none;
}

/* Remove spinner from number inputs */
input[type='number']::-webkit-inner-spin-button,
input[type='number']::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type='number'] {
    -moz-appearance: textfield;
}

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

/* Container */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
}

.container-wide {
    max-width: var(--container-wide);
}

.container-narrow {
    max-width: var(--container-narrow);
}

/* Text Alignment */
.text-left {
    text-align: left;
}

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

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

/* Text Colors */
.text-primary {
    color: var(--color-primary);
}

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

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

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

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

/* Background Colors */
.bg-primary {
    background-color: var(--color-primary);
}

.bg-secondary {
    background-color: var(--color-secondary);
}

.bg-dark {
    background-color: var(--color-dark);
}

.bg-light {
    background-color: var(--color-light);
}

.bg-white {
    background-color: var(--color-white);
}

/* Display */
.block {
    display: block;
}

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

.inline {
    display: inline;
}

.flex {
    display: flex;
}

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

.grid {
    display: grid;
}

.hidden {
    display: none;
}

/* Flexbox Utilities */
.flex-row {
    flex-direction: row;
}

.flex-col {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.items-start {
    align-items: flex-start;
}

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

.items-end {
    align-items: flex-end;
}

.justify-start {
    justify-content: flex-start;
}

.justify-center {
    justify-content: center;
}

.justify-end {
    justify-content: flex-end;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: var(--space-2);
}

.gap-4 {
    gap: var(--space-4);
}

.gap-6 {
    gap: var(--space-6);
}

.gap-8 {
    gap: var(--space-8);
}

/* Spacing */
.mt-auto {
    margin-top: auto;
}

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

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

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

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

/* Width */
.w-full {
    width: 100%;
}

.max-w-full {
    max-width: 100%;
}

/* Visibility */
.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;
}

/* ===== SECTION SPACING ===== */
section {
    padding: var(--space-20) 0;
}

@media (min-width: 768px) {
    section {
        padding: var(--space-32) 0;
    }
}

/* ===== SELECTIONS ===== */
::selection {
    background-color: var(--color-primary);
    color: var(--color-white);
}

::-moz-selection {
    background-color: var(--color-primary);
    color: var(--color-white);
}

/* ===== FOCUS VISIBLE ===== */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ===== LOADING STATE ===== */
.loading {
    pointer-events: none;
    opacity: 0.6;
}