/* 
   Project: Iris Atzmon Interior Design
   Theme: Calm, Elegant, Cream/Light-Brown/Black
*/

:root {
    /* Color Palette */
    --color-cream: #F9F7F2;
    --color-light-brown: #DCC8B3;
    /* Muted Terra-cotta / Sand */
    --color-dark-brown: #8C7868;
    --color-black: #1A1A1A;
    --color-grey: #666666;
    --color-white: #FFFFFF;
    --color-overlay: rgba(0, 0, 0, 0.3);

    /* Typography */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Outfit', sans-serif;

    /* Spacing */
    --container-width: 1200px;
    --section-padding: 100px 0;

    /* Transitions */
    --transition-slow: 0.6s ease;
    --transition-fast: 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-black);
    color: var(--color-white);
    line-height: 1.6;
    overflow-x: hidden;
}

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

ul {
    list-style: none;
}

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

/* Utility Classes */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.section-padding {
    padding: var(--section-padding);
}

.bg-light {
    background-color: var(--color-black);
    /* Was white, now dark */
}

.about-profile-img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 3/4;
    object-fit: cover;
    /* Optional: minimal styling if needed */
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    font-weight: 400;
}

h1 {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

p {
    margin-bottom: 1.5rem;
    color: #CCCCCC;
    /* Light grey for text on dark */
}

.divider {
    width: 60px;
    height: 2px;
    background-color: var(--color-light-brown);
    margin-bottom: 2rem;
}

/* Header */
#main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 30px 0;
    /* Slightly taller initial padding */
    background-color: transparent;
    transition: all 0.3s;
    border-bottom: none;
}

#main-header.scrolled {
    padding: 10px 0;
    background-color: rgba(26, 26, 26, 0.95);
    /* Dark background */
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 1.2rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--color-white);
    /* White on hero */
}

/* Hide header logo on desktop */
.header-logo-container {
    display: none;
}

#main-header.scrolled .logo a {
    color: var(--color-white);
    /* Keep white on scroll */
}

#main-nav ul {
    display: flex;
    gap: 40px;
}

.nav-link {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    color: var(--color-white);
    /* White on hero */
}

#main-header.scrolled .nav-link {
    color: var(--color-white);
    /* Keep white on scroll */
}

#main-header.scrolled .nav-link:hover,
#main-header.scrolled .nav-link.active {
    color: var(--color-light-brown);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--color-white);
    transition: var(--transition-fast);
}

#main-header.scrolled .nav-link::after {
    background-color: var(--color-white);
}

.nav-link:hover::after {
    width: 100%;
}

.mobile-menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-white);
}

#main-header.scrolled .mobile-menu-toggle {
    color: var(--color-white);
}

/* Hero Section */
#hero {
    height: 100vh;
    display: flex;
    align-items: flex-start;
    /* Align top */
    justify-content: flex-start;
    /* Align left */
    text-align: left;
    background-color: var(--color-light-brown);
    background-image: url('../assets/images/hero_final.webp');
    background-size: cover;
    background-position: center top;
    /* Ensure initial position aligns with JS parallax (0px) */
    position: relative;
    padding-top: 150px;
    /* Space from top */
    padding-left: 10%;
    /* Space from left - used % for responsiveness */
    width: 100%;

}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.hero-logo-container {
    position: absolute;
    top: 300px;
    left: 130px;
    width: 188px;
    /* 150px * 1.25 = 187.5px */
    z-index: 10;
    display: flex;
    flex-direction: column;
}

.hero-logo-img {
    width: 100%;
    height: auto;
    display: block;
}

.hero-tagline {
    color: var(--color-white);
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 0.7rem;
    /* Scaled up from 0.55rem */
    text-transform: uppercase;
    margin-top: 5px;
    width: 100%;
    text-align: center;
    margin-left: 4px;
    /* Center align instead of justify for normal spacing */
    /* Force full width removed */
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.hero-content {
    max-width: 600px;
    padding: 0;
    position: relative;
    z-index: 2;
}

.hero-logo {
    width: 300px;
    /* Base width */
    max-width: 100%;
    height: auto;
    margin-bottom: 0px;
}

.hero-logo img {
    width: 100%;
    height: auto;
    display: block;
    /* Invert black logo to White, Screen blend to remove resulting black background */
    filter: invert(1) brightness(2);
    mix-blend-mode: screen;
}















.btn {
    display: inline-block;
    padding: 15px 40px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-outline {
    border: 1px solid var(--color-black);
    color: var(--color-black);
    background: transparent;
}

.btn-outline:hover {
    background: var(--color-black);
    color: var(--color-white);
}

.btn-text {
    padding: 0;
    border: none;
    background: none;
    color: var(--color-black);
    border-bottom: 1px solid var(--color-black);
}

.btn-text:hover {
    color: var(--color-dark-brown);
    border-color: var(--color-dark-brown);
}

/* Scroll Mouse Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
}

.mouse {
    width: 26px;
    height: 40px;
    border: 1px solid var(--color-white);
    border-radius: 20px;
    position: relative;
}

.mouse::before {
    content: '';
    width: 2px;
    height: 6px;
    background: var(--color-white);
    position: absolute;
    top: 8px;
    left: 11px;
    border-radius: 2px;
    animation: scroll 2s infinite;
}

@keyframes scroll {
    0% {
        transform: translateY(0);
        opacity: 1;
    }

    100% {
        transform: translateY(10px);
        opacity: 0;
    }
}

/* About Section */
.reverse-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

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

    /* Flatten about-text to reorder children with image */
    .about-text {
        display: contents;
    }

    .about-text h2 {
        order: 1;
        margin-bottom: 5px;
        text-align: center;
    }

    .about-text .divider {
        order: 2;
        margin: 0 auto 20px auto;
        /* Center divider */
    }

    .about-image {
        order: 3;
        margin-bottom: 25px;
        /* Space between image and text */
        margin-top: 0;
    }

    .about-description {
        order: 4;
        text-align: center;
    }
}

/* Projects Section */
.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(500px, 1fr));
    gap: 40px;
}

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

.project-item {
    position: relative;
    cursor: pointer;
}

.project-image {
    width: 100%;
    height: 400px;
    /* Fixed height for consistency */
    overflow: hidden;
    margin-bottom: 15px;
}

.project-image .image-placeholder,
.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
}

.project-item:hover .project-image .image-placeholder {
    transform: scale(1.05);
}

.project-info h3 {
    font-size: 1.5rem;
    margin-bottom: 5px;
    font-family: var(--font-heading);
}

.project-info p {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #CCCCCC;
}

/* Publications */
#publications .container {
    max-width: 1600px;
    /* Expand container width for books */
    padding: 0 40px;
    /* Add slightly more side padding */
}

.publications-scroller {
    display: flex;
    gap: 30px;
    overflow-x: auto;
    padding-bottom: 20px;
    scrollbar-width: none;
    justify-content: center;
    /* Center the books */
}

.publications-scroller::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.pub-card {
    min-width: 180px;
    /* Reduced from 300px */
    max-width: 220px;
    flex-shrink: 0;
}

.pub-card .image-placeholder.book-cover {
    aspect-ratio: 1/1.4;
    background-color: var(--color-dark-brown);
    margin-bottom: 15px;
}

.pub-image {
    width: 100%;
    aspect-ratio: 1/1.4;
    overflow: hidden;
    margin-bottom: 15px;
    background-color: var(--color-dark-brown);
    position: relative;
}

.pub-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.pub-card:hover .pub-image img {
    transform: scale(1.05);
}

/* Fix for images with white borders - permanently zoomed in */
.pub-image img.crop-fix {
    transform: scale(1.15);
}

.pub-card:hover .pub-image img.crop-fix {
    transform: scale(1.2);
}

/* Contact/Footer */
footer {
    background-color: var(--color-black);
    color: var(--color-white);
    padding: 80px 0 30px;
    text-align: center;
}

.footer-logo h2 {
    color: var(--color-white);
    letter-spacing: 3px;
    margin-bottom: 40px;
    font-size: 2rem;
}

.contact-link {
    font-size: 1.5rem;
    font-family: var(--font-heading);
    color: var(--color-light-brown);
    display: block;
    margin-bottom: 30px;
}

.social-links a {
    font-size: 1.5rem;
    color: var(--color-white);
}

.social-links a:hover {
    color: var(--color-light-brown);
}

.copyright {
    margin-top: 80px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 30px;
    font-size: 0.8rem;
    color: var(--color-grey);
}

/* Animations */
.fade-in {
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.fade-in.visible {
    opacity: 1;
}

.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.delay-100 {
    transition-delay: 0.1s;
}

.delay-200 {
    transition-delay: 0.2s;
}

.delay-300 {
    transition-delay: 0.3s;
}

.delay-400 {
    transition-delay: 0.4s;
}

.delay-500 {
    transition-delay: 0.5s;
}

.scale-in {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

.scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* Masked Text Reveal */
.text-reveal-mask {
    overflow: hidden;
    display: inline-block;
    vertical-align: bottom;
    /* Ensure alignment */
}

.text-reveal {
    display: block;
    transform: translateY(100%);
    transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.text-reveal.visible {
    transform: translateY(0);
}

/* Curtain Reveal */
.curtain-reveal {
    position: relative;
    overflow: hidden;
}

.curtain-reveal::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-light-brown);
    /* Contrast color */
    z-index: 2;
    transform: scaleX(1);
    transform-origin: left;
    transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1);
    /* EaseInOut */
}

.curtain-reveal.visible::after {
    transform: scaleX(0);
    transform-origin: right;
}

.curtain-reveal img {
    /* Ensure image opacity is handled or just let curtain reveal it */
    opacity: 1;
}

/* Default state: Hide header logo (it's for mobile only) */
.header-tagline,
.mobile-menu-toggle {
    display: none;
}

/* Mobile Navigation */
/* Mobile Navigation */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block !important;
        font-size: 1.5rem;
        cursor: pointer;
        z-index: 1001;
        /* Ensure above nav overlay if needed, or inside header */
        color: var(--color-white);
    }

    .header-logo-img {
        display: block;
        height: 55px;
        /* Increased size (~60px) */
        width: auto;
        margin-bottom: 2px;
    }

    .header-tagline {
        display: block;
        font-size: 0.5rem;
        /* Slightly larger */
        color: var(--color-white);
        letter-spacing: 1px;
        text-transform: uppercase;
        font-family: var(--font-body);
        white-space: nowrap;
        margin-left: 19px;
        /* Shift right +1mm */
    }

    /* Sidebar Menu Style */
    #main-nav {
        position: fixed;
        top: 0;
        right: 0;
        width: 70%;
        /* Slide out width */
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.95);
        /* Dark background */
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.5);
        padding: 40px;
        gap: 30px;
        transform: translateX(100%);
        /* Hidden by default */
        transition: transform 0.3s ease-in-out;
        z-index: 1000;
    }

    #main-nav.active {
        transform: translateX(0);
        /* Slide in */
    }

    #main-nav ul {
        flex-direction: column;
        align-items: center;
        gap: 25px;
        width: 100%;
    }

    .nav-link {
        font-size: 1.2rem;
        /* Larger for touch */
        color: var(--color-white);
        text-transform: uppercase;
        width: 100%;
        text-align: center;
        display: block;
    }

    /* Header Container */
    #main-header .container {
        justify-content: space-between;
        align-items: center;
        padding: 10px 20px;
        position: relative;
    }

    /* Language Switcher in Menu */
    .lang-switch {
        margin-left: 0;
        gap: 20px;
        margin-top: 20px;
    }

    .lang-switch a {
        font-size: 1rem;
    }

    /* RTL Support for Sidebar */
    [dir="rtl"] #main-nav {
        left: 0;
        right: auto;
        transform: translateX(-100%);
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
    }

    [dir="rtl"] #main-nav.active {
        transform: translateX(0);
    }

    /* Force Header LTR for Logo Left / Burger Right even in RTL */
    [dir="rtl"] #main-header .container {
        direction: ltr;
        display: flex;
    }

    /* Mobile Hero Fixes */
    #hero {
        background-position: center 110px !important;
        /* Move down ~3mm below tagline */
        background-size: contain !important;
        /* Make sure full image is seen */
        background-repeat: no-repeat !important;
        /* No tiling */
        height: 50vh;
        /* Make it smaller */
        background-color: var(--color-black);
        /* Fill letterboxing with dark theme */
        margin-top: 0;
        /* Or padding? */
    }

    /* Hide overlay so background color matches body exactly */
    .overlay {
        display: none !important;
    }

    /* Ensure text is readable */
    .hero-content h1,
    .hero-tagline {
        text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
    }

    /* Hero Logo Mobile Adjustment - HIDE IT */
    .hero-logo-container {
        display: none !important;
    }

    /* Style the Header Logo Container */
    .header-logo-container {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        /* Left align text with logo */
        text-decoration: none;
        z-index: 1001;
        /* Above menu if needed */
    }

    h1 {
        font-size: 2.5rem;
    }

    .section-padding {
        padding: 60px 0;
    }

    .footer-content {
        padding: 0 20px;
    }
}

/* Language Switcher */
.lang-switch {
    display: flex;
    gap: 10px;
    margin-left: 20px;
    align-items: center;
}

.lang-switch a {
    color: var(--color-white);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.lang-switch a:hover,
.lang-switch a.active {
    opacity: 1;
    color: var(--color-light-brown);
}

/* RTL Support */
[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .hero-logo-container {
    left: 130px;
    right: auto;
}

[dir="rtl"] .lang-switch {
    margin-left: 0;
    margin-right: 60px;
}

[dir="rtl"] #main-nav ul {
    padding-right: 0;
    /* Reset default padding */
}

/* Mobile RTL */
@media (max-width: 768px) {
    [dir="rtl"] .hero-logo-container {
        left: 50%;
        right: auto;
        transform: translateX(50%);
    }
}

/* Specific RTL Overrides */
[dir="rtl"] #hero {
    text-align: right;
    padding-left: 0;
    padding-right: 10%;
    align-items: flex-start;
}

[dir="rtl"] .projects-grid {
    direction: ltr;
    /* Keep visual order same as English */
}

[dir="rtl"] .project-info {
    direction: rtl;
    /* Keep text RTL */
    text-align: right;
}

/* Hebrew Typography */
[lang="he"] body {
    font-family: 'Heebo', sans-serif;
}

[lang="he"] h1,
[lang="he"] h2,
[lang="he"] h3,
[lang="he"] h4,
[lang="he"] h5,
[lang="he"] h6,
[lang="he"] .contact-link {
    font-family: 'Frank Ruhl Libre', serif;
}

.about-quote {
    font-style: italic;
    font-weight: 500;
}

/* Mobile Publications Grid */
@media (max-width: 768px) {
    .publications-scroller {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        /* 3 columns grid */
        gap: 10px;
        /* Reduced gap */
        overflow-x: visible;
        /* Disable scroll */
        justify-content: center;
        padding-bottom: 0;
    }

    .pub-card {
        min-width: 0;
        /* Allow shrinking */
        max-width: none;
        width: 100%;
        margin-bottom: 15px;
    }

    .pub-details h4 {
        font-size: 0.6rem;
        /* Smaller text to fit */
        margin-bottom: 2px;
    }

    .pub-details p {
        font-size: 0.5rem;
    }

    /* Ensure images cover effectively */
    .pub-image {
        margin-bottom: 5px;
        background-color: transparent;
        /* Remove placeholder bg if needed */
    }

    /* RTL Override for Grid Order: Force LTR layout for books */
    [dir="rtl"] .publications-scroller {
        direction: ltr;
        justify-content: flex-start;
        /* Align grid to start (left) */
    }

    [dir="rtl"] .pub-details {
        direction: rtl;
        text-align: right;
    }
}