/* clavius-unit-style */

/* 2. Style the internal scrollbar to match your localhost */
body.single-unit .unit-container::-webkit-scrollbar {
    width: 10px;
}
body.single-unit .unit-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

body.single-unit .unit-container {
    position: relative !important;
    display: block !important;
    /* We lock the top margin to stop the theme's default push */
    margin-top: 0 !important;
    padding-top: 0 !important;
    /* This ensures the browser doesn't try to animate the size change */
    transition: none !important;
}

body.single-unit .site-main, 
body.single-unit .entry-content,
body.single-unit .post-content {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.unit-container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 20px !important;
    box-sizing: border-box !important;
    /* Prevents margin-collapse and height jumps */
    display: flow-root !important; 
    /* Ensures scrollbar doesn't vanish/appear causing width-flicker */
    scrollbar-gutter: stable !important;
}

/* 2. Fix for theme overrides */
body.single-unit #main .container { max-width: 100% !important; width: 100% !important; margin: 0 !important; padding: 0 !important; display: block !important; }
body.single-unit #primary { width: 100% !important; max-width: 100% !important; margin: 0 !important; padding: 0 !important; float: none !important; }

/* 3. Grid Structure */
.unit-flex-layout {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    /* Reserve space for the height even if empty */
    min-height: 400px;
}
.unit-main-col {
    flex: 0 0 74%;      
    max-width: 74%;
    margin-right: 1%;   
}
.unit-sidebar-col {
    flex: 0 0 25%;      
    max-width: 25%;
}

@media (max-width: 768px) {
    .unit-flex-layout { flex-wrap: wrap; }
    .unit-main-col, .unit-sidebar-col { flex: 0 0 100%; max-width: 100%; margin-right: 0; }
}

/* 4. Media Components - Reserved Space */
.unit-video-wrapper { 
    background: #000; 
    border-radius: 8px; 
    overflow: hidden; 
    margin-bottom: 20px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.3); 
    /* Forces the box to exist before video loads */
    aspect-ratio: 16 / 9; 
    width: 100%; 
    display: block; 
}
.unit-video-wrapper video {
    width: 100% !important;
    height: 100% !important;
    display: block;
}
.unit-text-area { 
    background: #fff; 
    padding: 35px; 
    border: 1px solid #ddd; 
    border-radius: 8px; 
    line-height: 1.8; 
    color: #333; 
    min-height: 200px; /* Ensures the area has size even before text fills it */
}

/* Sidebar & Navigation - (Keeping your existing styles) */
.btn-chapter { background: #0d0079; color: #fff !important; font-weight: 700; padding: 12px; text-align: center; border-radius: 4px; margin-bottom: 5px; text-transform: uppercase; font-size: 14px; }
.btn-summary { background: #fff; color: #0d0079 !important; border: 1px solid #0d0079; margin-bottom: 15px; font-size: 11px; font-weight: 700; text-align: center; display: block; padding: 8px; text-decoration: none; border-radius: 4px; }
.btn-modul-link { display: block; background: #eee; color: #444 !important; border-left: 4px solid #0d0079; padding: 10px 15px; font-size: 13px; margin-bottom: 8px; font-weight: 700; text-decoration: none; }
.btn-modul-link:hover {
    background: #e0e0e0 !important; /* Slightly darker than default */
    cursor: pointer;
}
.btn-modul-link.active { background: #0d0079; color: #fff !important; }
.btn-modul-link.active:hover {
    background: #000c60 !important; /* Slightly darker than your brand blue */
}

.unit-nav-strip { display: flex; justify-content: space-between; margin: 15px 0 20px 0; }
.btn-nav-main { 
    /* Remove the box styling */
    background: transparent !important; 
    border: none !important; 
    padding: 0 !important; 
    border-radius: 0 !important;
    
    /* Keep the text styling */
    color: #0d0079 !important; /* This is your brand blue */
    font-weight: 700 !important; 
    text-decoration: none !important; 
    font-size: 13px !important; 
    text-transform: uppercase !important;
    
    /* Ensure it behaves like a link */
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
}

/* Add a simple underline or color shift on hover */
.btn-nav-main:hover {
    color: #000 !important; /* Darkens on hover to show it's clickable */
    text-decoration: underline !important;
}
.btn-unit-grid { display: none !important; margin: 0 !important; }
.btn-unit-grid.show { display: grid !important; grid-template-columns: repeat(10, 1fr); gap: 4px; margin-bottom: 15px !important; }
.btn-unit { background: #fff; border: 1px solid #ccc; color: #666 !important; text-align: center; font-size: 11px; padding: 0; aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; text-decoration: none; font-weight: 700; border-radius: 3px; }
.btn-unit:hover {
    border-color: #0118D8 !important;
    background: #f0f0ff !important;
    cursor: pointer;
}
.btn-unit.active { background: #0118D8 !important; color: #fff !important; border-color: #0118D8; }
.btn-unit.active:hover {
    background: #000c60 !important; /* Slightly darker shade of active blue */
}

/* --- Adjust the Main Container for Restricted Views --- */
body.single-unit .unit-container {
    width: 100% !important;
    max-width: 100% !important; /* Changed from 1200px to 100% */
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 0 20px !important;
}

/* --- The Restricted Card Style --- */
.clavius-restricted-card {
    padding: 40px; 
    background: #f8f9fa;
    border: 1px solid #dee2e6; 
    border-radius: 15px; 
    text-align: center; 
    margin: 40px auto !important; /* Added 'auto' to center it */
    box-sizing: border-box;
    max-width: 800px; /* Capping the restricted card makes it easier to read */
}

.restricted-title {
    color: #0d0079 !important;
    margin-top: 0;
    font-size: 24px;
    font-weight: 700;
}

.restricted-text {
    color: #333;
    font-size: 16px;
    margin: 10px 0;
}

.restricted-info {
    margin: 15px 0;
    font-size: 15px;
}

.restricted-btn {
    display: inline-block;
    background: #0d0079;
    color: #fff !important;
    padding: 12px 25px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    margin: 10px 0;
}


/* --- 6. Mobile Responsiveness for Restricted Cards --- */
@media (max-width: 768px) {
    body.single-unit .unit-container {
        padding: 0 15px !important; /* Smaller side gaps on mobile */
    }

    .clavius-restricted-card {
        padding: 25px 15px; /* Reduce internal padding so text has room */
        margin: 20px 0;
        border-radius: 10px; /* Softer corners for mobile */
    }

    .restricted-title {
        font-size: 20px !important; /* Smaller heading for mobile screens */
    }

    .restricted-text {
        font-size: 14px !important;
        line-height: 1.4;
    }
    
    .restricted-btn {
        width: auto !important;       /* Stop it from stretching to 100% */
        display: inline-block !important; 
        min-width: 200px;             /* Gives it a nice solid base size */
        padding: 12px 30px !important; /* Extra breathing room for the text */
        box-sizing: border-box;
        margin: 10px auto;            /* Centers it if needed */
    }
}