/* ============================================================================
 * Managed-block (page builder) styles. Loaded on every public page so blocks
 * added through the inline editor display correctly to all visitors.
 *
 * Namespace: .apl-bk and .apl-bk-<template>. Designed to slot into the
 * existing apl-* design system (white background, neutral grays, primary
 * #1d4ed8, success #059669).
 * ========================================================================= */

.apl-bk {
    box-sizing: border-box;
    width: 100%;
    margin: 0;
    padding: 60px 24px;
    position: relative;
}
.apl-bk *, .apl-bk *::before, .apl-bk *::after { box-sizing: border-box; }

.apl-bk-inner {
    max-width: 1100px;
    margin: 0 auto;
}

.apl-bk h2 {
    font-size: clamp(24px, 3vw, 34px);
    margin: 0 0 24px;
    color: #0f172a;
    line-height: 1.2;
}
.apl-bk h3 {
    font-size: 20px;
    margin: 0 0 8px;
    color: #0f172a;
}
.apl-bk .apl-bk-rich p { margin: 0 0 12px; line-height: 1.65; color: #374151; }
.apl-bk .apl-bk-rich p:last-child { margin-bottom: 0; }
.apl-bk .apl-bk-rich a { color: #1d4ed8; }

.apl-bk-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: #1d4ed8;
    color: #fff !important;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.15s;
}
.apl-bk-cta-btn:hover { background: #1e40af; color: #fff !important; }

/* ============ HERO ============ */
.apl-bk-hero {
    min-height: 420px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: #fff;
    text-align: center;
}
.apl-bk-hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}
.apl-bk-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15,23,42,0.45) 0%, rgba(15,23,42,0.65) 100%);
    z-index: 1;
}
.apl-bk-hero-inner {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 80px 24px;
}
.apl-bk-hero-title {
    font-size: clamp(32px, 5vw, 56px);
    line-height: 1.1;
    margin: 0 0 16px;
    color: #fff;
}
.apl-bk-hero-subtitle {
    font-size: clamp(16px, 2vw, 20px);
    margin: 0 0 28px;
    color: #f1f5f9;
}

/* ============ TEXT + IMAGE ============ */
.apl-bk-text-image { background: #fff; }
.apl-bk-text-image-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}
.apl-bk-text-image-grid .apl-bk-image-col img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    display: block;
}
@media (max-width: 768px) {
    .apl-bk-text-image-grid { grid-template-columns: 1fr; }
}

/* ============ TEXT ============ */
.apl-bk-text { background: #fff; }
.apl-bk-text .apl-bk-inner { max-width: 800px; }

/* ============ CTA ============ */
.apl-bk-cta {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #fff;
    text-align: center;
}
.apl-bk-cta-inner h2 {
    color: #fff;
    margin-bottom: 20px;
}
.apl-bk-cta .apl-bk-cta-btn {
    background: #fff;
    color: #047857 !important;
}
.apl-bk-cta .apl-bk-cta-btn:hover { background: #f3f4f6; color: #047857 !important; }

/* ============ GALLERY ============ */
.apl-bk-gallery { background: #f9fafb; }
.apl-bk-gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
.apl-bk-gallery-grid img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}
@media (max-width: 768px) {
    .apl-bk-gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============ CARDS ============ */
.apl-bk-cards { background: #f9fafb; }
.apl-bk-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.apl-bk-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 28px 24px;
}
.apl-bk-card h3 { color: #1d4ed8; }
@media (max-width: 768px) {
    .apl-bk-cards-grid { grid-template-columns: 1fr; }
}

/* ============ TESTIMONIALS ============ */
.apl-bk-testimonials { background: #fff; }
.apl-bk-testimonials-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.apl-bk-testimonial {
    background: #f9fafb;
    border-radius: 12px;
    padding: 28px 24px;
    margin: 0;
    text-align: center;
}
.apl-bk-testimonial img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 16px;
    display: block;
}
.apl-bk-testimonial blockquote {
    font-style: italic;
    color: #374151;
    margin: 0 0 12px;
}
.apl-bk-testimonial figcaption {
    font-weight: 600;
    color: #1d4ed8;
    font-size: 14px;
}
@media (max-width: 768px) {
    .apl-bk-testimonials-grid { grid-template-columns: 1fr; }
}

/* ============ FAQ ============ */
.apl-bk-faq { background: #fff; }
.apl-bk-faq .apl-bk-inner { max-width: 800px; }
.apl-bk-faq-item {
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 10px;
    padding: 4px 20px;
    transition: background 0.15s;
}
.apl-bk-faq-item:hover { background: #f3f4f6; }
.apl-bk-faq-item summary {
    cursor: pointer;
    font-weight: 600;
    color: #0f172a;
    padding: 14px 0;
    list-style: none;
    position: relative;
    padding-right: 32px;
}
.apl-bk-faq-item summary::-webkit-details-marker { display: none; }
.apl-bk-faq-item summary::after {
    content: '+';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    color: #1d4ed8;
    font-size: 20px;
    transition: transform 0.15s;
}
.apl-bk-faq-item[open] summary::after { content: '−'; }
.apl-bk-faq-item > div { padding: 0 0 14px; }

/* ============ STATS ============ */
.apl-bk-stats {
    background: #1d4ed8;
    color: #fff;
}
.apl-bk-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 1100px;
    margin: 0 auto;
    text-align: center;
}
.apl-bk-stat-value {
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 800;
    color: #fff;
    line-height: 1;
}
.apl-bk-stat-label {
    margin-top: 8px;
    font-size: 14px;
    color: rgba(255,255,255,0.85);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
@media (max-width: 768px) {
    .apl-bk-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============ STEPS ============ */
.apl-bk-steps { background: #f9fafb; }
.apl-bk-steps-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    counter-reset: bksteps;
}
.apl-bk-step {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    position: relative;
}
.apl-bk-step-num {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #1d4ed8;
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 18px;
}
@media (max-width: 768px) {
    .apl-bk-steps-list { grid-template-columns: 1fr; }
}

/* ============================================================
 * Home cards (Ползи / История / Цени) — show icons on desktop too
 * and unify their color with the gold divider palette so they
 * read as a coherent set instead of stock blue stock images.
 * ========================================================= */
.row .column.col-sm-4 .ModuleIcon.only-mobile,
.row .column.col-sm-4 .module-container.ModuleIcon.only-mobile {
    display: block !important;
}
.row .column.col-sm-4 .ModuleIcon .icon {
    width: 64px !important;
    height: 64px !important;
    margin: 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #cc9966 !important;
    fill: #cc9966 !important;
    transition: transform 0.25s, filter 0.25s;
}
.row .column.col-sm-4 .ModuleIcon .icon svg,
.row .column.col-sm-4 .ModuleIcon .icon svg * {
    fill: #cc9966 !important;
    color: #cc9966 !important;
}
.row .column.col-sm-4:hover .ModuleIcon .icon {
    transform: translateY(-2px) scale(1.05);
    filter: drop-shadow(0 4px 8px rgba(204, 153, 102, 0.35));
}
.row .column.col-sm-4 .ModuleTitle .uc-content h4 {
    margin-top: 6px !important;
}

/* === Hide elements whose admin override emptied their text content === */
.apl-cta-actions a[data-bk-id]:empty,
.apl-cta-actions a:empty,
.apl-cta p[data-bk-id]:empty,
.apl-cta-inner > p[data-bk-id]:empty {
    display: none !important;
}

/* Team photo of Филиз Алендарова — её portrait is nearly square so the 4/3
   team card crops her forehead with default center alignment. Anchor the
   image so the top (head) stays in frame. */
.apl-team-media img[src*="filiz-alendarova"] {
    object-position: center top !important;
}

/* Locked regions get a discreet padlock cursor in edit mode so admins
   immediately understand why clicks do nothing on them. */
.bki-edit-mode .bki-locked {
    cursor: not-allowed !important;
    position: relative;
}
.bki-edit-mode .bki-locked::after {
    content: "🔒 🖕";
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(15, 23, 42, 0.85);
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    pointer-events: none;
    z-index: 10;
}
