/* ==========================================================================
   BHU Ceramics - Main Stylesheet
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design Tokens & CSS Variables
   -------------------------------------------------------------------------- */
:root {
    /* Brand & Accent Colors */
    --brand-color: #9F5331;
    --brand-color-dark: #7b3e23;
    --brand-color-light: #c86c43;
    --primary-gradient-start: #0d9488;
    --primary-gradient-end: #14b8a6;
    --secondary-color: #fb7185;
    --accent-warm: #f59e0b;

    /* Neutrals */
    --neutral-50: #fafaf9;
    --neutral-100: #f5f5f4;
    --neutral-200: #e7e5e4;
    --neutral-700: #44403c;
    --neutral-800: #292524;
    --neutral-900: #1c1917;

    /* Backgrounds */
    --bg-page: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --bg-card-glass: rgba(255, 255, 255, 0.92);
    --bg-glass-dark: rgba(0, 0, 0, 0.75);
    --bg-nav-dark: rgba(28, 25, 23, 0.92);

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Outfit', sans-serif;

    /* Elevation & Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.15), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* --------------------------------------------------------------------------
   2. Global & Base Styles
   -------------------------------------------------------------------------- */
html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-page);
    background-attachment: fixed;
    color: var(--neutral-800);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
}

/* Base Link Behaviors */
p a {
    color: var(--primary-gradient-end);
    transition: color var(--transition-base);
}

p a:hover {
    color: var(--secondary-color);
}

footer span a { 
    color: #FFF;
    transition: opacity var(--transition-base);
}

footer span a:hover {
    opacity: 0.8;
}

/* Layout Utilities */
.tm-container {
    max-width: 1200px;
}

.tm-intro-width {
    max-width: 436px;
}

.parallax-window {
    min-height: 1064px;
    background: transparent;
    position: relative;
}

/* Modern Text Utilities */
.brand-heading {
    color: var(--brand-color) !important;
    font-weight: 700;
}

.tm-text-yellow {
    background: linear-gradient(135deg, var(--accent-warm) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
}

.tm-text-green {
    color: var(--primary-gradient-start);
    font-weight: 600;
}

.tm-text-2xl {
    font-size: 1.25rem;
    line-height: 2rem;
}

/* Buttons and Card Containers */
a.tm-bg-green {
    background: linear-gradient(135deg, var(--primary-gradient-start) 0%, var(--primary-gradient-end) 100%);
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
}

a.tm-bg-green:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
    filter: brightness(1.1);
}

.tm-item-container {
    max-width: 520px;
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.85) !important;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow-2xl);
    transition: all var(--transition-base);
}

.tm-item-container:hover {
    transform: translateY(-4px);
    box-shadow: 0 30px 60px -15px rgb(0 0 0 / 0.3);
}

.bg-white {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(20px);
}

/* --------------------------------------------------------------------------
   3. Navigation Bar (Desktop & Mobile)
   -------------------------------------------------------------------------- */
#tm-nav {
    z-index: 1000;
    transition: all var(--transition-base);
    backdrop-filter: blur(10px);
}

#tm-nav.scroll {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-lg);
}

.topnav {
    background: var(--bg-nav-dark);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.topnav::after {
    content: "";
    display: table;
    clear: both;
}

.topnav a {
    float: left;
    display: block;
    color: #f5f5f4;
    text-align: center;
    padding: 1rem 1.25rem;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: all var(--transition-base);
    position: relative;
}

.topnav a.active {
    background: linear-gradient(135deg, var(--primary-gradient-start) 0%, var(--primary-gradient-end) 100%);
    color: white;
    border-radius: 8px;
}

.topnav a:hover,
.dropdown:hover .dropbtn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary-gradient-end);
    border-radius: 8px;
}

.topnav .icon {
    display: none;
}

/* Dropdown Sub-menu */
.dropdown {
    float: left;
    position: relative;
}

.dropdown .dropbtn {
    font-size: 1rem;
    border: none;
    outline: none;
    color: #f5f5f4;
    padding: 1rem 1.25rem;
    background-color: inherit;
    font-family: inherit;
    margin: 0;
    font-weight: 500;
    transition: all var(--transition-base);
    cursor: pointer;
}

.dropdown-content {
    display: none;
    position: absolute;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    min-width: 210px;
    box-shadow: var(--shadow-xl);
    z-index: 1001;
    border-radius: 12px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.dropdown-content a {
    float: none;
    color: var(--neutral-800);
    padding: 0.875rem 1.25rem;
    text-decoration: none;
    display: block;
    text-align: left;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.dropdown-content a:hover {
    background: linear-gradient(135deg, var(--primary-gradient-start) 0%, var(--primary-gradient-end) 100%);
    color: white;
    transform: translateX(4px);
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* Mobile Nav Styles */
@media screen and (max-width: 768px) {
    .topnav a:not(:first-child),
    .dropdown .dropbtn {
        display: none;
    }

    .topnav a.icon {
        float: right;
        display: block;
    }

    .topnav.responsive {
        position: relative;
    }

    .topnav.responsive a.icon {
        position: absolute;
        right: 0;
        top: 0;
    }

    .topnav.responsive a {
        float: none;
        display: block;
        text-align: left;
    }

    .topnav.responsive .dropdown {
        float: none;
        display: block;
    }

    .topnav.responsive .dropdown-content {
        position: static;
        display: block;
        box-shadow: none;
        background: rgba(0, 0, 0, 0.2);
        margin-top: 0;
        border-radius: 0;
    }

    .topnav.responsive .dropdown-content a {
        color: #f5f5f4;
        padding-left: 2rem;
    }

    .topnav.responsive .dropdown .dropbtn {
        display: block;
        width: 100%;
        text-align: left;
    }
}

/* --------------------------------------------------------------------------
   4. Products Horizontal Grid & Boxes (Index Page)
   -------------------------------------------------------------------------- */
.products-section-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

.category-header {
    margin-bottom: 2.5rem;
    text-align: center;
}

.category-title-block {
    display: inline-block;
    background: var(--bg-glass-dark);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.75rem 2.5rem;
    border-radius: 9999px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.category-title {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
    margin: 0;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5rem;
    margin-bottom: 4rem;
}

.product-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card-glass);
    backdrop-filter: blur(16px);
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: var(--shadow-xl);
    text-decoration: none;
    transition: all var(--transition-base);
    height: 100%;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 35px -5px rgba(0, 0, 0, 0.25), 0 10px 15px -5px rgba(0, 0, 0, 0.15);
    border-color: rgba(13, 148, 136, 0.5);
}

/* Aspect-ratio container prevents Cumulative Layout Shifts */
.product-card-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background-color: #f3f4f6;
}

.product-card-image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.product-card:hover .product-card-image-wrapper img {
    transform: scale(1.08);
}

.product-card-content {
    padding: 1.25rem 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    background: #ffffff;
}

.product-card-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    transition: color var(--transition-base);
}

.product-card:hover .product-card-title {
    color: var(--primary-gradient-start);
}

.product-card-action {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--primary-gradient-start);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    opacity: 0.85;
    transition: opacity var(--transition-base);
}

.product-card:hover .product-card-action {
    opacity: 1;
}

/* --------------------------------------------------------------------------
   5. Content Pages (Residency, Biography, Classes, Exhibitions)
   -------------------------------------------------------------------------- */
#ar_content {
    padding-top: 9rem;
    padding-bottom: 4rem;
    max-width: 900px;
    margin: 0 auto;
}

.content-glass-panel {
    background: rgba(255, 255, 255, 0.92) !important;
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: var(--shadow-xl);
    padding: 2.5rem 2rem;
}

#ar_content p {
    color: var(--neutral-800);
}

/* --------------------------------------------------------------------------
   6. Gallery Polaroid Layout (Product Detail & Showcase Pages)
   -------------------------------------------------------------------------- */
.gallery-body {
    background-color: var(--brand-color) !important;
    background-image: none;
}

.gallery-container {
    padding: 90px 1rem 3rem 1rem;
    max-width: 1000px;
    margin: 0 auto;
}

div.polaroid {
    background-color: #ffffff;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
    margin-bottom: 2rem;
    border-radius: 12px;
    overflow: hidden;
    transition: transform var(--transition-base);
}

div.polaroid:hover {
    transform: translateY(-4px);
}

div.polaroid-caption {
    text-align: center;
    padding: 1rem 1.25rem;
    color: var(--neutral-800);
}

/* --------------------------------------------------------------------------
   7. Media Queries & Responsive Grid
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem;
    }
    
    .category-title {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }

    .category-title-block {
        padding: 0.5rem 1.5rem;
    }
}
