/* MICC components. Replaces the CSS previously stored in the Customizer.
 * Layout classes are explicit: templates choose a grid and mark its items.
 * Bootstrap's column gutters remain; flex rows stretch cards to equal height.
 */

/* Content and legacy plugin presentation. */
.micc-presentation { padding-top: 20px; }
.micc-presentation-image { display: block; max-width: 90%; height: auto; margin: 0 auto; }
blockquote {
    position: relative;
    display: block;
    margin: 0 0 20px;
    padding: 15px 20px 15px 45px;
    border-left: 15px solid #dedede;
    border-right: 2px solid #dedede;
    background: #fff;
    box-shadow: 2px 2px 15px #dedede;
    font-family: "Raleway", sans-serif;
    font-size: 14px;
    text-align: justify;
}
blockquote::before {
    content: "IT";
    position: absolute;
    left: 10px;
    top: 5px;
    color: #999;
    font-size: 20px;
    font-weight: bold;
}
blockquote::after { content: ""; }
blockquote a {
    padding: 0 3px;
    color: #c76c0c;
    background: #eee;
    text-decoration: none;
}
blockquote a:hover { color: #666; }
blockquote em { font-style: italic; }
.ebd_link, .ebd_link:hover {
    display: inline-block;
    margin: 0 0 30px;
    padding: 6px 12px;
    border: 1px solid #2e6da4;
    border-radius: 4px;
    color: #fff;
    background: #337ab7;
    font-size: 14px;
    font-weight: normal;
    line-height: 1.42857143;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    touch-action: manipulation;
    user-select: none;
}
.wpcf7-submit { padding: 2px 4px; border-radius: 4px; margin-bottom: 20px; }
.wpcf7-mail-sent-ok { display: none; }
.single-content ol {
    margin-left: 15px;
    font-weight: 300;
    line-height: 1.6;
    letter-spacing: 0.1em;
}
.micc-courses h4 + p { margin-top: 0; }
body.admin-bar #wrapper .navbar-fixed-top { top: 32px; }
@media (max-width: 782px) {
    body.admin-bar #wrapper .navbar-fixed-top { top: 46px; }
}

/* Shared responsive grids: one column, two on tablet, then three or four. */
#wrapper .micc-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    --micc-columns: 1;
}
#wrapper .micc-grid::before,
#wrapper .micc-grid::after { display: none; }
#wrapper .micc-grid > .micc-grid-item {
    display: flex;
    flex-direction: column;
    float: none;
    width: calc(100% / var(--micc-columns));
    min-width: 0;
    margin-bottom: 30px;
}
#wrapper .micc-grid > .micc-grid-item[hidden] { display: none; }
#wrapper .micc-grid > .col-lg-12 { width: 100%; }
#wrapper .micc-grid-item > .micc-card,
#wrapper .micc-grid-item > .thumbnail,
#wrapper .micc-grid-item > .single-item,
#wrapper .micc-grid-item > .related-item {
    display: flex;
    flex: 1;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    margin-bottom: 0;
}
.micc-card-image,
.micc-people-photo {
    display: block;
    flex-shrink: 0;
    width: 100%;
    aspect-ratio: 5 / 3;
    overflow: hidden;
    background: #f4f4f4;
}
.micc-card-image > img,
.micc-people-photo > img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.micc-image-placeholder { display: block; width: 100%; height: 100%; }
#wrapper .micc-grid-item h3 { line-height: 1.35; overflow-wrap: anywhere; }
#wrapper .micc-grid-item p { overflow-wrap: anywhere; }
@media (min-width: 768px) {
    #wrapper .micc-grid { --micc-columns: 2; }
}
@media (min-width: 992px) {
    #wrapper .micc-grid--three { --micc-columns: 3; }
    #wrapper .micc-grid--four { --micc-columns: 4; }
}

/* People: aligned photographs, names, descriptions and contact rows. */
.micc-people-filters { display: flex; flex-wrap: wrap; gap: 4px; }
.micc-people-filters > li { float: none; margin: 0; }
.micc-people-filters button {
    display: block;
    padding: 10px 15px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #517398;
    font: inherit;
}
.micc-people-filters button:hover { background: #eee; }
.micc-people-filters button[aria-pressed="true"] { background: #517398; color: #fff; }
.micc-people-filters button:focus-visible { outline: 2px solid #517398; outline-offset: 2px; }
.micc-people-card .caption { display: flex; flex: 1; flex-direction: column; }
.micc-people-name { min-height: 2.7em; }
.micc-people-role { min-height: 3.2em; margin: 0 0 10px; color: #777; font-size: 85%; }
.micc-people-description { flex: 1; margin-bottom: 18px; }
#wrapper .micc-people-links { min-height: 30px; margin-top: auto; margin-bottom: 0; }
#wrapper .micc-people-links .fa { float: none; margin: 0; color: inherit; font-size: 1.5em; }

/* Related projects and the archive/resources grids. */
#wrapper .micc-related-grid .related-item { position: relative; min-height: 0; }
#wrapper .micc-related-grid .related-item > h3 { font-size: 18px; }
#wrapper .micc-related-grid .related-item > p { flex: 1; line-height: 1.5; }
#wrapper .micc-related-grid .related-item > .category_belt {
    position: relative;
    top: auto;
    left: 0;
    bottom: auto;
    height: auto;
    margin-top: auto;
    padding: 5px 12px;
    line-height: 1.5;
}
#wrapper .micc-related-grid .category_name { max-width: 100%; white-space: normal; }
#wrapper .micc-related-grid .beak { display: none; }
.micc-resources-grid .resource-item > p,
.micc-archive-grid .archived-item > p { flex: 1; }
.micc-archive-grid .archived-item > h3 { margin-top: 15px; }

/* Publications: stable metadata column instead of floats inside grid cards. */
#wrapper .micc-publication {
    display: grid;
    grid-template-columns: 100px minmax(0, 1fr);
    align-items: start;
    gap: 15px;
    margin: 0;
    min-height: 0;
}
#wrapper .micc-publication::before,
#wrapper .micc-publication::after { display: none; }
#wrapper .micc-publication > div { float: none; width: auto; min-width: 0; padding: 0; }
.micc-publication h3,
.micc-publication h4 { margin-top: 0; line-height: 1.4; overflow-wrap: anywhere; }
.micc-publication small,
.micc-publication p { line-height: 1.5; overflow-wrap: anywhere; }
@media (max-width: 767px) {
    #wrapper .micc-publication { grid-template-columns: minmax(0, 1fr); }
    .micc-publication-meta { display: flex; flex-wrap: wrap; gap: 12px; }
    .micc-publication-meta p { margin-bottom: 0; }
}

/* News carousel: each slide owns a grid; Bootstrap still controls active slides. */
#wrapper .micc-news-grid { padding: 0; margin: 0 -15px; list-style: none; }
#wrapper .micc-news-grid > .micc-grid-item { margin-bottom: 20px; }
#wrapper .micc-news-grid > li > a { display: flex; flex: 1; width: 100%; text-decoration: none; }
#wrapper .micc-news-grid .news-item { display: flex; flex-direction: column; width: 100%; margin-bottom: 0; }
#wrapper .micc-news-grid .thumbnail { aspect-ratio: 5 / 3; padding: 0; overflow: hidden; flex-shrink: 0; }
#wrapper .micc-news-grid .thumbnail img { display: block; width: 100%; height: 100%; object-fit: cover; }
#wrapper .micc-news-grid .caption { display: flex; flex: 1; flex-direction: column; }
#wrapper .micc-news-grid .caption h4 {
    display: -webkit-box;
    min-height: 2.6em;
    margin: 0 0 8px;
    padding-bottom: 0;
    font-size: 18px;
    line-height: 1.3;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
}
#wrapper .micc-news-grid .caption-date { margin: 0 0 6px; padding-bottom: 0; font-size: 12px; line-height: 1.4; }
#wrapper .micc-news-grid .caption p {
    display: -webkit-box;
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
}

/* Latest projects: quiet overlay and consistent image size, no shifting cards. */
#wrapper .micc-latest-card { position: relative; overflow: hidden; margin-bottom: 0; }
#wrapper .micc-latest-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: rgb(0 0 0 / 35%);
    pointer-events: none;
}
#wrapper .micc-latest-card img {
    position: static;
    width: 100%;
    height: 100%;
    margin: 0;
    object-fit: cover;
    filter: saturate(0.5);
    transform: none;
    transition: none;
}
.micc-latest-card > a { display: block; width: 100%; aspect-ratio: 15 / 8; }
#wrapper .micc-latest-card h2 {
    z-index: 2;
    padding: 0 12px;
    font-size: 1rem;
    line-height: 1.2;
    transform: scale(1);
    transform-origin: center;
    transition: transform 0.25s ease;
}
#wrapper .micc-latest-card:hover h2,
#wrapper .micc-latest-card:focus-within h2 { transform: scale(1.08); filter: none; }
#wrapper .micc-latest-grid .category_belt { z-index: 3; max-width: calc(100% - 25px); }
#wrapper .micc-latest-grid .category_name { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12px; letter-spacing: 0; }
#wrapper .micc-latest-grid .category_name > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#wrapper .micc-latest-grid .latest-year {
    flex-shrink: 1;
    width: auto;
    max-width: 35%;
    margin: 0;
    padding: 0 4px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 12px;
}
@media (prefers-reduced-motion: reduce) {
    #wrapper .micc-latest-card h2 { transition: none; }
}

/* Listing grids also align title and excerpt starts across each row. */
.micc-list-grid .micc-card-image { aspect-ratio: 15 / 8; background: #fff; }
.micc-list-grid .micc-card-image img { object-fit: contain; }
.micc-list-grid h3 { min-height: 2.7em; margin-top: 20px; }

/* Menu markers use content slugs, independently of the editable menu labels. */
#wrapper .micc-menu-marker {
    display: inline-block;
    font-size: 0.8em;
    color: transparent;
    background: transparent;
}
#wrapper .micc-menu-marker.cat-advanced-web-applications {
	color: #b0aac2;
}
#wrapper .micc-menu-marker.cat-computer-vision {
	color: #3fb0ac;
}
#wrapper .micc-menu-marker.cat-web-and-multimedia {
	color: #e05038;
}
#wrapper .micc-menu-marker.cat-cultural-heritage {
	color: #2F1AED;
}
#wrapper .micc-menu-marker.cat-image-processing {
	color: #e6af4b;
}
#wrapper .micc-menu-marker.cat-media-security {
	color: #3fb0ac;
}
#wrapper .micc-menu-marker.cat-natural-interaction {
	color: #e05038;
}
#wrapper .micc-menu-marker.cat-smart-environments {
	color: #935347;
}
#wrapper .micc-menu-marker.cat-web-media-search-and-retrieval {
	color: #ba9077;
}

#wrapper .micc-menu-marker.cat-3d-vision {
	color: #b5b5b7;
}
#wrapper .micc-menu-marker.cat-3d-imaging-and-vision {
	color: #e6af4b;
}
/* Markers align centrally with every label; the archive has no marker markup. */
#wrapper .dropdown-menu > li > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1em;
}
#wrapper .dropdown-menu .micc-menu-marker {
    flex: 0 0 auto;
    float: none;
    margin: 0;
    line-height: 1;
}
