/*
 * Common Section Styles
 * Consolidates shared styles from all section-specific CSS files
 * Loaded by naglowek.inc.php for consistent styling across all sections
 */
:root {
    /* Override Bootstrap's primary color system with SP31 school colors */
    --bs-primary: #384772;
    --bs-primary-rgb: 56, 71, 114;

    /* Create darker variation for hover states */
    --sp31-primary-dark: #2c3659;
    --sp31-primary-dark-rgb: 44, 54, 89;

    /* Bootstrap navbar variable overrides */
    --bs-navbar-color: var(--bs-white);
    --bs-navbar-hover-color: var(--bs-white);
    --bs-navbar-active-color: var(--bs-white);
    --bs-navbar-brand-color: var(--bs-white);
    --bs-navbar-brand-hover-color: var(--bs-white);

    /* Dropdown menu variables */
    --bs-dropdown-bg: var(--sp31-primary-dark);
    --bs-dropdown-border-color: var(--sp31-primary-dark);
    --bs-dropdown-link-color: var(--bs-white);
    --bs-dropdown-link-hover-color: var(--bs-white);
    --bs-dropdown-link-hover-bg: var(--sp31-primary-dark);
}

html {
    margin-top: 0 !important;
    padding-top: 0 !important;
    /* Fix anchor scroll offset for fixed navbar (80px navbar + 10px breathing room) */
    scroll-padding-top: 90px;
}

/* Base body styles for sections */
body {
    font-family: 'Roboto', sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    padding-top: 0px;
    /* Note: mobile-unified-nav.css will override this to 80px for mobile */
}

/* ================================================
   Accessibility Enhancements
   ================================================ */

/* Enhanced focus indicators for better keyboard navigation */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #0b0790;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(11, 7, 144, 0.3);
}

/* Ensure sufficient color contrast for links */
.link-wpis:focus,
.link-wpis:hover {
    background-color: #0b0790;
    color: #ffffff !important;
    padding: 2px 4px;
    border-radius: 3px;
}

/* Skip link improvements */
/* .skip-navigation:focus {
    position: absolute;
    top: 0;
    left: 6px;
    z-index: 10001;
    background: #000;
    color: #fff;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 0 0 4px 4px;
    font-weight: bold;
} */

/* Navbar styles - section common */
.navbar {
    background: #384772;
    border: 0;
}

/* Bootstrap 5 Navbar Updates */
.navbar-light {
    /* background-color: #fff !important; */
    z-index: 1030;
}

.navbar-header .navbar-brand {
    font-family: 'Roboto', sans-serif;
    font-size: 1em;
    margin-top: -2px;
    color: #ffffff;
}

.nav .navbar-nav {
    font-family: 'Roboto', sans-serif;
    font-size: 1em;
    color: #ffffff;
}

/* Sidebar navigation - common across sections */
.bottom-menu-index {
    width: 100%;
}

.sidebar .nav-pills li {
    font-family: 'Roboto', sans-serif;
    font-size: 1em;
    margin-top: 0px;
    border-bottom: 1px solid silver;
    background: #384772;
}

.sidebar .nav-pills li:last-child {
    border-bottom: none;
}

.sidebar .nav-pills li a:hover {
    text-align: left;
    color: #ffffff;
    background: #384772;
}

/* ================================================
   Bootstrap 5 Sidebar List Group Styling
   ================================================ */

/* 
 * IMPORTANT DECLARATIONS POLICY:
 * Only essential !important declarations are used in this section:
 * 1. Container overflow - Required to allow dropdown menus to appear outside sidebar bounds
 * 2. Z-index positioning - Essential for proper layering above other elements
 * 3. Critical positioning properties - Needed to override Bootstrap's absolute positioning
 * 
 * All other styling uses proper CSS specificity instead of !important for maintainability.
 */

/* Sidebar list group styling */
.sidebar .list-group {
    border: none;
}

/* Sidebar container - ensure dropdowns can overflow */
.sidebar {
    overflow: visible !important;
    /* Essential: Allows dropdown menus to appear outside sidebar bounds */
}

.sidebar .container-fluid {
    overflow: visible !important;
    /* Essential: Allows dropdown menus to appear outside container bounds */
}

.sidebar .list-group-item {
    background-color: #384772;
    border: 1px solid #4a5a8a;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    padding: 10px 15px;
    text-decoration: none;
    border-radius: 0;
}

.sidebar .list-group-item:first-child {
    border-top-left-radius: 0.375rem;
    border-top-right-radius: 0.375rem;
}

.sidebar .list-group-item:last-child {
    border-bottom-left-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
}

.sidebar .list-group-item:hover,
.sidebar .list-group-item:focus {
    background-color: #4a5a8a;
    color: #ffffff;
    text-decoration: none;
    outline: 2px solid #66b3ff;
    outline-offset: -2px;
}

/* Dropdown container positioning */
.sidebar .dropdown {
    position: relative;
}

/* Dropdown button styling - match navigation colors */
.sidebar .dropdown-toggle {
    background-color: #384772;
    border-color: #4a5a8a;
    border-radius: 0;
    color: #ffffff;
    text-align: left;
    white-space: normal;
    width: 100%;
}

.sidebar .dropdown-toggle:hover,
.sidebar .dropdown-toggle:focus {
    background-color: #4a5a8a;
    border-color: #4a5a8a;
    color: #ffffff;
}

.sidebar .dropdown-toggle.show {
    background-color: #4a5a8a;
    border-color: #4a5a8a;
    color: #ffffff;
}

.sidebar .dropdown-toggle::after {
    border-top-color: #ffffff;
    float: right;
    margin-top: 0.375rem;
}

/* Enhanced sidebar dropdown menu container */
.sidebar .dropdown-menu {
    background-color: var(--sp31-primary-dark);
    border: 1px solid var(--bs-white);
    /* Bootstrap 5 positioning for dropdown visibility */
    position: absolute;
    top: 100%;
    left: 0;
    /* Hide by default - Bootstrap 5 requirement */
    display: none;
    /* Only keep essential z-index for proper layering */
    z-index: 2100 !important;
}

.sidebar .dropdown-menu.show {
    display: block !important;
    /* Essential: Override the more specific .sidebar .dropdown-menu display:none rule */
    z-index: 2100 !important;
    /* Essential for proper layering */
}

.sidebar .dropdown-item {
    color: var(--bs-white);
}

.sidebar .dropdown-item:hover,
.sidebar .dropdown-item:focus {
    background-color: #f8f9fa;
    /* Override global navigation rules */
    color: #333333;
    /* Override global navigation rules */
}

/* Override global navigation dropdown focus styles for sidebar */
.sidebar .dropdown-menu a:focus {
    background-color: #f8f9fa !important;
    color: #333333 !important;
    outline: 2px solid #66b3ff !important;
    outline-offset: -2px !important;
}



/* Enhanced hover effects for sidebar main items */
.sidebar .nav-pills li:hover {
    background-color: #2c3659;
    transition: background-color 0.2s ease;
}

/* Better padding and accessibility for sidebar links */
.sidebar .nav-pills li a {
    font-family: 'Roboto', sans-serif;
    font-size: 1em;
    text-align: left;
    color: #ffffff;
    padding: 12px 15px;
    display: block;
    line-height: 1.4;
    transition: all 0.2s ease;
}

/* Page header styles - common */
.page-header.header-small {
    min-height: 300px;
    position: relative;
    height: 300px;
    margin-bottom: 0;
}

.boxed-layout-header {
    padding-bottom: 60px;
}

.page-header {
    overflow: hidden;
    height: 50vh;
    margin: 0;
    padding: 0;
    padding-bottom: 0px;
    border: 0;
    background-position: center center;
    background-size: cover;
}

.page-header {
    padding-bottom: 9px;
    margin: 0 0 20px;
    border-bottom: 1px solid #eee;
}

/* Box sizing and tap highlight fixes */
* {
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0);
    -webkit-tap-highlight-color: transparent;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

.header-filter {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

/* Common typography styles */
.h1-nag {
    font-size: 1.1em;
    color: #0b0790;
    line-height: 18.9px;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
    padding-top: 45px;
    padding-bottom: 45px;
}

.h2-nag-left {
    font-size: 1em;
    color: #0b0790;
    line-height: 18.9px;
    font-weight: 600;
    text-align: left;
    text-transform: uppercase;
    padding-top: 25px;
    padding-bottom: 11px;
    scroll-padding-top: 90px;
    /* 80px navbar + 10px breathing room */
}

.h2-nag-center {
    font-size: 1.1em;
    color: #0b0790;
    line-height: 18.9px;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    padding-top: 25px;
    padding-bottom: 11px;
}

.p-wpis {
    font-family: 'Roboto', sans-serif;
    font-size: 1.1em;
    line-height: 1.6;
    text-align: justify;
    margin-bottom: 15px;
}

/* Spacing utilities */
.bottom {
    margin-bottom: 30px;
}

.top {
    margin-top: 30px;
}

/* Layout components */
.godlo {
    text-align: center;
    margin: 20px 0;
}

.under-menu {
    padding-top: 20px;
}

/* Content layout */
.content {
    position: relative;
    display: table;
    width: 100%;
    min-height: 100vh;
}

.pull-middle {
    display: table-cell;
    vertical-align: middle;
}

.header {
    padding-top: 50px;
    background-color: #eee;
    overflow: hidden;
}

/* Button styles */
.btn {
    padding-left: 25px;
    padding-right: 25px;
}

.btn-circle {
    border-radius: 20px;
}

/* Input group styles */
.input-group input {
    border: 0;
    box-shadow: none;
    padding-right: 30px;
}

.input-group input:focus,
.input-group input:active {
    outline: 0;
    box-shadow: none;
}

.input-group-btn:last-child>.btn {
    z-index: 2;
    margin-left: -18px;
    border-radius: 20px;
}

/* Phone component style */
.phone {
    position: relative;
    max-width: 263px;
    margin: 0 auto;
    padding: 65px 15px 55px;
    border: 2px solid #ddd;
    border-radius: 20px;
    background-color: #222;
    box-shadow: 20px 20px 40px #887;
}

/* Footer styles - common across sections */
.footer {
    background-color: #384772;
    color: #ffffff;
    padding: 24px 16px;
    margin-top: 50px;
}

.footer h5 {
    color: #ffffff;
    font-weight: 600;
    margin-bottom: 20px;
}

.footer p,
.footer a {
    color: #cccccc;
    text-decoration: none;
    font-size: 0.7em;
}

.footer a:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* Scroll to top button - common */
.scroll-top-wrapper {
    position: fixed;
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
    text-align: center;
    z-index: 99999999;
    background-color: #384772;
    color: #ffffff;
    width: 50px;
    height: 48px;
    line-height: 48px;
    right: 30px;
    bottom: 30px;
    padding-top: 2px;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
    border-bottom-left-radius: 5px;
    -webkit-transition: all 0.3s ease-in-out;
    -moz-transition: all 0.3s ease-in-out;
    -ms-transition: all 0.3s ease-in-out;
    -o-transition: all 0.3s ease-in-out;
    transition: all 0.3s ease-in-out;
}

.scroll-top-wrapper:hover {
    background-color: #2c3954;
}

.scroll-top-wrapper.show {
    visibility: visible;
    cursor: pointer;
    opacity: 1.0;
}

.scroll-top-wrapper i.fa {
    line-height: inherit;
}

/* Gallery and image components */
.gallery-item {
    margin-bottom: 20px;
}

.gallery-item img {
    width: 100%;
    height: auto;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Table styling */
.table-responsive {
    border: none;
}

/* Enhanced table styling with borders */
table {
    border-collapse: collapse;
    width: 100%;
    border: 2px solid #384772;
    margin-bottom: 20px;
}

table th {
    background-color: #384772;
    color: #ffffff;
    font-weight: 600;
    border: 1px solid #2c3954;
    padding: 12px 8px;
    text-align: left;
}

table td {
    vertical-align: middle;
    border: 1px solid #cccccc;
    padding: 10px 8px;
    background-color: #ffffff;
}

table tr:nth-child(even) td {
    background-color: #f8f9fa;
}

table tr:hover td {
    background-color: #e9ecef;
}

/* Legacy Bootstrap table class support */
.table th {
    background-color: #384772;
    color: #ffffff;
    font-weight: 600;
    border: 1px solid #2c3954;
}

.table td {
    vertical-align: middle;
    border: 1px solid #cccccc;
}

/* Media queries for responsive design */
@media (max-width: 768px) {
    .h1-nag {
        font-size: 1.4em;
        padding-top: 15px;
        padding-bottom: 15px;
    }

    .h2-nag-center {
        font-size: 1.2em;
    }

    .sidebar .nav-pills li {
        font-size: 1em;
    }

    .sidebar .nav-pills li a {
        font-size: 1.0em;
        padding: 10px 12px !important;
    }

    .main-raised {
        margin-left: 5px;
        margin-right: 5px;
    }
}

/* ================================================
   Enhanced Typography System
   ================================================ */

/* Responsive base font sizing */
html {
    font-size: 16px;
    /* Base font size for rem calculations */
}

/* Heading styles with responsive scaling */

.h1-nag {
    font-size: 1.1em;
    color: #0b0790;
    line-height: 18.9px;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
    padding-top: 45px;
    padding-bottom: 45px;
}

.h2-nag-left {
    font-size: 1em;
    color: #0b0790;
    line-height: 18.9px;
    font-weight: 600;
    text-align: left;
    text-transform: uppercase;
    padding-top: 25px;
    padding-bottom: 11px;
}

.h2-nag-center {
    font-size: 1.1em;
    color: #0b0790;
    line-height: 18.9px;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    padding-top: 25px;
    padding-bottom: 11px;
}

/* Content text styles */

.p-wpis {
    font-size: 1rem;
    text-align: left;
    line-height: 1.6;
}

.p-wpis-b {
    font-size: 1em;
    text-align: left;
    font-weight: 600;
}

.p-wpis-center {
    font-size: 1em;
    text-align: center;
    padding-top: 10px;
}

.stol-span {
    font-size: 0.8em;
}

.span-b {
    font-weight: 600;
}

.reg-stol {
    color: #0b0790;
    font-weight: 600;
    font-size: 1.1em;
    padding-top: 60px;
}

.p-red {
    font-size: 1.1em;
    color: #950004;
    font-weight: 600;
}

.link-wpis {
    font-size: 1em;
    color: #0b0790;
    font-weight: 600;
    margin-top: 10px;
}

.wpis-data {
    font-size: 1em;
    color: #0b0790;
    font-weight: 600;
    text-align: right;
}

.top_nag {
    margin-top: -80px;
}

/* Mobile responsive typography */
@media (max-width: 575px) {
    html {
        font-size: 14px;
    }

    .h1-nag {
        font-size: 1.4rem;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    .h2-nag,
    .h2-nag-center {
        font-size: 1.2rem;
        padding-top: 1rem;
        padding-bottom: 0.5rem;
    }

    .p-wpis {
        font-size: 1.0rem;
        line-height: 1.5;
    }
}

/* Mobile responsive enhancements */
@media (max-width: 767px) {

    /* Heroes need negative margin to compensate for body padding and sit directly at 80px from viewport top */
    .hero-section,
    .container-fluid.p-0 {
        margin-top: -80px;
        /* No padding-top on hero - the image should start at viewport 80px */
        min-height: 80px;
    }

    /* Ensure hero images are properly sized on mobile */
    .hero-section img,
    .container-fluid.p-0 img {
        width: 100%;
        height: auto;
        display: block;
        margin-top: 80px;
        /* Push image down by 80px so it appears below navbar */
    }
}

/* Tablet responsive typography */
@media (min-width: 576px) and (max-width: 991px) {
    html {
        font-size: 15px;
    }

    .h1-nag {
        font-size: 1.6rem;
    }

    .h2-nag,
    .h2-nag-center {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .scroll-top-wrapper {
        right: 15px;
        bottom: 15px;
    }
}