/**
 * PONNUSAMY HOTEL - LAYOUT SYSTEM
 * Responsive grid and flexbox architecture
 * Optimized for all screen sizes including ultrawide
 */

/* ===== GLOBAL BOX SIZING ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* ===== BASE LAYOUT ===== */
/* Note: Global html/body styles are commented out to preserve existing heritage section styles */
/* Uncomment these when migrating to the new architecture */

/*
html {
    width: 100%;
    overflow-x: hidden;
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    color: var(--color-text-primary);
    background-color: var(--color-bg-primary);
    width: 100%;
    margin: 0;
    padding: 0;
    position: relative;
    overflow-x: hidden;
}
*/

/* ===== CONTAINER SYSTEM ===== */

/* Base container - centers content with max-width */
.container {
    width: 100%;
    max-width: var(--container-3xl);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--section-padding-inline);
    padding-right: var(--section-padding-inline);
}

/* Container variants */
.container-sm {
    max-width: var(--container-sm);
}

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

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

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

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

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

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

/* Fluid container - no max-width */
.container-fluid {
    max-width: 100%;
}

/* Full-bleed container - breaks out of container for backgrounds */
.container-full-bleed {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

/* ===== GRID SYSTEM ===== */

/* Base grid layout */
.grid {
    display: grid;
    gap: var(--gap-md);
    width: 100%;
}

/* Auto-fit grid - automatically adjusts columns */
.grid-auto-fit {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

/* Auto-fill grid */
.grid-auto-fill {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}

/* Responsive grid columns */
.grid-cols-1 {
    grid-template-columns: repeat(1, 1fr);
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

.grid-cols-5 {
    grid-template-columns: repeat(5, 1fr);
}

.grid-cols-6 {
    grid-template-columns: repeat(6, 1fr);
}

/* Responsive grid - adapts to screen size */
.grid-responsive {
    grid-template-columns: repeat(var(--grid-columns-mobile), 1fr);
}

/* Gap variants */
.gap-xs { gap: var(--gap-xs); }
.gap-sm { gap: var(--gap-sm); }
.gap-md { gap: var(--gap-md); }
.gap-lg { gap: var(--gap-lg); }
.gap-xl { gap: var(--gap-xl); }

/* ===== FLEXBOX UTILITIES ===== */

.flex {
    display: flex;
}

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

.flex-row {
    display: flex;
    flex-direction: row;
}

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

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

/* Justify content */
.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.justify-evenly { justify-content: space-evenly; }

/* Align items */
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.items-stretch { align-items: stretch; }
.items-baseline { align-items: baseline; }

/* Align content */
.content-start { align-content: flex-start; }
.content-center { align-content: center; }
.content-end { align-content: flex-end; }
.content-between { align-content: space-between; }
.content-around { align-content: space-around; }

/* Flex grow/shrink */
.flex-1 { flex: 1 1 0%; }
.flex-auto { flex: 1 1 auto; }
.flex-initial { flex: 0 1 auto; }
.flex-none { flex: none; }

/* ===== SECTION LAYOUT ===== */

section {
    width: 100%;
    padding-top: var(--section-padding-block);
    padding-bottom: var(--section-padding-block);
    position: relative;
}

/* Section with background - full bleed */
.section-full-bleed {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

/* ===== IMAGE HANDLING ===== */

/* Responsive images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Image with aspect ratio preservation */
.img-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.img-contain {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

/* Aspect ratio containers */
.aspect-square {
    aspect-ratio: 1 / 1;
}

.aspect-video {
    aspect-ratio: 16 / 9;
}

.aspect-portrait {
    aspect-ratio: 3 / 4;
}

.aspect-landscape {
    aspect-ratio: 4 / 3;
}

.aspect-ultrawide {
    aspect-ratio: 21 / 9;
}

/* ===== RESPONSIVE BREAKPOINTS ===== */

/* Mobile first approach - base styles above are for mobile */

/* Small tablets: 640px+ */
@media (min-width: 640px) {
    .grid-responsive {
        grid-template-columns: repeat(var(--grid-columns-tablet), 1fr);
    }

    .sm\:grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .sm\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .sm\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

    .sm\:flex-row { flex-direction: row; }
    .sm\:flex-col { flex-direction: column; }
}

/* Tablets: 768px+ */
@media (min-width: 768px) {
    .grid-responsive {
        grid-template-columns: repeat(var(--grid-columns-tablet), 1fr);
    }

    .md\:grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
    .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .md\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

    .md\:flex-row { flex-direction: row; }
    .md\:flex-col { flex-direction: column; }
}

/* Laptops: 1024px+ */
@media (min-width: 1024px) {
    .grid-responsive {
        grid-template-columns: repeat(var(--grid-columns-laptop), 1fr);
    }

    .lg\:grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
    .lg\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
    .lg\:grid-cols-5 { grid-template-columns: repeat(5, 1fr); }

    .lg\:flex-row { flex-direction: row; }
    .lg\:flex-col { flex-direction: column; }
}

/* Desktops: 1280px+ */
@media (min-width: 1280px) {
    .grid-responsive {
        grid-template-columns: repeat(var(--grid-columns-desktop), 1fr);
    }

    .xl\:grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
    .xl\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .xl\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .xl\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
    .xl\:grid-cols-5 { grid-template-columns: repeat(5, 1fr); }
    .xl\:grid-cols-6 { grid-template-columns: repeat(6, 1fr); }

    .xl\:flex-row { flex-direction: row; }
    .xl\:flex-col { flex-direction: column; }
}

/* Large desktops: 1536px+ */
@media (min-width: 1536px) {
    .\32xl\:grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
    .\32xl\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .\32xl\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .\32xl\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
    .\32xl\:grid-cols-5 { grid-template-columns: repeat(5, 1fr); }
    .\32xl\:grid-cols-6 { grid-template-columns: repeat(6, 1fr); }
}

/* Ultrawide: 1920px+ */
@media (min-width: 1920px) {
    .grid-responsive {
        grid-template-columns: repeat(var(--grid-columns-ultrawide), 1fr);
    }

    .\33xl\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
    .\33xl\:grid-cols-5 { grid-template-columns: repeat(5, 1fr); }
    .\33xl\:grid-cols-6 { grid-template-columns: repeat(6, 1fr); }
}

/* 4K and beyond: 2560px+ */
@media (min-width: 2560px) {
    .\34xl\:grid-cols-5 { grid-template-columns: repeat(5, 1fr); }
    .\34xl\:grid-cols-6 { grid-template-columns: repeat(6, 1fr); }
    .\34xl\:grid-cols-8 { grid-template-columns: repeat(8, 1fr); }
}

/* ===== ULTRAWIDE SPECIFIC LAYOUT ===== */
@media (min-aspect-ratio: 21/9) {
    /* Center content with more whitespace on ultrawide */
    .container {
        max-width: var(--container-3xl);
        padding-left: var(--section-padding-inline);
        padding-right: var(--section-padding-inline);
    }

    /* Increase grid columns on ultrawide */
    .grid-responsive {
        grid-template-columns: repeat(var(--grid-columns-ultrawide), 1fr);
    }

    /* Wider gaps */
    .grid {
        gap: var(--gap-lg);
    }
}

/* ===== LANDSCAPE MOBILE ===== */
@media (max-height: 768px) and (orientation: landscape) {
    /* Reduce vertical padding in landscape */
    section {
        padding-top: calc(var(--section-padding-block) * 0.5);
        padding-bottom: calc(var(--section-padding-block) * 0.5);
    }
}

/* ===== SPACING UTILITIES ===== */

/* Padding */
.p-0 { padding: 0; }
.p-xs { padding: var(--space-xs); }
.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }
.p-2xl { padding: var(--space-2xl); }
.p-3xl { padding: var(--space-3xl); }

/* Padding X (horizontal) */
.px-0 { padding-left: 0; padding-right: 0; }
.px-xs { padding-left: var(--space-xs); padding-right: var(--space-xs); }
.px-sm { padding-left: var(--space-sm); padding-right: var(--space-sm); }
.px-md { padding-left: var(--space-md); padding-right: var(--space-md); }
.px-lg { padding-left: var(--space-lg); padding-right: var(--space-lg); }
.px-xl { padding-left: var(--space-xl); padding-right: var(--space-xl); }

/* Padding Y (vertical) */
.py-0 { padding-top: 0; padding-bottom: 0; }
.py-xs { padding-top: var(--space-xs); padding-bottom: var(--space-xs); }
.py-sm { padding-top: var(--space-sm); padding-bottom: var(--space-sm); }
.py-md { padding-top: var(--space-md); padding-bottom: var(--space-md); }
.py-lg { padding-top: var(--space-lg); padding-bottom: var(--space-lg); }
.py-xl { padding-top: var(--space-xl); padding-bottom: var(--space-xl); }

/* Margin */
.m-0 { margin: 0; }
.m-xs { margin: var(--space-xs); }
.m-sm { margin: var(--space-sm); }
.m-md { margin: var(--space-md); }
.m-lg { margin: var(--space-lg); }
.m-xl { margin: var(--space-xl); }
.m-auto { margin: auto; }

/* Margin X (horizontal) */
.mx-0 { margin-left: 0; margin-right: 0; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mx-xs { margin-left: var(--space-xs); margin-right: var(--space-xs); }
.mx-sm { margin-left: var(--space-sm); margin-right: var(--space-sm); }
.mx-md { margin-left: var(--space-md); margin-right: var(--space-md); }
.mx-lg { margin-left: var(--space-lg); margin-right: var(--space-lg); }

/* Margin Y (vertical) */
.my-0 { margin-top: 0; margin-bottom: 0; }
.my-xs { margin-top: var(--space-xs); margin-bottom: var(--space-xs); }
.my-sm { margin-top: var(--space-sm); margin-bottom: var(--space-sm); }
.my-md { margin-top: var(--space-md); margin-bottom: var(--space-md); }
.my-lg { margin-top: var(--space-lg); margin-bottom: var(--space-lg); }
.my-xl { margin-top: var(--space-xl); margin-bottom: var(--space-xl); }

/* ===== WIDTH UTILITIES ===== */

.w-full { width: 100%; }
.w-auto { width: auto; }
.w-screen { width: 100vw; }

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

/* ===== HEIGHT UTILITIES ===== */

.h-full { height: 100%; }
.h-auto { height: auto; }
.h-screen { height: 100vh; }

.min-h-screen { min-height: 100vh; }

/* ===== OVERFLOW UTILITIES ===== */

.overflow-hidden { overflow: hidden; }
.overflow-visible { overflow: visible; }
.overflow-auto { overflow: auto; }
.overflow-scroll { overflow: scroll; }

.overflow-x-hidden { overflow-x: hidden; }
.overflow-y-hidden { overflow-y: hidden; }

/* ===== POSITION UTILITIES ===== */

.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.static { position: static; }

/* ===== DISPLAY UTILITIES ===== */

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

/* ===== TEXT UTILITIES ===== */

.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-justify { text-align: justify; }

/* ===== RESPONSIVE VISIBILITY ===== */

/* Hide on mobile */
@media (max-width: 767px) {
    .hide-mobile { display: none !important; }
}

/* Hide on tablet */
@media (min-width: 768px) and (max-width: 1023px) {
    .hide-tablet { display: none !important; }
}

/* Hide on desktop */
@media (min-width: 1024px) {
    .hide-desktop { display: none !important; }
}

/* Show only on mobile */
.show-mobile {
    display: block;
}

@media (min-width: 768px) {
    .show-mobile {
        display: none !important;
    }
}

/* Show only on desktop */
.show-desktop {
    display: none;
}

@media (min-width: 1024px) {
    .show-desktop {
        display: block;
    }
}
