/**
 * Royal Nepal Voyage - Base Styles
 * 
 * Modern CSS reset and foundational styles
 * Includes Geist font loading and utility classes
 */

/* ========================================
   FONT LOADING
   ======================================== */

/* Geist Font - Self-hosted variable font for best performance */
/* No external requests - eliminates Google Fonts dependency */
@font-face {
    font-family: 'Geist';
    src: url('../fonts/Geist/webfonts/Geist[wght].woff2') format('woff2-variations');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* Optional: Italic variant if needed */
@font-face {
    font-family: 'Geist';
    src: url('../fonts/Geist/webfonts/Geist-Italic[wght].woff2') format('woff2-variations');
    font-weight: 100 900;
    font-style: italic;
    font-display: swap;
}

/* ========================================
   MODERN CSS RESET (Josh Comeau inspired)
   ======================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: 80px;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-normal);
    color: var(--color-text-primary);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
    overflow-x: hidden;
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    h1 {
        font-size: 2.25rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    .container {
        padding-inline: var(--space-4);
    }
}

img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

input,
button,
textarea,
select {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

a {
    color: inherit;
    text-decoration: none;
}

ul,
ol {
    list-style: none;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
    overflow-wrap: break-word;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    letter-spacing: var(--letter-spacing-tight);
    color: var(--color-text-primary);
}

h1 {
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-bold);
}

h2 {
    font-size: var(--font-size-3xl);
}

h3 {
    font-size: var(--font-size-2xl);
}

h4 {
    font-size: var(--font-size-xl);
}

h5 {
    font-size: var(--font-size-lg);
}

h6 {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
}

p {
    margin-bottom: var(--space-4);
    color: var(--color-text-secondary);
}

p:last-child {
    margin-bottom: 0;
}

strong,
b {
    font-weight: var(--font-weight-semibold);
}

small {
    font-size: var(--font-size-sm);
}

/* Links */
a:not(.btn):not(.nav-link) {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: var(--transition-colors);
}

a:not(.btn):not(.nav-link):hover {
    color: var(--color-accent);
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

/* Skip Link */
.skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-4);
    z-index: var(--z-max);
    padding: var(--space-3) var(--space-4);
    background: var(--color-primary);
    color: var(--color-text-inverse);
    border-radius: var(--radius-md);
    font-weight: var(--font-weight-medium);
    transition: top var(--duration-fast) var(--ease-out);
}

.skip-link:focus {
    top: var(--space-4);
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* Focus Styles */
:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 3px;
}

:focus:not(:focus-visible) {
    outline: none;
}

/* 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;
}

/* ========================================
   LAYOUT UTILITIES
   ======================================== */

.container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--section-padding-x);
}

.container-narrow {
    max-width: var(--container-narrow);
}

.container-wide {
    max-width: var(--container-wide);
}

/* Section */
.section {
    padding-block: var(--section-padding-y);
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-12);
}

.section-title {
    margin-bottom: var(--space-4);
}

.section-subtitle {
    font-size: var(--font-size-lg);
    color: var(--color-text-secondary);
    max-width: 600px;
    margin-inline: auto;
}

/* ========================================
   FLEXBOX & GRID UTILITIES
   ======================================== */

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.items-end {
    align-items: flex-end;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-end {
    justify-content: flex-end;
}

.gap-1 {
    gap: var(--space-1);
}

.gap-2 {
    gap: var(--space-2);
}

.gap-3 {
    gap: var(--space-3);
}

.gap-4 {
    gap: var(--space-4);
}

.gap-6 {
    gap: var(--space-6);
}

.gap-8 {
    gap: var(--space-8);
}

.grid {
    display: grid;
}

/* ========================================
   SPACING UTILITIES
   ======================================== */

.mt-4 {
    margin-top: var(--space-4);
}

.mt-6 {
    margin-top: var(--space-6);
}

.mt-8 {
    margin-top: var(--space-8);
}

.mb-4 {
    margin-bottom: var(--space-4);
}

.mb-6 {
    margin-bottom: var(--space-6);
}

.mb-8 {
    margin-bottom: var(--space-8);
}

.py-4 {
    padding-block: var(--space-4);
}

.py-6 {
    padding-block: var(--space-6);
}

.py-8 {
    padding-block: var(--space-8);
}

.px-4 {
    padding-inline: var(--space-4);
}

.px-6 {
    padding-inline: var(--space-6);
}

/* ========================================
   TEXT UTILITIES
   ======================================== */

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.text-primary {
    color: var(--color-text-primary);
}

.text-secondary {
    color: var(--color-text-secondary);
}

.text-muted {
    color: var(--color-text-muted);
}

.text-accent {
    color: var(--color-accent);
}

.text-sm {
    font-size: var(--font-size-sm);
}

.text-lg {
    font-size: var(--font-size-lg);
}

.text-xl {
    font-size: var(--font-size-xl);
}

.font-medium {
    font-weight: var(--font-weight-medium);
}

.font-semibold {
    font-weight: var(--font-weight-semibold);
}

.font-bold {
    font-weight: var(--font-weight-bold);
}

.uppercase {
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-wider);
}

/* Lead text for introductions */
.lead {
    font-size: var(--font-size-lg);
    line-height: var(--line-height-relaxed);
    color: var(--color-text-secondary);
}

/* ========================================
   VISUAL UTILITIES
   ======================================== */

.bg-white {
    background-color: var(--color-surface);
}

.bg-alt {
    background-color: var(--color-bg-alt);
}

.bg-primary {
    background-color: var(--color-primary);
}

.bg-accent {
    background-color: var(--color-accent);
}

.rounded-md {
    border-radius: var(--radius-md);
}

.rounded-lg {
    border-radius: var(--radius-lg);
}

.rounded-xl {
    border-radius: var(--radius-xl);
}

.rounded-full {
    border-radius: var(--radius-full);
}

.shadow-sm {
    box-shadow: var(--shadow-sm);
}

.shadow-md {
    box-shadow: var(--shadow-md);
}

.shadow-lg {
    box-shadow: var(--shadow-lg);
}

/* ========================================
   VISIBILITY UTILITIES
   ======================================== */

.hidden {
    display: none !important;
}

@media (max-width: 767px) {
    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 768px) {
    .hide-desktop {
        display: none !important;
    }
}

/* ========================================
   ANIMATION UTILITIES
   ======================================== */

/* Fade in animation for scroll reveals */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity var(--duration-slow) var(--ease-out),
        transform var(--duration-slow) var(--ease-out);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children animation */
.stagger-children>* {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity var(--duration-normal) var(--ease-out),
        transform var(--duration-normal) var(--ease-out);
}

.stagger-children.visible>*:nth-child(1) {
    transition-delay: 0ms;
}

.stagger-children.visible>*:nth-child(2) {
    transition-delay: 100ms;
}

.stagger-children.visible>*:nth-child(3) {
    transition-delay: 200ms;
}

.stagger-children.visible>*:nth-child(4) {
    transition-delay: 300ms;
}

.stagger-children.visible>*:nth-child(5) {
    transition-delay: 400ms;
}

.stagger-children.visible>*:nth-child(6) {
    transition-delay: 500ms;
}

.stagger-children.visible>* {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   SELECTION STYLES
   ======================================== */

::selection {
    background-color: var(--color-accent);
    color: var(--color-text-inverse);
}

::-moz-selection {
    background-color: var(--color-accent);
    color: var(--color-text-inverse);
}