/**
 * Residential Properties Grid CSS
 * Зачувајте го како: assets/css/residentialgridpage.css
 */

/* Додавање на Lufga фонт */
@font-face {
    font-family: 'Lufga';
    src: url('../fonts/Lufga-Medium.woff2') format('woff2'),
         url('../fonts/Lufga-Medium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

/* Reset и основни стилови */
.residentialgridpage-container * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Главен контејнер */
.residentialgridpage-container {
    max-width: 1240px !important; /* Додадено !important за да се осигура највисок приоритет */
    margin: 0 auto !important;
    padding: 20px;
    font-family: 'Arial', sans-serif;
    width: 100% !important; /* Додадено за да спречи проширување */
    box-sizing: border-box !important;
}

/* Наслов и копче за преглед на сите */
.residentialgridpage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-top: 60px;
}

.residentialgridpage-title {
    font-family: Lufga;
    font-weight: 500;
    font-size: 40px;
    line-height: 48px;
    letter-spacing: 0%;
    text-align: center;
    text-transform: capitalize;
}

.residentialgridpage-view-all {
    display: inline-block;
    width: 165px;
    height: 56px;
    padding: 16px 24px;
    gap: 8px;
    background-color: #ffffff;
    border: 1px solid #00000080;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    font-family: Lufga;
    font-weight: 500;
    font-size: 15px;
    line-height: 24px;
    letter-spacing: 0%;
    transition: all 0.3s ease;
}

.residentialgridpage-view-all:hover {
    background-color: #f8f8f8;
    border-color: #000000;
}

/* Grid Layout */
.residentialgridpage-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
    width: 100%;
    max-width: 1240px !important; /* Додадено за да се осигура дека и grid-от не излегува од ширината */
    grid-auto-rows: 1fr; /* Сите редови да имаат еднаква висина */
}

/* Column configuration */
.residentialgridpage-columns-1 {
    grid-template-columns: 1fr;
}

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

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

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

/* Картичка за имот - фиксирани димензии */
.residentialgridpage-card {
    height: 408px !important; /* Фиксирана висина со !important */
    width: 100% !important; /* Целосна ширина на gridcell */
    min-height: 408px !important; /* Минимална висина */
    max-height: 408px !important; /* Максимална висина */
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    background-color: #fff;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex !important; /* Користење на flex за внатрешниот распоред */
    flex-direction: column !important;
}

/* Стил за карти кога е достапна */
.residentialgridpage-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Целосен клик врз картичката */
.residentialgridpage-card-link {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    width: 100% !important;
    text-decoration: none;
    color: inherit;
}

/* Слика - фиксирана висина */
.residentialgridpage-image {
    width: 100% !important;
    height: 204px !important; /* Фиксирана висина за слика */
    min-height: 204px !important; /* Минимална висина */
    max-height: 204px !important; /* Максимална висина */
    overflow: hidden;
    position: relative;
    flex-shrink: 0; /* Не дозволува смалување */
}

.residentialgridpage-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

/* Детали */
.residentialgridpage-details {
    padding: 20px;
    display: flex !important;
    flex-direction: column !important;
    flex-grow: 1;
    height: 204px !important; /* Фиксирана висина за детали */
    min-height: 204px !important;
    max-height: 204px !important;
    overflow: hidden;
    position: relative;
}

/* Наслов */
.residentialgridpage-details h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 500;
    font-family: 'Lufga', Arial, sans-serif;
    color: #333;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Адреса */
.residentialgridpage-address {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Карактеристики */
.residentialgridpage-features {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 15px;
}

.residentialgridpage-beds,
.residentialgridpage-baths,
.residentialgridpage-sqft {
    font-size: 14px;
    color: #555;
    display: flex;
    align-items: center;
    margin-right: 15px;
}

.residentialgridpage-features i {
    margin-right: 5px;
}

/* Цена и тип */
.residentialgridpage-price-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 15px;
    position: relative;
    width: 100%;
}

.residentialgridpage-price-container:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #e0e0e0;
}

.residentialgridpage-price {
    font-size: 24px;
    font-weight: 400;
    color: #333;
    display: flex;
    align-items: center;
}

.residentialgridpage-type {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    color: #555;
    text-decoration: none;
    transition: all 0.3s ease;
    text-align: center;
    width: auto;
    height: auto;
    white-space: nowrap;
    overflow: hidden;
}

/* Статус достапност */
.status-available {
    color: #2e7d32;
    border-color: #a5d6a7;
    background-color: rgba(46, 125, 50, 0.05);
    border-radius: 30px;
    padding: 8px 20px;
}

.status-not-available {
    color: #c62828;
    border-color: #ef9a9a;
    background-color: rgba(198, 40, 40, 0.05);
    border-radius: 30px;
    padding: 8px 20px;
}

/* Pagination */
.residentialgridpage-pagination {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.residentialgridpage-pagination .page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: 0 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.residentialgridpage-pagination .page-numbers.current {
    background-color: #f8f8f8;
    font-weight: bold;
}

.residentialgridpage-pagination .page-numbers:hover {
    background-color: #f8f8f8;
}

/* WordPress default post content padding fix */
div.entry-content.wp-block-post-content.has-global-padding.is-layout-constrained {
    padding-left: 24px !important;
    padding-right: 24px !important;
}

/* Responsive стилови - Improved for better mobile experience */
@media (max-width: 1200px) {
    .residentialgridpage-columns-4 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .residentialgridpage-title {
        font-size: 36px;
        line-height: 44px;
    }
}

@media (max-width: 992px) {
    .residentialgridpage-columns-3,
    .residentialgridpage-columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .residentialgridpage-title {
        font-size: 32px;
        line-height: 40px;
        text-align: center;
    }
    
    .residentialgridpage-header {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
    
    .residentialgridpage-view-all {
        max-width: 320px;
    }
}

@media (max-width: 768px) {
    .residentialgridpage-header {
        flex-direction: column;
        align-items: center;
        gap: 20px;
        margin-bottom: 25px;
    }
    
    .residentialgridpage-title {
        font-size: 28px;
        line-height: 36px;
        text-align: center;
    }
    
    .residentialgridpage-view-all {
        margin-top: 0;
        width: 100%;
        max-width: 320px;
        text-align: center;
    }
    
    .residentialgridpage-columns-2,
    .residentialgridpage-columns-3,
    .residentialgridpage-columns-4 {
        grid-template-columns: 1fr;
    }
    
    .residentialgridpage-card {
        height: 408px !important; /* Задржување на фиксната висина */
        max-width: 100%;
        margin: 0 auto;
    }
    
    .residentialgridpage-features {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .residentialgridpage-beds,
    .residentialgridpage-baths, 
    .residentialgridpage-sqft {
        margin-right: 0;
    }
    
    .residentialgridpage-pagination {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    .residentialgridpage-details {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .residentialgridpage-container {
        padding: 8px !importatnt; /* Changed from 15px to 24px as requested */
    }
    
    .residentialgridpage-title {
        font-size: 32px;
        line-height: 100%;
        text-align: center;
        width: 100%;
    }
    
    /* Allowing text to wrap into two lines instead of using ellipsis */
    .residentialgridpage-details h3 {
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: initial;
        height: auto;
        max-height: 46px; /* Approximately two lines of text */
    }
    
    .residentialgridpage-address {
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: initial;
        max-height: 42px; /* Approximately two lines of text */
    }
    
    /* Keeping the price and status in one row for mobile */
    .residentialgridpage-price-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
    }
    
    .residentialgridpage-type {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .residentialgridpage-price {
        font-size: 20px;
    }
    
    .residentialgridpage-grid {
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .residentialgridpage-container {
        padding: 8px !important; /* Правилно напишано */
    }
    /* Останати стилови... */
}