/* ==========================================================================
   detail-pages.css — Shared styles for ahkam detail / OpenWordFile pages
   ========================================================================== */

/* Noto Sans / Noto Sans Arabic @font-face declarations now live in base.css,
   which is loaded before this stylesheet on every page. */


/* ---- Lusail @font-face declarations ------------------------------------ */
@font-face {
    font-family: 'Lusail';
    src: url('../../fonts/Lusail/Lusail-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

.detail-principle-page #rightData p.header {
    display: none;
}

.detail-principle-page #rightData .centercaption:nth-of-type(-n+3),
.detail-principle-page #rightData .centercaption:nth-of-type(-n+3) + br {
    display: none;
}

@font-face {
    font-family: 'Lusail';
    src: url('../../fonts/Lusail/Lusail-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Lusail';
    src: url('../../fonts/Lusail/Lusail-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Lusail';
    src: url('../../fonts/Lusail/Lusail-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

body {
    font-family: "Noto Sans Arabic", "Noto Sans", sans-serif;
    font-weight: 400;
    color: #111;
    line-height: 1.9;
    background: #f5f5f5;
    margin: 0;
    padding: 0;
    font-size: 20px;
}

/* ---- Page container ---------------------------------------------------- */
.body-content {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    background: #fff;
    background-color: var(--color-offwhite);
    min-height: 100vh;
    box-sizing: border-box;
}

/* ---- Hide old centered-logo header on screen --------------------------- */
.header.center {
    display: none !important;
}

/* ---- Print header baseline (hidden on screen; print.css controls print) -- */
#print-header {
    display: none !important;
}

.logo-header {
    max-height: 72px;
    width: auto;
}

/* ---- Case header (DetailsView) ----------------------------------------- */
.HeadText,
.HeadText td {
    font-weight: 700;
    font-size: 19px;
    text-align: center;
    text-decoration: none;
    padding: 6px 12px;
    line-height: 1.7;
    color: #111;
}

    .HeadText h1 {
        font-size: 28px;
        font-weight: 700;
        margin: 6px 0;
        color: #111;
    }

    .HeadText time {
        display: block;
        font-size: 19px;
        font-weight: 500;
        color: #333;
        margin-bottom: 6px;
    }

p.header {
    display: block;
    text-align: center !important;
    font-weight: 700;
    font-size: 22px;
    line-height: 1.7;
    margin: 0;
    padding: 6px 12px;
    color: #111;
}

/* ---- Body text (GridView) ---------------------------------------------- */
.GridText,
.GridText td {
    font-size: 19px;
    font-weight: 400;
    text-align: justify;
    line-height: 2.1;
    color: #111;
}

/* ---- Main content area ------------------------------------------------- */
main {
    text-align: right;
}

#content,
#google_translate_element,
#rightData {
    margin: 0 !important;
    padding: 12px 8px;
    direction: rtl;
    color: #111 !important;
}

/* Ensure HeadText centering inside GridView context */
.GridText .HeadText,
.GridText .HeadText td {
    text-align: center;
}

/* ---- OpenWord legislation header group -------------------------------- */
.leg-header-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
}

.openword-detail-page .leg-header-wrapper,
.openword-detail-page main,
.openword-detail-page .bodymn {
    width: 100%;
    max-width: 1080px;
    margin-left: auto;
    margin-right: auto;
}

.judgement-header {
    margin-top: 5px;
}

.principle-header {
    margin-top: 18px;

}

.openword-detail-page .leg-header-wrapper {
    display: block;
}

.openword-detail-page .legislation-header {
    margin: 10px auto 18px;
}

.openword-detail-page main {
    padding: 0;
}

.openword-detail-page #print-header {
    display: none !important;
}

.openword-detail-page #myText .centercaption:nth-of-type(-n+3),
.openword-detail-page #myText .centercaption:nth-of-type(-n+3) + br {
    display: none;
}

.detail-doc-page .leg-header-wrapper,
.detail-doc-page main,
.detail-doc-page #rightData,
.detail-doc-page #content,
.detail-doc-page #google_translate_element {
    width: 100%;
    max-width: 1082px;
    margin-left: auto !important;
    margin-right: auto !important;
}

.detail-doc-page #rightData,
.detail-doc-page #content,
.detail-doc-page #google_translate_element {
    padding-left: 0;
    padding-right: 0;
}

.detail-doc-card .doc-type-title {
    display: block;
    color: #6b7c85;
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 10px;
}

.detail-doc-card .toolbar-group-switch {
    order: 1;
    margin-inline-start: 0;
    margin-inline-end: auto;
}

.detail-doc-card .toolbar > .toolbar-group:not(.toolbar-group-switch) {
    order: 2;
    direction: rtl;
}

.detail-doc-card .toolbar > .toolbar-group:not(.toolbar-group-switch) .btn.primary {
    order: 3;
}

.legislation-header {
    border: 1px solid #dbe5ea;
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
    margin: 10px 0 18px;
    max-width: 1080px;
    width: 100%;
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.15);
}

    .legislation-header .header-content {
        padding: 18px 22px 14px;
    }

    .legislation-header .meta-row {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px 18px;
        margin-bottom: 12px;
        color: #08384f;
        font-size: 14px;
        font-weight: 700;
    }

    .legislation-header .meta-item {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        white-space: nowrap;
    }

    .legislation-header .btn img {
        width: 16px;
        height: 16px;
        display: block;
    }

    .legislation-header .toolbar-group-switch .btn img {
        filter: brightness(0) saturate(100%) invert(25%) sepia(36%) saturate(1333%) hue-rotate(170deg) brightness(92%) contrast(94%);
    }

    .legislation-header .meta-label {
        color: #6b7c85;
        font-weight: 600;
    }

    .legislation-header .status {
        color: #08384f;
        font-size: 14px;
        font-weight: 700;
    }

    .legislation-header .title-block {
        text-align: center;
        font-family: 'Noto Sans Arabic', 'Noto Sans', 'Simplified Arabic', sans-serif !important;
    }


    .legislation-header .title-block *
    .legislation-header .gazette-title,
    .legislation-header .gazette-title *
    .legislation-header .legislation-title,
    .legislation-header .legislation-title *
    .legislation-header .legislation-subtitle,
    .legislation-header .legislation-subtitle * {
        font-family: 'Noto Sans Arabic', 'Noto Sans', 'Simplified Arabic', sans-serif !important;
    }



    .legislation-header .gazette-title {
        margin: 0 0 10px;
        font-size: 20px;
        line-height: 1.6;
        font-weight: 700;
        color: #000;
    }

    .legislation-header .legislation-title {
        margin: 0 0 10px;
        font-size: 20px;
        line-height: 1.6;
        font-weight: 700;
        color: #000;
    }

    .legislation-header .legislation-subtitle {
        margin: 8px 0 0;
        font-size: 20px;
        line-height: 1.6;
        font-weight: 700;
        color: #000;
    }

    .legislation-header .toolbar {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        padding: 12px 12px 10px;
        background: #fff;
        position: relative;
    }

        .legislation-header .toolbar::before {
            content: "";
            position: absolute;
            top: 0;
            left: 12px;
            right: 12px;
            border-top: 1px solid #d9d9d9;
        }

    .legislation-header .toolbar-group {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .legislation-header .btn {
        min-height: 25px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        padding: 3px 10px;
        border-radius: 12px;
        border: .5px solid rgba(52, 50, 49, 0.5);
        background: #fff;
        color: #0d4261;
        text-decoration: none;
        font-size: 12px;
        font-weight: 700;
        line-height: 1.9;
        cursor: pointer;
        transition: .2s ease;
        white-space: nowrap;
    }

.detail-doc-page .legislation-header .btn {
    min-height: 30px;
    padding-top: 4px;
    padding-bottom: 4px;
}

.legislation-header .btn:hover {
    background: #f3f3f3;
    border-color: rgba(52, 50, 49, 0.5);
    color: #0d4261;
}

/* Ensure primary toolbar buttons have blue background and white text in ArabSample */
.legislation-header .btn.primary {
    background: #0D4261;
    border-color: #0D4261;
    color: #fff;
}

.legislation-header .btn.primary:hover {
    background: #0A3650;
    border-color: #0A3650;
    color: #fff;
}

/* ---- Action buttons bar ------------------------------------------------ */
.icons {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px 0;
    width: 100%;
    z-index: 1;
}

    .icons a,
    .icons a:link,
    .icons a:visited,
    .icons a:active,
    a.btn-action,
    a.btn-action:link,
    a.btn-action:visited,
    a.btn-action:active {
        display: inline-flex !important;
        align-items: center;
        gap: 8px;
        padding: 7px 16px !important;
        background: #0D4261 !important;
        color: #fff !important;
        border-radius: 6px;
        text-decoration: none !important;
        font-size: 13px;
        font-weight: 500;
        vertical-align: middle;
        transition: background .2s ease;
        border: none;
        cursor: pointer;
    }

        .icons a:hover,
        a.btn-action:hover {
            background: #0A3650 !important;
            color: #fff !important;
            text-decoration: none !important;
        }

        .icons a svg {
            flex-shrink: 0;
        }

    .icons .btn-action-related {
        background: #ffffff !important;
        color: #0D4261 !important;
        border: 1px solid rgba(13, 66, 97, 0.35) !important;
    }

        .icons .btn-action-related:hover {
            background: #f3f6f8 !important;
            color: #0D4261 !important;
        }

    .icons .btn-action-disabled,
    .icons .btn-action-disabled:hover {
        background: rgba(52, 50, 49, 0.08) !important;
        color: rgba(52, 50, 49, 0.45) !important;
        border: 1px solid rgba(52, 50, 49, 0.2) !important;
        cursor: default;
        pointer-events: none;
    }

.law-meta-inline {
    margin: 6px 0 12px;
    padding: 10px 12px;
    border: 1px solid #d7e9f6;
    background: #f7fbff;
    border-radius: 8px;
    text-align: center;
}

.law-meta-inline-title {
    font-size: 20px;
    font-weight: 700;
    color: #111;
    margin-bottom: 6px;
}

.law-meta-inline-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    color: #0D4261;
    font-size: 15px;
    font-weight: 500;
}

/* ---- Highlight for keyword search -------------------------------------- */
.highlight {
    background: #fff3cd;
    color: #1a1a1a;
    text-decoration: none;
    padding: 1px 3px;
    border-radius: 2px;
}

/* ---- OpenWordFile-specific --------------------------------------------- */
.bodymn {
    font-size: 16px;
    margin: 12px;
    padding: 12px 20px;
    text-align: justify;
    line-height: 1.9;
}

.detail-legislation-card-shell {
    margin-bottom: 14px;
}

    .detail-legislation-card-shell .legislation-cards-card {
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
    }

#myText {
    position: relative;
    z-index: 1;
    direction: rtl;
    font-size: 19px;
    font-weight: 400;
    line-height: 1.8;
    color: #111;
    margin: 0;
    padding: 0;
}

    #myText p,
    #content p,
    #rightData p {
        margin: 0 0 7px;
    }

    #myText .centercaption,
    #content .centercaption,
    #rightData .centercaption {
        display: block;
        text-align: center !important;
        font-weight: 700;
        font-size: 21px;
        line-height: 1.6;
        margin: 7px auto 2px;
        color: #111;
    }

    #myText br + .centercaption,
    #content br + .centercaption,
    #rightData br + .centercaption {
        margin: 30px auto 10px;
        padding: 6px 14px;
        border-radius: 10px;
        background: white;
        width: fit-content;
        box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.15);
        max-width: 100%;
    }

    #myText .centercaption + br + .centercaption,
    #content .centercaption + br + .centercaption,
    #rightData .centercaption + br + .centercaption {
        margin-top: 8px;
        padding: 0;
        background: transparent;
        border: none;
        width: auto;
    }

    #myText br,
    #content br,
    #rightData br {
        display: block;
        content: "";
        line-height: 1;
        margin: 2px 0;
    }

/* ---- Footer ------------------------------------------------------------ */
footer {
    padding: 18px 0 24px;
    text-align: center;
    font-size: 0.95rem;
    color: #555;
}

    footer p {
        margin: 0;
    }

hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 24px 0 0;
}

@media (max-width: 1080px) {
    .detail-doc-page main {
        padding-right: 20px;
        padding-left: 20px;
    }
    .legislation-header.detail-doc-card {
        margin-right: 20px;
        margin-left: 20px;
    }
    }

/* ---- Responsive: tablets and smaller desktops -------------------------- */
@media (max-width: 992px) {
    body {
        font-size: 17px;
    }

    .HeadText, .HeadText td {
        font-size: 20px;
    }

        .HeadText h1 {
            font-size: 23px;
        }

    .GridText, .GridText td {
        font-size: 18px;
    }

    #myText {
        font-size: 17px;
        margin: 0;
    }

        #myText .centercaption, #content .centercaption, #rightData .centercaption {
            font-size: 20px;
        }
}

@media (max-width: 768px) {
    body {
        font-size: 16px;
    }

    .HeadText, .HeadText td {
        font-size: 18px;
    }

        .HeadText h1 {
            font-size: 20px;
        }

    .GridText, .GridText td {
        font-size: 17px;
   
    }

    #myText {
        font-size: 16px;
        margin: 0;
    }

    .icons a {
        font-size: 13px;
        padding: 6px 14px !important;
    }

    #myText .centercaption, #content .centercaption, #rightData .centercaption {
        font-size: 18px;
    }

    .legislation-header .header-content {
        padding: 16px 14px 12px;
    }

    .legislation-header .toolbar {
        flex-direction: column;
    }

    .legislation-header .toolbar-group {
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }

    .detail-doc-card .toolbar-group-switch {
        margin-inline-start: 0;
    }

    .legislation-header .btn {
        width: 100%;
    }

    .legislation-header .gazette-title {
        font-size: 17px;
    }

    .legislation-header .legislation-title {
        font-size: 20px;
    }

    .legislation-header .legislation-subtitle {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 15px;
    }

    .HeadText, .HeadText td {
        font-size: 16px;
    }

    .GridText, .GridText td {
        font-size: 15px;
    }

    #myText {
        font-size: 16px;
        margin: 0;
    }

    .legislation-header .meta-row {
        justify-content: flex-start;
    }

    .legislation-header .toolbar-group {
        grid-template-columns: 1fr;
    }
}

/* Print output is controlled exclusively via assets/css/print.css */
