/**
 * Frontend CSS pro Stanektech Reference
 */

/* Základní kontejner referencí */
.stanektech-references-wrapper {
    max-width: 100%;
    margin: 30px 0;
    box-sizing: border-box;
}

.stanektech-references-wrapper *,
.stanektech-references-wrapper *::before,
.stanektech-references-wrapper *::after {
    box-sizing: border-box;
}

/* Výpis referencí */
.stanektech-references-list {
    display: grid;
    gap: 30px;
    margin-bottom: 40px;
}

/* Počet sloupců referencí */
.stanektech-references-list.stanektech-ref-col-2 {
    grid-template-columns: repeat(2, 1fr);
}

.stanektech-references-list.stanektech-ref-col-3 {
    grid-template-columns: repeat(3, 1fr);
}

.stanektech-references-list.stanektech-ref-col-4 {
    grid-template-columns: repeat(4, 1fr);
}

.stanektech-references-list.stanektech-ref-col-5 {
    grid-template-columns: repeat(5, 1fr);
}

.stanektech-references-list.stanektech-ref-col-6 {
    grid-template-columns: repeat(6, 1fr);
}

/* Jednotlivá reference */
.stanektech-reference-item {
    position: relative;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.stanektech-reference-inner {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.stanektech-reference-inner:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.stanektech-reference-image {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 50%; /* Poměr 3:2 */
    overflow: hidden;
}

.stanektech-reference-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    height: 225px !important;
}

.stanektech-reference-inner:hover .stanektech-reference-image img {
    transform: scale(1.05);
}

.stanektech-reference-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.stanektech-reference-title {
    margin: 0 0 12px;
    font-size: 20px;
    color: #333;
    font-weight: 600;
    line-height: 1.3;
}

.stanektech-reference-city {
    display: flex;
    align-items: center;
    color: #666;
    font-size: 14px;
}

.stanektech-reference-city .dashicons {
    color: #2271b1;
    margin-right: 5px;
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.stanektech-reference-customer {
    display: flex;
    align-items: center;
    color: #666;
    font-size: 14px;
}

.stanektech-reference-customer .dashicons {
    color: #2271b1;
    margin-right: 5px;
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.stanektech-reference-detail-city {
    align-items: center;
    color: #666;
    font-size: 14px;
}

.stanektech-reference-detail-location .dashicons {
    color: #2271b1;
}

.stanektech-reference-detail-customer {
    align-items: center;
    color: #666;
    font-size: 14px;
}

.stanektech-reference-detail-customer .dashicons {
    color: #2271b1;
}

.stanektech-reference-excerpt {
    color: #555;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 15px;
}

.stanektech-reference-more {
    margin-top: auto;
    text-align: right;
}

.stanektech-reference-button {
    display: inline-block;
    padding: 8px 15px;
    background-color: #2271b1;
    color: #fff;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s;
}

.stanektech-reference-button:hover {
    background-color: #135e96;
}

/* Detail reference */
.stanektech-single-reference {
    margin-bottom: 50px;
}

.stanektech-reference-header {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.stanektech-reference-header h2 {
    margin: 0 0 10px;
    font-size: 28px;
    color: #333;
}

.stanektech-reference-description {
    margin-bottom: 30px;
    font-size: 16px;
    line-height: 1.6;
    color: #555;
}

/* Galerie v detailu reference */
.stanektech-reference-gallery {
    display: grid;
    gap: 15px;
}

/* Počet sloupců galerie */
.stanektech-reference-gallery.stanektech-ref-col-2 {
    grid-template-columns: repeat(2, 1fr);
}

.stanektech-reference-gallery.stanektech-ref-col-3 {
    grid-template-columns: repeat(3, 1fr);
}

.stanektech-reference-gallery.stanektech-ref-col-4 {
    grid-template-columns: repeat(4, 1fr);
}

.stanektech-reference-gallery.stanektech-ref-col-5 {
    grid-template-columns: repeat(5, 1fr);
}

.stanektech-reference-gallery.stanektech-ref-col-6 {
    grid-template-columns: repeat(6, 1fr);
}

/* Jednotlivý obrázek v galerii */
.stanektech-gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.stanektech-gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.stanektech-gallery-item a {
    display: block;
    position: relative;
    height: 0;
    padding-bottom: 75%; /* Poměr 4:3 */
    overflow: hidden;
}

.stanektech-gallery-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.stanektech-gallery-item:hover .stanektech-gallery-image {
    transform: scale(1.05);
}

/* Popisek obrázku */
.stanektech-gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0));
    color: #fff;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.stanektech-gallery-item:hover .stanektech-gallery-caption {
    opacity: 1;
    transform: translateY(0);
}

.stanektech-gallery-caption span {
    font-size: 14px;
    font-weight: 500;
}

/* Styl galerie: Grid */
.stanektech-ref-style-grid .stanektech-gallery-item {
    padding: 10px;
    background: #fff;
    border: 1px solid #eee;
}

.stanektech-ref-style-grid .stanektech-gallery-item a {
    margin-bottom: 10px;
}

.stanektech-ref-style-grid .stanektech-gallery-caption {
    position: static;
    background: transparent;
    color: #333;
    opacity: 1;
    transform: none;
    padding: 5px 0 0;
}

/* Styl galerie: Masonry */
.stanektech-ref-style-masonry {
    column-count: 3;
    column-gap: 15px;
    display: block;
}

.stanektech-ref-style-masonry.stanektech-ref-col-2 {
    column-count: 2;
}

.stanektech-ref-style-masonry.stanektech-ref-col-3 {
    column-count: 3;
}

.stanektech-ref-style-masonry.stanektech-ref-col-4 {
    column-count: 4;
}

.stanektech-ref-style-masonry.stanektech-ref-col-5 {
    column-count: 5;
}

.stanektech-ref-style-masonry.stanektech-ref-col-6 {
    column-count: 6;
}

.stanektech-ref-style-masonry .stanektech-gallery-item {
    display: inline-block;
    width: 100%;
    margin-bottom: 15px;
}

/* Modální okno pro detail reference */
.stanektech-reference-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
}

.stanektech-reference-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
}

.stanektech-reference-modal-content {
    position: relative;
    background-color: #fff;
    margin: 5% auto;
    width: 80%;
    max-width: 1200px;
    max-height: 90%;
    overflow-y: auto;
    z-index: 1000000;
    border-radius: 10px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    animation: stanekModalFadeIn 0.3s;
}

@keyframes stanekModalFadeIn {
    from {opacity: 0; transform: translateY(-20px);}
    to {opacity: 1; transform: translateY(0);}
}

.stanektech-reference-modal-header {
    position: relative;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.stanektech-reference-modal-close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
}

.stanektech-reference-modal-close:hover {
    color: #2271b1;
}

.stanektech-reference-modal-body {
    padding: 30px;
}

/* Zprávy */
.stanektech-ref-empty,
.stanektech-ref-error,
.stanektech-no-images {
    padding: 20px;
    background-color: #f8f9fa;
    border-left: 4px solid #2271b1;
    color: #555;
    font-style: italic;
    margin-bottom: 20px;
}

.stanektech-ref-error {
    border-left-color: #dc3232;
}

/* Animace načítání */
.stanektech-loading-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 0;
}

.stanektech-loading-spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 3px solid rgba(0,0,0,0.1);
    border-radius: 50%;
    border-top-color: #2271b1;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 20px;
}

/* Stránka detailu reference */
.stanektech-single-reference-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.stanektech-single-reference-wrapper {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    padding: 40px;
    margin-bottom: 40px;
}

.stanektech-single-reference-header {
    margin-bottom: 30px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 20px;
}

.stanektech-single-reference-title {
    font-size: 32px;
    color: #222;
    margin: 0 0 20px;
    line-height: 1.3;
    font-weight: 700;
}

.stanektech-reference-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 10px;
}

.stanektech-reference-description {
    font-size: 16px;
    line-height: 1.7;
    color: #444;
    margin-bottom: 40px;
}

.stanektech-reference-gallery-title {
    margin-bottom: 20px;
    border-top: 1px solid #f0f0f0;
    padding-top: 30px;
}

.stanektech-reference-gallery-title h2 {
    font-size: 24px;
    color: #333;
    margin: 0;
    font-weight: 600;
}

.stanektech-reference-back-link {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.stanektech-reference-back-button {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background: #f0f0f0;
    border-radius: 5px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.stanektech-reference-back-button:hover {
    background: #e0e0e0;
    color: #222;
    text-decoration: none;
}

.stanektech-reference-back-button .dashicons {
    margin-right: 8px;
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 1;
}

/* Responzivita pro detail reference */
@media screen and (max-width: 768px) {
    .stanektech-single-reference-wrapper {
        padding: 30px 20px;
    }
    
    .stanektech-single-reference-title {
        font-size: 28px;
    }
    
    .stanektech-reference-meta {
        flex-direction: column;
        gap: 10px;
    }
}



@media screen and (max-width: 480px) {
    .stanektech-single-reference-wrapper {
        padding: 20px 15px;
    }
    
    .stanektech-single-reference-title {
        font-size: 24px;
    }
    
    .stanektech-reference-gallery-title h2 {
        font-size: 20px;
    }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responzivita */
@media screen and (max-width: 992px) {
    .stanektech-references-list.stanektech-ref-col-5,
    .stanektech-references-list.stanektech-ref-col-6 {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .stanektech-reference-gallery.stanektech-ref-col-5,
    .stanektech-reference-gallery.stanektech-ref-col-6 {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .stanektech-ref-style-masonry.stanektech-ref-col-5,
    .stanektech-ref-style-masonry.stanektech-ref-col-6 {
        column-count: 4;
    }
}

@media screen and (max-width: 768px) {
    .stanektech-references-list.stanektech-ref-col-3,
    .stanektech-references-list.stanektech-ref-col-4,
    .stanektech-references-list.stanektech-ref-col-5,
    .stanektech-references-list.stanektech-ref-col-6 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stanektech-reference-gallery.stanektech-ref-col-3,
    .stanektech-reference-gallery.stanektech-ref-col-4,
    .stanektech-reference-gallery.stanektech-ref-col-5,
    .stanektech-reference-gallery.stanektech-ref-col-6 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stanektech-ref-style-masonry.stanektech-ref-col-3,
    .stanektech-ref-style-masonry.stanektech-ref-col-4,
    .stanektech-ref-style-masonry.stanektech-ref-col-5,
    .stanektech-ref-style-masonry.stanektech-ref-col-6 {
        column-count: 2;
    }
    
    .stanektech-reference-modal-content {
        width: 90%;
        margin: 10% auto;
    }
    
    .stanektech-reference-modal-body {
        padding: 20px;
    }
}

@media screen and (max-width: 576px) {
    .stanektech-references-list {
        grid-template-columns: 1fr !important;
    }
    
    .stanektech-reference-gallery {
        grid-template-columns: 1fr !important;
    }
    
    .stanektech-ref-style-masonry {
        column-count: 1 !important;
    }
    
    .stanektech-reference-header h2 {
        font-size: 24px;
    }
}

