/**
 * ========================================================
 * LAYOUT.CSS - Grid System, Containers & Sections
 * ========================================================
 *
 * This file defines the structural layout components for
 * the Spirit Skin Slim Bloom website.
 *
 * Contents:
 * 1. Container Classes
 * 2. Section Layouts
 * 3. Grid Systems
 * 4. Flexbox Utilities
 * 5. Header Layout
 * 6. Footer Layout
 * 7. Page Layouts
 *
 * Dependencies: variables.css
 *
 * ========================================================
 */


/* ========================================================
   1. CONTAINER CLASSES
   ========================================================
   Centered content containers with responsive padding
   ======================================================== */

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

/* Narrow container for text-heavy content */
.container--narrow {
    max-width: var(--container-narrow);
}

/* Wide container for full-width layouts */
.container--wide {
    max-width: var(--container-wide);
}

/* Full width container (no max-width) */
.container--fluid {
    max-width: none;
}

/* Remove horizontal padding */
.container--flush {
    padding-left: 0;
    padding-right: 0;
}


/* ========================================================
   2. SECTION LAYOUTS
   ========================================================
   Standard section spacing and backgrounds
   ======================================================== */

.section {
    padding-top: var(--section-padding-y);
    padding-bottom: var(--section-padding-y);
    position: relative;
}

/* Section size variants */
.section--sm {
    padding-top: var(--space-xl);
    padding-bottom: var(--space-xl);
}

.section--lg {
    padding-top: var(--space-4xl);
    padding-bottom: var(--space-4xl);
}

/* Section with no padding */
.section--flush {
    padding: 0;
}

/* Section backgrounds */
.section--primary {
    background-color: var(--color-primary);
    color: var(--color-white);
}

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

.section--dark {
    background-color: var(--color-near-black);
    color: var(--color-cream);
}

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

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

/* Section Header (title area) */
.section-header {
    margin-bottom: var(--space-xl);
}

.section-label {
    display: inline-block;
    font-family: var(--font-body);
    font-size: var(--font-size-small);
    font-weight: var(--font-weight-medium);
    letter-spacing: var(--letter-spacing-widest);
    text-transform: uppercase;
    color: var(--color-primary);
    margin-bottom: var(--space-sm);
}

.bg-primary .section-label {
    color: var(--color-gold-light);
}

.section-title {
    font-family: var(--font-display);
    font-size: var(--font-size-h2);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    margin-bottom: var(--space-sm);
}

.section-description {
    font-size: var(--font-size-body-lg);
    color: var(--color-dark-gray);
    max-width: 600px;
}

.section-header.text-center .section-description {
    margin-left: auto;
    margin-right: auto;
}

.section-intro {
    font-size: var(--font-size-body-lg);
    line-height: var(--line-height-loose);
    color: var(--color-dark-gray);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}


/* ========================================================
   3. GRID SYSTEMS
   ========================================================
   CSS Grid layouts for various content arrangements
   ======================================================== */

/* Base Grid */
.grid {
    display: grid;
    gap: var(--space-lg);
}

/* Auto-fit responsive grid */
.grid--auto {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* Column variants */
.grid--2 {
    grid-template-columns: repeat(2, 1fr);
}

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

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

/* Responsive grid stacking */
@media (max-width: 768px) {
    .grid--2,
    .grid--3,
    .grid--4 {
        grid-template-columns: 1fr;
    }
}

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

/* Card Grid - Specifically for card layouts */
.card-grid {
    display: grid;
    gap: var(--space-lg);
}

.card-grid--2 {
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
}

.card-grid--3 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.card-grid--4 {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* Product Grid */
.product-grid {
    display: grid;
    gap: var(--space-lg);
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* Features Grid */
.features-grid {
    display: grid;
    gap: var(--space-xl);
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Testimonials Grid */
.testimonials-slider {
    display: grid;
    gap: var(--space-lg);
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}


/* ========================================================
   4. FLEXBOX UTILITIES
   ========================================================
   Flexible box layouts for various arrangements
   ======================================================== */

.flex {
    display: flex;
}

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

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

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

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

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

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

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

.flex-1 {
    flex: 1;
}

.flex-grow {
    flex-grow: 1;
}

.flex-shrink-0 {
    flex-shrink: 0;
}

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


/* ========================================================
   5. HEADER LAYOUT
   ========================================================
   Fixed navigation header structure

   DESIGN SPECIFICATIONS:
   - Initially transparent with light text (on dark hero)
   - Becomes solid white/cream with dark text after 100px scroll
   - Smooth transition (300ms ease)
   - Sticky position at top
   - Z-index above all content

   Desktop (>1024px): Logo left, Navigation center, CTA right
   Mobile (<768px): Logo left, Hamburger right
   ======================================================== */

/* ========================
   SKIP LINK
   ======================== */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    z-index: calc(var(--z-maximum) + 1);
    padding: var(--space-sm) var(--space-lg);
    background-color: var(--color-primary);
    color: var(--color-white);
    font-weight: var(--font-weight-medium);
    text-decoration: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    transition: top var(--transition-normal) var(--ease-smooth);
}

.skip-link:focus {
    top: 0;
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
}

/* ========================
   HEADER BASE STYLES
   ======================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-header);
    transition: background-color 300ms ease,
                box-shadow 300ms ease,
                transform 300ms ease;
}

/* ========================
   HEADER - TRANSPARENT STATE
   ========================
   Initially transparent with light text
   Used on pages with dark hero backgrounds
   ======================== */
.header--transparent {
    background-color: transparent;
    box-shadow: none;
}

.header--transparent .logo {
    color: var(--color-white);
}

.header--transparent .logo:hover {
    color: var(--color-cream);
}

.header--transparent .nav__link {
    color: var(--color-white);
}

.header--transparent .nav__link:hover,
.header--transparent .nav__link:focus {
    color: var(--color-cream);
}

.header--transparent .nav__link--active {
    color: var(--color-cream);
}

.header--transparent .nav-toggle__bar {
    background-color: var(--color-white);
}

/* ========================
   HEADER - SCROLLED STATE
   ========================
   Solid white/cream background with dark text
   Activated after 100px scroll
   ======================== */
.header--scrolled {
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

.header--scrolled .logo {
    color: var(--color-primary);
}

.header--scrolled .logo:hover {
    color: var(--color-primary-dark);
}

.header--scrolled .nav__link {
    color: var(--color-charcoal);
}

.header--scrolled .nav__link:hover,
.header--scrolled .nav__link:focus {
    color: var(--color-primary);
}

.header--scrolled .nav__link--active {
    color: var(--color-primary);
}

.header--scrolled .nav-toggle__bar {
    background-color: var(--color-charcoal);
}

/* ========================
   HEADER - HIDDEN STATE
   ========================
   For hide-on-scroll behavior (optional)
   ======================== */
.header--hidden {
    transform: translateY(-100%);
}

/* ========================
   HEADER CONTAINER
   ======================== */
.header__container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--nav-height);
    gap: var(--space-lg);
}

/* ========================
   LOGO STYLES
   ======================== */
.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 2.5vw, 1.375rem);
    font-weight: var(--font-weight-semibold);
    color: var(--color-primary);
    text-decoration: none;
    transition: color 300ms ease,
                transform 300ms ease;
    flex-shrink: 0;
    position: relative;
    z-index: var(--z-maximum);
}

.logo:hover {
    color: var(--color-primary-dark);
    transform: scale(1.02);
}

.logo:focus {
    outline: 2px solid var(--color-accent);
    outline-offset: 4px;
    border-radius: var(--radius-sm);
}

.logo__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    flex-shrink: 0;
}

.logo__svg {
    width: 28px;
    height: 28px;
    transition: transform 300ms ease;
}

.logo:hover .logo__svg {
    transform: rotate(10deg) scale(1.1);
}

.logo__text {
    letter-spacing: 0.02em;
    white-space: nowrap;
}

/* Hide full logo text on very small screens */
@media (max-width: 400px) {
    .logo__text {
        font-size: 1rem;
    }
}

/* ========================
   NAVIGATION - DESKTOP
   ======================== */
.nav {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
}

.nav__list {
    display: flex;
    align-items: center;
    gap: var(--space-2xs);
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav__item {
    position: relative;
}

/* ========================
   NAVIGATION LINKS
   ========================
   - Font: Outfit, 500 weight, slightly letterspaced
   - Size: 0.875rem (14px)
   - Subtle hover underline animation (left to right)
   - Active page: Underline visible
   ======================== */
.nav__link {
    display: inline-flex;
    align-items: center;
    position: relative;
    padding: 0.625rem 1rem;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-charcoal);
    text-decoration: none;
    transition: color 300ms ease;
    overflow: hidden;
}

.nav__link-text {
    position: relative;
    z-index: 1;
}

/* Underline animation element */
.nav__link-underline {
    position: absolute;
    bottom: 0.375rem;
    left: 1rem;
    right: 1rem;
    height: 2px;
    background-color: currentColor;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover: Underline animates from left to right */
.nav__link:hover .nav__link-underline,
.nav__link:focus .nav__link-underline {
    transform: scaleX(1);
}

/* Active state: Underline always visible */
.nav__link--active .nav__link-underline {
    transform: scaleX(1);
}

/* Focus visible state */
.nav__link:focus {
    outline: none;
}

.nav__link:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* ========================
   CTA BUTTON - HEADER
   ========================
   - Background: Rose gold (#B76E79)
   - Text: White
   - Border radius: 50px (pill shape)
   - Padding: 12px 28px
   - Hover: Darken slightly, subtle scale
   ======================== */
.btn--cta,
.nav__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--color-white);
    background-color: #B76E79;
    border: none;
    border-radius: 50px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 300ms ease,
                transform 300ms ease,
                box-shadow 300ms ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn--cta:hover,
.nav__cta:hover {
    background-color: #A35F69;
    transform: scale(1.03);
    box-shadow: 0 4px 15px rgba(183, 110, 121, 0.35);
}

.btn--cta:focus,
.nav__cta:focus {
    outline: none;
}

.btn--cta:focus-visible,
.nav__cta:focus-visible {
    outline: 2px solid var(--color-white);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(183, 110, 121, 0.5);
}

.btn--cta:active,
.nav__cta:active {
    transform: scale(0.98);
}

/* ========================
   MOBILE MENU TOGGLE
   ========================
   - Hamburger icon with animated transition
   - Visible only on mobile (<1024px)
   - Minimum touch target: 44x44px
   ======================== */
.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: calc(var(--z-maximum) + 1);
    position: relative;
}

.nav-toggle:focus {
    outline: none;
}

.nav-toggle:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

.nav-toggle__wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 24px;
    height: 24px;
}

.nav-toggle__bar {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--color-charcoal);
    border-radius: 2px;
    transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1),
                opacity 300ms cubic-bezier(0.4, 0, 0.2, 1),
                background-color 300ms ease;
    transform-origin: center;
}

/* Hamburger to X animation */
.nav-toggle.is-active .nav-toggle__bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle.is-active .nav-toggle__bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.nav-toggle.is-active .nav-toggle__bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* When menu is active, ensure bars are dark */
.nav-toggle.is-active .nav-toggle__bar {
    background-color: var(--color-charcoal);
}

/* ========================
   MOBILE MENU HEADER
   ========================
   Visible only in mobile menu
   ======================== */
.nav__header {
    display: none;
}

/* ========================
   MOBILE MENU CLOSE BUTTON
   ======================== */
.nav__close {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: var(--radius-full);
    color: var(--color-charcoal);
    cursor: pointer;
    transition: background-color 300ms ease,
                color 300ms ease;
}

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

.nav__close:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* ========================
   MOBILE MENU FOOTER
   ========================
   Social icons - visible only in mobile menu
   ======================== */
.nav__footer {
    display: none;
}

.nav__footer-text {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-medium-gray);
    margin-bottom: var(--space-sm);
}

.nav__social {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.nav__social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background-color: var(--color-secondary);
    color: var(--color-charcoal);
    transition: background-color 300ms ease,
                color 300ms ease,
                transform 300ms ease;
}

.nav__social-link:hover {
    background-color: var(--color-primary);
    color: var(--color-white);
    transform: translateY(-2px);
}

.nav__social-link:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* ========================
   MOBILE OVERLAY
   ======================== */
.nav-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 300ms ease,
                visibility 300ms ease;
    z-index: 399;
    pointer-events: none;
}

.nav-overlay.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}


/* ========================================================
   6. FOOTER LAYOUT
   ========================================================
   Multi-column footer structure
   ======================================================== */

.footer {
    background-color: var(--color-near-black);
    color: var(--color-cream);
    padding: var(--space-3xl) 0 var(--space-lg);
}

.footer__grid {
    display: grid;
    gap: var(--space-xl);
    grid-template-columns: 2fr repeat(3, 1fr);
    margin-bottom: var(--space-2xl);
}

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

@media (max-width: 640px) {
    .footer__grid {
        grid-template-columns: 1fr;
    }
}

.footer__brand {
    max-width: 320px;
}

.footer__logo {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: var(--font-weight-semibold);
    color: var(--color-white);
    text-decoration: none;
    margin-bottom: var(--space-sm);
}

.footer__tagline {
    font-family: var(--font-accent);
    font-style: italic;
    color: var(--color-gold);
    margin-bottom: var(--space-md);
}

.footer__description {
    font-size: var(--font-size-small);
    color: var(--color-medium-gray);
    line-height: var(--line-height-loose);
    margin-bottom: var(--space-lg);
}

/* Footer navigation */
.footer__heading {
    font-family: var(--font-body);
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-semibold);
    color: var(--color-white);
    margin-bottom: var(--space-md);
}

.footer__list {
    list-style: none;
}

.footer__list li {
    margin-bottom: var(--space-xs);
}

.footer__link {
    font-size: var(--font-size-small);
    color: var(--color-medium-gray);
    text-decoration: none;
    transition: var(--transition-colors);
}

.footer__link:hover {
    color: var(--color-primary-light);
}

/* Footer contact */
.footer__address {
    font-size: var(--font-size-small);
    color: var(--color-medium-gray);
    line-height: var(--line-height-loose);
}

.footer__address p {
    margin-bottom: var(--space-sm);
}

.footer__subheading {
    font-size: var(--font-size-small);
    font-weight: var(--font-weight-semibold);
    color: var(--color-white);
    margin-top: var(--space-md);
    margin-bottom: var(--space-xs);
}

.footer__hours {
    font-size: var(--font-size-small);
    color: var(--color-medium-gray);
}

.footer__hours p {
    margin-bottom: var(--space-3xs);
}

/* Social links */
.social-links {
    display: flex;
    gap: var(--space-sm);
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--color-cream);
    transition: var(--transition-base);
}

.social-link:hover {
    background-color: var(--color-primary);
    color: var(--color-white);
    transform: translateY(-2px);
}

.social-link svg {
    width: 20px;
    height: 20px;
}

/* Footer bottom */
.footer__bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md);
    padding-top: var(--space-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer__copyright {
    font-size: var(--font-size-small);
    color: var(--color-medium-gray);
}

.footer__legal {
    display: flex;
    gap: var(--space-md);
}

.footer__legal-link {
    font-size: var(--font-size-small);
    color: var(--color-medium-gray);
    text-decoration: none;
    transition: var(--transition-colors);
}

.footer__legal-link:hover {
    color: var(--color-primary-light);
}


/* ========================================================
   7. PAGE LAYOUTS
   ========================================================
   Common page structure patterns
   ======================================================== */

/* Page wrapper */
.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-wrapper main {
    flex: 1;
}

/* Page header (for inner pages) */
.page-header {
    padding: var(--space-4xl) 0 var(--space-2xl);
    background: var(--gradient-cream);
    margin-top: var(--nav-height);
    text-align: center;
}

.page-header__title {
    font-size: var(--font-size-h1);
    margin-bottom: var(--space-md);
}

.page-header__description {
    font-size: var(--font-size-body-lg);
    color: var(--color-dark-gray);
    max-width: 600px;
    margin: 0 auto;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    font-size: var(--font-size-small);
    margin-bottom: var(--space-md);
}

.breadcrumb__item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.breadcrumb__link {
    color: var(--color-dark-gray);
    text-decoration: none;
    transition: var(--transition-colors);
}

.breadcrumb__link:hover {
    color: var(--color-primary);
}

.breadcrumb__separator {
    color: var(--color-medium-gray);
}

.breadcrumb__current {
    color: var(--color-charcoal);
    font-weight: var(--font-weight-medium);
}

/* Two column layout */
.layout-sidebar {
    display: grid;
    gap: var(--space-xl);
    grid-template-columns: 1fr 300px;
}

@media (max-width: 1024px) {
    .layout-sidebar {
        grid-template-columns: 1fr;
    }
}

/* Centered content layout */
.layout-centered {
    max-width: var(--container-narrow);
    margin: 0 auto;
}
