/* ==============================================
   Global Styles — KPower child theme
   Přesunuto z wp_global_styles DB → soubor
   ============================================== */

/* ==============================================
   CSS Variables & Global Styles
   ============================================== */

:root {
    /* Barvy */
    --color-primary: var(--wp--preset--color--accent-1);
    --color-secondary: var(--wp--preset--color--accent-2);
    --color-base: var(--wp--preset--color--base);
    --color-custom-page-title: var(--wp--preset--color--custom-page-title);
    --color-white: white;
    --color-gainsboro: gainsboro;

    /* Přechody */
    --transition-default: 0.3s ease all;

    /* Padding & Spacing */
    --padding-button: 7px 20px;
    --padding-list-item: 10px 15px;
    --padding-category-link: 20px 30px;
    --gap-default: 20px;

    /* Border */
    --border-primary: 1px solid var(--color-primary);
    --border-custom-page-title: 1px solid var(--color-custom-page-title);

    /* Box Shadow */
    --shadow-product: 2px 4px 13px #cdcdcd;

    /* SVG ikony — filter pro přebarvení na kpower zelenou #78B833 */
    --kpower-icon-filter: brightness(0) saturate(100%) invert(57%) sepia(57%) saturate(490%) hue-rotate(52deg) brightness(97%);
}

:root :where(.wp-block-navigation a:where(:not(.wp-element-button)):focus) {
    text-decoration: unset !important;
}

/* ==============================================
   Utility Classes
   ============================================== */

.position-relative {
    position: relative;
}

.overflow-hidden {
    overflow: hidden;
}

.w-60px {
    width: 60px !important;
}

.w-fit {
    width: -webkit-fill-available;
}

.max-w-85 {
    max-width: 85% !important;
}

.h-50-px img {
    height: 50px;
    object-fit: contain;
}

/* ==============================================
   Navigation
   ============================================== */

/* cstm-navbar responsivity */
@media screen and (max-width: 1326px) {
    .wp-block-navigation__responsive-container-open {
        display: block !important;
    }

    .wp-block-navigation__responsive-container:not(.is-menu-open.has-modal-open) {
        display: none !important;
    }

    .wp-block-navigation__responsive-container.is-menu-open {
        padding: 25px;
    }
}

a.custom-logo-link {
    max-width: 300px;
}

.nav-phone-icon {
    display: flex;
}

.nav-phones a {
    text-decoration: none;
    color: var(--color-custom-page-title);
    font-weight: 600;
}

.nav-phones a:hover {
    text-decoration: underline;
}

@media screen and (max-width: 1063px) {
    .nav-phones {
        display: none !important;
    }
}

/* ==============================================
   Buttons
   ============================================== */

.custom-button a {
    background: var(--color-primary);
    padding: var(--padding-button) !important;
    color: var(--color-white) !important;
    font-weight: 600;
    text-decoration: none !important;
    transition: var(--transition-default);
    border: var(--border-primary);
}

.custom-button a:hover {
    background: var(--color-base);
    color: var(--color-primary) !important;
}

a.dalsi-reference {
    font-size: 1.4rem;
    text-transform: uppercase;
    display: flex;
    padding: 35px 15px;
    justify-content: center;
    text-decoration: none;
    transition: var(--transition-default);
    border: var(--border-primary);
    background: var(--color-primary);
    color: var(--color-white);
    width: calc(100% - 30px);
}

a.dalsi-reference:hover {
    background: var(--color-white);
    color: var(--color-primary);
}

/* ==============================================
   Homepage Main Buttons — hover slide overlay
   ============================================== */

.hp-main-buttons img.thumbnail-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
}

/* Každá dlaždice = relative kontejner pro overlay */
.hp-main-buttons .custom-page-thumbnail {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hp-main-buttons a.thumbnail-link {
    width: 100%;
}

/* Titulek — vždy viditelný, staticky na spodu dlaždice */
.hp-main-buttons a.title-link {
    width: 86%;
    height: 90px;
    margin-top: -8%;
    text-transform: uppercase;
    position: relative;
    z-index: 5;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    font-weight: 700;
    text-decoration: none;
    padding: 2%;
    text-align: center;
    background: var(--color-custom-page-title);
    color: var(--color-white);
    display: flex;
}


/* ==============================================
   Grid Responsive
   ============================================== */

@media screen and (max-width: 1250px) {
    .grid-2c-tablet {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media screen and (max-width: 600px) {
    .grid-1c-mobile {
        grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    }

    .stranka-obsah-custom > .entry-content {
        max-width: 90% !important;
    }
}

@media screen and (max-width: 782px) {
    .linear-bg-mobile {
        background: linear-gradient(180deg, rgb(255, 255, 255) 30%, rgb(120, 184, 51) 100%) !important;
    }

    .max-w-85 {
        max-width: 85% !important;
    }

    ul.category-links {
        flex-direction: column !important;
        justify-content: center !important;
        width: 100% !important;
        padding: 0px !important;
    }

    ul.category-links a {
        width: unset !important;
    }
}

/* ==============================================
   Custom Lists
   ============================================== */

.custom-page-title {
    max-width: 100%;
}

ol.wp-block-list.custom-seznam {
    padding: 0px;
}

ol.wp-block-list.custom-seznam li {
    background: var(--color-secondary);
    padding: var(--padding-list-item);
}

/* ==============================================
   Product Items
   ============================================== */

.product-column {
    display: flex;
    justify-content: center;
    gap: var(--gap-default);
    flex-wrap: wrap;
}

.product-item {
    width: 200px;
    background: var(--color-white);
    padding: 5%;
    color: var(--color-primary);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    box-shadow: var(--shadow-product);
}

.product-item * {
    width: 100%;
    text-align: center;
}

.product-item span {
    font-size: 22px !important;
    font-weight: 600;
    text-align: center;
    margin: 10px 0px;
    color: var(--color-primary) !important;
}

.product-item div {
    height: 100%;
}

.product-item div img {
    height: 70%;
    object-fit: contain;
}

/* ==============================================
   Realizace (Projects)
   ============================================== */

.image-bg-hover {
    overflow: hidden;
    position: relative;
    display: flex;
}

.custom-realizace {
    background-color: var(--color-custom-page-title);
    width: 100%;
    height: 100%;
    transition: transform 0.3s ease;
    transform: translate(0px, 100%);
    position: absolute;
    z-index: 5464;
}

.image-bg-hover:hover .custom-realizace {
    transform: translate(0px, 0px);
}

.realizace-cstm-smycka figure.wp-block-post-featured-image img {
    height: 200px;
    object-fit: cover;
}

/* ==============================================
   Category Links
   ============================================== */

ul.category-links {
    display: flex;
    list-style-type: none;
    gap: var(--gap-default);
    flex-wrap: wrap;
    padding: 0px 30px;
    width: fit-content;
}

ul.category-links a {
    display: flex;
    padding: var(--padding-category-link);
    background: var(--color-custom-page-title);
    color: var(--color-white);
    text-decoration: none;
    font-weight: 600;
    text-transform: uppercase;
    border: var(--border-custom-page-title);
    transition: var(--transition-default);
    width: 228px;
    justify-content: center;
}

ul.category-links a:hover {
    background: var(--color-white);
    color: var(--color-custom-page-title);
}

/* ==============================================
   Service Pages — ikona grid + sekce
   ============================================== */

/* Ikona + popisek v gridu */
.service-ikona-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
    padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--40);
}

.service-ikona-item img {
    width: 65px;
    height: 65px;
    object-fit: contain;
    flex-shrink: 0;
}

/* SVG ikony (WP media ID 109–116) — přebarvení na kpower zelenou #78B833 */
.wp-image-109, .wp-image-110, .wp-image-111, .wp-image-112,
.wp-image-113, .wp-image-114, .wp-image-115, .wp-image-116 {
    filter: var(--kpower-icon-filter);
}

/* Kroky realizace */
.realizace-krok {
    display: flex;
    align-items: flex-start;
    gap: var(--wp--preset--spacing--30);
    padding: 8px var(--wp--preset--spacing--40);
    background: var(--wp--preset--color--secondary, #f0f4eb);
}

.realizace-krok-cislo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-primary);
    min-width: 50px;
    flex-shrink: 0;
}

/* ==============================================
   Page Content — hero + title overlay
   ============================================== */

/* Hero obrázek stránky */
.pages-nahl-obr img {
    object-position: center;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Fallback šedé pozadí, pokud stránka nemá featured image */
.obsah-stranky div:nth-child(1) {
    min-height: 55vh;
    background: var(--color-gainsboro);
}

/* Titulek stránky s zeleným pozadím překrývajícím spodek fotky */
.wp-block-post-title.page-title-custom {
    display: inline-block;
    line-height: 1.2;
}

/* Obsah stránky — šíře a základní typografie */
.stranka-obsah-custom {
    padding-left: var(--wp--preset--spacing--40);
    padding-right: var(--wp--preset--spacing--40);
}

.stranka-obsah-custom p,
.stranka-obsah-custom li {
    line-height: 1.75;
    font-size: 1rem;
}

.stranka-obsah-custom h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-custom-page-title);
    margin-top: 2rem;
    margin-bottom: 0.8rem;
}

.stranka-obsah-custom h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 0.6rem;
}

/* Zpět odkaz na detail reference */
a.ref-back-link {
    font-size: 0.85rem;
    color: var(--color-custom-page-title);
    text-decoration: none;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

a.ref-back-link:hover {
    text-decoration: underline;
}

/* Taxonomy badge (reference_type) na detail reference */
.wp-block-post-terms a {
    color: inherit;
    text-decoration: none;
}

@media screen and (max-width: 782px) {
    .stranka-obsah-custom {
        padding-left: var(--wp--preset--spacing--30);
        padding-right: var(--wp--preset--spacing--30);
    }
}

/* ==============================================
   Reference — filtrační tlačítka + grid
   ============================================== */

.reference-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 40px;
}

a.ref-filter-btn {
    padding: 10px 22px;
    background: var(--color-white);
    color: var(--color-custom-page-title);
    border: var(--border-custom-page-title);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    text-decoration: none;
    transition: var(--transition-default);
}

a.ref-filter-btn:hover,
a.ref-filter-btn.active {
    background: var(--color-custom-page-title);
    color: var(--color-white);
}

.reference-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.reference-card {
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-product);
    overflow: hidden;
    transition: var(--transition-default);
    cursor: pointer;
    user-select: none;
}

.reference-card:hover {
    box-shadow: 2px 6px 22px #b0b0b0;
    transform: translateY(-2px);
}

.reference-card__img-wrap {
    display: block;
    overflow: hidden;
    height: 220px;
    position: relative;
}

.reference-card__img-wrap--empty {
    background: var(--color-gainsboro);
    height: 220px;
}

.reference-card__img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.reference-card:hover .reference-card__img-wrap img {
    transform: scale(1.04);
}

/* Hover overlay na referenční kartě (zelený slide zleva) */
.reference-card__overlay {
    position: absolute;
    inset: 0;
    background: rgba(120, 184, 51, 0.88);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transform: translateY(100%);
    transition: transform 0.35s ease;
    z-index: 5;
}

.ref-card__cat {
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: rgba(0,0,0,0.18);
    padding: 3px 10px;
    border-radius: 3px;
}

.ref-card__zoom {
    color: white;
    font-size: 1.6rem;
    line-height: 1;
}

.reference-card:hover .reference-card__overlay {
    transform: translateY(0);
}

.reference-card__body {
    padding: 18px 20px 22px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.reference-card__type {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--color-custom-page-title);
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}

.reference-card__title {
    font-size: 1.05rem;
    margin: 0 0 10px;
    font-weight: 700;
}

.reference-card__excerpt {
    font-size: 0.88rem;
    color: #555;
    flex: 1;
    margin: 0 0 14px;
    line-height: 1.5;
}

.reference-empty {
    color: #777;
    font-style: italic;
}

@media screen and (max-width: 900px) {
    .reference-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 600px) {
    .reference-grid {
        grid-template-columns: 1fr;
    }
}

/* =============================================
   Reference HP grid — wrapper pro category-block vortex-style
   CSS pro jednotlivé karty je v custom-post-block-style.css
   ============================================= */
.wp-block-custom-theme-category-block {
    display: flex;
}

.reference-type-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    width: 100vw;
    position: relative;
}

.wp-block-custom-theme-category-block .category-link {
    text-decoration: none;
    color: inherit;
    display: block;
    width: 100%;
}

.reference-type-grid .wp-block-custom-theme-category-block {
    margin-bottom: 0;
}

/* Barva overlay — kpower zelená místo vortex modré */
.reference-type-grid .category-overlay {
    background-color: var(--wp--preset--color--custom-page-title);
}

@media screen and (max-width: 900px) {
    .reference-type-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 600px) {
    .reference-type-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* =============================================
   LIGHTBOX — kpower reference galerie
   ============================================= */
.kplb {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kplb[hidden] {
    display: none;
}

.kplb__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.88);
    cursor: zoom-out;
}

.kplb__inner {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90vw;
    max-height: 90vh;
    gap: 18px;
}

.kplb__img-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 70vh;
}

.kplb__img {
    max-width: 82vw;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 3px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.6);
    display: block;
}

.kplb__caption {
    text-align: center;
    color: #f0f0f0;
    padding: 0 16px;
    max-width: 700px;
}

.kplb__type {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-custom-page-title);
    background: rgba(255,255,255,0.08);
    padding: 3px 10px;
    border-radius: 2px;
    margin-bottom: 8px;
}

.kplb__title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 8px;
    color: #fff;
}

.kplb__excerpt {
    font-size: 0.88rem;
    color: #ccc;
    line-height: 1.55;
    margin: 0;
}

.kplb__counter {
    font-size: 0.82rem;
    color: #aaa;
    margin-top: -8px;
}

.kplb__close {
    position: fixed;
    top: 18px;
    right: 24px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 2.4rem;
    line-height: 1;
    cursor: pointer;
    z-index: 3;
    padding: 4px 10px;
    transition: color 0.2s;
}

.kplb__close:hover { color: var(--color-custom-page-title); }

.kplb__nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.12);
    border: none;
    color: #fff;
    font-size: 3rem;
    line-height: 1;
    padding: 10px 18px;
    cursor: pointer;
    z-index: 3;
    transition: background 0.2s, color 0.2s;
    border-radius: 3px;
    user-select: none;
}

.kplb__nav:hover {
    background: var(--color-custom-page-title);
}

.kplb__nav--prev { left: 16px; }
.kplb__nav--next { right: 16px; }

@media screen and (max-width: 600px) {
    .kplb__nav { font-size: 2rem; padding: 8px 12px; }
    .kplb__img { max-width: 95vw; }
    .kplb__nav--prev { left: 4px; }
    .kplb__nav--next { right: 4px; }
}
