/* ==========================================================================
   DANKA UI BLOCKS (WordPress-style Layout Elements)
   Shared 1:1 between Frontend (php_web511) & CMS CKEditor (php_cmsweb)
   ========================================================================== */

.dk-block {
    margin: 24px 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #334155;
    line-height: 1.65;
}
.dk-block *, .dk-block *::before, .dk-block *::after {
    box-sizing: border-box;
}

/* Section Heading with Accent Line */
.dk-sec-heading {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 32px 0 18px;
}
.dk-sec-heading h2,
.dk-sec-heading h3 {
    margin: 0 !important;
    font-size: 22px;
    font-weight: 700;
    color: #0F172A;
    white-space: nowrap;
}
.dk-sec-heading .dk-sec-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, #248FB2 0%, #E2E8F0 100%);
    border-radius: 2px;
}

/* Multi-column Grid (2 cols / 3 cols) */
.dk-row {
    display: grid;
    gap: 20px;
    margin: 24px 0;
}
.dk-cols-1 {
    grid-template-columns: 1fr;
}
.dk-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.dk-cols-30-70 {
    grid-template-columns: minmax(0, 3fr) minmax(0, 7fr);
}
.dk-cols-70-30 {
    grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
}
.dk-cols-40-60 {
    grid-template-columns: minmax(0, 4fr) minmax(0, 6fr);
}
.dk-cols-60-40 {
    grid-template-columns: minmax(0, 6fr) minmax(0, 4fr);
}
.dk-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.dk-cols-25-50-25 {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr);
}
.dk-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.dk-gap-sm { gap: 12px; }
.dk-gap-md { gap: 20px; }
.dk-gap-lg { gap: 30px; }
.dk-align-start { align-items: start; }
.dk-align-center { align-items: center; }
.dk-align-stretch { align-items: stretch; }
.dk-row-clean .dk-col {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 4px 0;
}
.dk-el-img {
    margin: 0 0 12px;
}
.dk-el-img:last-child {
    margin-bottom: 0;
}
.dk-el-img .dk-img-box {
    width: 100%;
    overflow: hidden;
    border-radius: 10px;
    background: #F8FAFC;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dk-el-img .dk-img-box img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}
.dk-img-ratio-auto .dk-img-box img {
    height: auto !important;
    object-fit: contain;
}
.dk-img-ratio-43 .dk-img-box { aspect-ratio: 4 / 3; }
.dk-img-ratio-169 .dk-img-box { aspect-ratio: 16 / 9; }
.dk-img-ratio-11 .dk-img-box { aspect-ratio: 1 / 1; }
.dk-el-img .dk-img-cap {
    font-size: 13px;
    font-style: italic;
    color: #64748B;
    text-align: center;
    margin-top: 6px;
}
.dk-el-spacer {
    display: block;
    width: 100%;
}
.dk-el-divider {
    border: none;
    border-top: 1px solid #E2E8F0;
    margin: 14px 0;
    width: 100%;
}
.dk-el-list {
    margin: 0 0 12px;
    padding-left: 20px;
    color: #475569;
    font-size: 14.5px;
}
.dk-el-list li {
    margin-bottom: 6px;
}
.dk-btn-outline {
    background: #FFFFFF;
    color: #248FB2 !important;
    border: 1.5px solid #248FB2;
}
.dk-btn-outline:hover {
    background: #248FB2;
    color: #FFFFFF !important;
}
.dk-col {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
    display: flex;
    flex-direction: column;
}
.dk-col.dk-col-img-only {
    padding: 8px;
}
.dk-col.dk-col-img-only .dk-card-img-wrap {
    margin-bottom: 0;
}
.dk-icon-circle {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #EBF7FA;
    color: #248FB2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 12px;
}
.dk-col-text-top .dk-card-img-wrap {
    margin-top: auto;
    margin-bottom: 0;
}
.dk-stat-card {
    text-align: center;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #F8FAFC 0%, #FFFFFF 100%);
}
.dk-stat-num {
    font-size: 28px;
    font-weight: 800;
    color: #248FB2;
    line-height: 1.2;
    margin-bottom: 6px;
}
.dk-stat-label {
    font-size: 13.5px;
    font-weight: 600;
    color: #475569;
}
.dk-col h3, .dk-col h4 {
    margin: 0 0 8px;
    font-size: 16.5px;
    font-weight: 700;
    color: #0F172A;
    line-height: 1.4;
}
.dk-col p {
    margin: 0 0 10px;
    font-size: 14.5px;
    color: #475569;
}
.dk-col p:last-child {
    margin-bottom: 0;
}

/* Image Card inside Grid (Landscape 4:3) */
.dk-card-img-wrap {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #F8FAFC;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #F1F5F9;
}
.dk-card-img-wrap img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}
.dk-card-caption {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    text-align: center;
    margin-top: 4px;
}

/* Split Layout: Image Left - Text Right (and Reverse) */
.dk-split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
    align-items: center;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
    margin: 24px 0;
}
.dk-split-media {
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    background: #F8FAFC;
}
.dk-split-media img {
    width: 100% !important;
    height: auto !important;
    display: block;
    object-fit: cover;
    margin: 0 !important;
    border-radius: 10px !important;
}
.dk-split-content h3 {
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 700;
    color: #0F172A;
    line-height: 1.35;
}
.dk-split-content p {
    margin: 0 0 12px;
    font-size: 15px;
    color: #475569;
}
.dk-split.dk-split-reverse .dk-split-media {
    order: 2;
}
.dk-split.dk-split-reverse .dk-split-content {
    order: 1;
}

/* Stack Layout: Text Top - Image Bottom */
.dk-stack-text-img {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 14px;
    padding: 22px;
    margin: 24px 0;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}
.dk-stack-text-img .dk-stack-header {
    margin-bottom: 16px;
}
.dk-stack-text-img .dk-stack-header h3 {
    margin: 0 0 8px;
    font-size: 19px;
    font-weight: 700;
    color: #0F172A;
}
.dk-stack-text-img .dk-stack-header p {
    margin: 0;
    font-size: 15px;
    color: #475569;
}
.dk-stack-text-img .dk-stack-media {
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    background: #F8FAFC;
    text-align: center;
}
.dk-stack-text-img .dk-stack-media img {
    width: 100% !important;
    height: auto !important;
    display: block;
    margin: 0 auto !important;
    border-radius: 10px !important;
}

/* Callout / Highlight Box */
.dk-callout {
    background: #F0F9FF;
    border: 1px solid #BAE6FD;
    border-left: 4px solid #248FB2;
    border-radius: 0 12px 12px 0;
    padding: 16px 20px;
    margin: 22px 0;
}
.dk-callout h4 {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 700;
    color: #0369A1;
}
.dk-callout p {
    margin: 0;
    font-size: 14.5px;
    color: #1E293B;
}

/* CTA Banner Box */
.dk-cta-box {
    background: linear-gradient(115deg, #248FB2 0%, #176B87 100%);
    color: #FFFFFF;
    border-radius: 14px;
    padding: 24px 28px;
    margin: 26px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}
.dk-cta-box h3 {
    margin: 0 0 6px;
    font-size: 19px;
    font-weight: 700;
    color: #FFFFFF;
}
.dk-cta-box p {
    margin: 0;
    font-size: 14.5px;
    color: rgba(255, 255, 255, 0.92);
}
.dk-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    border-radius: 999px;
    background: #248FB2;
    color: #FFFFFF !important;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none !important;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.dk-btn:hover {
    background: #1B728E;
    transform: translateY(-1px);
}
.dk-cta-box .dk-btn {
    background: #FFFFFF;
    color: #248FB2 !important;
}
.dk-cta-box .dk-btn:hover {
    background: #F0F9FF;
}

/* Responsive Tablet (<= 991px) */
@media (max-width: 991px) {
    .dk-cols-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

/* Responsive Mobile (<= 767px) */
@media (max-width: 767px) {
    .dk-cols-2,
    .dk-cols-30-70,
    .dk-cols-70-30,
    .dk-cols-40-60,
    .dk-cols-60-40,
    .dk-cols-3,
    .dk-cols-25-50-25,
    .dk-cols-4,
    .dk-split {
        grid-template-columns: 1fr !important;
        gap: 14px;
    }
    .dk-split.dk-split-reverse .dk-split-media,
    .dk-split.dk-split-reverse .dk-split-content {
        order: unset;
    }
    .dk-sec-heading h2,
    .dk-sec-heading h3 {
        font-size: 18px;
        white-space: normal;
    }
    .dk-cta-box {
        padding: 18px;
        text-align: center;
        justify-content: center;
    }
}

/* CKEditor WYSIWYG Visual Guides (only active inside CMS editor iframe) */
body.cke_editable .dk-row,
body.cke_editable .dk-split,
body.cke_editable .dk-stack-text-img,
body.cke_editable .dk-callout,
body.cke_editable .dk-cta-box {
    outline: 1px dashed rgba(36, 143, 178, 0.35);
    outline-offset: 2px;
}
body.cke_editable .dk-col {
    outline: 1px dashed rgba(148, 163, 184, 0.5);
}
body.cke_editable .dk-block img:hover {
    outline: 2px solid #248FB2;
    cursor: pointer;
}
