/* Two-row-layout */
.two-row-links {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    padding-bottom: 40px;
    justify-content: space-between;
    align-items: center;
}
.two-row-links > a {
    flex: 1 1 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
    max-width: 100%;
}
.two-row-links > a > img {
        width: 100%;
        height: auto;
        display: block;
}
@media (min-width: 768px) {
    .two-row-links > a {
        flex: 1 1 calc(50% - 20px);
        max-width: calc(50% - 20px);
    }
}
/* Language switcher dropdown in mobile menu (uses <details>) */
.mobile-langswitcher {
    position: fixed;
    top: 2.9rem;
    right: 4.5rem;
    z-index: 998;
}

.mobile-langswitcher .lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    height: 30px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    list-style: none;
}

.mobile-langswitcher .lang-toggle::-webkit-details-marker { display: none; }
.mobile-langswitcher .lang-toggle:hover { color: var(--main-color); }
.mobile-langswitcher[open] .lang-arrow { transform: rotate(180deg); }
.mobile-langswitcher .lang-arrow { font-size: 0.7rem; transition: transform 0.2s; }

.mobile-langswitcher .lang-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 0.2rem;
    background: white;
    border: 1px solid #ccc;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    width: max-content;
}

.mobile-langswitcher .lang-menu ul.langswitcher {
    margin: 0 !important;
    padding: 0.3rem 0 !important;
    position: static !important;
    transform: none !important;
}

.mobile-langswitcher .lang-menu ul.langswitcher li {
    display: block !important;
    margin: 0 !important;
}

.mobile-langswitcher .lang-menu ul.langswitcher li a {
    display: block;
    padding: 0.4rem 1rem !important;
    font-weight: 600;
    color: #333 !important;
    text-transform: uppercase;
    text-decoration: none !important;
}

.mobile-langswitcher .lang-menu ul.langswitcher li a:hover,
.mobile-langswitcher .lang-menu ul.langswitcher li a.active {
    color: var(--main-color) !important;
}

.mobile-langswitcher .lang-menu ul.langswitcher li a.active {
    background: var(--main-color-20pc);
}

/* Make burger icon black when menu is closed */
.mobile-menu .button_container .top,
.mobile-menu .button_container .middle,
.mobile-menu .button_container .bottom {
    background: #000 !important;
}
.mobile-menu .button_container {
    top: 3.1rem;
}
body.header-fixed.header-animated #header.scrolled ~ .mobile-menu .button_container {
    top: 3.1rem;
}
/* Shift ABZ logo to the right on mobile */
@media (max-width: 840px) {
    #header > div > div > a {
        padding-left: 0.2rem;
    }
}
/* Shift ABZ logo to the right on desktop */
@media (min-width: 841px) {
    #header > div > div > a {
        padding-left: 0.5rem;
    }
}
/* Site-wide CSS variables for brand colors */
:root {
    --main-color: #215caf;            /* ETH color */
    --main-color-dark: color-mix(in srgb, var(--main-color), black 20%);
    --main-color-20pc: color-mix(in srgb, var(--main-color) 20%, white);
    --main-color-contrast: #ffffff;   /* Text on ETH color background*/
}

/* Shift headings down (h1 -> h3, h2 -> h4, ...) */
#body-wrapper h1 { font-size: 1.4rem; }
#body-wrapper h2 { font-size: 1.2rem; }
#body-wrapper h3 { font-size: 1rem; }
#body-wrapper h4 { font-size: .8rem; }
#body-wrapper h5 { font-size: .8rem; }
#body-wrapper h6 { font-size: .8rem; }

/* STIU page styles */
.stiu-h1-title {
    margin-bottom: 0.2em;
}

.stiu-h2-theme {
    margin-top: 0;
    margin-bottom: 1.70em;
}

.stiu-h1-title-no-theme {
    margin-bottom: 1.70em;
}

.image-caption {
    color: var(--main-color20pc);
}

.home-banner {
    padding-top: 30px;
}

/* Prevent overflow in Unterrichtsmaterial listing (mobile) */
@media (max-width: 420px) {
    .unterrichtsmaterialien-item {
        flex-wrap: wrap !important;
    }

    .unterrichtsmaterialien-item-text {
        flex: 1 1 100%;
        min-width: 0;
    }

    .unterrichtsmaterialien-item-text a {
        overflow-wrap: anywhere;
    }

    .unterrichtsmaterialien-item-thumb {
        margin: 10px 0 0 !important;
    }
}

/* ETH logo margin for desktop */
@media (min-width: 1024px) {
    .eth-logo {
        margin-left: -12px !important;
    }
}

/* Navbar height override */
.navbar{
    height: 2.5rem;
}

/* ABZ logo size inside navbar */
#header .logo img {
    height: 1.1rem !important;
    width: auto;
}

#materials {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1em;
    margin-bottom: 2em;
    align-items: flex-start;
}

.stiu-archive {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
    gap: 1em;
}

.stiu-archive > p {
    display: none;
}

.stiu-archive > figure,
.stiu-archive > a {
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

/* Produkte filter panel */
#filterPanel input[type="checkbox"] {
    accent-color: var(--main-color);
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    min-height: 16px !important;
    cursor: pointer;
    flex-shrink: 0;
    margin: 0;
}

#filterPanel input[type="checkbox"]:checked {
    background-color: var(--main-color);
    border-color: var(--main-color);
}

#filterPanel label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

/* Produkte filter toggle switch */
.filter-toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.filter-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.filter-toggle-bg {
    position: absolute;
    inset: 0;
    cursor: pointer;
    background-color: #ccc;
    transition: .4s;
    border-radius: 20px;
}

.filter-toggle input:checked + .filter-toggle-bg {
    background-color: var(--main-color);
}

.filter-toggle-circle {
    position: absolute;
    height: 16px;
    width: 16px;
    left: 2px;
    top: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.filter-toggle input:checked + .filter-toggle-bg .filter-toggle-circle {
    transform: translateX(20px);
}

figure.figure-stiu {
    margin: 0;
}

figure.figure-stiu img {
    width: 100%;
}

@media (max-width: 850px) {
    #materials {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
}

.material-card {
    padding: 10px;
    border: 1px solid inherit;
    border-radius: 5px;
    box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.2);
    width: 30%;
    transition: transform 0.3s;
}

.material-card-title {
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.2;
    color: #3a414e;
    margin: 0;
}

.material-card:hover {
    cursor: pointer;
}

@media only screen {
  .material-card:hover {
      transform: scale(1.05);
/*       transform: rotate(0.02turn); */
  }
}

@media (max-width: 850px) {
    .material-card {
        width: 400px;
        max-width: 100%;
    }
}

.program-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dots {
    border-bottom: 3px dotted var(--main-color-dark);
    flex-grow: 1;
    line-height: 0;
}

a:has(figcaption) {
    font-weight: bold;
    color: inherit;
}

a:hover:has(figcaption) {
    color: var(--main-color);
    text-decoration: none;
}

a[rel="tab"] {
    color: var(--main-color);
}


a:visited {
    color: var(--main-color);
}

a:hover {
    text-decoration: none;
    color: var(--main-color);
}

.dropmenu ul li a:hover,
.dropmenu ul li a:focus {
    background-color: var(--main-color) !important;
    color: var(--main-color-contrast) !important;
}

.dropmenu ul li a.active {
    color: var(--main-color) !important;
}

/* Active menu element hover property*/
.dropmenu ul li a.active:hover,
.dropmenu ul li a.active:focus {
    color: var(--main-color-20pc) !important;
}

.btn {
    border-color: inherit;
    color: inherit;
}

a img {
    transition: transform 0.3s;
}

a:hover img {
    transform: scale(1.05);
}

.hover-transition {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -51%);
    color: white;
    width: 300px;
    height: 200px;
    background-color: color-mix(in srgb, var(--main-color) 90%, transparent);
    text-align: center;
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.3s ease; 
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 24px;
}

.hover-transition:hover {
    opacity: 1;
    transform: translate(-50%, -51%) scale(1.05); 
}

.selection {
    display: flex;
    flex-direction: row;
    gap: 24px;
    font-size: 24px;
    justify-content: center;
    margin: 24px;
}

@media (max-width: 850px) {
    .selection{
        flex-direction: column;
    }
}

.selection > a {
    color: #50596c;
}

.selection > a:hover,
.selection > a:focus,
.selection > a.active {
    color: var(--main-color);
    text-decoration: none;
}

/* Primary button override using brand vars (match Spectre specificity) */
.btn.btn-primary,
.btn.btn-primary:focus,
.btn.btn-primary:active,
.btn-primary.button,
.btn-primary.button:focus,
.btn-primary.button:active {
    background-color: var(--main-color) !important;
    border-color: var(--main-color) !important;
    color: var(--main-color-contrast) !important;
}

.btn.btn-primary:hover,
.btn-primary.button:hover {
    background-color: var(--main-color-dark) !important;
    border-color: var(--main-color-dark) !important;
    color: var(--main-color-contrast) !important;
}

/* Button rows */
.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.btn-row .btn,
.btn-row .button {
    background-color: var(--main-color) !important;
    border-color: var(--main-color) !important;
    color: var(--main-color-contrast) !important;
}

.btn-row .btn:hover,
.btn-row .btn:focus,
.btn-row .btn:active,
.btn-row .button:hover,
.btn-row .button:focus,
.btn-row .button:active {
    background-color: var(--main-color-dark) !important;
    border-color: var(--main-color-dark) !important;
    color: var(--main-color-contrast) !important;
}

@media (max-width: 768px) {
    .btn-row {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-row .btn,
    .btn-row .button {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
        text-align: center;
    }
}

/* Non-clickable menu items styling - match the existing link styles */
.dropmenu ul li span.non-clickable {
    display: block;
    padding: 7px 30px 7px 20px;
    text-decoration: none;
    color: inherit;
    cursor: default;
}

/* Add the dropdown arrow for parent items */
.dropmenu ul li span.non-clickable:after {
    content: '\f107';
    font-family: 'FontAwesome';
    display: inline-block;
    vertical-align: middle;
    float: right;
    margin-right: -20px;
}

/* Match the active state styling */
.dropmenu ul li span.non-clickable.active {
    color: var(--main-color) !important;
}

/* WebTigerPython image: smaller and on the right on desktop, centered on mobile */

@media (min-width: 768px) {
    .two-row-image {
        float: right;
        margin-left: 1.5rem;
        margin-bottom: 1rem;
        max-width: 50%;
    }
}

@media (max-width: 767px) {
    .two-row-image {
        display: block;
        margin: 1rem auto;
        max-width: 70%;
        float: none;
    }
}

/* Mobile responsive styling */
@media (max-width: 840px) {
    .dropmenu ul li span.non-clickable {
        display: block;
        padding: 7px 30px 7px 20px;
    }

    /* Fade out ABZ logo when mobile menu is open */
    body.mobile-nav-open #header .logo img,
    body.mobile-nav-open #header .logo svg {
        opacity: 0;
    }
}

/* Mobile menu overlay styling - white */
.overlay {
    background: #ffffff !important;
}

/* Make burger icon/X black when menu is open */
.mobile-menu .button_container.active .top,
.mobile-menu .button_container.active .middle,
.mobile-menu .button_container.active .bottom {
    background: #000000 !important;
}
.overlay-menu .treemenu ul li {
    background: transparent;
}

.overlay-menu .tree li a,
.overlay-menu .treemenu li a {
    color: #333333 !important;
}

.overlay-menu .tree li span.non-clickable,
.overlay-menu .treemenu li span.non-clickable {
    display: block;
    margin-left: 1.2rem;
    color: #333333 !important;
    cursor: default;
    font-size: 1rem;
}

/* Remove blue color for active/hover states in mobile menu */
.overlay-menu .tree li a:hover,
.overlay-menu .tree li a:focus,
.overlay-menu .tree li a.active,
.overlay-menu .treemenu li a:hover,
.overlay-menu .treemenu li a:focus,
.overlay-menu .treemenu li a.active {
    color: #333333 !important;
    text-decoration: none;
}

/* Style the toggler consistently */
.overlay-menu .toggler,
.overlay-menu .treemenu .toggler {
    color: #333333 !important;
}

/* Override any link colors in the overlay */
.overlay-menu a {
    color: #333333 !important;
}

.overlay-menu span.non-clickable {
    color: #333333 !important;
}

/* Team Grid Styles */
.team-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px 30px;
    margin: 40px auto;
    padding: 20px 0;
    max-width: 900px;
}

.team-member {
    text-align: center;
}

.team-member img {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
    filter: grayscale(100%);
    transition: filter 0.3s ease;
}

.team-member:hover img {
    filter: grayscale(0%);
}

.team-member h4 {
    font-size: 0.95rem;
    margin: 8px 0 3px 0;
    color: #333;
    font-weight: 600;
    line-height: 1.2;
}

.team-member .team-title {
    font-style: normal;
    color: #333;
    margin: 0 0 3px 0;
    font-size: 0.85rem;
    font-weight: normal;
}

.team-member .team-affiliation {
    color: #666;
    margin: 0;
    font-size: 0.85rem;
    font-weight: normal;
}

/* Responsive adjustments for team grid */
@media (max-width: 900px) {
    .team-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 30px 25px;
    }
}

@media (max-width: 650px) {
    .team-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px 20px;
    }
    
    .team-member img {
        width: 140px;
        height: 140px;
    }
}

@media (max-width: 400px) {
    .team-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px 15px;
    }
    
    .team-member img {
        width: 120px;
        height: 120px;
    }
    
    .team-member h4 {
        font-size: 0.85rem;
    }
    
    .team-member .team-title,
    .team-member .team-affiliation {
        font-size: 0.75rem;
    }
}

/* Main color for links*/
a,
a:visited,
a:focus,
a:active {
    color: var(--main-color);
}
a:hover{
    color: var(--main-color-dark);
}

.carousel-img-borders .owl-carousel .owl-item img {
    border: 2px solid #aeaeae;
    width: calc(100% - 16px);
    margin: 8px auto;
}

.carousel-slide {
    text-align: center;
}

.caption {
    padding: 10px 0;
    font-style: italic;
}

.container table:not(.table) {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0 24px;
}

.container table:not(.table) thead th {
    border-bottom: 0.1rem solid #e1e1e1;
    text-align: left;
}

.container table:not(.table) th,
.container table:not(.table) td {
    padding: 0.6rem 0.4rem;
}

.container table:not(.table) tbody th,
.container table:not(.table) tbody td {
    border-top: 0.05rem solid #e1e1e1;
}

.container table:not(.table) tbody tr:nth-child(odd) {
    background-color: rgba(0, 0, 0, 0.03);
}

/* Hide required asterisk in Grav forms globally */
.required {
    display: none !important;
}

#header {
    height: auto !important;
    max-width: 100vw !important;
}

#header .navbar-section {
    height: auto !important;
    max-width: 100vw !important;
}

/* Langswitcher in mobile overlay */
.overlay-menu ul li:has(ul.langswitcher) {
    background-color: var(--main-color-20pc);
}

.overlay-menu ul li:has(ul.langswitcher) > span.non-clickable {
    color: var(--main-color) !important;
}

.overlay-menu ul li:has(ul.langswitcher) ul.langswitcher li a {
    color: var(--main-color) !important;
}

.overlay-menu ul.langswitcher {
    display: flex;
    flex-direction: column;
    margin-left: 1.2rem !important;
    position: static !important;
    transform: none !important;
}

.overlay-menu ul.langswitcher li {
    display: block !important;
    margin-left: 0 !important;
}

/* Langswitcher */
.dropmenu ul li:has(ul.langswitcher) > span.non-clickable {
    background-color: var(--main-color-20pc);
    color: var(--main-color);
}

.dropmenu ul.langswitcher {
    display: flex !important;
    flex-direction: column !important;
    margin-left: 0 !important;
}

.dropmenu ul.langswitcher li {
    display: block !important;
}

.dropmenu ul.langswitcher li a.active {
    color: var(--main-color) !important;
    text-decoration: none !important;
}

.dropmenu ul.langswitcher li a.active:hover,
.dropmenu ul.langswitcher li a.active:focus {
    color: var(--main-color-20pc) !important;
}

/* Form columns layout (used by Grav form plugin's columns/column field types) */
.form-columns {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-column {
    flex: 1;
    min-width: 250px;
}

@media (max-width: 768px) {
    .form-columns {
        flex-direction: column;
    }
}
