/*
Theme Name: IPCV-LAB
Theme URI: https://ipcv-lab.eie.ucr.ac.cr/
Author: IPCV-LAB
Description: Recreates the look of the original IPCV-LAB site (Drupal 7 with the Bartik theme): blue header with the UCR logo, left sidebar with the main menu and the latest news, Georgia typography and a dark footer. People and Photos show as grids, like the original.
Version: 1.0.1
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ipcv-lab
*/

/* Values taken from the original site's stylesheets (Bartik layout.css, style.css, colors.css and the
   site's CSS Injector rules): 960px page, 240px left sidebar, 720px content, 110px blue header. */
:root {
	--ipcv-text: #3b3b3b;
	--ipcv-link: #0071b3;
	--ipcv-link-hover: #018fe2;
	--ipcv-dark: #23272c;
	--ipcv-block: #f6f6f2;
	--ipcv-block-border: #f9f9f9;
	--ipcv-rule: #d6d6d6;
	--ipcv-footer: #292929;
	--ipcv-serif: Georgia, "Times New Roman", Times, serif;
	--ipcv-sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* dark like the original's page background, so the footer color runs to the bottom of short pages
   (":root body" outranks the white background that WordPress prints from theme.json for the editor) */
html,
:root body {
	background: var(--ipcv-footer);
}

body {
	margin: 0;
	color: var(--ipcv-text);
	font-family: var(--ipcv-serif);
	font-size: 87.5%;
	line-height: 1.5;
	word-wrap: break-word;
}

.wp-site-blocks {
	padding: 0;
}

.wp-site-blocks > * {
	margin-block-start: 0;
	margin-block-end: 0;
}

a,
a:visited {
	color: var(--ipcv-link);
	text-decoration: none;
}

a:hover,
a:focus {
	color: var(--ipcv-link-hover);
	text-decoration: underline;
}

img {
	max-width: 100%;
	height: auto;
}

/* ------------------------------------------------------------------ header */
.ipcv-header {
	background-color: #48a9e4;
	background-image: linear-gradient(to bottom, #0779bf 0%, #48a9e4 100%);
	height: 110px;
	overflow: hidden;
	font-family: var(--ipcv-sans);
}

.ipcv-header-inner {
	box-sizing: border-box;
	display: flex;
	align-items: flex-start;
	width: 960px;
	max-width: 100%;
	margin: 0 auto;
	padding: 15px 15px 0;
}

.ipcv-header-inner > * {
	margin: 0;
}

.ipcv-brand {
	flex: 0 0 548px;
	width: 548px;
}

.ipcv-brand > * {
	margin: 0;
}

.ipcv-ucr-logo,
.ipcv-ucr-logo a {
	display: block;
	line-height: 0;
}

.ipcv-ucr-logo img {
	display: block;
	width: 548px;
	max-width: 100%;
	height: auto;
}

.ipcv-school {
	margin: -7px 0 0 82px !important;
	font-family: var(--ipcv-serif);
	font-size: 22px;
	line-height: 1.1;
}

.ipcv-school a,
.ipcv-school a:visited,
.ipcv-lab-title a,
.ipcv-lab-title a:visited {
	color: var(--ipcv-dark);
	text-decoration: none;
}

.ipcv-lab-title {
	margin: 6px 0 0 37px !important;
	font-family: var(--ipcv-serif);
	font-size: 65px;
	font-weight: normal;
	line-height: 1;
	white-space: nowrap;
}

/* ------------------------------------------------------------------ main area */
.ipcv-main-wrapper {
	background: #fff;
	min-height: 300px;
	overflow: hidden;
}

.ipcv-main {
	box-sizing: border-box;
	width: 960px;
	max-width: 100%;
	margin: 20px auto 40px;
}

.ipcv-main > * {
	margin-block-start: 0;
}

.ipcv-breadcrumb {
	margin: 0 15px !important;
	font-size: 0.929em;
}

.ipcv-row {
	display: flex;
	align-items: flex-start;
}

.ipcv-row > * {
	margin: 0 !important;
}

.ipcv-sidebar {
	box-sizing: border-box;
	flex: 0 0 240px;
	width: 240px;
	padding: 10px 15px 0;
}

.ipcv-content {
	box-sizing: border-box;
	flex: 0 0 720px;
	width: 720px;
	min-width: 0;
	padding: 0 15px;
}

/* sidebar blocks */
.ipcv-block {
	background: var(--ipcv-block);
	border: 1px solid var(--ipcv-block-border);
	padding: 15px 20px;
	margin: 0 0 20px !important;
}

.ipcv-block > * {
	margin-block-start: 0;
}

.ipcv-block-title {
	margin: 0 0 0.5em !important;
	padding-bottom: 5px;
	border-bottom: 1px solid var(--ipcv-rule);
	text-shadow: 0 1px 0 #fff;
	font-family: var(--ipcv-serif);
	font-size: 1.071em;
	font-weight: normal;
	line-height: 1.2;
	color: var(--ipcv-text);
}

.ipcv-menu ul {
	margin: 0 !important;
	padding: 0 0 0.25em 1em;
	list-style: disc;
}

.ipcv-menu li {
	margin: 0;
	font-size: 18px;
	line-height: 1.4;
}

.ipcv-news .wp-block-query {
	font-size: 0.914em;
	line-height: 1.4;
}

.ipcv-news ul.wp-block-post-template {
	margin: 0;
	padding: 0 0 0.25em 1em;
	list-style: disc;
}

.ipcv-news li.wp-block-post {
	margin: 0;
	padding: 0.2em 0.5em 0 0;
}

.ipcv-news li.wp-block-post > * {
	margin: 0;
}

.ipcv-news .wp-block-post-date,
.ipcv-news .wp-block-post-title {
	font-family: var(--ipcv-serif);
	font-size: 1em;
	font-weight: normal;
	line-height: 1.4;
}

.ipcv-news .wp-block-post-title {
	color: var(--ipcv-text);
	font-size: 14px;
}

/* ------------------------------------------------------------------ content */
.ipcv-page-title,
.ipcv-content .wp-block-post-title.ipcv-page-title {
	margin: 0.6em 0 0.5em !important;
	font-family: var(--ipcv-serif);
	font-size: 2em;
	font-weight: normal;
	line-height: 1;
	color: #000;
}

.ipcv-entry {
	font-size: 1.071em;
}

.ipcv-entry p {
	margin-top: 0;
	margin-bottom: 0;
}

.ipcv-entry > * + *,
.ipcv-entry .wp-block-column > * + * {
	margin-block-start: 0.7em;
}

.ipcv-entry h2 {
	margin: 1em 0 2px;
	font-family: var(--ipcv-serif);
	font-size: 18px;
	font-weight: normal;
	line-height: 1.4;
	color: var(--ipcv-text);
}

.ipcv-entry h3 {
	margin: 1em 0 0.3em;
	font-family: var(--ipcv-serif);
	font-size: 16px;
	font-weight: normal;
	line-height: 1.4;
}

.ipcv-entry ul,
.ipcv-entry ol {
	margin: 1em 0;
	padding: 0 0 0.25em 2.5em;
}

.ipcv-entry li {
	margin: 0 0 0.25em;
}

.ipcv-entry .wp-block-image {
	margin-left: 0;
	margin-right: 0;
}

/* Home: the first heading is the page title, and the news list lives in the sidebar */
.home .ipcv-entry > h2:first-child {
	margin: 0.6em 0 0.5em;
	font-size: 2em;
	line-height: 1;
	color: #000;
}

.home .ipcv-entry > .wp-block-latest-posts {
	display: none;
}

.home .ipcv-entry > h2:has(+ .wp-block-latest-posts) {
	display: none;
}

/* People: the big gallery of outstanding past members is replaced by a small grid (assets/ipcv.js) */
.ipcv-js.ipcv-page-people .ipcv-entry > .wp-block-gallery {
	display: none !important;
}

/* slideshow made from the Home gallery (assets/ipcv.js) */
.ipcv-slideshow {
	position: relative;
	margin: 0.5em 0 0.7em;
}

.ipcv-slides {
	position: relative;
	width: 100%;
	aspect-ratio: 690 / 420;
	overflow: hidden;
	background: #000;
}

.ipcv-slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	transition: opacity 0.8s ease;
}

.ipcv-slide.is-active {
	opacity: 1;
	z-index: 1;
}

.ipcv-slide img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ipcv-slide-title {
	position: absolute;
	right: 2px;
	bottom: 7px;
	width: 235px;
	padding: 2px 6px;
	box-sizing: border-box;
	background: #fff;
	opacity: 0.75;
	color: #000;
	font-size: 14px;
	line-height: 1.3;
	text-align: center;
}

.ipcv-slide-pager {
	display: flex;
	gap: 10px;
	padding: 10px 5px;
}

.ipcv-slide-pager button {
	width: 20px;
	height: 20px;
	padding: 0;
	border: 1px solid #9aa4ad;
	border-radius: 50%;
	background: #e4e8ec;
	cursor: pointer;
}

.ipcv-slide-pager button[aria-current="true"] {
	border-color: #0779bf;
	background: #48a9e4;
}

/* People and Photos grids (assets/ipcv.js) */
.ipcv-grid {
	display: grid;
	margin: 0.5em 0 0;
	font-size: 12px;
	line-height: 1.5;
	text-align: center;
}

.ipcv-people-grid {
	grid-template-columns: repeat(3, 1fr);
	width: 310px;
}

.ipcv-photos-grid {
	grid-template-columns: repeat(3, 1fr);
	row-gap: 6px;
}

.ipcv-card {
	display: block;
	padding: 4px 9px;
}

.ipcv-card img {
	display: block;
	margin: 0 auto 4px;
}

.ipcv-people-grid .ipcv-card img {
	width: auto;
	height: 100px;
	max-width: 100%;
	object-fit: cover;
}

.ipcv-photos-grid .ipcv-card img {
	width: 220px;
	height: 165px;
	object-fit: cover;
}

.ipcv-pager {
	margin: 1.5em 0 0;
	padding: 0;
	list-style: none;
	font-size: 0.929em;
	text-align: center;
}

.ipcv-pager li {
	display: inline;
	padding: 0.5em;
}

.ipcv-pager .is-current {
	font-weight: bold;
}

.ipcv-hidden,
.ipcv-detail {
	display: none !important;
}

.ipcv-detail.is-current {
	display: block !important;
}

.ipcv-detail.is-current .wp-block-column {
	flex-basis: auto !important;
	width: auto;
}

.ipcv-detail.is-current .wp-block-column + .wp-block-column {
	margin-top: 0.7em;
}

.ipcv-page-people .ipcv-detail.is-current .wp-block-image img {
	width: 164px;
}

.ipcv-detail-mode .ipcv-entry > h2,
.ipcv-detail-mode .ipcv-grid,
.ipcv-detail-mode .ipcv-pager {
	display: none !important;
}

/* Publications: link and PDF icons at the end of each item, like the original */
.ipcv-icon-link {
	display: inline-block;
	margin-left: 4px;
	vertical-align: -3px;
	line-height: 0;
}

.ipcv-icon-link svg {
	width: 18px;
	height: 18px;
}

/* News page: the date is the title of each item, like the original */
.ipcv-page-news .wp-block-latest-posts {
	padding: 0;
	list-style: none;
}

.ipcv-page-news .wp-block-latest-posts > li {
	margin: 0 0 1.5em;
}

.ipcv-page-news .wp-block-latest-posts__post-title {
	display: block;
	margin: 0 0 0.3em;
	font-size: 18px;
}

/* ------------------------------------------------------------------ footer */
.ipcv-footer {
	padding: 35px 5px 30px;
	background: var(--ipcv-footer);
	color: rgba(255, 255, 255, 0.65);
	font-family: var(--ipcv-sans);
	font-size: 0.857em;
}

.ipcv-footer-inner {
	width: 940px;
	max-width: 100%;
	margin: 0 auto;
}

.ipcv-footer-inner p {
	margin: 20px 0 0;
	line-height: 1.5;
}

.ipcv-footer a,
.ipcv-footer a:visited {
	color: rgba(255, 255, 255, 0.8);
}

/* ------------------------------------------------------------------ small screens */
@media (max-width: 990px) {
	.ipcv-header {
		height: auto;
		padding-bottom: 14px;
	}

	.ipcv-header-inner {
		flex-wrap: wrap;
		padding: 14px 16px 0;
	}

	.ipcv-brand {
		flex: 1 1 100%;
		width: 100%;
		max-width: 548px;
	}

	.ipcv-ucr-logo img {
		width: 100%;
	}

	.ipcv-school {
		margin: 2px 0 0 15% !important;
		font-size: 18px;
	}

	.ipcv-lab-title {
		margin: 10px 0 0 !important;
		font-size: 46px;
	}

	.ipcv-main {
		margin: 16px auto 32px;
	}

	.ipcv-breadcrumb {
		margin: 0 16px !important;
	}

	.ipcv-row {
		flex-direction: column;
		align-items: stretch;
	}

	.ipcv-sidebar {
		display: contents;
	}

	.ipcv-sidebar .ipcv-menu {
		order: 1;
		margin: 12px 16px 0 !important;
	}

	.ipcv-content {
		order: 2;
		flex: none;
		width: 100%;
		padding: 0 16px;
	}

	.ipcv-sidebar .ipcv-news {
		order: 3;
		margin: 24px 16px 0 !important;
	}

	.ipcv-photos-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.ipcv-photos-grid .ipcv-card img {
		width: 100%;
		height: auto;
		aspect-ratio: 4 / 3;
	}

	.ipcv-slide-title {
		width: auto;
		left: 2px;
	}
}

@media (max-width: 600px) {
	.ipcv-lab-title {
		font-size: 38px;
	}

	.ipcv-entry .wp-block-columns {
		display: block;
	}

	.ipcv-entry .wp-block-column + .wp-block-column {
		margin-top: 0.7em;
	}
}
