/* Shared Shell Layout for Healing Happens Here Microsite */
/* Consistent spacing, responsive design, and background tokens */

/* CSS Custom Properties / Design Tokens */
:root {
    /* Layout Tokens */
    --max-content-width: 1200px;
    --gutter-mobile: 1.5rem;
    --gutter-tablet: 2rem;
    --gutter-desktop: 3rem;
    
    /* Section Rhythm */
    --section-padding-mobile: 5rem;
    --section-padding-xl: 7rem;
    
    /* Background Tokens */
    --bg-paper: #ffffff;
    --paper: #ffffff;
    --paper-2: #f8f8f8;
    --bg-gradient: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
    --ocean-overlay: rgba(0, 0, 0, 0.4);
    --bg-stripes: repeating-linear-gradient(
        45deg,
        #2a2a2a,
        #2a2a2a 10px,
        #252525 10px,
        #252525 20px
    );
    --bg-ocean: radial-gradient(
        circle at 30% 50%,
        rgba(8, 146, 208, 0.2) 0%,
        rgba(12, 64, 101, 0.15) 40%,
        transparent 70%
    ), linear-gradient(180deg, #1a2a2a 0%, #0f1a1a 100%);
    
    /* Colors */
    --color-primary: #0C4065;
    --color-secondary: #0892D0;
    --color-dark: #2a2a2a;
    --color-darker: #1a1a1a;
    --color-text: #d0d0d0;
    --color-text-muted: #b0b0b0;
    --color-white: #ffffff;
    
    /* Z-index layers */
    --z-header: 1000;
    --z-dropdown: 1100;
    --z-modal: 2000;
    --z-toast: 3000;
}

/* Shell Container */
.shell-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-gradient);
}

/* Header Sticky Positioning */
.site-header {
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.site-header.scrolled {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* Main Content Area */
.main-content {
    flex: 1;
    width: 100%;
}

/* Content Width Container */
.content-container {
    width: 100%;
    max-width: none;
    margin: 0 auto;
    padding-left: clamp(1rem, 3vw, 1.75rem);
    padding-right: clamp(1rem, 3vw, 1.75rem);
}

/* Section Rhythm */
.section {
    padding-top: var(--section-padding-mobile);
    padding-bottom: var(--section-padding-mobile);
}

@media (min-width: 1280px) {
    .section {
        padding-top: var(--section-padding-xl);
        padding-bottom: var(--section-padding-xl);
    }
}

/* Section Variants with reduced padding */
.section-sm {
    padding-top: calc(var(--section-padding-mobile) * 0.6);
    padding-bottom: calc(var(--section-padding-mobile) * 0.6);
}

@media (min-width: 1280px) {
    .section-sm {
        padding-top: calc(var(--section-padding-xl) * 0.6);
        padding-bottom: calc(var(--section-padding-xl) * 0.6);
    }
}

.section-lg {
    padding-top: calc(var(--section-padding-mobile) * 1.4);
    padding-bottom: calc(var(--section-padding-mobile) * 1.4);
}

@media (min-width: 1280px) {
    .section-lg {
        padding-top: calc(var(--section-padding-xl) * 1.4);
        padding-bottom: calc(var(--section-padding-xl) * 1.4);
    }
}

/* Background Utilities */
.bg-paper {
    background: var(--bg-paper);
    color: var(--color-dark);
}

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

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

/* Enhanced Background Helpers */

/* Blue Horizontal Stripes - Seamless SVG Pattern */
.bg-stripes {
    background-color: #0C4065;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='20' viewBox='0 0 100 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%230892D0' fill-opacity='0.08'%3E%3Crect width='100' height='10' y='0'/%3E%3C/g%3E%3C/svg%3E");
    background-repeat: repeat;
    color: var(--color-white);
}

/* Alternative: Layered Gradients for Stripes */
.bg-stripes-gradient {
    background: 
        linear-gradient(0deg, transparent 50%, rgba(8, 146, 208, 0.08) 50%),
        linear-gradient(0deg, transparent 50%, rgba(8, 146, 208, 0.08) 50%);
    background-color: #0C4065;
    background-size: 100% 20px, 100% 20px;
    background-position: 0 0, 0 10px;
    color: var(--color-white);
}

/* Ocean Background with Image Layer */
.bg-ocean {
    position: relative;
    background-color: #0f1a1a;
    color: var(--color-white);
}

.bg-ocean::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('/healing/assets/ocean-texture.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.3;
    z-index: 0;
}

.bg-ocean::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--ocean-overlay);
    background-image: radial-gradient(
        circle at 30% 50%,
        rgba(8, 146, 208, 0.15) 0%,
        rgba(12, 64, 101, 0.15) 40%,
        transparent 70%
    );
    z-index: 1;
}

.bg-ocean > * {
    position: relative;
    z-index: 2;
}

/* Paper Gradient - Subtle Vertical */
.bg-paper-gradient {
    background: linear-gradient(
        180deg,
        var(--paper) 0%,
        var(--paper-2) 100%
    );
    color: var(--color-dark);
}

/* Prevent Layout Shift */
.site-header {
    /*min-height: 80px;*/
}

.site-footer {
    min-height: 300px;
}

/* Content Skeleton (prevents layout shift) */
.content-skeleton {
    min-height: 400px;
}

/* Generous Gutters - Responsive Grid */
.grid-container {
    display: grid;
    gap: var(--gutter-mobile);
    max-width: var(--max-content-width);
    margin: 0 auto;
    padding-left: var(--gutter-mobile);
    padding-right: var(--gutter-mobile);
}

@media (min-width: 768px) {
    .grid-container {
        gap: var(--gutter-tablet);
        padding-left: var(--gutter-tablet);
        padding-right: var(--gutter-tablet);
    }
}

@media (min-width: 1280px) {
    .grid-container {
        gap: var(--gutter-desktop);
        padding-left: var(--gutter-desktop);
        padding-right: var(--gutter-desktop);
    }
}

/* Grid Variants */
.grid-2 {
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

.grid-3 {
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

.grid-4 {
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Flex Container with Gutters */
.flex-container {
    display: flex;
    gap: var(--gutter-mobile);
    max-width: var(--max-content-width);
    margin: 0 auto;
    padding-left: var(--gutter-mobile);
    padding-right: var(--gutter-mobile);
}

@media (min-width: 768px) {
    .flex-container {
        gap: var(--gutter-tablet);
        padding-left: var(--gutter-tablet);
        padding-right: var(--gutter-tablet);
    }
}

@media (min-width: 1280px) {
    .flex-container {
        gap: var(--gutter-desktop);
        padding-left: var(--gutter-desktop);
        padding-right: var(--gutter-desktop);
    }
}

/* Typography Rhythm */
.prose {
    max-width: 65ch;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
    margin-top: 2em;
    margin-bottom: 0.75em;
    line-height: 1.2;
}

.prose h1:first-child,
.prose h2:first-child,
.prose h3:first-child,
.prose h4:first-child {
    margin-top: 0;
}

.prose p {
    margin-bottom: 1.25em;
    line-height: 1.7;
}

.prose ul,
.prose ol {
    margin-bottom: 1.25em;
    padding-left: 1.5em;
}

.prose li {
    margin-bottom: 0.5em;
}

/* Utility Classes */
.container-narrow {
    max-width: 800px;
    margin: 0 auto;
    padding-left: var(--gutter-mobile);
    padding-right: var(--gutter-mobile);
}

@media (min-width: 768px) {
    .container-narrow {
        padding-left: var(--gutter-tablet);
        padding-right: var(--gutter-tablet);
    }
}

.container-wide {
    max-width: 1400px;
    margin: 0 auto;
    padding-left: var(--gutter-mobile);
    padding-right: var(--gutter-mobile);
}

@media (min-width: 768px) {
    .container-wide {
        padding-left: var(--gutter-tablet);
        padding-right: var(--gutter-tablet);
    }
}

@media (min-width: 1280px) {
    .container-wide {
        padding-left: var(--gutter-desktop);
        padding-right: var(--gutter-desktop);
    }
}

/* Spacing Utilities */
.space-y-4 > * + * {
    margin-top: 1rem;
}

.space-y-8 > * + * {
    margin-top: 2rem;
}

.space-y-12 > * + * {
    margin-top: 3rem;
}

.space-y-16 > * + * {
    margin-top: 4rem;
}

/* Responsive Visibility */
.mobile-only {
    display: block;
}

.desktop-only {
    display: none;
}

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

/* Smooth Scroll Behavior */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px; /* Account for sticky header */
}

/* Prevent Flash of Unstyled Content */
body {
    opacity: 0;
    animation: fadeIn 0.3s ease-in forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Print Styles */
@media print {
    .site-header,
    .site-footer {
        position: static;
    }
    
    .no-print {
        display: none !important;
    }
}
