/* 
Theme Name: Hello Elementor Child
Theme URI: https://github.com/elementor/hello-theme/
Description: Hello Elementor Child is a child theme of Hello Elementor, created by Elementor team
Author: Elementor Team
Author URI: https://elementor.com/
Template: hello-elementor
Version: 1.0.1
Text Domain: hello-elementor-child
License: GNU General Public License v3 or later.
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Tags: flexible-header, custom-colors, custom-menu, custom-logo, editor-style, featured-images, rtl-language-support, threaded-comments, translation-ready
*/

/*
    Add your custom styles here
*/

/* Load NarkissBlockCondensed Font (local to avoid CORS) */
@font-face {
    font-family: 'NarkissBlockCondensed';
    src: url('fonts/NarkissBlockCondensed-Thin.woff2') format('woff2'),
         url('fonts/NarkissBlockCondensed-Thin.woff') format('woff');
    font-weight: 100;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'NarkissBlockCondensed';
    src: url('fonts/NarkissBlockCondensed-Medium.woff2') format('woff2'),
         url('fonts/NarkissBlockCondensed-Medium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'NarkissBlockCondensed';
    src: url('fonts/NarkissBlockCondensed-Bold.woff2') format('woff2'),
         url('fonts/NarkissBlockCondensed-Bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

header#site-header, footer#site-footer {
    display: none;
}

/* Building Template Styles */
.building-template-container {
    width: 100%;
    margin: 0;
    padding: 0 40px;
    box-sizing: border-box;
    font-family: "NarkissBlockCondensed", "Arial", "Helvetica", Sans-serif !important;
}

.building-header {
    margin-bottom: 2rem;
    text-align: center;
}

.building-title {
    font-size: 2rem;
    padding-right: 15%;
    font-weight: 700;
    margin: 0;
    color: #ffffff;
    font-family: "NarkissBlockCondensed", "Arial", "Helvetica", Sans-serif !important;
}

.building-error {
    max-width: 800px;
    margin: 2rem auto;
    padding: 1.5rem;
    background-color: #fee;
    border: 1px solid #fcc;
    border-radius: 4px;
    text-align: center;
}

.building-floors {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
}
.elementor.elementor-160.dce-elementor-post-2451.elementor-location-header {
    display: none;
}

/* Hide header on buildings list page */
.page-template-page-buildings .elementor-location-header {
    display: none;
}

/* Hide footer on buildings list page for cleaner look */
.page-template-page-buildings .elementor-location-footer {
    display: none;
}

/* Ensure full height on buildings list page */
.page-template-page-buildings #page {
    min-height: 100vh;
}

.page-template-page-buildings #content {
    padding: 0;
    margin: 0;
}

.floor-section {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
}

.floor-label {
    margin-bottom: 0;
    padding-bottom: 0;
    text-align: right;
    flex-shrink: 0;
    min-width: 62px;
}

.floor-number {
    font-size: 1.5rem;
    font-weight: 400;
    color: #fff;
    font-family: "NarkissBlockCondensed", "Arial", "Helvetica", Sans-serif !important;
}

.floor-apartments {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.4rem;
    width: 100%;
    flex: 1;
}

.floor-apartments > * {
    flex: 1;
    min-width: 0;
    box-sizing: border-box;
}

.apartment-cube {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    min-height: 70px;
    background-color: #ffffff;
    border-radius: 0;
    color: #1e3a5f;
    box-sizing: border-box;
}

.apartment-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0;
}

.apartment-details {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    width: 100%;
    height: 100%;
}

.apartment-number-side {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 35px;
    background-color: #ffffff;
    border-right: 2px solid #1e3a5f;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e3a5f;
    font-family: "NarkissBlockCondensed", "Arial", "Helvetica", Sans-serif !important;
    flex-shrink: 0;
    order: 2;
}

.apartment-content-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: center;
    padding: 0.5rem;
    order: 1;
    align-items: center;
}

.apartment-detail-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e3a5f;
    line-height: 1.1;
    justify-content: center;
    font-family: "NarkissBlockCondensed", "Arial", "Helvetica", Sans-serif !important;
}

.apartment-detail-row:first-child .detail-label:first-child + .detail-value {
    margin-right: 1rem;
    margin-left: -0.25rem; /* Remove gap between "חדרים:" and the number */
}

.detail-label {
    font-weight: 700;
}

.detail-value {
    font-weight: 400;
}

.apartment-detail-row:first-child {
    font-size: 1.5rem; /* Larger font size for first row */
}

.apartment-detail-row:first-child .detail-label,
.apartment-detail-row:first-child .detail-value {
    color: #1e3a5f; /* Blue color for first row */
}

.apartment-detail-row:first-child .detail-label:first-child + .detail-value {
    margin-right: 0;
    gap: 0;
}

.apartment-detail-row:first-child .detail-label:nth-child(3) {
    margin-right: 0.1rem;
}

.apartment-detail-row:nth-child(2) {
    font-weight: 500; /* Medium weight for second row */
}



/* Fallback when no inline background from ACF status color; templates may set style="background-color: ..." per term */
.apartment-sold {
    background-color: #ff6b6b;
    border-color: #1e3a5f;
    color: #1e3a5f;
    border-width: 3px;
}


.apartment-sold-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e3a5f;
    width: 100%;
    height: 100%;
    flex-direction: row-reverse;
}

.sold-apartment-number {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: "NarkissBlockCondensed", "Arial", "Helvetica", Sans-serif !important;
    color: #1e3a5f;
}

.sold-lottie {
    width: 3rem;
    height: 3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.sold-lottie svg {
    width: 3rem !important;
    height: 3rem !important;
    transform: scale(2) !important;
    transform-origin: center center;
}

.sold-lottie svg path,
.sold-lottie svg circle,
.sold-lottie svg ellipse,
.sold-lottie svg rect,
.sold-lottie svg line,
.sold-lottie svg polyline,
.sold-lottie svg polygon {
    fill: #1e3a5f !important;
    stroke: #1e3a5f !important;
}

.sold-text {
    font-size: 2rem;
    font-weight: 700;
    font-family: "NarkissBlockCondensed", "Arial", "Helvetica", Sans-serif !important;
    line-height: 1em;
}

.floor-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
    padding: 1rem;
    color: #999;
    font-style: italic;
}

.empty-indicator {
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .building-template-container {
        padding: 0 0.5rem;
    }

    .building-title {
        font-size: 1.5rem;
    }

    .floors-columns {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .floor-section {
        padding: 0.75rem;
    }

    .floor-apartments {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }

    .apartment-cube {
        min-width: 100px;
        min-height: 70px;
        padding: 0.75rem;
    }

    .apartment-number {
        font-size: 1.25rem;
    }

    .apartment-status {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .floor-apartments {
        grid-template-columns: 1fr;
    }

    .apartment-cube {
        min-width: 80px;
        min-height: 70px;
        padding: 0.5rem;
    }

    .apartment-number {
        font-size: 1.1rem;
    }

    .apartment-status {
        font-size: 0.7rem;
    }
}

/* RTL Support */
[dir="rtl"] .building-floors {
    direction: rtl;
}

[dir="rtl"] .floors-columns {
    direction: rtl;
}

[dir="rtl"] .floors-column {
    direction: rtl;
}

[dir="rtl"] .floor-apartments {
    direction: rtl;
}

[dir="rtl"] .building-header {
    direction: rtl;
}

[dir="rtl"] .building-header-right {
    justify-content: flex-start;
}

[dir="rtl"] .apartment-number-side {
    border-right: none;
    border-left: 2px solid #1e3a5f;
    order: 1;
}

[dir="rtl"] .apartment-content-wrapper {
    order: 2;
}

/* Buildings List Template Styles */
.buildings-list-container {
    width: 100%;
    margin: 0;
    padding: 60px 40px;
    box-sizing: border-box;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #1a2332;
}

.buildings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.building-card {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 350px;
    background-color: #243447;
    border: 3px solid #3a4f68;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.4s ease;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.building-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0) 100%);
    pointer-events: none;
}

.building-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
    border-color: #5a7a9a;
    background-color: #2a3d52;
}

.building-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 3rem 2rem;
    position: relative;
    z-index: 1;
}

.building-card-label {
    font-size: 2rem;
    font-weight: 400;
    color: #a0b4cc;
    font-family: "NarkissBlockCondensed", "Arial", "Helvetica", Sans-serif !important;
    text-align: center;
    margin-bottom: 1rem;
    letter-spacing: 1px;
}

.building-card-name {
    font-size: 8rem;
    font-weight: 700;
    color: #ffffff;
    font-family: "NarkissBlockCondensed", "Arial", "Helvetica", Sans-serif !important;
    text-align: center;
    line-height: 1;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* Entrance animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.building-card {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

.building-card:nth-child(1) {
    animation-delay: 0.1s;
}

.building-card:nth-child(2) {
    animation-delay: 0.2s;
}

.building-card:nth-child(3) {
    animation-delay: 0.3s;
}

.building-card:nth-child(4) {
    animation-delay: 0.4s;
}

.building-card:nth-child(5) {
    animation-delay: 0.5s;
}

.building-card:nth-child(6) {
    animation-delay: 0.6s;
}

.building-card:nth-child(n+7) {
    animation-delay: 0.7s;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .buildings-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 2rem;
    }
    
    .building-card-name {
        font-size: 6rem;
    }
    
    .building-card-label {
        font-size: 1.8rem;
    }
}

@media (max-width: 768px) {
    .buildings-list-container {
        padding: 40px 20px;
    }
    
    .buildings-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1.5rem;
    }
    
    .building-card {
        min-height: 280px;
    }
    
    .building-card-name {
        font-size: 5rem;
    }
    
    .building-card-label {
        font-size: 1.5rem;
    }
}

/* Print Styles */
@media print {
    .apartment-cube {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .floor-section {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* Directions Row */
.directions-row {
    display: flex;
    gap: 0.2rem;
    margin-top: 0;
    width: 100%;
    align-items: center;
    justify-content: space-between;
}
#direction-empty {
    flex: 0.33;
}
#direction-north-east {
    flex: 1.25;
}
div#direction-north-west{
    flex: 0.75;
}
div#direction-north{
    flex: 1;
}
div#direction-south{
    flex: 1;
}
div#direction-south-west{
    flex: 0.75;
}
div#direction-south-east{
    flex: 1.5;
}
.direction-column {
    background-color: transparent;
    color: #ffffff;
    text-align: center;
    padding: 1rem;
    font-family: "NarkissBlockCondensed", "Arial", "Helvetica", Sans-serif !important;
    font-size: 2rem;
    font-weight: 700;
}

.direction-empty {
    padding: 0;
}

/* Buildings Auto Scroll Template Styles */
.buildings-auto-scroll-container {
    width: 100%;
    height: 100vh;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "NarkissBlockCondensed", "Arial", "Helvetica", Sans-serif !important;
    position: relative;
    overflow: hidden;
    background-color: #0b1f31; /* Dark gray background for TV */
}

.building-slide {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
    padding: 0px 40px 0 40px; /* Added top padding for fixed header */
    box-sizing: border-box;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    overflow: hidden;
}

.building-slide:first-child {
    opacity: 1;
}
.building-header-left {
    display: flex;
    justify-content: flex-end;
}
.building-header-right {
    display: flex;
    justify-content: flex-start;
}
.building-header-left img {
    max-height: 140px;
}
.building-header-right img {
    max-height: 200px;
}
/* Global Header - Outside building slides */
.building-header.global-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    padding:0;
    margin: 0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-direction: row-reverse;
    background-color: #0b1f31;
    z-index: 100;
    box-sizing: border-box;
    min-height: 120px;
}

.building-slide .building-header {
    margin-bottom: 1rem;
    padding-top: 1rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    flex-direction: row-reverse;
}

.building-header-left {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.building-header-left img {
    object-fit: contain;
}

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

.building-header-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1.5rem;
}

.building-header-right img {
    max-width: 150px;
    flex-shrink: 0;
    object-fit: contain;
}

.building-logo {
    max-width: 180px;
    max-height: 140px;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
}

.building-scroll-wrapper {
    width: 100%;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: auto; /* Disable smooth scroll for programmatic control */
    position: relative;
    -webkit-overflow-scrolling: touch;
    min-height: 0; /* Important for flexbox */
}

.building-scroll-wrapper::-webkit-scrollbar {
    display: none; /* Hide scrollbar for TV display */
    width: 0;
    height: 0;
}

.building-scroll-wrapper {
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}

.building-floors-scroll {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
    padding-bottom: 2rem;
}

/* Ensure smooth scrolling */
.building-floors-scroll .floor-section {
    flex-shrink: 0;
}

.building-slide .directions-row {
    flex-shrink: 0;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

/* TV Display Optimizations */
@media (min-width: 1920px) {
    .buildings-auto-scroll-container {
        max-width: 100%;
    }
    
    .building-header.global-header {
        min-height: 140px;
        padding: 0;
    }
    
    
    .building-slide .building-title {
        font-size: 2.5rem;
    }
    
    .building-slide .floor-number {
        font-size: 1.8rem;
    }
    
    .building-slide .apartment-cube {
        min-height: 80px;
    }
    
    .building-header-button {
        min-width: 100px;
        min-height: 110px;
    }
    
    .building-header-label {
        font-size: 1.3rem;
    }
    
    .building-header-name {
        font-size: 3.5rem;
    }
}

/* Prevent user interaction on TV */
.buildings-auto-scroll-container * {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.building-scroll-wrapper {
    pointer-events: auto; /* Allow scrolling container to work */
}

/* Fullscreen optimization */
html.buildings-auto-scroll-page,
html.buildings-auto-scroll-page body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    height: 100%;
    width: 100%;
}

/* Navigation Arrows */
.building-nav-arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background-color: transparent;
    border: none;
    border-radius: 4px;
    width: 30px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
    transition: all 0.3s ease;
    padding: 0;
    color: #ff6b6b;
    box-shadow: none;
}

.building-nav-arrow:hover {
    background-color: transparent;
    transform: translateY(-50%) scale(1.1);
    box-shadow: none;
}

.building-nav-arrow:active {
    transform: translateY(-50%) scale(0.95);
}

.building-nav-arrow-left {
    left: 20px;
}

.building-nav-arrow-right {
    right: 20px;
}

.building-nav-arrow svg {
    width: 40px;
    height: 40px;
    stroke: currentColor;
}

/* RTL Support for arrows - swap positions */
[dir="rtl"] .building-nav-arrow-left {
    left: auto;
    right: 0;
}

[dir="rtl"] .building-nav-arrow-right {
    right: auto;
    left: 0;
}

/* In RTL, we need to flip the arrow directions visually */
[dir="rtl"] .building-nav-arrow-left svg {
    transform: scaleX(-1);
}

[dir="rtl"] .building-nav-arrow-right svg {
    transform: scaleX(-1);
}

/* Responsive arrows */
@media (max-width: 768px) {
    .building-nav-arrow {
        width: 60px;
        height: 60px;
    }
    
    .building-nav-arrow svg {
        width: 30px;
        height: 30px;
    }
    
    .building-nav-arrow-left {
        left: 10px;
    }
    
    .building-nav-arrow-right {
        right: 10px;
    }
    
    [dir="rtl"] .building-nav-arrow-left {
        right: 10px;
    }
    
    [dir="rtl"] .building-nav-arrow-right {
        left: 10px;
    }
}

/* Buildings Header Navigation */
.buildings-header-nav {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.building-header-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    min-height: 80px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: none;
}

.building-header-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.building-header-button:hover {
    transform: translateY(-3px) scale(1.05);
    background-color: transparent;
    border: none;
    box-shadow: none;
}

.building-header-button.active span {
    color: #5a9aff;
}
.building-header-button.active, .building-header-button.focus {
    background-color: transparent;
    border: none;
    box-shadow: none;
    outline: none;
}
.building-header-label {
    font-size: 1.2rem;
    font-weight: 400;
    color: #a0b4cc;
    font-family: "NarkissBlockCondensed", "Arial", "Helvetica", Sans-serif !important;
    text-align: center;
    margin-bottom: 5px;
    letter-spacing: 0.5px;
}

.building-header-name {
    font-size: 3rem;
    font-weight: 700;
    color: #ffffff;
    font-family: "NarkissBlockCondensed", "Arial", "Helvetica", Sans-serif !important;
    text-align: center;
    line-height: 1;
}

/* Responsive buildings header navigation */
@media (max-width: 1400px) {
    .building-header-button {
        min-width: 80px;
        min-height: 90px;
        padding: 8px 10px;
    }
    
    .building-header-label {
        font-size: 1.1rem;
    }
    
    .building-header-name {
        font-size: 2.5rem;
    }
}

@media (max-width: 1200px) {
    .buildings-header-nav {
        gap: 10px;
    }
    
    .building-header-button {
        min-width: 70px;
        min-height: 80px;
        padding: 6px 8px;
    }
    
    .building-header-label {
        font-size: 1rem;
    }
    
    .building-header-name {
        font-size: 2.2rem;
    }
}

@media (max-width: 768px) {
    .building-header.global-header {
        padding: 0;
        min-height: 100px;
        flex-wrap: wrap;
    }
    
    .building-header-right {
        flex: 1;
        width: 100%;
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .building-header-right img {
        max-height: 150px;
    }
    
    .buildings-header-nav {
        gap: 8px;
        width: 100%;
        justify-content: center;
    }
    
    .building-header-button {
        min-width: 60px;
        min-height: 70px;
        padding: 5px 6px;
        border-width: 2px;
    }
    
    .building-header-label {
        font-size: 0.9rem;
    }
    
    .building-header-name {
        font-size: 2rem;
    }
    

}

/* Apartment size variations by room number */
/* דירות ברוחב שונה לפי מספר החדרים - מקטן לגדול */

/* דירת 3 חדרים - צרה */
.apartment-cube.apartment-rooms-3 {
    flex: 0.75;
}

/* דירת 4 חדרים - רגילה */
.apartment-cube.apartment-rooms-4 {
    flex: 1;
}

/* דירת 5 חדרים - רחבה יותר */
.apartment-cube.apartment-rooms-5 {
    flex: 1.25;
}

/* דירת 6 חדרים - הכי רחבה */
.apartment-cube.apartment-rooms-6 {
    flex: 1.5;
}

/* Responsive adjustments for room-based sizing */
@media (max-width: 768px) {
    .apartment-cube.apartment-rooms-3 {
        flex: 0.8;
    }
    
    .apartment-cube.apartment-rooms-5 {
        flex: 1.2;
    }
    
    .apartment-cube.apartment-rooms-6 {
        flex: 1.4;
    }
}
