/*
Theme Name: HPC UT-like child theme
Template: twentytwentyfive
Version: 0.9.0
*/

*, :after, :before {
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

.container-fluid, .container-lg, .container-md, .container-sm, .container-xl, .container-xxl, .wrapper {
	max-width: 1280px;
}

header .has-background {
	padding: 0;
}

.header-outer {
/*	background-color: #f4f4f4; */
	background: linear-gradient(to right, #1b365d calc((100vw - 1280px) / 2 + 755px), #204070 calc((100vw - 1280px) / 2 + 960px), #2c5697 calc((100vw - 1280px) / 2 + 1280px));
/*	background-color: #ffffff; */
	position: relative;
	width: 100%;
	z-index: 10;
	padding: 0;
}
.header-container {
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
    position: relative;
	height: 200px;
	background-image: url(res/img/header-element.svg);
	background-repeat: no-repeat;
	background-position: 955px;
	overflow: hidden;
	align-content: center;
}
.header-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    /* We swap dimensions or use 100% to ensure it fills the height */
    width: 200px;  /* Match this to the height of .header-container */
    height: 200px;
	margin-left: -39px;
    
    background-image: url(res/img/header-element.svg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain; /* This ensures it scales to fit the 200px height */
    
    /* Rotate 90 degrees to the left (counter-clockwise) */
    transform: rotate(-90deg);
    
    /* Adjust origin if it shifts out of place */
    transform-origin: center;
    
    z-index: -1;
}
.header-content {
	padding-left: 200px;
}
.header-institute {
	color: #aac864;
	font-size: 19px;
	font-weight: 500;
}
.header-title h1 {
	color: #ffffff;
	font-size: 40px;
	font-weight: 700;
}
.header-menu .wp-block-navigation-item {
    list-style-type: none;
    position: relative;
    padding-left: 25px;
	color: #ffffff;
	font-weight: 700;
	font-size: 20px;
	transition: filter 0.3s ease;
}
.header-menu .wp-block-navigation-item:hover {
    filter: brightness(0.7);
}
.header-menu .wp-block-navigation-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 20px;
    background-image: url('res/img/header-link-mark.svg');
    background-size: contain;
    background-repeat: no-repeat;
}
@media (max-width: 1280px) {
	.header-container::before {
		margin-left: -39px;
	}
}
@media (max-width: 768px) {
	.header-content {
		padding-left: 140px;
	}
}
@media (max-width: 500px) {
	.header-institute {
        font-size: 14px;
    }

    .header-title h1 {
        font-size: 26px; /* Reduced from 40px */
        line-height: 1.2; /* Ensures lines don't crash if it wraps */
    }

    .header-menu .wp-block-navigation-item {
        font-size: 16px; /* Reduced from 20px */
        padding-left: 20px; /* Tighten the space for the icon */
    }
	.header-menu .wp-block-navigation {
		row-gap: 0.5em;
	}
    .header-menu .wp-block-navigation-item::before {
        width: 11px;
        height: 16px;
    }
}
footer ul {
	list-style-type: none;
}
/*.header-content-top {
    border-bottom: 1px solid #ddd;
    padding: 8px 0;
}*/
/*.accessibility-link {
	display: inline-block;
    background-image: url(res/img/icon-accessibility.svg);
    background-position: 50%;
    background-repeat: no-repeat;
    background-size: 24px;
    height: 24px;
    width: 24px;
}*/
/*@media (min-width: 1200px) {
	.header-wrap .logo-wrap {
		height: 113px;
	}
}*/
/*.header-wrap .logo-wrap:before {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='384' height='215' fill='none'%3E%3Cpath fill='%232C5697' d='M0 215V0h354l30 112.99z'/%3E%3C/svg%3E");
    background-position: 50%;
    background-repeat: no-repeat;
    background-size: cover;
    content: "";
    height: 216px;
    left: 0;
    pointer-events: none;
    position: absolute;
    top: 0;
    width: 384px;
    z-index: -1;
}*/

/* Header wrap - flex container */
.header-wrap {
    display: flex;
    align-items: center;
    width: 100%;
    position: relative;
}

/* 1. The Outer Wrap: Sets the "Reserved Space" in the Header */
.header-wrap .logo-wrap {
    display: flex;
    align-items: center;
    width: 384px; /* Matches your SVG/Reserved space */
    min-height: 80px;
    flex-shrink: 0;
    z-index: 1;
	padding-bottom: 16px;
	padding-top: 16px;
}

/* 2. The Logo Container/Link Area */
.header-wrap .header-logo {
    display: block;
    width: 100%;
    height: 100%;
}

/* 3. The Actual Link: This MUST have dimensions to be clickable */
.header-logo a.custom-logo-link {
    display: block;      /* Changed from inline-block to block */
    width: 100%;
    height: 100%;
    min-height: 53px;    /* Minimum height to ensure clickability */
    line-height: 0;
    text-decoration: none;
}

/* 4. The Image (When a logo IS set in WordPress) */
.logo-wrap img.custom-logo {
    display: block;
    max-width: 260px;    /* Your desired display width */
    height: auto;
    object-fit: contain;
}

/* 5. The Fallback (When NO logo is set in WordPress) */
/* WordPress adds the 'custom-logo' class to the body ONLY if a logo is uploaded */
body:not(.custom-logo) .header-logo a.custom-logo-link {
    background-image: url("res/img/arvutiteaduse instituut_est_valge.svg");
    background-repeat: no-repeat;
    background-size: contain;
    background-position: left center;
    width: 260px;
    height: 80px;
}

/* Hide the empty/broken image tag if no logo is set */
body:not(.custom-logo) .header-logo img {
    display: none !important;
}

/* Content area - takes remaining space */
/*.header-content {
    flex: 1;
    min-width: 0; /* Prevents flex overflow */
/*}*/

/* Top bar */
/*.header-content-top {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}*/

.polylang_langswitcher {
	list-style: none;
	display: flex;
	gap: 10px;
	padding: 0;
	margin: 0;
	margin-left: 1.2rem !important;
}
.polylang_langswitcher .current-lang {
	color: black;
}
.polylang_langswitcher a:hover {
	color: black;
	text-decoration: underline;
}

/* Bottom bar */
/*.header-content-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}*/

/* Main menu */
.main-menu-wrap {
    flex: 1;
}

.classic-menu-list {
	list-style: none;
    text-decoration: none;
	display: flex;
	gap: 30px;
    color: #333;
    font-weight: 500;
    transition: color 0.2s;
	padding: 0;
	margin: 0;
}

.classic-menu-list a:hover {
	color: #2C5697;
}

/* Header search container */
/*.header-search {
    flex: 0 0 auto;
}*/

/* internal layout */
/*.header-search .wp-block-search__inside-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid var(--wp--preset--color--contrast);
}*7

/* input */
/*.header-search .wp-block-search__input {
    border: none;
    padding: 0px 12px;
    font-size: 14px;
    width: 180px;
}*/

/* remove focus outline overlap */
/*.header-search .wp-block-search__input:focus {
    outline: none;
}*/

/* button */
/*.header-search .wp-block-search__button {
    border: none;
    background: var(--wp--preset--color--contrast);
    color: #fff;
    padding: 0px 16px;
    cursor: pointer;
}*/

/* hover */
/*.header-search .wp-block-search__button:hover {
    opacity: 0.9;
}*/

/* Hide on mobile unless needed */
@media (max-width: 1199px) {
    .d-xl-inline {
        display: none;
    }
}

/* Utility classes */
.d-none {
    display: none;
}

@media (min-width: 1200px) {
    .d-xl-inline {
        display: inline;
    }
}

/* Responsive adjustments */
/*@media (max-width: 1200px) {
    .header-wrap {
        flex-wrap: wrap;
    }
    
    .header-wrap .logo-wrap {
        width: 100%;
        max-width: 384px;
    }
    
    .header-content {
        padding-left: 20px;
        padding-right: 20px;
    }
}*/

@media (max-width: 768px) {
/*    .header-content {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .header-content-bottom {
        flex-wrap: wrap;
        gap: 15px;
    }
  */  
    .btn-search {
        width: 100%;
        justify-content: center;
    }
}

/* Footer */
.footer {
	background-color: #fff;
	-webkit-box-shadow: 0 -6px 38px rgba(0,0,0,.25);
	box-shadow: 0 -6px 38px rgba(0,0,0,.25);
	color: #2c5697;
	font-size: .875rem;
	line-height: 1.8;
	margin-top: 160px;
	padding: 48px 0;
}

.footer__col-1--empty-cols {
	border-bottom: 0;
	margin-bottom: 0;
	padding-bottom: 0;
}

/* Archive */
.archive-layout {
	display: grid;
	grid-template-columns: 190px minmax(0,1fr) 260px;
	gap: 1rem;
}
/*
 * Article cards
 */

.post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 cards per row */
    grid-template-rows: auto auto 1fr auto;
    gap: 8px 16px;
	padding-left: 0px !important;
	padding-right: 0px !important;
}
  
.post-card {
    display: grid;
    /* This tells the card to span all 4 rows defined in the parent */
    grid-row: span 4;
    /* This is the magic: it syncs internal rows to the parent grid */
    grid-template-rows: subgrid; 

/*    border: 1px solid #ddd;
    padding: 15px;*/
}
  
  /* Category styling - allows wrapping */
.post-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-self: start;
}
.post-categories a {
    font-size: 0.75rem;
    text-decoration: none;
    color: #333;
}
.post-categories span {
	font-size: .75rem;
	color: #4b4b4b;
}
  
  /* Image styling */
.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Prevents distortion */
/*	max-height: 250px;*/
	aspect-ratio: 16/9;
}
.post-image img:hover {
	opacity: 0.8;
}
.post-image-link {
	height: 100%;
	display: inline-block;
}
/*.post-image-link:hover {
	transform: translateY(-5px);
}*/
  
  /* Title styling */
.post-card a:hover {
	color: #1976d2 !important;
}
  .post-title {
    margin: 0;
    font-size: 1.25rem;
    line-height: 1.4;
  }
  
  /* Date styling */
  .post-date {
    font-size: 0.85rem;
    color: #666;
    padding-top: 10px;
    align-self: end;
  }
  
  /* Responsive: 1 column on mobile, 2 on tablets */
  @media (max-width: 992px) {
    .post-grid { grid-template-columns: repeat(2, 1fr); }
  }
  @media (max-width: 600px) {
    .post-grid { grid-template-columns: 1fr; }
  }

.month-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.month-pill {
    padding: 8px 11px;
    border-radius: 1rem;
    background: white;
    border: 1px solid rgba(13, 79, 148, 0.15);
	color: var(--bs-heading-color);
    font-size: 0.78rem;
    font-weight: 700;
}
.month-pill:hover {
	color: #2C5697;
	border-color: #2C5697;
}
.tag-list a.is-active {
	border-color: red;
	color: red;
}
.tag-list a.is-active::after {
    content: " ×";
}