/* ============================================
   Chana Pottery Studio - Main Stylesheet
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
    /* Colors */
    --color-primary: #2c2c2c;
    --color-secondary: #4a4a4a;
    --color-text: #2c2c2c;
    --color-text-light: #5a5a5a;
    --color-text-muted: #999;
    --color-background: #f9f7f4;
    --color-background-alt: #ebe7e0;
    --color-background-dark: #2c2c2c;
    --color-accent: #d4cfc4;
    --color-border: #e8e3dc;

    /* Typography */
    --font-heading: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Spacing */
    --spacing-xs: 8px;
    --spacing-sm: 16px;
    --spacing-md: 24px;
    --spacing-lg: 40px;
    --spacing-xl: 80px;
    --spacing-2xl: 120px;

    /* Layout */
    --max-width: 1400px;
    --nav-height: 80px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-medium: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--color-text);
    background-color: var(--color-background);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: opacity var(--transition-medium);
}

a:hover {
    opacity: 0.6;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 300;
    line-height: 1.2;
}

.section-title {
    font-size: clamp(32px, 5vw, 48px);
    letter-spacing: -1px;
    margin-bottom: var(--spacing-lg);
}

/* ---------- Navbar ---------- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(249, 247, 244, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 20px var(--spacing-lg);
    z-index: 1000;
    border-bottom: 1px solid var(--color-border);
    transition: transform var(--transition-medium), box-shadow var(--transition-medium);
}

.navbar.scrolled {
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
}

.navbar.hidden {
    transform: translateY(-100%);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: var(--max-width);
    margin: 0 auto;
}

.nav-left,
.nav-right {
    flex: 1;
    display: flex;
    gap: 30px;
}

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

.nav-center {
    flex: 0 0 auto;
}

.logo {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: lowercase;
}

.nav-link {
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    width: 30px;
    height: 24px;
    position: relative;
    z-index: 1001;
}

.hamburger,
.hamburger::before,
.hamburger::after {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--color-primary);
    transition: transform var(--transition-medium), opacity var(--transition-medium);
}

.hamburger {
    position: relative;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    left: 0;
}

.hamburger::before {
    top: -8px;
}

.hamburger::after {
    bottom: -8px;
}

.mobile-menu-btn.active .hamburger {
    background-color: transparent;
}

.mobile-menu-btn.active .hamburger::before {
    transform: translateY(8px) rotate(45deg);
}

.mobile-menu-btn.active .hamburger::after {
    transform: translateY(-8px) rotate(-45deg);
}

/* Mobile Menu */
.mobile-menu {
    display: none;
    flex-direction: column;
    gap: var(--spacing-md);
    padding: var(--spacing-lg) 0;
    text-align: center;
}

.mobile-menu.active {
    display: flex;
}

/* ---------- Hero Section ---------- */
.hero {
    margin-top: var(--nav-height);
    min-height: calc(100vh - var(--nav-height));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl) var(--spacing-lg);
    background-color: var(--color-background-alt);
    background-image: url('../images/hero/hero-bg.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(235, 231, 224, 0.5);
}

.hero-content {
    position: relative;
    max-width: 800px;
    text-align: center;
    z-index: 1;
    /* Frosted glass overlay box */
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: var(--spacing-xl) var(--spacing-lg);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.hero-title {
    font-size: clamp(40px, 8vw, 72px);
    letter-spacing: -1px;
    margin-bottom: var(--spacing-md);
}

.hero-description {
    font-size: clamp(16px, 2vw, 18px);
    line-height: 1.8;
    color: var(--color-text-light);
    margin-bottom: var(--spacing-lg);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ---------- CTA Button ---------- */
.cta-button {
    display: inline-block;
    padding: 16px 48px;
    background-color: var(--color-primary);
    color: var(--color-background);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: background-color var(--transition-medium), transform var(--transition-fast);
}

.cta-button:hover {
    background-color: var(--color-secondary);
    opacity: 1;
    transform: translateY(-2px);
}

/* ---------- Products Section ---------- */
.products {
    padding: var(--spacing-2xl) 0;
    overflow: hidden;
    background-color: var(--color-background);
}

.products .section-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.carousel-row {
    display: flex;
    gap: var(--carousel-gap, 30px);
    margin-bottom: 30px;
    width: max-content;
    /* Animation is set dynamically by JavaScript for seamless looping */
}

.carousel-row.scrolling {
    animation: var(--carousel-animation);
}

.carousel-row:hover,
.carousel-row.paused {
    animation-play-state: paused;
}

.carousel-row:hover {
    animation-play-state: paused;
}

.carousel-row img {
    width: 320px;
    height: auto;
    flex-shrink: 0;
    object-fit: contain;
    cursor: pointer;
    transition: transform var(--transition-slow);
}

.carousel-row img:hover {
    transform: scale(1.05);
}

/* ---------- Story Section ---------- */
.story {
    padding: var(--spacing-2xl) var(--spacing-lg);
    background-color: var(--color-background-dark);
    color: var(--color-background);
}

.story-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
    align-items: center;
}

.story-image {
    width: 100%;
    height: 600px;
    background-color: var(--color-secondary);
    overflow: hidden;
}

.story-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.story-content .section-title {
    color: var(--color-background);
}

.story-content p {
    font-size: 15px;
    line-height: 1.9;
    margin-bottom: var(--spacing-md);
    color: #d4d0c8;
}

.story-content p:last-child {
    margin-bottom: 0;
}

/* ---------- Video Section ---------- */
.video-section {
    padding: var(--spacing-2xl) var(--spacing-lg);
    background-color: var(--color-background);
}

.video-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Video Grid for Vertical Videos */
.video-grid {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    max-width: 800px;
    margin: 0 auto;
}

.video-item {
    flex: 0 1 auto;
}

.vertical-video {
    width: auto;
    height: 70vh;
    max-height: 600px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    background-color: #000;
    object-fit: cover;
}

/* Legacy Custom Video Wrapper */
.video-wrapper-custom {
    max-width: 800px;
    margin: 0 auto;
}

.video-wrapper-custom video {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    background-color: #000;
}

.video-credit {
    text-align: center;
    margin-top: var(--spacing-sm);
    font-size: 13px;
    color: var(--color-text-muted);
}

.video-credit a {
    color: var(--color-text-muted);
    text-decoration: underline;
}

.video-credit a:hover {
    color: var(--color-primary);
}

/* Instagram Embed Wrapper (legacy - keep for reference) */
.instagram-embed-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    width: 100%;
}

.instagram-embed-wrapper .instagram-media {
    max-width: 540px !important;
    min-width: 326px !important;
    width: 100% !important;
    margin: 0 auto !important;
}

/* Legacy video wrapper styles (keep for reference) */
.video-wrapper {
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    position: relative;
    background-color: var(--color-border);
    overflow: hidden;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    cursor: pointer;
}

.play-icon {
    display: block;
    width: 80px;
    height: 80px;
    margin: 0 auto var(--spacing-md);
    border: 2px solid var(--color-text-muted);
    border-radius: 50%;
    position: relative;
    transition: border-color var(--transition-medium), transform var(--transition-medium);
}

.play-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 55%;
    transform: translate(-50%, -50%);
    border-style: solid;
    border-width: 12px 0 12px 20px;
    border-color: transparent transparent transparent var(--color-text-muted);
    transition: border-color var(--transition-medium);
}

.video-placeholder:hover .play-icon {
    border-color: var(--color-primary);
    transform: scale(1.05);
}

.video-placeholder:hover .play-icon::after {
    border-left-color: var(--color-primary);
}

.video-text {
    font-size: 16px;
    letter-spacing: 1px;
    color: var(--color-text-muted);
}

/* ---------- Needle & Clay Section ---------- */
.needle-clay {
    padding: var(--spacing-2xl) var(--spacing-lg);
    background-color: var(--color-accent);
}

.needle-clay-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
    align-items: center;
}

.needle-clay-content .section-title {
    color: var(--color-text);
}

.needle-clay-content p {
    font-size: 15px;
    line-height: 1.9;
    margin-bottom: var(--spacing-md);
    color: #3a3a3a;
}

.needle-clay-content .cta-button {
    margin-top: var(--spacing-md);
}

.needle-clay-image {
    width: 100%;
    height: 600px;
    background-color: #b8b3a8;
    overflow: hidden;
}

.needle-clay-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ---------- Contact Section ---------- */
.contact {
    padding: var(--spacing-2xl) var(--spacing-lg);
    background-color: var(--color-background-alt);
}

.contact-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.contact-info {
    font-size: 18px;
    line-height: 2.2;
    margin-bottom: var(--spacing-lg);
}

.contact-info a {
    border-bottom: 1px solid var(--color-primary);
    padding-bottom: 2px;
}

.contact-info a:hover {
    opacity: 0.6;
}

.social-links {
    display: flex;
    gap: 30px;
    justify-content: center;
    margin-top: var(--spacing-lg);
}

.social-link {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* ---------- Back to Top Button ---------- */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--color-primary);
    color: var(--color-background);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity var(--transition-medium),
                visibility var(--transition-medium),
                transform var(--transition-medium),
                background-color var(--transition-medium);
    z-index: 999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background-color: var(--color-secondary);
    transform: translateY(-3px);
}

.back-to-top svg {
    width: 24px;
    height: 24px;
}

/* ---------- Footer ---------- */
.footer {
    padding: var(--spacing-lg);
    text-align: center;
    background-color: var(--color-background-dark);
    color: var(--color-background);
}

.footer p {
    font-size: 12px;
    letter-spacing: 1px;
}

/* ---------- Responsive Styles ---------- */
@media (max-width: 1024px) {
    .story-container,
    .needle-clay-container {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    .story-image,
    .needle-clay-image {
        height: 450px;
    }

    /* Fix cropping issue - keep heads visible */
    .needle-clay-image img {
        object-position: center top;
    }

    .needle-clay-container {
        direction: rtl;
    }

    .needle-clay-container > * {
        direction: ltr;
    }

    .needle-clay-image {
        order: -1;
    }

    /* Center text and button on responsive views */
    .story-content,
    .needle-clay-content {
        text-align: center;
    }

    .needle-clay-content .cta-button {
        display: inline-block;
    }
}

@media (max-width: 768px) {
    :root {
        --nav-height: 70px;
    }

    .navbar {
        padding: 15px 20px;
    }

    .nav-left,
    .nav-right {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
        align-items: center;
    }

    .logo {
        font-size: 20px;
    }

    .hero {
        min-height: calc(100vh - var(--nav-height));
        padding: var(--spacing-lg) 20px;
    }

    .hero-content {
        padding: var(--spacing-lg) var(--spacing-md);
        border-radius: 16px;
        margin: 0 10px;
    }

    .carousel-row img {
        width: 240px;
        height: auto;
    }

    .story-image,
    .needle-clay-image {
        height: 350px;
    }

    .video-section {
        padding: var(--spacing-xl) 20px;
    }

    .video-grid {
        gap: var(--spacing-md);
    }

    .vertical-video {
        height: 50vh;
        max-height: 400px;
    }
}

@media (max-width: 480px) {
    .carousel-row img {
        width: 200px;
        height: auto;
    }

    .cta-button {
        padding: 14px 36px;
        font-size: 12px;
    }

    .social-links {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .back-to-top {
        width: 44px;
        height: 44px;
        bottom: 20px;
        right: 20px;
    }

    .back-to-top svg {
        width: 20px;
        height: 20px;
    }

    .video-grid {
        flex-direction: column;
        align-items: center;
        gap: var(--spacing-md);
    }

    .vertical-video {
        height: 60vh;
        max-height: 450px;
        width: 100%;
        max-width: 280px;
    }
}

/* ---------- Utility Classes ---------- */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Animations ---------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* Fade in animation for sections */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}
