/**
 * Legacy Block Compatibility Styles
 *
 * Maps the old xwrite theme block classes (.title_box, .box1, etc.)
 * to match the visual appearance of the new Malta theme blocks
 * (.xw-block-title-box, .xw-box-type1, etc.)
 *
 * @package Malta_Portal
 */

/* ============================================
   Legacy Title Box (.title_box)
   Match new .xw-block-title-box look
   ============================================ */

/* --- Base Container --- */
.title_box {
    --background-color: transparent;
    --accent-color: #333;
    --border-radius: initial;
    --text-color: #fff;
    overflow: hidden;
    position: relative;
    border-radius: var(--border-radius, 0);
}

/* --- Title Bar --- */
.title_box>.title {
    min-height: 2em;
    padding: 0.5em var(--block--box--pad, 20px);
    background-color: var(--accent-color);
    color: var(--text-color);
    font-family: "YuGothic", "Yu Gothic", sans-serif;
    font-weight: 700;
    font-size: 16px;
    line-height: 1.6;
    letter-spacing: 0;
}

/* --- Title Text --- */
.title_box .title-text {
    display: inline-block;
    color: var(--text-color);
    vertical-align: middle;
    font-family: "Marcellus", serif;
    font-weight: 400;
    font-style: normal;
    font-size: 24px;
    line-height: 1.2;
    letter-spacing: 0;
}

/* --- Title Icons --- */
.title_box .title-icon:not(.left):not(.right) {
    padding-right: 10px;
}

.title_box .title-icon.left {
    padding-right: 10px;
}

.title_box .title-icon.right {
    padding-left: 10px;
}

/* --- Content Area --- */
.title_box>.content {
    padding: 20px;
    border-color: var(--accent-color);
    background-color: var(--background-color);
    font-size: 16px;
    line-height: 1.6;
}

.title_box>.content> :first-child {
    margin-top: 0;
}

.title_box>.content> :last-child {
    margin-bottom: 0;
}

/* --- Content Paragraph Override --- */
.title_box>.content p {
    font-family: "Yu Gothic", YuGothic, sans-serif;
    font-weight: 700;
    font-size: 16px;
    line-height: 1.6;
    letter-spacing: 0;
    padding: 0;
    margin: 0 0 1em 0;
}

.title_box>.content p:last-child {
    margin-bottom: 0;
}

/* ============================================
   Legacy Title Box Type Variants
   ============================================ */

/* --- Type 1: Simple (box1) --- */
.title_box.box1 {
    box-shadow: 1px 1px 4px 1px #ccc;
}

.title_box.box1>.title {
    font-weight: 700;
    text-align: center;
}

.title_box.box1>.content {
    border: 2px solid var(--accent-color);
    border-top: none;
    border-radius: 0 0 var(--border-radius, 0) var(--border-radius, 0);
}

/* --- Type 2: No Border (box2) --- */
.title_box.box2 {
    box-shadow: 1px 1px 4px 1px #ccc;
    border-top-left-radius: var(--border-radius, 0);
    border-top-right-radius: var(--border-radius, 0);
}

.title_box.box2>.title {
    font-weight: 700;
    text-align: center;
}

/* --- Type 3: Label (box3) --- */
.title_box.box3 {
    background-color: var(--background-color);
}

.title_box.box3::before {
    pointer-events: none;
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    border: 2px solid var(--accent-color);
    border-radius: var(--border-radius, 0);
    z-index: 1;
}

.title_box.box3>.title {
    position: relative;
    display: table;
    min-width: 5em;
    padding: 0.3em var(--block--box--pad, 20px);
    border-bottom-right-radius: var(--border-radius, 0);
    font-weight: 700;
    text-align: center;
}

/* --- Type 4: Tab (box4) --- */
.title_box.box4>.title {
    display: table;
    min-width: 5em;
    padding: 0.3em var(--block--box--pad, 20px);
    border-top-left-radius: var(--border-radius, 0);
    border-top-right-radius: var(--border-radius, 0);
    font-weight: 700;
    line-height: 1.5em;
    text-align: center;
}

.title_box.box4>.content {
    margin-top: -2px;
    border: 2px solid var(--accent-color);
    border-top-right-radius: var(--border-radius, 0);
    border-bottom-left-radius: var(--border-radius, 0);
    border-bottom-right-radius: var(--border-radius, 0);
}

.title_box.box4.shadow {
    box-shadow: none;
    filter: drop-shadow(2px 2px 2px rgba(0, 0, 0, 0.15));
}

.title_box.box4 .title-text {
    font-family: "Marcellus", serif;
    font-weight: 400;
    font-style: normal;
    font-size: 24px;
    line-height: 1.2;
}

.xw-block-title-box>.xw-box-content {
    padding: 20px;
}

@media (max-width: 767.98px) {
    .xw-block-title-box.xw-box-type4 .title-text {
        font-size: 20px;
    }

    .xw-block-title-box>.xw-box-content {
        padding: 16px;
    }

    .xw-block-title-box>.xw-box-content p {
        font-size: 12px !important;

    }
}



/* --- Shadow Hide --- */
.title_box.shadow_hide {
    box-shadow: none;
}

/* --- Responsive --- */
@media (max-width: 991.98px) {
    .title_box {
        width: auto;
    }
}