/* 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);
    }
}
/* 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: #627313 ;         /* ETH color */
    --main-color-dark: #3a4726;   
    --main-color-20pc: #e0e3d0; /* 20% ETH color used for hover in menu*/
    --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; }

/* 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;
}

@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%; 
}

@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 #485A2D;
    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: currentColor;
}

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;
}

img.figure-left, a img {
    transition: transform 0.3s;
}

img.figure-left:hover, 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: rgba(72, 90, 45, 0.9);
    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;
}

/* .btn-row use ETH color*/
.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;
}

/* 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 .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;
}

#header .navbar-section {
    height: auto !important;
}