/**
 * About Ustredie - Responzívne štýly pre stránku o ústredných orgánoch
 *
 * @package Srz_Rada
 * @since 1.0.0
 */

/* Grid layout pre karty ústredných orgánov */
.srz-ustredie-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 30px;
    align-items: stretch;
    justify-content: center;
}

/* Ak je nepárny počet kariet, posledná sa centruje */
.srz-ustredie-grid > *:last-child:nth-child(odd) {
    grid-column: 1 / -1 !important;
    max-width: calc(50% - 15px) !important;
    justify-self: center !important;
}

/* Grid s jednou kartou (napr. Snem) - rovnaká šírka ako ostatné karty */
.srz-ustredie-grid--single {
    display: flex !important;
    justify-content: center;
}

.srz-ustredie-grid--single > .srz-ustredie-card {
    width: calc(50% - 15px) !important;
    max-width: none !important;
}


/* Reset WordPress block gap */
.srz-ustredie-grid.wp-block-group {
    --wp--style--block-gap: 0 !important;
}

/* Jednotlivé karty - reset WordPress margins */
.srz-ustredie-grid > .srz-ustredie-card {
    margin: 0 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex !important;
    flex-direction: column !important;
}

/* Tlačidlá na spodku karty, zarovnané vľavo */
.srz-ustredie-card > .wp-block-buttons {
    margin-top: auto !important;
    justify-content: flex-start !important;
    width: 100%;
}

/* Medzera medzi hlavičkou (ikona + názov) a textom pod ňou */
.srz-ustredie-card > .wp-block-group:first-child {
    margin-bottom: 20px !important;
}

.srz-ustredie-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* Wrapper pre Snem + volené orgány */
.srz-volene-wrapper {
    border: 1px solid rgba(255, 152, 0, 0.3);
    border-radius: 20px;
    padding: 30px;
    background: rgba(255, 152, 0, 0.03);
}

/* Snem - oranžová čiara dole */
.srz-ustredie-card--snem {
    border-bottom: 4px solid #FF9800 !important;
}

/* Karty volené Snemom - oranžová čiara hore */
.srz-ustredie-card--voleny {
    border-top: 4px solid #FF9800 !important;
}

/* Ikona komisie */
.srz-ustredie-icon {
    flex-shrink: 0;
}

.srz-ustredie-icon img {
    object-fit: contain;
}

/* Ikona v nadpise - base */
.srz-heading-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ikona v intro sekcii (väčšia) */
.srz-heading-icon--intro {
    border-radius: 8px;
    padding: 6px;
}

/* Ikona v Rozdelenie právomocí (menšia) */
.srz-heading-icon--small {
    border-radius: 6px;
    padding: 5px;
}

/* Farby ikon */
.srz-heading-icon--orange {
    background-color: #FF9800;
}

.srz-heading-icon--green {
    background-color: #018763;
}

/* Tablet - menší gap */
@media (max-width: 1024px) {
    .srz-ustredie-grid {
        gap: 24px;
    }

    .srz-ustredie-grid > *:last-child:nth-child(odd) {
        max-width: calc(50% - 12px) !important;
    }
}

/* Mobile - 1 stĺpec, 90% šírka */
@media (max-width: 768px) {
    .srz-ustredie-grid {
        grid-template-columns: 90%;
        gap: 20px;
    }

    /* Reset centrovania na mobile */
    .srz-ustredie-grid > *:last-child:nth-child(odd) {
        grid-column: auto !important;
        max-width: none !important;
        justify-self: stretch !important;
    }

    /* Single grid na mobile - plná šírka */
    .srz-ustredie-grid--single {
        max-width: 90%;
    }

    .srz-ustredie-card {
        padding: 24px !important;
    }

    .srz-ustredie-icon img {
        width: 48px !important;
        height: 48px !important;
    }
}

/* Malé mobily */
@media (max-width: 480px) {
    .srz-ustredie-card {
        padding: 20px !important;
    }

    .srz-ustredie-card h3 {
        font-size: 18px !important;
    }

    .srz-ustredie-icon img {
        width: 40px !important;
        height: 40px !important;
    }
}
