/*
Theme Name: EDRL Simple
Description: A small, fast, readable theme for the EDRL website, styled after the former UC Berkeley Brand look (Berkeley Blue and Gold, Freight fonts). Written from scratch; contains no code from the Berkeley Brand theme.
Version: 1.2.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: edrl-simple
*/

:root {
	--blue: #003262;
	--blue-dark: #00244a;
	--gold: #fdb515;
	--gold-dark: #c4820e;
	--text: #222831;
	--muted: #5b6573;
	--line: #d9dee5;
	--bg-soft: #f4f6f9;
	--max: 1240px;
	--sans: "freight-sans-pro", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--serif: "freight-micro-pro", Constantia, "Lucida Bright", "DejaVu Serif", Georgia, serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	color: var(--text);
	background: #fff;
	font-family: var(--sans);
	font-size: 16px;
	line-height: 1.6;
}

img, video, iframe { max-width: 100%; }
img { height: auto; }
figure { margin: 0 0 1.25em; }

a { color: var(--blue); text-underline-offset: 2px; }
a:hover { color: var(--blue); text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible {
	outline: 3px solid var(--gold);
	outline-offset: 2px;
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--serif);
	font-weight: 600;
	color: var(--blue);
	line-height: 1.25;
	margin: 1.4em 0 .5em;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }
p, ul, ol, table, blockquote { margin: 0 0 1.1em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }

blockquote {
	border-left: 4px solid var(--gold);
	margin-left: 0;
	padding: .2em 0 .2em 1.1em;
	color: #38414d;
}

table { border-collapse: collapse; max-width: 100%; }
td, th { padding: .45em .65em; vertical-align: top; }
/* Tables of data (with header cells, or made with the table block) get lines; tables used only for layout, e.g. rows of videos, do not */
table:has(th) td, table:has(th) th, .wp-block-table td, .wp-block-table th { border: 1px solid var(--line); text-align: left; }
table:has(th), .wp-block-table table { width: 100%; }
td iframe { display: block; margin: 0 auto 6px; max-width: 100%; }
.entry-content table[style*="width"] { height: auto; }
th { background: var(--bg-soft); }

.screen-reader-text {
	border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
	height: 1px; margin: -1px; overflow: hidden; padding: 0;
	position: absolute; width: 1px; word-wrap: normal;
}
.skip-link {
	position: absolute; left: -9999px; top: 0; z-index: 100;
	background: var(--gold); color: #000; padding: .6em 1em; font-weight: 700;
}
.skip-link:focus { left: 0; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* ---- Top bar and header ---- */
.uc-bar { background: var(--blue); }
.uc-bar .wrap { padding-top: 0; padding-bottom: 0; }
.home-link {
	display: inline-block; color: #fff; font-weight: 600; font-size: 16px;
	text-decoration: none; padding: 11px 0;
}
.home-link:hover, .home-link:focus { color: var(--gold); text-decoration: none; }

.site-header { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); position: relative; z-index: 20; }
.header-inner {
	display: flex; flex-wrap: wrap; align-items: center;
	justify-content: space-between; gap: 10px 24px; padding-top: 14px; padding-bottom: 10px;
}
.branding { display: flex; align-items: center; gap: 14px; }
.custom-logo { max-height: 70px; width: auto; }
.site-logo { display: block; line-height: 0; flex: none; }
.site-logo img { height: 70px; width: 70px; }
.site-title { margin: 0; font-family: var(--serif); font-size: 30px; line-height: 1.1; font-weight: 600; }
.site-title a { color: var(--blue); text-decoration: none; }
.site-title a:hover { color: var(--blue-dark); text-decoration: none; }

.search-form { display: flex; gap: 6px; }
.search-form label { margin: 0; }
.search-field {
	border: 1px solid #aeb7c2; border-radius: 0; padding: .5em .7em;
	font: inherit; min-width: 210px;
}
.search-submit {
	border: 0; border-radius: 0; background: var(--blue); color: #fff;
	padding: .5em 1em; font: inherit; font-weight: 600; cursor: pointer;
}
.search-submit:hover { background: var(--blue-dark); }

/* ---- Navigation ---- */
.nav-toggle {
	display: none; background: none; border: 1px solid var(--blue);
	color: var(--blue); font: inherit; font-weight: 600; padding: 8px 14px; cursor: pointer;
}
.main-nav .menu, .main-nav .sub-menu { list-style: none; margin: 0; padding: 0; }
.main-nav .menu { display: flex; flex-wrap: wrap; justify-content: flex-end; }
.main-nav li { position: relative; }
.main-nav a {
	display: block; color: var(--blue); text-decoration: none;
	padding: 12px 14px; font-weight: 400; font-size: 18px; line-height: 1.2;
	border-bottom: 3px solid transparent;
}
.main-nav a:hover, .main-nav li:focus-within > a, .main-nav .current-menu-item > a,
.main-nav .current-menu-ancestor > a, .main-nav .current_page_item > a {
	color: var(--blue); border-bottom-color: var(--gold); text-decoration: none;
}
.main-nav .sub-menu {
	display: none; position: absolute; left: 0; top: 100%; z-index: 50;
	min-width: 280px; background: #fff; border: 1px solid var(--line);
	border-top: 3px solid var(--blue); box-shadow: 0 8px 18px rgba(0,0,0,.15);
	max-height: 70vh; overflow-y: auto;
}
.main-nav li:hover > .sub-menu, .main-nav li:focus-within > .sub-menu { display: block; }
.main-nav .sub-menu a {
	color: var(--blue); font-size: 16px;
	padding: 9px 16px; border-bottom: 1px solid var(--bg-soft);
}
.main-nav .sub-menu a:hover, .main-nav .sub-menu li:focus-within > a {
	background: var(--bg-soft); border-bottom-color: var(--bg-soft); box-shadow: inset 4px 0 0 var(--gold);
}

/* ---- Content ---- */
.site-main { padding: 28px 0 56px; min-height: 55vh; }
.page-title { margin-top: .2em; border-bottom: 3px solid var(--gold); padding-bottom: .25em; display: inline-block; }
.entry-content { overflow-wrap: break-word; }
.entry-content > *:first-child { margin-top: 0; }
.entry-thumb img { border-radius: 4px; }
.entry-cats { color: var(--muted); font-size: .9rem; margin-top: 2em; }
.back-link { margin-top: 2em; }
.archive-description { color: var(--muted); margin-bottom: 1.5em; }

.aligncenter { display: block; margin-left: auto; margin-right: auto; text-align: center; }
.alignleft { float: left; margin: .3em 1.4em 1em 0; }
.alignright { float: right; margin: .3em 0 1em 1.4em; }
.alignwide, .alignfull { max-width: 100%; }
.wp-caption { max-width: 100%; }
.wp-caption-text, figcaption { color: var(--muted); font-size: .88rem; }
.entry-content::after { content: ""; display: table; clear: both; }

/* Responsive YouTube snippets (from the old child theme) */
.iframe-container { position: relative; width: 100%; padding-bottom: 56.25%; height: 0; margin-bottom: 1.2em; }
.iframe-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

/* Rows and columns from the old page builder */
.pbs-row { display: flex; flex-wrap: wrap; align-items: stretch; margin: 0 -12px 1em; }
.pbs-col { display: flex; flex-direction: column; box-sizing: border-box; padding: 0 12px; min-width: 0; flex-grow: 0; }
.pbs-col img { max-width: 100%; height: auto; }
.pbs-row .pbs-col:only-child { flex-basis: 100%; }
@media (max-width: 760px) {
	.pbs-row { margin-left: 0; margin-right: 0; }
	.pbs-col { flex-basis: 100% !important; padding: 0 0 10px !important; }
	.alignleft, .alignright { float: none; display: block; margin: 0 auto 1em; }
	.wp-block-media-text { grid-template-columns: 1fr !important; }
}

/* ---- Lists of posts ---- */
.entry-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; margin-top: 1.4em; }
.entry-card { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.entry-card .card-thumb img { width: 100%; display: block; }
.card-body { padding: 14px 16px 16px; }
.card-title { font-size: 1.1rem; margin: 0 0 .3em; }
.card-title a { text-decoration: none; }
.card-title a:hover { text-decoration: underline; }
.card-type { margin: 0 0 .3em; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--gold-dark); font-weight: 700; }
.card-excerpt { color: #3d4652; font-size: .95rem; }
.card-excerpt p:last-child { margin-bottom: 0; }

.navigation.pagination { margin-top: 2em; }
.nav-links { display: flex; flex-wrap: wrap; gap: 6px; }
.page-numbers { border: 1px solid var(--line); border-radius: 4px; padding: .35em .8em; text-decoration: none; }
.page-numbers.current { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ---- People ---- */
.people-grid { list-style: none; padding: 0; margin: 1.6em 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 24px 20px; }
.person-card { text-align: center; }
.person-card a { text-decoration: none; display: block; }
.person-card-photo { display: block; aspect-ratio: 1 / 1; overflow: hidden; border-radius: 50%; background: var(--bg-soft); margin: 0 auto 10px; max-width: 160px; }
.person-card-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.person-card-photo .no-photo { display: block; width: 100%; height: 100%; background: linear-gradient(135deg, var(--bg-soft), #dde3ea); }
.person-card-name { display: block; font-weight: 700; color: var(--blue); line-height: 1.3; }
.person-card a:hover .person-card-name { text-decoration: underline; }
.person-card-role { display: block; font-size: .88rem; color: var(--muted); }
.person-head { display: flex; flex-wrap: wrap; gap: 22px; align-items: center; margin-bottom: 1.2em; }
.person-photo img { width: 180px; height: 180px; object-fit: cover; border-radius: 50%; display: block; }
.person-role { color: var(--muted); font-size: 1.1rem; margin: .2em 0 0; }

/* ---- Publications ---- */
.pub-list { padding-left: 0; list-style: none; }
.pub-list li { padding: .8em 0; border-bottom: 1px solid var(--line); }
.pub-title { font-weight: 600; }
.pub-cite { color: #38414d; font-size: 1.02rem; }

/* ---- Events ---- */
.section-title { border-bottom: 1px solid var(--line); padding-bottom: .2em; }
.event-list { list-style: none; padding: 0; }
.event-list li { padding: .6em 0; border-bottom: 1px solid var(--bg-soft); }
.event-date { display: inline-block; min-width: 11em; color: var(--muted); font-size: .92rem; }
.event-venue { color: var(--muted); font-size: .9rem; margin-left: .6em; }
.event-venue::before { content: "\00b7\00a0"; }
.event-meta { color: var(--muted); }

/* ---- Footer ---- */
.site-footer { margin-top: 20px; }
.dept-footer { background: #063f75; color: #eee; padding: 30px 0 20px; }
.dept-footer a { color: #fff; }
.dept-footer a:hover { color: #829db5; }
.footer-widgets { display: flex; flex-wrap: wrap; gap: 24px 40px; }
.footer-widgets .widget { flex: 1 1 260px; }
.footer-widgets p { margin-bottom: .8em; font-size: 15px; line-height: 22px; color: #eee; }
.widget-title { margin: 0 0 .7em; font-family: var(--sans); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; color: rgba(255,255,255,.7); }
.universal-footer { background: var(--blue); color: #ccc; padding: 20px 0 30px; }
.universal-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 40px; }
.uc-logo img { display: block; height: auto; }
.universal-footer .copyright { font-size: 13px; margin: 0; padding: 0; border: 0; color: #ccc; }
.footer-links { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 22px; }
.universal-footer a { color: #acb5b9; text-decoration: none; }
.universal-footer a:hover, .universal-footer a:focus { color: var(--gold); text-decoration: underline; }

/* ---- Small screens ---- */
@media (max-width: 800px) {
	body { font-size: 16px; }
	.site-title { font-size: 1.4rem; }
	.site-logo img, .custom-logo { height: 48px; width: 48px; }
	.nav-toggle { display: block; }
	.main-nav { display: none; width: 100%; }
	.main-nav.is-open { display: block; padding-bottom: 10px; }
	.main-nav .menu { display: block; }
	.main-nav a { padding: 11px 4px; border-bottom: 1px solid var(--line); }
	.main-nav .sub-menu { display: block; position: static; min-width: 0; max-height: none; box-shadow: none; border: 0; background: transparent; }
	.main-nav .sub-menu a { padding-left: 22px; font-size: 16px; }
	.event-date { display: block; }
}

@media (prefers-reduced-motion: no-preference) {
	a, .search-submit { transition: background-color .15s, color .15s; }
}

/* ---- Sidebar layout ---- */
.layout.has-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 36px; align-items: start; }
.content-col { min-width: 0; }
.sidebar .widget { margin: 0 0 30px; }
.sidebar .widget-title { color: var(--blue); font-size: 1.15rem; border-bottom: 3px solid var(--gold); padding-bottom: .25em; margin: 0 0 .7em; }
.sidebar img { border-radius: 4px; }
.sidebar .block-header, .sidebar h3 { font-size: 1.1rem; margin-top: 0; }
@media (max-width: 1000px) { .layout.has-sidebar { display: block; } .sidebar { margin-top: 36px; } }

/* ---- Widgets from the old UC Berkeley component plugins ---- */
.block.quote.solid-background { background: var(--blue); color: #fff; padding: 20px 22px; border-radius: 4px; }
.block.quote.web-founders-rock { background: #3b7ea1; }
.block.quote .caption { font-size: 1.05rem; line-height: 1.5; }
.block.quote .caption * { color: inherit; }
.block.events .block-header { font-size: 1.15rem; margin: 0 0 .6em; }
.media-list { list-style: none; padding: 0; margin: 0; }
.media-list .media { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.media-list .date { background: var(--blue); color: #fff; text-align: center; border-radius: 4px; min-width: 52px; padding: 5px 4px; line-height: 1.1; }
.media-list .date .month { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--gold); }
.media-list .date .day { display: block; font-size: 1.35rem; font-weight: 700; }
.media-list .media-body h3 { font-size: 1rem; margin: 0 0 .15em; }
.media-list .event_venue { font-size: .88rem; color: var(--muted); }
.block .more-link { margin-top: .6em; }

/* ---- Lists from [catlist] ---- */
.thumb-list { margin: 0 0 1.2em; }
.thumbnail-list-item { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.thumbnail-list-thumb { flex: 0 0 84px; }
.thumbnail-list-thumb img { width: 84px; height: 84px; object-fit: cover; border-radius: 4px; display: block; }
.thumbnail-list-text { min-width: 0; flex: 1; }
.thumbnail-list-text .block-header { font-size: 1rem; margin: 0 0 .2em; }
.thumbnail-list-text p { font-size: .92rem; margin: 0 0 .4em; color: #3d4652; }

/* Footer link widgets (privacy, accessibility ...) sit in a row */
.footer-widgets .widget_custom_html { flex: 0 1 auto; }
.footer-widgets .widget_custom_html p { margin: 0; }

/* Publication lists */
.apa-list .apa-refs { list-style: none; margin: 0 0 1.4em; padding: 0; }
.apa-list .apa-ref { margin: 0 0 .9em; padding-left: 2em; text-indent: -2em; line-height: 1.5; }
.apa-list h3.apa-year { margin: 1.4em 0 .5em; padding-bottom: .15em; border-bottom: 2px solid var(--gold); }

/* Sidebar headings: links inside them are not underlined */
.sidebar h2 a, .sidebar h3 a { text-decoration: none; }
.sidebar h2 { margin-top: 0; }

/* The last menu items open their dropdown towards the left so it never leaves the screen */
.main-nav .menu > li:nth-last-child(-n+2) > .sub-menu { left: auto; right: 0; }
.main-nav .sub-menu { max-width: min(340px, 92vw); }

/* Videos taken out of layout tables */
.video-list { margin: 0 0 1.5em; }
.video-item { margin: 0 0 1.6em; max-width: 720px; }
.video-item figcaption { margin-top: .5em; font-size: 1rem; color: var(--text); text-align: left; }
.video-item figcaption em, .video-item figcaption i { font-style: italic; }
