/* =========================================
   Department Info Page Template
   ========================================= */

/* --- Header: let it flow in normal document order on this template,
   so the hero title sits below it. Sticky state (position:fixed via
   .tp-header-sticky on #header-sticky) is added by JS on scroll and
   keeps working unchanged. --- */
body.tpte-dept-info .header-area.tp-header-transparent {
    position: relative;
    top: 0;
}

/* --- Hero (title + quick links) --- */
.tp-dept-hero {
    background: #eddff2;
}

.tp-dept-hero .tp-breadcrumb__list span,
.tp-dept-hero .tp-breadcrumb__list span a {
    color: #031f42;
}

.tp-dept-hero-title {
    color: #031f42;
}

.tp-dept-hero-quick {
    margin-top: 32px;
}

.tp-dept-hero-quick-title {
    font-size: 20px;
    font-weight: 700;
    color: #031f42;
    margin-bottom: 20px;
}

.tp-dept-hero-quick-list {
    gap: 12px;
}

.tp-dept-quick-link-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 24px;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
    min-width: 100px;
}

.tp-dept-quick-link-item:hover {
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.tp-dept-quick-link-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.tp-dept-quick-link-item:hover .tp-dept-quick-link-icon {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.tp-dept-quick-link-icon img {
    max-width: 36px;
    max-height: 36px;
    object-fit: contain;
}

.tp-dept-quick-link-icon i {
    font-size: 24px;
    color: #031f42;
}

.tp-dept-quick-link-title {
    font-size: 14px;
    font-weight: 600;
    color: #031f42;
    transition: color 0.3s ease;
}

.tp-dept-quick-link-item:hover .tp-dept-quick-link-title {
    color: #2d4cff;
}

/* --- Content Sections --- */
.tp-dept-info-area {
    background: #F6F4EE;
}

.tp-dept-info-section {
    border-bottom: 1px solid #e8e9ed;
    padding-bottom: 40px;
}

.tp-dept-info-section:last-child {
    border-bottom: none;
}

.tp-dept-info-heading {
    font-size: 24px;
    font-weight: 700;
    color: #031f42;
    margin-bottom: 20px;
    line-height: 1.4;
}

.tp-dept-info-text p {
    font-size: 16px;
    line-height: 1.75;
    color: #555;
    margin-bottom: 16px;
}

.tp-dept-info-text ul,
.tp-dept-info-text ol {
    margin-bottom: 16px;
    padding-left: 20px;
}

.tp-dept-info-text li {
    font-size: 16px;
    line-height: 1.75;
    color: #555;
    margin-bottom: 8px;
}

.tp-dept-info-text img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 16px 0;
}

.tp-dept-info-text a {
    color: #2d4cff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.tp-dept-info-text a:hover {
    color: #031f42;
}

/* --- Collapsible Text --- */
.tp-dept-info-text--collapsible {
    position: relative;
}

.tp-dept-info-text-inner {
    max-height: 200px;
    overflow: hidden;
    transition: max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Fade overlay when collapsed */
.tp-dept-info-text--collapsible .tp-dept-info-fade {
    position: absolute;
    bottom: 44px;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to bottom, rgba(246,244,238,0) 0%, rgba(246,244,238,1) 100%);
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.tp-dept-info-text--collapsible.is-expanded .tp-dept-info-fade {
    opacity: 0;
}

/* Toggle button */
.tp-dept-info-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: #51aeff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 0;
    margin-top: 4px;
    transition: color 0.3s ease;
}

.tp-dept-info-toggle:hover {
    color: #031f42;
}

.tp-dept-info-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1.5px solid currentColor;
    transition: transform 0.3s ease;
}

/* Toggle text visibility */
.tp-dept-info-toggle .tp-dept-info-toggle-less {
    display: none;
}

.tp-dept-info-toggle[aria-expanded="true"] .tp-dept-info-toggle-more {
    display: none;
}

.tp-dept-info-toggle[aria-expanded="true"] .tp-dept-info-toggle-less {
    display: inline;
}

.tp-dept-info-toggle[aria-expanded="true"] .tp-dept-info-toggle-icon {
    transform: rotate(45deg);
}

/* --- Section Image Layout (text + image row) --- */
.tp-dept-info-row {
    margin-top: 4px;
}

.tp-dept-info-image {
    position: sticky;
    top: 100px;
}

.tp-dept-info-image figure {
    margin: 0;
}

.tp-dept-info-image figure img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.tp-dept-info-image figcaption {
    font-size: 13px;
    color: #888;
    text-align: center;
    margin-top: 8px;
}

/* --- About page: mission cards sticky stack --- */
/* Cards stack on top of each other as the page scrolls. The card currently in
   focus sits at the sticky offset; the next card slides up over it, and the
   covered card scales/fades slightly (driven by JS). Enabled on ≥992px. */
@media (min-width: 992px) {
    .tp-mission-stack {
        display: block;
    }

    .tp-mission-stack-card {
        position: sticky;
        top: 120px;
        transform-origin: top center;
        transition: transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1),
                    box-shadow 0.35s cubic-bezier(0.22, 0.61, 0.36, 1),
                    opacity 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
        will-change: transform;
        box-shadow: 0 6px 24px rgba(3, 31, 66, 0.06);
    }

    /* Stagger the sticky offsets so each stacked card peeks behind the focused
       one, giving the "deck of cards" look. */
    .tp-mission-stack-card:nth-child(1) { top: 120px; z-index: 1; }
    .tp-mission-stack-card:nth-child(2) { top: 136px; z-index: 2; }
    .tp-mission-stack-card:nth-child(3) { top: 152px; z-index: 3; }
    .tp-mission-stack-card:nth-child(4) { top: 168px; z-index: 4; }
    .tp-mission-stack-card:nth-child(5) { top: 184px; z-index: 5; }

    /* Override the legacy `.tp-our-mission-wrapper .tp-our-mission-item:last-child`
       rule in main.css — its (0,3,0) specificity would otherwise reset the last
       card to position:relative with a -120px margin, dropping it below the stack. */
    .tp-our-mission-wrapper .tp-mission-stack .tp-mission-stack-card:last-child {
        position: sticky;
        margin-bottom: 0;
        z-index: 5;
    }

    /* When a card is expanded via the "Περισσότερα" toggle, release it from
       the stack so the long text reads naturally. */
    .tp-mission-stack-card.is-stack-expanded {
        position: relative;
        top: auto !important;
        transform: none !important;
        opacity: 1 !important;
    }
}

/* --- Responsive --- */
@media (max-width: 991px) {
    .tp-dept-info-image {
        margin-top: 24px;
        position: static;
    }
}

@media (max-width: 767px) {
    .tp-dept-quick-link-item {
        padding: 12px 16px;
        min-width: 80px;
    }

    .tp-dept-quick-link-icon {
        width: 48px;
        height: 48px;
    }

    .tp-dept-quick-link-icon img {
        max-width: 28px;
        max-height: 28px;
    }

    .tp-dept-quick-link-title {
        font-size: 12px;
    }

    .tp-dept-info-heading {
        font-size: 20px;
    }

    .tp-dept-info-text p,
    .tp-dept-info-text li {
        font-size: 15px;
    }
}

/* --- University About: history "year" band ----------------------------- */
/* Overrides the global .tp-about-year-background fill (main.css #0a53be).
   This file loads after main.css, so the equal-specificity rule wins. */
.tp-about-year-area {
    background: rgb(62 112 230 / 96%);
}

/* --- University About: center the 4 intro images on mobile ------------- */
@media (max-width: 575.98px) {
    .tp-about-4-thumb-1,
    .tp-about-4-thumb-2,
    .tp-about-4-thumb-3,
    .tp-about-4-thumb-4 {
        text-align: center;
    }

    .tp-about-4-thumb-1 img,
    .tp-about-4-thumb-2 img,
    .tp-about-4-thumb-3 img,
    .tp-about-4-thumb-4 img {
        margin-inline: auto;
    }
}

/* --- University About: keep the header (and its mega-menu) above the -----
   sticky mission cards. The theme gives `.tp-header-transparent` z-index:2,
   which caps the ENTIRE header subtree — including the z-index:99999 mega-menu
   dropdown — at 2 in the root stacking context. The mission-stack cards
   (.tp-mission-stack-card) go up to z-index:5, so they were painting OVER the
   open menu. Lift the whole header above them. */
.page-template-page-university-about-php .header-area.tp-header-transparent {
    z-index: 999;
}

/* --- University About: make the research-lab tabs match the undergrad -----
   programme tab style (assets/css/programme.css) — a clean blue underline on
   the active tab instead of a plain colour change. */
.tp-about-research-tab .tp-about-research-nav .nav-link {
    border-bottom: 3px solid transparent;
    border-radius: 0;
    padding: 12px 4px;
    font-weight: 600;
    color: var(--tp-heading-primary, #161613);
    transition: color 0.2s ease, border-color 0.2s ease;
}

.tp-about-research-tab .tp-about-research-nav .nav-link:hover,
.tp-about-research-tab .tp-about-research-nav .nav-link:focus {
    color: var(--tp-theme-primary, #488ecc);
}

.tp-about-research-tab .tp-about-research-nav .nav-link.active {
    color: var(--tp-theme-secondary, #1a73e8);
    background-color: transparent;
    border-bottom-color: var(--tp-theme-secondary, #1a73e8);
}

.tp-about-research-tab .tp-about-research-nav .nav-link.active::after {
    content: none !important;
}

/* --- University About: stop the research card from overlapping the footer -
   on mobile. Below 768px the white info card (.tp-about-campus-content) becomes
   position:static, but the box keeps min-height:500px with a height:100% thumb,
   so the stacked card overflowed the section into the footer. Let the box wrap
   its content naturally instead. */
@media (max-width: 767px) {
    .tp-about-research-box {
        min-height: 0;
        height: auto;
    }

    .tp-about-research-box .tp-about-campus-thumb,
    .tp-about-research-box .tp-about-campus-thumb img {
        height: auto;
    }
}
