/*
Theme Name: PEFJA 2025
Theme URI: https://pefja.kg.ac.rs
Author: Faculty of Pedagogical Sciences
Author URI: https://pefja.kg.ac.rs
Description: Full Site Editing theme for Faculty of Pedagogical Sciences, Jagodina
Requires at least: 6.4
Tested up to: 6.9
Requires PHP: 7.4
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: pefja
Tags: block-patterns, full-site-editing, education, custom-colors, wide-blocks

This theme, like WordPress, is licensed under the GPL.
*/

/* ==========================================================================
   Smooth Scrolling
   ========================================================================== */

html {
    scroll-behavior: smooth;
}

/* ==========================================================================
   Header & Logo Styles
   ========================================================================== */

/* Header wrapper positioning (ensure relative for absolute children) */
.pefja-header-wrapper {
    position: relative;
    padding-top: 62px; /* Space for fixed header-blue-line */

    /* Adjust for WordPress admin bar */
    .admin-bar & {
        padding-top: 62px;
    }
}

/* Logo placeholder: make it absolute so the white circle can overflow the lower white bar */
.pefja-logo-placeholder {
    position: absolute;
    left: 20px; /* align with header paddings */
    top: 0; /* aligns logo within the blue bar */
    z-index: 100;
    width: 140px;
    height: 140px;
    transition: all 0.25s ease;
}

/* Shrink logo when scrolled past header - stays on blue line */
.pefja-logo-placeholder.logo-scrolled {
    position: fixed;
    top: 5px;
    left: 20px;
    width: 50px;
    height: 50px;

    /* Adjust for WordPress admin bar */
    .admin-bar & {
        top: 37px; /* 5px + 32px admin bar */
    }
}

.pefja-logo-placeholder.logo-scrolled .pefja-site-logo {
    width: 50px !important;
    height: 50px !important;
    margin-bottom: 0;
    box-shadow: none;
}

.pefja-logo-placeholder.logo-scrolled .pefja-site-logo img {
    width: 40px !important;
    height: 40px !important;
}

/* Hide logo when scrolled past header */
.pefja-logo-placeholder.logo-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* white circle logo */
.pefja-site-logo {
    background: white;
    border-radius: 50%;
    width: 120px !important;
    height: 120px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    /* pull the lower half of the circle into the white bar */
    margin-bottom: -40px;
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.95); /* small white ring to blend into the white bar */
    transition: all 0.25s ease;

    > a {
        margin: 0 !important;
    }

    img {
        transition: all 0.25s ease;
    }
}

.header-blue-line {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;

    /* Adjust for WordPress admin bar */
    .admin-bar & {
        top: 32px;
    }

    a {
        color: #FFFFFF;
        text-decoration: none;
        font-size: 16px;
        margin: 0 10px;
    }

    .pefja-language {
        gap: 16px;

        a {
            margin: 0;
        }
    }
}
.header-blue-line  a.wp-block-navigation-item__content:hover {
    color: #97D700;
}

.header-white-line {
    margin-top: 0;
    margin-bottom: 0;
    padding: 15px 0;
}

/* ==========================================================================
   Button Styles
   ========================================================================== */

.wp-block-button__link {
    transition: all 0.3s ease;
}

.wp-block-button__link:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Brighten button backgrounds by 40% on hover using color-mix */
.wp-block-button__link.has-black-background-color:hover {
    background-color: color-mix(in srgb, var(--wp--preset--color--black) 70%, white 30%) !important;
}

.wp-block-button__link.has-cyan-bluish-gray-background-color:hover {
    background-color: color-mix(in srgb, var(--wp--preset--color--cyan-bluish-gray) 70%, white 30%) !important;
}

.wp-block-button__link.has-white-background-color:hover {
    background-color: color-mix(in srgb, var(--wp--preset--color--white) 70%, white 30%) !important;
}

.wp-block-button__link.has-pale-pink-background-color:hover {
    background-color: color-mix(in srgb, var(--wp--preset--color--pale-pink) 70%, white 30%) !important;
}

.wp-block-button__link.has-vivid-red-background-color:hover {
    background-color: color-mix(in srgb, var(--wp--preset--color--vivid-red) 70%, white 30%) !important;
}

.wp-block-button__link.has-luminous-vivid-orange-background-color:hover {
    background-color: color-mix(in srgb, var(--wp--preset--color--luminous-vivid-orange) 70%, white 30%) !important;
}

.wp-block-button__link.has-luminous-vivid-amber-background-color:hover {
    background-color: color-mix(in srgb, var(--wp--preset--color--luminous-vivid-amber) 70%, white 30%) !important;
}

.wp-block-button__link.has-light-green-cyan-background-color:hover {
    background-color: color-mix(in srgb, var(--wp--preset--color--light-green-cyan) 70%, white 30%) !important;
}

.wp-block-button__link.has-vivid-green-cyan-background-color:hover {
    background-color: color-mix(in srgb, var(--wp--preset--color--vivid-green-cyan) 70%, white 30%) !important;
}

.wp-block-button__link.has-pale-cyan-blue-background-color:hover {
    background-color: color-mix(in srgb, var(--wp--preset--color--pale-cyan-blue) 70%, white 30%) !important;
}

.wp-block-button__link.has-vivid-cyan-blue-background-color:hover {
    background-color: color-mix(in srgb, var(--wp--preset--color--vivid-cyan-blue) 70%, white 30%) !important;
}

.wp-block-button__link.has-vivid-purple-background-color:hover {
    background-color: color-mix(in srgb, var(--wp--preset--color--vivid-purple) 70%, white 30%) !important;
}

.wp-block-button__link.has-primary-blue-background-color:hover {
    background-color: color-mix(in srgb, var(--wp--preset--color--primary-blue) 70%, white 30%) !important;
}

.wp-block-button__link.has-accent-green-background-color:hover {
    background-color: color-mix(in srgb, var(--wp--preset--color--accent-green) 70%, white 30%) !important;
}

.wp-block-button__link.has-accent-pink-background-color:hover {
    background-color: color-mix(in srgb, var(--wp--preset--color--accent-pink) 70%, white 30%) !important;
}

.wp-block-button__link.has-accent-yellow-background-color:hover {
    background-color: color-mix(in srgb, var(--wp--preset--color--accent-yellow) 70%, white 30%) !important;
}

.wp-block-button__link.has-light-gray-background-color:hover {
    background-color: color-mix(in srgb, var(--wp--preset--color--light-gray) 70%, white 30%) !important;
}

.wp-block-button__link.has-custom-background-color:hover {
    background-color: color-mix(in srgb, var(--wp--preset--color--custom) 70%, white 30%) !important;
}


/* ==========================================================================
   Link Styles
   ========================================================================== */

a {
    transition: color 0.3s ease;
    text-decoration: none;
}

/* ==========================================================================
   Doctor Archive List
   ========================================================================== */

.pefja-doctor-archive-list {
    list-style: none;
    padding: 0;
    margin: 10px 0 0 0;
}

.pefja-doctor-archive-list li {
    margin-bottom: 8px;
}

.pefja-doctor-archive-list a {
    color: #273461;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s ease;
}

.pefja-doctor-archive-list a:hover {
    color: #97D700;
}

/* ==========================================================================
   News Section & Post Cards
   ========================================================================== */

/* Equalize card heights in the news section grid */
.pefja-news-grid {
    /* Ensure grid items behave uniformly across rows */
    align-items: stretch;
    gap: 45px;
}

/* Make each news card fill available row height */
.pefja-news-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Featured image: keep consistent height using aspect-ratio; cover ensures crop */
.pefja-news-card .wp-block-post-featured-image,
.pefja-news-card .wp-block-post-featured-image a,
.pefja-news-card .wp-block-post-featured-image img {
    display: block;
    width: 100%;
}

/* Apply a unified aspect ratio to images; fallback to fixed height on very small screens */
.pefja-news-card .wp-block-post-featured-image img {
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

/* Ensure the content area grows to push card to equal height */
.pefja-news-card > .wp-block-group:last-child {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}

/* On small screens, allow cards to auto-height naturally */
@media (max-width: 782px) {
    .pefja-news-card {
        height: auto;
    }
}

.pefja-news-header-ticker {
    display: flex;
    align-items: center;
    gap: 16px;
}
.pefja-news-header-ticker .wp-block-heading {
    margin: 0;
}
.pefja-news-header-ticker .pefja-news-ticker {
    flex: 1 1 auto;
    height: 4px;
    margin: 0;
    background-color: #97D700 !important;
}
.pefja-news-header-ticker p {
    margin: 0;
    color: #97D700;
    white-space: nowrap;
}
/* Make link green by default inside the ticker row */
.pefja-news-header-ticker a {
    color: #97D700 !important;
    text-decoration: none;
}
.pefja-news-header-ticker a:hover,
.pefja-news-header-ticker a:focus {
    color: #7fb600 !important; /* slightly darker on hover/focus */
    text-decoration: underline;
}

.pefja-front-section-title {
    display: flex;
    align-items: center;
    gap: 16px;
}
.pefja-front-section-title .wp-block-heading {
    margin: 0;
}
.pefja-front-section-title .pefja-front-section-hr {
    flex: 1 1 auto;
    height: 4px;
    margin: 0;
    background-color: #97D700;
}
.pefja-front-section-title p {
    margin: 0;
    color: #97D700;
    white-space: nowrap;
}
@media (max-width: 782px) {
    .pefja-news-header-ticker {
        gap: 10px;
    }
    .pefja-news-header-ticker .wp-block-heading {
        font-size: 36px !important;
    }
}
.pefja-news-with-overlay {
    position: relative;
}
.pefja-news-with-overlay::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('images/ginko-footer.png');
    background-repeat: no-repeat;
    background-position: top center;
    background-size: cover;
    opacity: 0.05;
    pointer-events: none;
    z-index: 0;
}
.pefja-news-with-overlay > * {
    position: relative;
    z-index: 1;
}


/* ==========================================================================
   Navigation Styles
   ========================================================================== */

.wp-block-navigation__responsive-container-open,
.wp-block-navigation__responsive-container-close {
    color: #1E3764;
}

/* ==========================================================================
   Search Block Styles
   ========================================================================== */

.header-white-line {
    .wp-block-search__inside-wrapper {
        border: 0;
    }

    .wp-block-search__input {
        border-bottom: 1px solid #aaaaaa;
        border-bottom-left-radius: 0 !important;
        border-bottom-right-radius: 0 !important;
        padding: 0 4px;
        font-size: 16px;
    }

    .wp-block-search__button {
        padding: 4px;
        font-size: 16px;
    }
}

/* ==========================================================================
   Layout & Spacing
   ========================================================================== */

.wp-block-group.alignfull {
    margin-left: 0;
    margin-right: 0;
}

/* ==========================================================================
   Quick Links Pattern Styles
   ========================================================================== */
.pefja-quick-links {
    margin-left: 30px !important;
    margin-right: 30px !important;
}
/* Equal height columns in quick-links pattern only */
.pefja-quick-links-columns {
    align-items: stretch;
}

.pefja-quick-links-columns .wp-block-column {
    display: flex;
    flex-direction: column;
}

/* Stretch background to fill column height */
.pefja-quick-links-columns .wp-block-column > .wp-block-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

/* Hover effect - pop up with shadow */
.pefja-quick-links-columns .wp-block-column > .wp-block-group:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Remove underline from links */
.pefja-quick-links-columns a {
    text-decoration: none;
}

/* Target the link inside the paragraph and stretch it to cover the entire box */
.pefja-quick-links-columns .wp-block-column .wp-block-group p a::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

/* Mobile: 2 columns per row */
@media (max-width: 782px) {
    .pefja-quick-links-columns {
        flex-wrap: wrap !important;
        gap: 10px;
    }

    .pefja-quick-links-columns.wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column {
        flex-basis: calc(50% - 10px) !important;
        min-width: calc(50% - 10px) !important;
        max-width: calc(50% - 10px) !important;
        flex-grow: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box !important;
    }
}

/* ==========================================================================
   Study Programs Pattern Styles
   ========================================================================== */

/* Make columns in study programs equal height */
.wp-block-columns:has(.pefja-study-program-blue) .pefja-study-program-blue {
    align-items: stretch;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    border-top: 5px solid #97D700;
    border-bottom: none;
    margin: 0 auto;
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.wp-block-columns:has(.pefja-study-program-blue) > .wp-block-column > .wp-block-group:hover .pefja-study-program-blue {
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
}

.wp-block-columns:has(.pefja-study-program-blue) > .wp-block-column {
    display: flex;
    flex-direction: column;
}

/* Make the outer white group stretch to fill column */
.wp-block-columns:has(.pefja-study-program-blue) > .wp-block-column > .wp-block-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}


/* Override WordPress constrained layout width limits */
.wp-block-columns:has(.pefja-study-program-blue) .pefja-study-program-blue > * {
    max-width: 100%;
}

/* Remove underline from links and stretch clickable area */
.wp-block-columns:has(.pefja-study-program-blue) a {
    text-decoration: none;
}

.wp-block-columns:has(.pefja-study-program-blue) .pefja-study-program-blue p a::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
}

/* Green bottom border shadow on hover */
.wp-block-columns:has(.pefja-study-program-blue) > .wp-block-column {
    position: relative;
}


.wp-block-columns:has(.pefja-study-program-blue) > .wp-block-column:hover::after {
    height: 8px;
}

.wp-block-columns:has(.pefja-study-program-blue) > .wp-block-column > .wp-block-group {
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-bottom 0.3s ease;
    border-bottom: 4px solid transparent;
}

.wp-block-columns:has(.pefja-study-program-blue) > .wp-block-column > .wp-block-group:hover {
    transform: translateY(-8px);
    border-bottom: 8px solid #97D700;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

/* ==========================================================================
   Footer Styles
   ========================================================================== */

.footer-with-overlay {
    position: relative;
}

.footer-with-overlay::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('images/ginko-footer.png');
    background-repeat: no-repeat;
    background-position: top center;
    background-size: cover;
    opacity: 0.05;
    pointer-events: none;
    z-index: 0;
}

.footer-with-overlay > * {
    position: relative;
    z-index: 1;
}

.wp-block-media-text.has-media-on-the-right.footer-logos-left {
    padding-right: 2.25rem;
    border-right: 1px solid #FFFFFF;
    grid-template-columns: auto 20%;
}

.footer-links-white ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links-white a {
    color: #FFFFFF;
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 18px;

    &:hover {
        color: #97D700;
    }
}

.footer-logos-right {
    grid-template-columns: 20% auto;
}

.footer-social-network-title {
    text-align: right;
}

.footer-contact-title {
    text-align: center;
}

.footer-social-icons {
    justify-content: flex-end;
}


/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 1279px) {
    .pefja-header-wrapper,
    .admin-bar .pefja-header-wrapper {
        padding-top: 0; /* Remove fixed header space on mobile */
    }

    .header-blue-line,
    .admin-bar .header-blue-line {
        position: relative;
        top: 0;
    }

    .pefja-logo-placeholder {
        position: static;
        margin: 0 auto 20px;
        width: 110px;
        height: 110px;
    }

    .pefja-site-logo {
        width: 110px !important;
        height: 110px !important;
        margin-bottom: 0;
    }

    .pefja-header-line {
        margin-left: 0;
        text-align: center;
    }

    .pefja-header-wrapper .wp-block-navigation {
        margin-left: 0;
    }

    .wp-block-media-text.has-media-on-the-right.footer-logos-left {
        border-right: none !important;
        padding-right: 0;
        grid-template-columns: 30% auto;
    }

    .wp-block-media-text.has-media-on-the-right.footer-logos-left > figure {
        grid-column: 1;
    }

    .wp-block-media-text.has-media-on-the-right.footer-logos-left > div {
        grid-column: 2;
    }

    .wp-block-media-text.has-media-on-the-right.footer-logos-left > div > p.has-text-align-right {
        grid-column: 2;
        text-align: left;
    }

    .wp-block-media-text.footer-logos-right {
        grid-template-columns: 30% auto;
    }

    .footer-social-network-title {
        text-align: left;
    }

    .footer-contact-title {
        text-align: left;
    }

    .footer-social-icons {
        justify-content: flex-start;
    }

    .header-blue-line {
        /* Mobile: fixed bar height with wrapping content; allow overflow (e.g., logo) */
        position: relative;
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center;
        justify-content: center;
        height: 60px;
        box-sizing: border-box; /* include paddings in fixed height */
        overflow: visible; /* content (images) may overflow the blue bar */
        z-index: 2;
    }

    /* Ensure nested flex groups can wrap onto next row on small screens */
    .header-blue-line .is-layout-flex,
    .header-blue-line .alignwide {
        flex-wrap: wrap !important;
    }

    /* Prevent the logo container from shrinking; allow it to overflow without growing the bar */
    .header-blue-line .pefja-logo-placeholder {
        flex: 0 0 auto;
    }

    /* Do not cap image height inside the blue line on mobile */
    .header-blue-line img,
    .header-blue-line .wp-block-site-logo img,
    .header-blue-line .pefja-site-logo {
        max-height: none;
        overflow: visible;
    }

    .header-white-line {
        padding: 20px 20px 60px 20px;
    }

    /* Mobile injected language block */
    .wp-block-navigation__responsive-container-content .pefja-mobile-language {
        margin: 8px 0 0;
        padding: 0 16px;
    }

    .pefja-mobile-language__list {
        list-style: none;
        display: flex;
        gap: 12px;
        padding: 0;
        margin: 0;
        flex-wrap: wrap;
    }

    .pefja-mobile-language__link {
        display: inline-block;
        padding: 8px 10px;
        border-radius: 4px;
        background: #F3F5F9;
        color: #1E3764;
        text-decoration: none;
        font-weight: 600;
        font-size: 16px;
    }

    /* Mobile injected search under language */
    .pefja-mobile-search {
        display: flex;
        align-items: center;
        gap: 8px;
        width: 100%;
        padding: 0;
    }

    .pefja-mobile-search .wp-block-search__input {
        flex: 1 1 auto;
        height: 42px;
        border: 1px solid #D9DFEA;
        border-radius: 6px;
        padding: 0 12px;
        font-size: 16px;
        color: #1E3764;
        background: #FFFFFF;
    }

    .pefja-mobile-search .wp-block_search__button {
        flex: 0 0 auto;
        height: 42px;
        width: 42px;
        border-radius: 6px;
        background: #32373c;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;

        svg {
            fill: #FFFFFF;
        }
    }

    .pefja-image-gradient-left::before {
        display: none !important;
    }


    .pefja-free-first-year h1.wp-block-heading {
        font-size: 36px !important;
        line-height: 1.2;
    }

    /* Free First Year: stack image first, then text on mobile */
    .pefja-free-first-year .wp-block-columns {
        display: flex;
        flex-direction: column;
    }
    .pefja-free-first-year .wp-block-columns > .wp-block-column:nth-child(1) {
        order: 2;
    }
    .pefja-free-first-year .wp-block-columns > .wp-block-column:nth-child(2) {
        order: 1;
    }

    .pefja-quick-links h1,
    .pefja-quick-links h2 {
        margin-left: 30px;
    }


    /* Move the image column (usually the 2nd column) to appear before content */
    .pefja-page-study-programs-columns .wp-block-columns > .wp-block-column:nth-child(2) {
        order: -1 !important;
    }
    /* Gradient overlay from left side of images in studije section */
    .pefja-studije-section .has-accent-green-background-color .wp-block-image img {
        -webkit-mask-image: linear-gradient(to top, transparent 0%, black 40%);
        mask-image: linear-gradient(to top, transparent 0%, black 40%);
        border-top-right-radius: 10px;
        border-top-left-radius: 10px;
    }

}

/* Desktop-only H1 size for Free First Year */
@media (min-width: 783px) {
    .pefja-free-first-year h1.wp-block-heading {
        font-size: 72px !important;
        line-height: 1.1;
    }
}

/* Hide the mobile snippets source block rendered in header; JS will clone its children */
.pefja-mobile-snippets-source {
    display: none !important;
}

/* Hide WP search block at <= 1024px */
@media (max-width: 1080px) {
    .pefja-header-search {
        display: none !important;
        visibility: hidden !important;
    }
}

/* ==========================================================================
   Free First Year image gradient overlay (left side)
   ========================================================================== */
.pefja-image-gradient-left {
    position: relative;
}
.pefja-image-gradient-left::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #5a656b 0%, rgba(0,0,0,0.0) 45%);
    pointer-events: none;
    z-index: 1;
}
.pefja-image-gradient-left img {
    position: relative;
    z-index: 0;
}

/* ==========================================================================
   International Program image gradient overlay (right side)
   ========================================================================== */
.pefja-image-gradient-right {
    position: relative;
}
.pefja-image-gradient-right::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(270deg, rgba(255,255,255,1) 0%, rgba(255,255,255,0.85) 20%, rgba(255,255,255,0) 45%);
    pointer-events: none;
    z-index: 1;
}
.pefja-image-gradient-right img {
    position: relative;
    z-index: 0;
}
@media (max-width: 782px) {
    .pefja-image-gradient-right::before { display: none !important; }
}

/* ==========================================================================
   Services section link styles
   ========================================================================== */
.pefja-services-links a {
    text-decoration: none;
}
.pefja-services-links a:hover,
.pefja-services-links a:focus {
    text-decoration: underline; /* optional: underline on interaction */
}

/* ==========================================================================
   Footer spacing overrides
   ========================================================================== */
/* Remove any top margin on the footer template part */
.wp-site-blocks > footer {
    margin-top: 0 !important;
}
.wp-block-template-part[area="footer"] {
    margin-top: 0 !important;
}
footer .wp-block-group:first-child {
    margin-top: 0 !important;
}

/* ==========================================================================
   Professor profile layout
   ========================================================================== */
.professor-container {
    margin: 0;
}
.professor-container .professor-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
}
.professor-container .professor-photo img,
.professor-container .professor-photo .fake-photo {
    display: block;
    width: 100%;
    border-radius: 8px;
    background: #F3F5F9;
    text-align: center;
}
.professor-container .display-flex {
    display: flex;
    gap: 12px;
}
.professor-container .item-title {
    width: 280px;
    font-weight: 600;
    color: #1E3764;
}
.professor-container .item-value a { text-decoration: none; }
.professor-container .item-value a:hover { text-decoration: underline; }

.professor-container .professor-career {
    border-collapse: collapse;
}
.professor-container .professor-career thead td {
    font-weight: 700;
    background: #F3F5F9;
}
.professor-container .professor-career td {
    border: 1px solid #E5EAF2;
    padding: 8px 12px;
}

/* Professor section headings */
.professor-container h3 {
    background: #1E3764;
    color: #FFFFFF;
    padding: 8px 12px;
    border-radius: 6px;
    margin-top: 20px;
    font-size: var(--wp--preset--font-size--medium);
}

/* Professor other activities row alignment */
.professor-container .professor-other-activities .display-flex {
    align-items: flex-start;
    margin-top: 10px;
}
.professor-container .professor-other-activities .item-title {
    flex: 0 0 260px; /* fixed width for labels under other activities */
    max-width: 260px;
    width: 260px; /* override general width */
}
.professor-container .professor-other-activities .item-value {
    flex: 1 1 auto;
}

@media (max-width: 782px) {
    .professor-container .professor-other-activities .display-flex {
        flex-direction: column;
        gap: 6px; /* small gap between label and value */
    }
    .professor-container .professor-other-activities .item-title {
        flex: 0 0 auto;
        max-width: 100%;
        width: 100%;
    }
    .professor-container .professor-other-activities .item-value {
        width: 100%;
    }
    .professor-container .professor-grid {
        grid-template-columns: 1fr;
    }
    .professor-container .item-title {
        min-width: 160px;
        width: 160px;
    }
    .pefja-professor-title.wp-block-post-title {
        line-height: 1.2 !important;
    }
}

/* Professor career table horizontal scrolling on mobile */
.professor-container .professor-table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.professor-container .professor-table-scroll table {
    min-width: 600px; /* ensure scroll needed on narrow screens */
}

/* Ensure wrapping for list items and professor value text */
.professor-container ol,
.professor-container ul {
    margin: 0 0 1rem 1.25rem;
}
.professor-container ol li,
.professor-container ul li {
    display: list-item;
    white-space: normal;
    overflow-wrap: anywhere; /* break long words/URLs */
    word-break: break-word;  /* fallback */
}
.professor-container .item-value {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    min-width: 0; /* allow wrapping within flex container */
}
.professor-container .item-value a {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.professor-container .item-value p {
    margin: 0 0 1rem 0;
}

/* Professor archive table */
.professor-archive-block .professor-table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.professor-archive-block table.professor-archive-table {
    border-collapse: collapse;
    width: 100%;
    min-width: 720px; /* ensure scroll on narrow viewports */
}
.professor-archive-block table.professor-archive-table th,
.professor-archive-block table.professor-archive-table td {
    border: 1px solid #E5EAF2;
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
    background: #fff;
}
.professor-archive-block table.professor-archive-table thead th {
    background: #F3F5F9;
    font-weight: 700;
}
.professor-archive-block table.professor-archive-table a {
    color: var(--wp--preset--color--primary-blue);
    text-decoration: none;
}
.professor-archive-block table.professor-archive-table a:hover {
    text-decoration: underline;
}

/* Professor archive page spacing and title size */
.pefja-archive-professor {
    margin: 0 30px;
}
.pefja-archive-title {
    font-size: 42px !important;
    line-height: 1.2 !important;
}

/* Assistant archive sidebar styles */
.pefja-archive-assistant .pefja-sidebar {
    background: #007896;
    padding: 16px 16px;
    border-radius: 8px;
}
.pefja-archive-assistant .pefja-sidebar .wp-block-heading,
.pefja-archive-assistant .pefja-sidebar h3 {
    margin: 0 0 8px;
    font-size: 18px;
    color: #1E3764; /* replaced var(--wp--preset--color--primary-blue) */
}

/* Upis section sidebar navigation */
.pefja-upis-sidebar .wp-block-group {
    background: #007896 !important;
    border-radius: 8px !important;
}

.pefja-upis-sidebar .wp-block-heading {
    margin: 0 0 8px;
    font-size: 18px;
    color: #1E3764;
}

/* Style navigation lists exactly like assistant-archives-item */
.pefja-upis-sidebar .wp-block-navigation ul,
.pefja-upis-sidebar .wp-block-navigation__container,
.pefja-upis-sidebar .wp-block-navigation__submenu-container {
    list-style: none;
    display: block;
    margin: 0;
    padding: 0;
}

.pefja-upis-sidebar .wp-block-navigation li,
.pefja-upis-sidebar .wp-block-navigation-item {
    margin: 0;
    padding: 6px 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);

}

.pefja-upis-sidebar .wp-block-navigation li:last-child,
.pefja-upis-sidebar .wp-block-navigation-item:last-child {
    border-bottom: none;
}

.pefja-upis-sidebar .wp-block-navigation a,
.pefja-upis-sidebar .wp-block-navigation-item a {
    display: block;
    padding-left: 8px;
    text-decoration: none;
    color: #1E3764;
    transition: color 0.3s ease;
    width: 100%;
}

.pefja-upis-sidebar .wp-block-navigation a:hover,
.pefja-upis-sidebar .wp-block-navigation-item a:hover {
    color: #97D700;

}

/* Upis section study program cards - equal height */
.pefja-upis-section .wp-block-columns.alignwide {
    align-items: stretch;
}

.pefja-upis-section .wp-block-columns.alignwide > .wp-block-column:not(.pefja-upis-sidebar) {
    display: flex;
    flex-direction: column;
}

/* Make each study program card fill available height */
.pefja-upis-section .wp-block-columns.alignwide .wp-block-column:not(.pefja-upis-sidebar) > .wp-block-group {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* The inner content group should flex to fill space */
.pefja-upis-section .wp-block-columns.alignwide .wp-block-column:not(.pefja-upis-sidebar) .wp-block-group > .wp-block-group {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}

/* Gradient overlay from bottom of images in upis section */
/* First row (green cards) - green gradient */
.pefja-upis-section .has-accent-green-background-color .wp-block-image img {
    -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
}

.pefja-upis-section .wp-block-image {
    background: linear-gradient(to top, #97D700 0%, transparent 60%);
}

/* Second row (blue cards) - blue gradient */
.pefja-upis-section .has-primary-blue-background-color .wp-block-image img {
    -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
}

.pefja-upis-section .has-primary-blue-background-color .wp-block-image {
    background: linear-gradient(to top, #273461 0%, transparent 60%);
}
@media (min-width: 783px) {

    /* Gradient overlay from left side of images in studije section */
    .pefja-studije-section .has-accent-green-background-color .wp-block-image img {
        -webkit-mask-image: linear-gradient(to right, transparent 0%, black 40%);
        mask-image: linear-gradient(to right, transparent 0%, black 40%);
        border-top-right-radius: 10px;
        border-bottom-right-radius: 10px;
    }

    .pefja-studije-section .has-accent-green-background-color .wp-block-image {
        background: linear-gradient(to right, #97D700 0%, transparent 40%);
        border-top-right-radius: 10px;
        border-bottom-right-radius: 10px;
    }
}

/* List appearance (shared for assistant and doctor archive navigations) */
.assistant-archives-nav,
.doctor-archives-nav { margin: 0; }

.assistant-archives-list,
.doctor-archives-list { list-style: none; margin: 0; padding: 0; }

.assistant-archives-item,
.doctor-archives-item { margin: 0; padding: 6px 0; border-bottom: 1px solid rgba(0,0,0,0.06); }

.assistant-archives-item:last-child,
.doctor-archives-item:last-child { border-bottom: none; }

.assistant-archives-item a,
.doctor-archives-item a { display: block; padding-left: 8px; text-decoration: none; color: #FFFFFF; }

.assistant-archives-item a:hover,
.doctor-archives-item a:hover { color: #97D700; }

/* Generic navigation styling for pefja-main-page (matches doctor/assistant archive navigation) */
.pefja-main-page nav:not(.bottom-nav),
.pefja-menu-right nav{
    background: #007896;
    padding: 16px 16px;
    border-radius: 8px;
    color: #FFFFFF;
}
.pefja-main-page .wp-block-navigation ul,
.pefja-main-page .wp-block-navigation__container,
.pefja-main-page .wp-block-navigation__submenu-container,
.pefja-menu-righte .wp-block-navigation ul,
.pefja-menu-right .wp-block-navigation__container,
.pefja-menu-right .wp-block-navigation__submenu-container {
    list-style: none;
    display: block;
    margin: 0;
    padding: 0;
}

.pefja-main-page .wp-block-navigation li,
.pefja-main-page .wp-block-navigation-item,
.pefja-menu-right .wp-block-navigation li,
.pefja-menu-right .wp-block-navigation-item {
    margin: 0;
    padding: 6px 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.pefja-main-page .wp-block-navigation li:last-child,
.pefja-main-page .wp-block-navigation-item:last-child {
    border-bottom: none;
}

.pefja-main-page .wp-block-navigation a,
.pefja-main-page .wp-block-navigation-item a,
.pefja-menu-right .wp-block-navigation a,
.pefja-menu-right .wp-block-navigation-item a {
    display: block;
    padding-left: 8px;
    text-decoration: none;
    color: #FFFFFF;
    transition: color 0.3s ease;
    width: 100%;
}


.pefja-main-page .wp-block-navigation-item a:hover,
.pefja-main-page nav .current-menu-item,
.pefja-menu-right .wp-block-navigation-item a:hover,
.pefja-menu-right nav .current-menu-item {
    /*background: #fff;*/
    color: #97D700;
}

.pefja-menu-right nav .current-menu-item > a:hover,
.pefja-main-page nav .current-menu-item > a:hover{
    padding-left: 8px !important;
    border-left: none !important;
}



/* ==========================================================================
   Program Page Blue Pills Styles
   ========================================================================== */

/* Blue pill boxes in program page - make them clickable with proper styling */
.pefja-program-pill {
    position: relative;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.pefja-program-pill:hover {
    background-color: #97D700 !important;
    transform: translateY(-2px);
}

/* Links inside blue pills should be white with no underline */
.pefja-program-pill a,
.pefja-program-pill .wp-block-heading {
    color: #FFFFFF !important;
    text-decoration: none !important;
}

/* Stretch link to cover entire pill */
.pefja-program-pill a::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}
.pefja-main-page,
.assistant-archive-container,
.pefja-archive-announcement-student,
.pefja-archive-announcement-program,
.pefja-archive-master-defense,
.pefja-archive-thesis-public-viewing,
.pefja-archive-staff-competition,
.pefja-archive-intro-lecture {
    margin-left: 30px !important;
    margin-right: 30px !important;
}
