/* --- CUSTOM BLOCKS --- */
/* --- CUSTOM BLOCKS --- */
.custom-card-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    margin: 1rem 0;
}

/* Dynamické počítání prvků (do 6 pro účely roztažení, více se chová jako "plný počet") */
.custom-card-grid > * { --total-items: 999; }
.custom-card-grid > *:first-child:nth-last-child(1), .custom-card-grid > *:first-child:nth-last-child(1) ~ * { --total-items: 1; }
.custom-card-grid > *:first-child:nth-last-child(2), .custom-card-grid > *:first-child:nth-last-child(2) ~ * { --total-items: 2; }
.custom-card-grid > *:first-child:nth-last-child(3), .custom-card-grid > *:first-child:nth-last-child(3) ~ * { --total-items: 3; }
.custom-card-grid > *:first-child:nth-last-child(4), .custom-card-grid > *:first-child:nth-last-child(4) ~ * { --total-items: 4; }
.custom-card-grid > *:first-child:nth-last-child(5), .custom-card-grid > *:first-child:nth-last-child(5) ~ * { --total-items: 5; }
.custom-card-grid > *:first-child:nth-last-child(6), .custom-card-grid > *:first-child:nth-last-child(6) ~ * { --total-items: 6; }

.custom-card-grid > * {
    --current-max: var(--cols-desktop, 3);
    --actual-cols: min(var(--total-items), var(--current-max));
    width: calc((100% - ((var(--actual-cols) - 1) * 30px)) / var(--actual-cols));
}

@media (max-width: 991px) {
    .custom-card-grid > * {
        --current-max: var(--cols-tablet, 2);
    }
}

@media (max-width: 767px) {
    .custom-card-grid > * {
        --current-max: var(--cols-mobile, 1);
    }
}

.custom-card, .wp-block-my-theme-card {
    background-color: var(--card-bg, #ffffff);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
}

.custom-card .card-tag, .wp-block-my-theme-card .card-tag {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 6px 16px;
    border-radius: 20px;
    margin-bottom: 20px;
    display: inline-block;
    /* Default colors if not overridden by inline styles */
    background-color: rgba(165, 190, 0, 0.15);
    color: var(--secondary-dark, #94a700);
}

.custom-card .card-price, .wp-block-my-theme-card .card-price {
    font-family: var(--font-heading, 'Lexend', sans-serif);
    font-size: var(--h2, 2.44rem);
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1;
    color: var(--primary, #00509D);
}

.custom-card .card-desc, .wp-block-my-theme-card .card-desc {
    font-size: 15px;
    color: var(--text-main, #00000088);
}

/* --- ALERT BLOCK --- */
.custom-alert, .wp-block-my-theme-alert {
    width: 100%;
    border-radius: 10px;
    padding: 24px 32px;
    margin: 1rem 0;
    background-color: rgba(165, 190, 0, 0.15); /* Default to green */
}

.custom-alert .alert-title, .wp-block-my-theme-alert .alert-title {
    display: flex;
    align-items: center;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    margin-bottom: 12px;
    gap: 12px;
    color: var(--secondary-dark, #94a700); /* Default to green */
}

.custom-alert .alert-title::before, .wp-block-my-theme-alert .alert-title::before {
    content: "";
    display: block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--secondary-dark, #94a700); /* Default to green */
}

.custom-alert .alert-content, .wp-block-my-theme-alert .alert-content {
    font-size: 16px;
    color: var(--text-main, #333);
}

/* Green Variant (explicit class if Gutenberg adds it) */
.custom-alert.is-style-green, .wp-block-my-theme-alert.is-style-green {
    background-color: rgba(165, 190, 0, 0.15);
}
.custom-alert.is-style-green .alert-title, .wp-block-my-theme-alert.is-style-green .alert-title {
    color: var(--secondary-dark, #94a700);
}
.custom-alert.is-style-green .alert-title::before, .wp-block-my-theme-alert.is-style-green .alert-title::before {
    background-color: var(--secondary-dark, #94a700);
}

/* Blue Variant */
.custom-alert.is-style-blue, .wp-block-my-theme-alert.is-style-blue {
    background-color: rgba(0, 80, 157, 0.08);
}
.custom-alert.is-style-blue .alert-title, .wp-block-my-theme-alert.is-style-blue .alert-title {
    color: var(--primary, #00509D);
}
.custom-alert.is-style-blue .alert-title::before, .wp-block-my-theme-alert.is-style-blue .alert-title::before {
    background-color: var(--primary, #00509D);
}

/* --- STEP LIST BLOCK --- */
.custom-step-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 1rem 0;
    counter-reset: step-counter;
    --circle-color: var(--secondary, #A5BE00); /* default */
}

/* Modrá (Primary) varianta aplikovaná na celý seznam */
.custom-step-list.is-style-primary {
    --circle-color: var(--primary, #00509D);
}

.custom-step {
    background-color: var(--card-bg, #ffffff);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    padding: 24px 32px;
    display: flex;
    align-items: center;
    gap: 24px;
    counter-increment: step-counter;
}

.custom-step .step-number, .wp-block-my-theme-step .step-number {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background-color: var(--circle-color, var(--secondary, #A5BE00));
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading, 'Lexend', sans-serif);
    font-size: 20px;
    font-weight: 700;
}
.custom-step .step-number::before, .wp-block-my-theme-step .step-number::before {
    content: counter(step-counter);
}

.custom-step .step-content, .wp-block-my-theme-step .step-content {
    font-size: 16px;
    color: var(--text-main, #333);
}

@media (max-width: 767px) {
    .custom-step, .wp-block-my-theme-step {
        padding: 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
}

/* --- ADVANCED LIST BLOCK --- */
.custom-adv-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start; /* Nepusť to na střed */
    gap: 20px;
    margin: 1rem 0;
    counter-reset: adv-list-counter;
}

/* Dynamické počítání prvků */
.custom-adv-list > * { --total-items: 999; }
.custom-adv-list > *:first-child:nth-last-child(1), .custom-adv-list > *:first-child:nth-last-child(1) ~ * { --total-items: 1; }
.custom-adv-list > *:first-child:nth-last-child(2), .custom-adv-list > *:first-child:nth-last-child(2) ~ * { --total-items: 2; }
.custom-adv-list > *:first-child:nth-last-child(3), .custom-adv-list > *:first-child:nth-last-child(3) ~ * { --total-items: 3; }
.custom-adv-list > *:first-child:nth-last-child(4), .custom-adv-list > *:first-child:nth-last-child(4) ~ * { --total-items: 4; }
.custom-adv-list > *:first-child:nth-last-child(5), .custom-adv-list > *:first-child:nth-last-child(5) ~ * { --total-items: 5; }
.custom-adv-list > *:first-child:nth-last-child(6), .custom-adv-list > *:first-child:nth-last-child(6) ~ * { --total-items: 6; }

.custom-adv-list > * {
    --current-max: var(--cols-desktop, 2);
    --actual-cols: min(var(--total-items), var(--current-max));
    width: calc((100% - ((var(--actual-cols) - 1) * 20px)) / var(--actual-cols));
}

@media (max-width: 991px) {
    .custom-adv-list > * { --current-max: var(--cols-tablet, 2); }
}
@media (max-width: 767px) {
    .custom-adv-list > * { --current-max: var(--cols-mobile, 1); }
}

/* Barvy přednastavené na parentu */
.custom-adv-list.item-color-primary { --item-color: var(--primary, #00509D); }
.custom-adv-list.item-color-secondary { --item-color: var(--secondary, #A5BE00); }
.custom-adv-list.bg-color-primary { --item-bg: rgba(0, 80, 157, 0.05); }
.custom-adv-list.bg-color-secondary { --item-bg: rgba(165, 190, 0, 0.1); }

/* Položka seznamu */
.custom-adv-list-item {
    background-color: var(--item-bg, #f4f4f4);
    border-radius: 10px;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    counter-increment: adv-list-counter;
}

.custom-adv-list-item .adv-list-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Numbered style */
.custom-adv-list.type-numbered .adv-list-icon {
    width: 32px;
    height: 32px;
    background-color: var(--item-color);
    color: #ffffff;
    border-radius: 50%;
    font-family: var(--font-heading, 'Lexend', sans-serif);
    font-size: 14px;
    font-weight: 700;
}
.custom-adv-list.type-numbered .adv-list-icon::before {
    content: counter(adv-list-counter);
}

/* Bullet style */
.custom-adv-list.type-bullet .adv-list-icon {
    width: 12px;
    height: 12px;
    background-color: var(--item-color);
    border-radius: 50%;
}
.custom-adv-list.type-bullet .adv-list-icon::before {
    content: ""; /* No counter text */
}

.custom-adv-list-item .adv-list-content {
    font-size: 15px;
    color: var(--text-main, #333);
    font-weight: 500;
}

/* --- CONTACT BLOCK --- */
.custom-contact {
    background-color: var(--card-bg, #ffffff);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    padding: 24px 32px;
    margin: 1rem 0;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

/* Color variations */
.custom-contact.circle-color-primary { --contact-circle-bg: var(--primary, #00509D); }
.custom-contact.circle-color-secondary { --contact-circle-bg: var(--secondary, #A5BE00); }
.custom-contact.contact-color-primary { --contact-text-color: var(--primary, #00509D); }
.custom-contact.contact-color-secondary { --contact-text-color: var(--secondary, #A5BE00); }

/* Initials */
.custom-contact .contact-initials {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    background-color: var(--contact-circle-bg, var(--primary, #00509D));
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading, 'Lexend', sans-serif);
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
    text-align: center;
}

/* Details wrapper */
.custom-contact .contact-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Name */
.custom-contact .contact-name {
    font-family: var(--font-heading, 'Lexend', sans-serif);
    font-size: 18px;
    font-weight: 700;
    color: #111;
}

/* Role */
.custom-contact .contact-role {
    font-size: 16px;
    color: var(--text-main, #666);
    font-weight: 500;
}

/* Contact info */
.custom-contact .contact-info {
    font-family: var(--font-heading, 'Lexend', sans-serif);
    font-size: 16px;
    font-weight: 700;
    color: var(--contact-text-color, var(--primary, #00509D));
    text-align: right;
}

/* RESPONSIVE DESIGN */
@media (max-width: 575px) {
    .custom-contact {
        padding: 20px;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 12px;
    }
    .custom-contact .contact-info {
        text-align: center;
        margin-top: 8px;
    }
}
@media (min-width: 576px) and (max-width: 767px) {
    .custom-contact .contact-info {
        width: 100%;
        text-align: left;
        margin-top: 8px;
    }
}

/* --- LINK LIST BLOCK --- */
.custom-link-list {
    background-color: var(--card-bg, #ffffff);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    padding: 40px;
    margin: 1rem 0;
}

.custom-link-list .link-list-main-title {
    font-family: var(--font-heading, 'Lexend', sans-serif);
    font-size: 24px;
    font-weight: 700;
    color: #111;
    margin-bottom: 30px;
    margin-top: 0;
}

.custom-link-list .link-list-wrapper {
    display: flex;
    flex-direction: column;
    counter-reset: link-counter;
}

/* Color logic */
.custom-link-list.color-variant-primary {
    --link-accent-color: var(--primary, #00509D);
    --link-accent-bg: rgba(0, 80, 157, 0.1);
}
.custom-link-list.color-variant-secondary {
    --link-accent-color: var(--secondary, #A5BE00);
    --link-accent-bg: rgba(165, 190, 0, 0.15);
}

/* Item */
.custom-link-item, .custom-link-item-edit {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 20px 0;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
    counter-increment: link-counter;
    transition: background-color 0.2s ease;
}
.custom-link-item:last-child, .custom-link-item-edit:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.custom-link-item:first-child, .custom-link-item-edit:first-child {
    padding-top: 0;
}

/* Hover effect on frontend */
a.custom-link-item:hover .link-item-arrow {
    transform: translateX(5px);
}

/* Number */
.custom-link-list .link-item-number {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background-color: var(--link-accent-bg);
    color: var(--link-accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading, 'Lexend', sans-serif);
    font-size: 18px;
    font-weight: 700;
}
.custom-link-list .link-item-number::before {
    content: counter(link-counter);
}

/* Content */
.custom-link-list .link-item-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.custom-link-list .link-item-title {
    font-family: var(--font-heading, 'Lexend', sans-serif);
    font-size: 18px;
    font-weight: 700;
    color: #111;
}

.custom-link-list .link-item-desc {
    font-size: 15px;
    color: var(--text-main, #666);
}

/* Arrow */
.custom-link-list .link-item-arrow {
    flex-shrink: 0;
    color: var(--link-accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}
.custom-link-list .link-item-arrow svg {
    width: 24px;
    height: 24px;
}

/* Responsive */
@media (max-width: 575px) {
    .custom-link-list {
        padding: 24px;
    }
    .custom-link-item, .custom-link-item-edit {
        gap: 16px;
    }
    .custom-link-list .link-item-number {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    .custom-link-list .link-item-title {
        font-size: 16px;
    }
    .custom-link-list .link-item-desc {
        font-size: 14px;
    }
}

/* ==========================================================================
   11. NÁVOD S DOKUMENTEM / CO DĚLAT KDYŽ (HOW-TO CARD)
   ========================================================================== */
.custom-howto-card,
.wp-block-my-theme-howto-card {
    background-color: var(--card-bg, #ffffff);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.07);
    padding: 32px 36px;
    margin: 24px 0;
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 36px;
    align-items: center;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    position: relative;
    box-sizing: border-box;
    width: 100% !important;
    max-width: 100%;
    align-self: stretch;
}

.custom-howto-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 80, 157, 0.18);
}

.custom-howto-card.color-variant-secondary:hover {
    border-color: rgba(165, 190, 0, 0.35);
}

/* Barevné proměnné dle varianty */
.custom-howto-card.color-variant-primary,
.wp-block-my-theme-howto-card.color-variant-primary {
    --howto-accent: var(--primary, #00509D);
    --howto-accent-dark: var(--primary-dark, #003e7a);
    --howto-accent-bg: rgba(0, 80, 157, 0.08);
    --howto-btn-shadow: rgba(0, 80, 157, 0.25);
}

.custom-howto-card.color-variant-secondary,
.wp-block-my-theme-howto-card.color-variant-secondary {
    --howto-accent: var(--secondary, #A5BE00);
    --howto-accent-dark: var(--secondary-dark, #94a700);
    --howto-accent-bg: rgba(165, 190, 0, 0.15);
    --howto-btn-shadow: rgba(165, 190, 0, 0.35);
}

/* LEVÁ STRANA: Otázka a popis */
.howto-content-side {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
}

.howto-tag {
    font-family: var(--font-heading, 'Lexend', sans-serif);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 5px 14px;
    border-radius: 20px;
    background-color: var(--howto-accent-bg);
    color: var(--howto-accent);
    margin-bottom: 12px;
    display: inline-block;
}

.howto-title {
    font-family: var(--font-heading, 'Lexend', sans-serif);
    font-size: 22px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--heading-main, #111111);
    margin: 0 0 10px 0;
}

.howto-desc {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-main, #555555);
    margin: 0;
}

/* PRAVÁ STRANA: Box s dokumentem */
.howto-doc-side {
    width: 100%;
}

.howto-doc-box {
    display: flex;
    align-items: center;
    gap: 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 20px 22px;
    transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.custom-howto-card:hover .howto-doc-box {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
}

/* Miniatura dokumentu */
.howto-doc-preview {
    flex-shrink: 0;
}

.howto-sheet-placeholder {
    width: 68px;
    height: 88px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px 14px 6px 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07), 0 1px 3px rgba(0, 0, 0, 0.04);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 10px 8px 8px;
    overflow: hidden;
    transition: transform 0.2s ease;
    box-sizing: border-box;
}

.custom-howto-card:hover .howto-sheet-placeholder,
.custom-howto-card:hover .howto-preview-sheet {
    transform: scale(1.04) rotate(-1deg);
}

.howto-sheet-corner {
    position: absolute;
    top: 0;
    right: 0;
    width: 16px;
    height: 16px;
    background: #f1f5f9;
    border-bottom-left-radius: 5px;
    box-shadow: -1px 1px 3px rgba(0, 0, 0, 0.08);
}

.howto-sheet-lines {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding-top: 6px;
}

.howto-sheet-lines span {
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    display: block;
}

.howto-sheet-lines span:nth-child(1) { width: 80%; }
.howto-sheet-lines span:nth-child(2) { width: 100%; }
.howto-sheet-lines span:nth-child(3) { width: 60%; }

.howto-sheet-badge {
    align-self: flex-start;
    font-family: var(--font-heading, 'Lexend', sans-serif);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #ffffff;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1.2;
}

/* Reálný obrázek náhledu */
.howto-preview-sheet {
    width: 68px;
    height: 88px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    flex-shrink: 0;
}

.howto-preview-sheet.is-image-preview {
    cursor: pointer;
    background: #f1f5f9;
}

.howto-preview-sheet.is-image-preview:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
}

.howto-preview-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none !important;
    position: relative;
}

.howto-preview-sheet img.howto-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.25s ease;
}

.howto-preview-sheet:hover img.howto-preview-img {
    transform: scale(1.08);
}

.howto-preview-sheet .howto-sheet-badge {
    position: absolute;
    bottom: 5px;
    left: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 2;
    pointer-events: none;
}

/* Info o dokumentu a tlačítko */
.howto-doc-meta {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.howto-doc-name {
    font-family: var(--font-heading, 'Lexend', sans-serif);
    font-size: 14.5px;
    font-weight: 700;
    color: var(--heading-main, #1e293b);
    line-height: 1.35;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.howto-doc-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.howto-doc-badge-pill {
    font-family: var(--font-heading, 'Lexend', sans-serif);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    padding: 2px 8px;
    border-radius: 4px;
}

.howto-doc-size {
    font-size: 12.5px;
    color: #64748b;
    font-weight: 500;
}

.howto-doc-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 8px;
    background-color: var(--howto-accent);
    color: #ffffff !important;
    text-decoration: none !important;
    font-family: var(--font-heading, 'Lexend', sans-serif);
    font-size: 13.5px;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 12px var(--howto-btn-shadow);
    box-sizing: border-box;
}

.howto-doc-download:hover {
    background-color: var(--howto-accent-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px var(--howto-btn-shadow);
}

.howto-doc-download svg {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.howto-doc-download:hover svg {
    transform: translateY(2px);
}

.howto-doc-download.disabled {
    background-color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
}

/* Editor styly pro howto blok */
.custom-howto-card-edit {
    cursor: default;
}

.howto-editor-doc-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 14px;
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    text-align: center;
    gap: 10px;
}

.howto-editor-doc-placeholder .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: #94a3b8;
}

/* Responzivní chování */
@media (max-width: 900px) {
    .custom-howto-card,
    .wp-block-my-theme-howto-card {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 28px 26px;
    }
}

@media (max-width: 500px) {
    .custom-howto-card,
    .wp-block-my-theme-howto-card {
        padding: 20px 18px;
    }
    .howto-title {
        font-size: 19px;
    }
    .howto-doc-box {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        padding: 16px;
    }
    .howto-doc-download {
        width: 100%;
    }
}

/* --- MULTI-DOCUMENT STACK (Více dokumentů ke stažení) --- */
.custom-howto-card.has-multiple-files,
.wp-block-my-theme-howto-card.has-multiple-files {
    grid-template-columns: 1fr minmax(320px, 420px);
}

.howto-doc-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.howto-doc-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.howto-doc-item:hover {
    background: #ffffff;
    border-color: #cbd5e1;
    transform: translateX(2px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

.howto-doc-item-badge {
    flex-shrink: 0;
    font-family: var(--font-heading, 'Lexend', sans-serif);
    font-size: 11px;
    font-weight: 800;
    color: #ffffff;
    padding: 6px 9px;
    border-radius: 6px;
    letter-spacing: 0.04em;
    line-height: 1;
    text-align: center;
}

.howto-doc-item-img-link {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-decoration: none !important;
}

.howto-doc-item-img-thumb {
    width: 38px;
    height: 38px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    flex-shrink: 0;
    display: block;
    background: #f8fafc;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.howto-doc-item:hover .howto-doc-item-img-thumb {
    transform: scale(1.08);
    border-color: #cbd5e1;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}

.howto-doc-item-info {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.howto-doc-item-name {
    font-family: var(--font-heading, 'Lexend', sans-serif);
    font-size: 13.5px;
    font-weight: 700;
    color: var(--heading-main, #1e293b);
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.howto-doc-item-size {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.howto-doc-item-download {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 6px;
    background-color: var(--howto-accent);
    color: #ffffff !important;
    text-decoration: none !important;
    font-family: var(--font-heading, 'Lexend', sans-serif);
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 8px var(--howto-btn-shadow);
}

.howto-doc-item-download:hover {
    background-color: var(--howto-accent-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--howto-btn-shadow);
}

.howto-doc-item-download svg {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.howto-doc-item-download:hover svg {
    transform: translateY(2px);
}

/* Edit mód pro položku ve stacku */
.howto-doc-item-edit {
    cursor: default;
}

.howto-doc-item-edit .howto-doc-item-name {
    min-width: 120px;
}

@media (max-width: 900px) {
    .custom-howto-card.has-multiple-files,
    .wp-block-my-theme-howto-card.has-multiple-files {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 500px) {
    .howto-doc-item {
        flex-wrap: wrap;
        gap: 10px;
    }
    .howto-doc-item-download {
        width: 100%;
        justify-content: center;
    }
}

/* --- REŽIM ROZVRŽENÍ POD SEBOU (LAYOUT-STACKED / FULL WIDTH) --- */
.custom-howto-card.layout-stacked,
.wp-block-my-theme-howto-card.layout-stacked {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
}

.custom-howto-card.layout-stacked .howto-content-side {
    max-width: 100%;
}

.custom-howto-card.layout-stacked .howto-doc-side {
    width: 100%;
}

.custom-howto-card.layout-stacked .howto-doc-box {
    width: 100%;
    max-width: 100%;
}

.custom-howto-card.layout-stacked .howto-doc-stack {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    width: 100%;
}

/* --- GUTENBERG ZAROVNÁNÍ (WIDE & FULL WIDTH) --- */
.custom-howto-card.alignfull,
.wp-block-my-theme-howto-card.alignfull {
    width: 100% !important;
    max-width: 100% !important;
}

.custom-howto-card.alignwide,
.wp-block-my-theme-howto-card.alignwide {
    width: 100% !important;
    max-width: 100% !important;
}



