/* EIKH Academic Portal Theme */

/* Header */
#patternTopBar,
#patternTopBarContentsWrapper,
#patternTopBarContents {
    height: 80px !important;
    min-height: 80px !important;
    background: #ffffff !important;
    background-image: none !important;
}

#foswikiLogo img {
    height: 56px !important;
    width: auto !important;
    max-width: 480px !important;
    object-fit: contain;
}

/* Typography */
body {
    color: #233247;
}

#patternMainContents {
    line-height: 1.65;
}

/* Sidebar appearance only — preserve PatternSkin positioning */
#patternSideBar {
    background: #f8fafc;
    border-right: 1px solid #e1e7ef;
}

#patternSideBarContents {
    padding: 18px 12px;
}

/* Navigation */
.eikh-nav-heading {
    color: #1d4774;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: .06em;
    margin: 20px 0 8px;
}

.eikh-nav-link {
    padding: 7px 10px;
    border-radius: 5px;
}

.eikh-nav-link:hover {
    background: #e9f1fa;
}

.eikh-nav-link a {
    color: #24476b;
    text-decoration: none;
}




/* EIKH sidebar box-model correction */
#patternSideBar {
    box-sizing: border-box !important;
}

#patternSideBarContents {
    box-sizing: border-box;
    padding: 18px 12px !important;
}

/* EIKH Horizontal Navigation */
.eikh-topnav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    padding: 0 20px;
    min-height: 44px;
    background: #173f70;
}

.eikh-topnav a {
    display: inline-block;
    padding: 12px 16px;
    color: #ffffff !important;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    border-radius: 4px;
}

.eikh-topnav a:hover {
    background: #285b91;
    color: #ffffff !important;
}

@media (max-width: 870px) {
    .eikh-topnav {
        padding: 4px 8px;
        gap: 0;
    }

    .eikh-topnav a {
        padding: 9px 11px;
        font-size: 12px;
    }
}

/* ===== EIKH HEADER POLISH ===== */

/* Logo alignment */
#patternTopBarContents {
    padding-top: 8px !important;
}

#foswikiLogo img {
    height: 62px !important;
    max-width: 500px !important;
}

/* Search and Jump fields */
#patternTopBar .foswikiInputField {
    border: 1px solid #d5deea;
    border-radius: 6px;
    background: #f8fafc;
    padding: 7px 10px;
    font-size: 13px;
}

#patternTopBar .foswikiInputField:focus {
    border-color: #2b6cb0;
    outline: 2px solid rgba(43,108,176,.12);
}

/* Navigation refinements */
.eikh-topnav {
    background: #173f70;
    border-bottom: 3px solid #2f9e59;
}

.eikh-topnav a {
    transition: background-color .2s ease;
}

.eikh-topnav a:hover,
.eikh-topnav a:focus-visible {
    background: #285b91;
    color: #ffffff !important;
}

/* Smaller screens */
@media (max-width: 870px) {
    #foswikiLogo img {
        height: 44px !important;
        max-width: 220px !important;
    }

    #patternTopBar .foswikiInputField {
        max-width: 110px;
        box-sizing: border-box;
    }
}

/* EIKH personalized header */
.eikh-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 64px;
    padding: 0 24px;
}

.eikh-header-brand img {
    height: 58px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.eikh-header-actions {
    display: flex;
    align-items: center;
    gap: 22px;
}

.eikh-header-search {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.eikh-header-search input {
    width: 220px;
    padding: 8px 12px;
    border: 1px solid #d5deea;
    border-radius: 6px;
}

.eikh-header-search button {
    padding: 8px 12px;
    border: 0;
    border-radius: 6px;
    background: #173f70;
    color: white;
    cursor: pointer;
}

.eikh-user-account {
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
    font-size: 13px;
}

.eikh-user-name {
    color: #173f70;
    font-weight: 700;
}

.eikh-user-account a {
    color: #24639a;
    text-decoration: none;
}

.eikh-user-account a:hover {
    text-decoration: underline;
}

@media (max-width: 870px) {
    .eikh-header-inner {
        padding: 6px 12px;
        gap: 10px;
    }

    .eikh-header-actions {
        gap: 10px;
    }

    .eikh-header-search input {
        width: 120px;
    }

    .eikh-header-search button {
        display: none;
    }

    .eikh-user-account {
        gap: 6px;
        flex-wrap: wrap;
    }
}

/* EIKH header alignment correction */
#patternTopBarContentsWrapper,
#patternTopBarContents {
    width: 100%;
    box-sizing: border-box;
}

#patternTopBarContents .eikh-header-inner {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 24px;
    box-sizing: border-box;
}

.eikh-header-brand {
    flex: 0 0 auto;
    margin: 0;
    text-align: left;
}

.eikh-header-brand img {
    display: block;
    height: 58px;
    width: auto;
}

.eikh-header-actions {
    margin-left: auto;
}


/* EIKH Sidebar Navigation */
.eikh-sidebar-nav {
    padding: 4px 0 16px;
}

.eikh-sidebar-nav .eikh-nav-heading {
    margin: 22px 10px 8px;
    padding-bottom: 7px;
    border-bottom: 1px solid #dce5ef;
    color: #173f70;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .07em;
}

.eikh-sidebar-nav .eikh-nav-link {
    margin: 2px 0;
    padding: 0;
}

.eikh-sidebar-nav .eikh-nav-link a {
    display: block;
    padding: 9px 12px;
    border-radius: 6px;
    color: #34465d;
    font-size: 13px;
    text-decoration: none;
}

.eikh-sidebar-nav .eikh-nav-link a:hover {
    background: #e7f0f9;
    color: #173f70;
}

/* EIKH simplified top navigation */
.eikh-topnav-simple {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
}

.eikh-topnav-left,
.eikh-topnav-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.eikh-topnav-right {
    margin-left: auto;
}

.eikh-topnav-right a {
    padding: 9px 14px;
    color: #ffffff !important;
    font-weight: 600;
}

@media (max-width: 600px) {
    .eikh-topnav-simple {
        flex-wrap: wrap;
        gap: 4px;
    }
}

/* ===== EIKH PAGE ACTIONS ===== */

.eikh-page-actions {
    position: relative;
}

.eikh-page-actions summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 6px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.eikh-page-actions summary::-webkit-details-marker {
    display: none;
}

.eikh-page-actions summary::after {
    content: "▾";
    font-size: 12px;
}

.eikh-page-actions summary:hover {
    background: #285b91;
}

.eikh-actions-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 1000;
    width: 220px;
    padding: 8px;
    background: #ffffff;
    border: 1px solid #dce5ef;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.14);
}

.eikh-actions-menu a {
    display: block;
    padding: 10px 12px;
    border-radius: 5px;
    color: #243b53 !important;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none !important;
}

.eikh-actions-menu a:hover {
    background: #eaf2fb;
    color: #173f70 !important;
}

/* Allow the dropdown to extend below the navigation bar */
.eikh-topnav,
.eikh-topnav-simple {
    overflow: visible;
}

/* EIKH consistent sidebar Home link */
#patternSideBar .patternWebIndicator {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 0 12px !important;
}

#patternSideBar .patternWebIndicator a {
    display: block;
    padding: 10px 12px;
    border-radius: 5px;
    background: transparent !important;
    color: #333333 !important;
    font-size: 13px;
    font-weight: 400;
    text-decoration: none !important;
}

#patternSideBar .patternWebIndicator a:hover {
    background: #e9f1fa !important;
    color: #173f70 !important;
}

/* ===== EIKH CURRENT PAGE INDICATOR ===== */

#patternSideBar .eikh-current-page {
    display: flex !important;
    flex-direction: column;
    gap: 5px;
    padding: 15px 14px !important;
    margin: 0 0 24px !important;
    background: #173f70 !important;
    border: none !important;
    border-left: 4px solid #39a66b !important;
    border-radius: 7px;
    box-shadow: 0 4px 12px rgba(23,63,112,.15);
}

#patternSideBar .eikh-current-label {
    color: #c9dbed;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .09em;
}

#patternSideBar .eikh-current-page a {
    display: block;
    padding: 0 !important;
    background: transparent !important;
    color: #ffffff !important;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    overflow-wrap: anywhere;
    text-decoration: none !important;
}

#patternSideBar .eikh-current-page a:hover {
    color: #a8e5c4 !important;
    background: transparent !important;
}

/* EIKH compact page name indicator */
#patternSideBar .eikh-current-page {
    height: auto !important;
    min-height: 0 !important;
    padding: 10px 12px !important;
    margin-bottom: 18px !important;
    gap: 0 !important;
    justify-content: center !important;
}

#patternSideBar .eikh-current-page a {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 15px !important;
    line-height: 1.3 !important;
}

/* ===== EIKH COMPACT CENTERED PAGE INDICATOR ===== */

#patternSideBar .patternWebIndicator.eikh-current-page {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;

    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;

    padding: 8px 10px !important;
    margin: 0 0 16px !important;
    box-sizing: border-box !important;
}

#patternSideBar .patternWebIndicator.eikh-current-page a {
    display: block !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;

    padding: 0 !important;
    margin: 0 !important;

    font-size: 15px !important;
    line-height: 1.3 !important;
    text-align: center !important;
    color: #ffffff !important;
    background: transparent !important;
}

/* Remove extra paragraph spacing if generated by Foswiki */
#patternSideBar .eikh-current-page p {
    margin: 0 !important;
    padding: 0 !important;
}

/* ===== EIKH GLOBAL FOOTER ===== */

#patternBottomBar,
#patternBottomBarContents,
#patternWebBottomBar {
    background: #173f70 !important;
    color: #c9dbed !important;
}

#patternBottomBar {
    border-top: 4px solid #39a66b !important;
}

#patternBottomBarContents {
    padding: 0 !important;
}

.eikh-footer {
    padding: 22px 28px 14px;
    font-size: 13px;
}

.eikh-footer-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    padding-bottom: 18px;
}

.eikh-footer-brand {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.eikh-footer-brand strong {
    color: #ffffff;
    font-size: 16px;
}

.eikh-footer-brand span {
    color: #c9dbed;
}

.eikh-footer-links {
    display: flex;
    align-items: center;
    gap: 22px;
    flex-wrap: wrap;
}

.eikh-footer a {
    color: #ffffff !important;
    text-decoration: none !important;
}

.eikh-footer a:hover {
    color: #a8e5c4 !important;
    text-decoration: underline !important;
}

.eikh-footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    border-top: 1px solid #426489;
    padding-top: 12px;
    color: #c9dbed;
    font-size: 12px;
}

@media (max-width: 600px) {
    .eikh-footer {
        padding: 18px 16px;
    }

    .eikh-footer-main,
    .eikh-footer-bottom {
        flex-direction: column;
        align-items: flex-start;
    }

    .eikh-footer-links {
        gap: 14px;
    }
}

/* ===== EIKH COMPACT FOOTER ===== */

#patternBottomBar {
    border-top: 3px solid #39a66b !important;
}

#patternBottomBarContents,
#patternWebBottomBar {
    padding: 0 !important;
}

.eikh-footer.eikh-footer-compact {
    display: grid !important;
    grid-template-columns: 1fr 2fr 1fr;
    align-items: center;
    gap: 15px;
    padding: 10px 22px !important;
    min-height: 0 !important;
    box-sizing: border-box;
}

.eikh-footer-powered {
    text-align: left;
}

.eikh-footer-copyright {
    text-align: center;
}

.eikh-footer-icon {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.eikh-footer-icon img {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

@media (max-width: 700px) {
    .eikh-footer.eikh-footer-compact {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 8px;
    }

    .eikh-footer-powered,
    .eikh-footer-copyright {
        text-align: center;
    }

    .eikh-footer-icon {
        justify-content: center;
    }
}

/* Highlight the selected Contact navigation item */
.eikh-nav-contact:has(strong) {
    background: #193f6d;
    border-radius: 5px;
    padding: 8px 12px;
}
.eikh-nav-contact strong {
    color: #ffffff;
}

/* =========================================
   EIKH Unified Sidebar
   ========================================= */

#patternSideBarContents .eikh-sidebar-nav {
    padding: 4px 0;
}

/* Section headings */
#patternSideBarContents .eikh-nav-heading {
    font-size: 13px;
    font-weight: 700;
    color: #193f6d;
    letter-spacing: 0.5px;
    margin: 24px 0 10px;
    padding: 0 8px 9px;
    border-bottom: 1px solid #d8e2ed;
}

/* Navigation items */
#patternSideBarContents .eikh-nav-link {
    display: block;
    box-sizing: border-box;
    margin: 3px 0;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    font-size: 15px;
    line-height: 1.5;
}

/* Links */
#patternSideBarContents .eikh-nav-link a {
    display: block;
    padding: 9px 12px;
    color: #26394c;
    text-decoration: none;
    border: 0;
    border-radius: 6px;
    font-size: 15px;
}

/* Hover */
#patternSideBarContents .eikh-nav-link a:hover {
    background: #edf3fa;
    color: #193f6d;
    text-decoration: none;
}

/* Selected Contact page */
#patternSideBarContents .eikh-nav-contact:has(strong) {
    background: #e2edfa;
    border-left: 3px solid #193f6d;
    border-radius: 6px;
    padding: 0;
}

#patternSideBarContents .eikh-nav-contact strong {
    display: block;
    padding: 9px 12px;
    color: #193f6d;
    font-size: 15px;
    font-weight: 700;
}

/* Remove inconsistent borders from navigation links */
#patternSideBarContents .eikh-nav-link,
#patternSideBarContents .eikh-nav-link a {
    border-bottom: none !important;
    box-shadow: none;
}


/* EIKH automatic active sidebar navigation */
.eikh-sidebar-nav .eikh-nav-link.eikh-active {
    background: #e2edfa;
    border-left: 3px solid #193f6d;
    border-radius: 4px;
    padding-left: 9px;
}

.eikh-sidebar-nav .eikh-nav-link.eikh-active a {
    color: #193f6d;
    font-weight: 700;
    text-decoration: none;
}

.eikh-sidebar-nav .eikh-nav-link.eikh-active:hover {
    background: #d5e5f8;
}


/* Shared EIKH page banner */
.eikh-page-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 24px;
    margin-bottom: 22px;
    background: #193f6d;
    border-radius: 8px;
    overflow: visible;
}

.eikh-page-banner-title h1 {
    margin: 0;
    padding: 0;
    color: #ffffff !important;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.3;
}

.eikh-page-banner .eikh-page-actions {
    flex-shrink: 0;
    z-index: 20;
}

.eikh-page-banner .eikh-actions-menu {
    z-index: 1000;
}

@media (max-width: 600px) {
    .eikh-page-banner {
        padding: 12px 16px;
        gap: 10px;
    }

    .eikh-page-banner-title h1 {
        font-size: 19px;
    }
}

/* EIKH homepage dashboard */
.eikh-dashboard {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    align-items: start;
}

.eikh-dashboard-card {
    border: 1px solid #dbe3ed;
    border-radius: 8px;
    background: #ffffff;
    overflow: hidden;
    min-width: 0;
}

.eikh-dashboard-card h2 {
    margin: 0;
    padding: 13px 18px;
    background: #edf3fa;
    color: #193f6d;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 1px solid #dbe3ed;
}

.eikh-dashboard-body {
    padding: 16px 18px;
    line-height: 1.7;
}

.eikh-dashboard-body ul {
    margin: 8px 0;
    padding-left: 22px;
}

.eikh-dashboard-body li {
    margin-bottom: 6px;
}

@media (max-width: 800px) {
    .eikh-dashboard {
        grid-template-columns: 1fr;
    }
}

/* EIKH dashboard grid alignment correction */
#patternMainContents .foswikiTopic .eikh-dashboard {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 20px !important;
    width: 100% !important;
    clear: both;
    align-items: start;
}

#patternMainContents .foswikiTopic .eikh-dashboard-card {
    display: block !important;
    float: none !important;
    width: auto !important;
    min-width: 0;
    margin: 0 !important;
    box-sizing: border-box;
}

@media (max-width: 800px) {
    #patternMainContents .foswikiTopic .eikh-dashboard {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}

/* Optional dashboard images */
.eikh-dashboard-image {
    display: block;
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 14px;
}

/* Prevent Foswiki-generated empty paragraphs from occupying grid cells */
.eikh-dashboard > p:empty {
    display: none !important;
}

/* EIKH three-column dashboard */
#patternMainContents .foswikiTopic .eikh-dashboard {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

/* Ignore empty paragraphs generated by Foswiki */
#patternMainContents .foswikiTopic .eikh-dashboard > p:empty {
    display: none !important;
}

/* Responsive dashboard */
@media (max-width: 1100px) {
    #patternMainContents .foswikiTopic .eikh-dashboard {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 700px) {
    #patternMainContents .foswikiTopic .eikh-dashboard {
        grid-template-columns: 1fr !important;
    }
}

/* Collapsible sidebar Web Utilities */
.eikh-sidebar-collapse {
    margin-top: 12px;
}

.eikh-sidebar-collapse > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.eikh-sidebar-collapse > summary::-webkit-details-marker {
    display: none;
}

.eikh-sidebar-collapse > summary::after {
    content: "▾";
    font-size: 16px;
    color: #193f6d;
    transition: transform 0.2s ease;
}

.eikh-sidebar-collapse:not([open]) > summary::after {
    transform: rotate(-90deg);
}

.eikh-sidebar-collapse > summary:hover {
    color: #193f6d;
}


/* =========================================
   EIKH Responsive Masonry Dashboard
   ========================================= */

/* Desktop: three independent columns */
#patternMainContents .foswikiTopic .eikh-dashboard {
    display: block !important;
    columns: 3 250px;
    column-gap: 20px;
    width: 100% !important;
}

/* Each card maintains its natural height */
#patternMainContents .foswikiTopic .eikh-dashboard-card {
    display: inline-block !important;
    width: 100% !important;
    height: auto !important;
    margin: 0 0 20px !important;
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    box-sizing: border-box;
    vertical-align: top;
}

/* Ignore paragraphs inserted by Foswiki */
#patternMainContents .foswikiTopic .eikh-dashboard > p:empty {
    display: none !important;
}

/* Tablets: two columns */
@media (min-width: 701px) and (max-width: 1100px) {
    #patternMainContents .foswikiTopic .eikh-dashboard {
        columns: 2 !important;
    }
}

/* Mobile: one column */
@media (max-width: 700px) {
    #patternMainContents .foswikiTopic .eikh-dashboard {
        columns: 1 !important;
    }
}

/* Display only the five newest Recent Activity entries */
.eikh-recent-five li:nth-child(n+6) {
    display: none;
}
