/* ==========================================================================
   LEGALS / FOOTER SECTION
   ========================================================================== */

.legals {
    padding: 50px 20px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted); /* Linked to #888888 */
    line-height: 1.6;
    background-color: var(--bg-dark); /* Maintains consistent dark footer */
}

.legals p {
    margin-bottom: 10px;
    max-width: 800px; /* Slightly wider than standard paragraphs for legal text */
}

.legals p:last-child {
    margin-bottom: 0;
}

/* Links within legal text (if any) */
.legals a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition-smooth);
}

.legals a:hover {
    text-decoration: underline;
}

/* 1. Modal Styling */
.legal-lightbox {
    border: none;
    border-radius: 12px;
    padding: 0;
    max-width: 850px;
    width: 90%;
    max-height: 85vh;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.legal-lightbox::backdrop {
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px); /* Modern blur effect */
}

.modal-header {
    display: flex;
    justify-content: flex-end;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
}

.modal-body {
    padding: 30px 40px;
    overflow-y: auto;
}

/* 2. Content Typography */
.legal-text-style {
    line-height: 1.7;
    font-size: 15px;
    color: #333;
}

.legal-text-style h3 { margin-top: 1.5em; border-bottom: 1px solid #ddd; padding-bottom: 5px; }
.legal-text-style strong { color: #000; }

/* 3. Buttons */
.close-btn, .print-btn {
    border: none;
    background: #e9ecef;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    margin-left: 10px;
}
.close-btn:hover { background: #ff4444; color: white; }

/* 4. THE PRINT LOGIC */
@media print {
    /* 1. Hide the entire screen UI */
    body {
        visibility: hidden;
        background: white !important;
    }

    /* 2. Target only the OPEN dialog and its contents */
    dialog[open].legal-lightbox,
    dialog[open].legal-lightbox * {
        visibility: visible;
    }

    /* 3. Reset the dialog's position so it starts at the top of the paper */
    dialog[open].legal-lightbox {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 0;
        border: none;
        box-shadow: none;
        display: block !important; /* Forces block layout for print */
    }

    /* 4. Formatting for paper */
    .modal-body {
        padding: 0 !important;
        margin: 0 !important;
    }

    .legal-text-style {
        font-size: 12pt; /* Better for reading on paper */
        color: black !important;
    }

    /* 5. Hide UI elements (Close & Print buttons) on the paper */
    .modal-header, .close-btn, .print-btn, .site-footer {
        display: none !important;
        visibility: hidden !important;
    }
    
    /* Ensure no weird background colors waste ink */
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
}