/* 
 * JAYTRA V2 - Mobile-First Foundation
 * Establishes a modern, responsive baseline using native CSS.
 */

:root {
    /* Fluid Typography Foundation */
    --fs-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
    --fs-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);
    --fs-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
    --fs-lg: clamp(1.125rem, 1.05rem + 0.375vw, 1.25rem);
    --fs-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
    --fs-2xl: clamp(1.5rem, 1.25rem + 1.25vw, 2rem);
    --fs-3xl: clamp(1.75rem, 1.4rem + 1.75vw, 2.5rem);
    --fs-4xl: clamp(2rem, 1.5rem + 2.5vw, 3.5rem);
    
    /* Spacing System */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-24: 6rem;

    /* Layout Boundaries */
    --container-max: 1280px;
    --container-px: clamp(1rem, 5vw, 2rem);
}

/* Mobile-First Resets & Base */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; }
body {
    font-family: 'Poppins', sans-serif;
    font-size: var(--fs-base);
    line-height: 1.6;
    color: var(--black, #1e293b);
    background-color: var(--light-bg, #f8fafc);
    overflow-x: hidden; /* Prevent horizontal scroll on mobile, safely */
}

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

/* Structural Utilities (Mobile First) */
.v2-container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--container-px);
}

.v2-section {
    padding-block: var(--space-12);
}

/* Grid System */
.v2-grid {
    display: grid;
    gap: var(--space-4);
    grid-template-columns: 1fr; /* Default mobile: 1 column */
}

/* Breakpoints (Progressive Enhancement) */
@media (min-width: 640px) { /* sm */
    .v2-section { padding-block: var(--space-16); }
    .sm\:grid-2 { grid-template-columns: repeat(2, 1fr); }
    .sm\:gap-6 { gap: var(--space-6); }
}

@media (min-width: 768px) { /* md */
    .md\:grid-2 { grid-template-columns: repeat(2, 1fr); }
    .md\:grid-3 { grid-template-columns: repeat(3, 1fr); }
    .md\:gap-8 { gap: var(--space-8); }
    .md\:hidden { display: none !important; }
    .md\:block { display: block !important; }
    .md\:flex { display: flex !important; }
}

@media (min-width: 1024px) { /* lg */
    .v2-section { padding-block: var(--space-24); }
    .lg\:grid-3 { grid-template-columns: repeat(3, 1fr); }
    .lg\:grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Interactive Element Standards */
button, a {
    touch-action: manipulation;
}

/* Ensure 44x44 minimum touch targets for critical mobile interactions */
.touch-target {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Typography Standards */
.v2-heading-1 { font-size: var(--fs-4xl); font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; }
.v2-heading-2 { font-size: var(--fs-3xl); font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
.v2-heading-3 { font-size: var(--fs-2xl); font-weight: 600; line-height: 1.3; }
.v2-subtext { font-size: var(--fs-lg); color: var(--medium-gray); line-height: 1.5; }

/* Focus Accessibility */
:focus-visible {
    outline: 2px solid var(--gold, #d4af37);
    outline-offset: 4px;
}

/* ─── Components ────────────────────────────────────────────── */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-3) var(--space-6);
    border-radius: var(--space-2);
    font-size: var(--fs-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    text-decoration: none;
}

.btn-gold {
    background-color: var(--gold, #d4af37);
    color: #000;
}
.btn-gold:hover {
    background-color: #c5a880;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.3);
}
.btn-gold:active { transform: translateY(0); }

.btn-outline {
    background: transparent;
    border-color: var(--border-color, #e2e8f0);
    color: var(--black, #1e293b);
}
.btn-outline:hover {
    border-color: var(--gold);
    color: var(--gold);
    background: rgba(212, 175, 55, 0.05);
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--fs-base);
}

/* Cards */
.v2-card {
    background: #fff;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: var(--space-3);
    padding: var(--space-6);
    transition: all 0.3s ease;
}
.v2-card:hover {
    border-color: var(--gold);
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

/* Badges */
.badge {
    display: inline-flex;
    padding: var(--space-1) var(--space-3);
    border-radius: 9999px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.badge-gold {
    background: rgba(212, 175, 55, 0.1);
    color: var(--gold);
    border: 1px solid rgba(212, 175, 55, 0.2);
}

/* Dark Mode Integration */
body.dark-mode-active {
    --light-bg: #0f172a;
    --black: #f8fafc;
    --border-color: #334155;
}
body.dark-mode-active .v2-card {
    background: #1e293b;
}
body.dark-mode-active .btn-outline {
    color: #f8fafc;
}

