/*
Theme Name: Grunnskólinn á Hellu
Theme URI: https://grhella.is
Author: Grunnskólinn á Hellu
Description: Sérsniðið þema fyrir Grunnskólann á Hellu. Fréttir, viðburðir, afmælisbörn, starfsfólk og myndasíður.
Version: 1.0.3
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: grhella
*/

/* =========================================================
   1. Tokens
   ========================================================= */
:root {
	--blue: #1c4b82;
	--blue-deep: #143a66;
	--blue-ink: #0f2c4f;
	--sky: #eaf2fb;
	--sky-2: #d5e4f5;
	--gold: #e8b55d;
	--gold-deep: #a9761f;
	--gold-tint: #fbf3e2;
	--red: #d94b3d;
	--ink: #1e2a38;
	--ink-2: #4a5867;
	--ink-3: #75828f;
	--line: #e2e8ef;
	--paper: #ffffff;
	--cloud: #f6f8fb;

	--font-body: "Nunito", "Segoe UI", system-ui, sans-serif;
	--font-head: "Rubik", "Segoe UI", system-ui, sans-serif;

	--r-s: 8px;
	--r-m: 14px;
	--r-l: 20px;
	--shadow: 0 10px 30px rgba(20, 58, 102, 0.10);
	--shadow-s: 0 3px 10px rgba(20, 58, 102, 0.08);
	--wrap: 1200px;
	--gutter: clamp(16px, 4vw, 32px);
	--header-h: 0px;
}

/* =========================================================
   2. Base
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 90px; }
html.nav-locked { overflow: hidden; }
body {
	margin: 0;
	font-family: var(--font-body);
	font-size: 1.0625rem;
	line-height: 1.6;
	color: var(--ink);
	background: var(--paper);
	-webkit-font-smoothing: antialiased;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--blue-deep); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4, h5, h6 {
	font-family: var(--font-head);
	font-weight: 600;
	line-height: 1.2;
	color: var(--blue-ink);
	margin: 0 0 0.5em;
	letter-spacing: -0.01em;
	text-wrap: balance;
}
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; }
button { font: inherit; color: inherit; }
.icon { width: 1.25em; height: 1.25em; flex: none; }
.icon--inline { width: 0.85em; height: 0.85em; margin-left: 0.3em; vertical-align: -0.05em; display: inline; opacity: 0.7; }
.icon--back { transform: rotate(180deg); }
.wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }
.skip-link { position: absolute; left: 8px; top: -60px; background: var(--blue-ink); color: #fff; padding: 10px 16px; border-radius: var(--r-s); z-index: 1000; }
.skip-link:focus { top: 8px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); }
.empty { color: var(--ink-2); background: var(--cloud); border-radius: var(--r-m); padding: 20px 24px; }

/* Buttons */
.btn {
	display: inline-flex; align-items: center; gap: 8px;
	padding: 12px 20px; border-radius: 10px; border: 0;
	font-weight: 700; text-decoration: none; cursor: pointer; line-height: 1.2;
	transition: background-color .15s, color .15s;
}
.btn .icon { width: 1.1em; height: 1.1em; }
.btn--primary { background: var(--blue); color: #fff; }
.btn--primary:hover { background: var(--blue-deep); color: #fff; }
.btn--dark { background: var(--blue-ink); color: #fff; }
.btn--dark:hover { background: var(--blue-deep); color: #fff; }
.btn--ghost { background: var(--sky); color: var(--blue-ink); }
.btn--ghost:hover { background: var(--sky-2); color: var(--blue-ink); }

/* =========================================================
   3. Header + navigation
   ========================================================= */
.site-header { position: relative; z-index: 50; background: var(--paper); }
.site-header__bar {
	display: flex; align-items: center; justify-content: space-between; gap: 24px;
	padding: 14px 0;
}
.brand { display: inline-flex; }
.brand__logo { height: 92px; width: auto; }
.site-header__aside { display: flex; align-items: center; gap: 6px; }
.util-link {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 8px 12px; border-radius: 999px;
	color: var(--ink-2); font-weight: 700; font-size: 0.95rem; text-decoration: none;
}
.util-link:hover { background: var(--cloud); color: var(--blue-ink); }
.util-link .icon { width: 1.1em; height: 1.1em; }
.search-toggle {
	display: inline-flex; align-items: center; gap: 6px;
	background: transparent; border: 0; border-radius: 999px; padding: 8px 12px; cursor: pointer;
	color: var(--ink-2); font-weight: 700; font-size: 0.95rem;
}
.search-toggle:hover, .search-toggle[aria-expanded="true"] { background: var(--cloud); color: var(--blue-ink); }
.search-toggle .icon { width: 1.15em; height: 1.15em; }
.site-search { background: var(--sky); border-bottom: 1px solid var(--sky-2); }
.site-search .search-form { margin: 0; padding: 14px 0; max-width: 560px; }
.site-search .search-form input { background: #fff; }
.nav-burger {
	display: none; align-items: center; gap: 8px;
	background: var(--blue); color: #fff; border: 0; border-radius: 999px;
	padding: 10px 16px 10px 12px; font-weight: 700; cursor: pointer;
}
.nav-burger .icon--close, .nav-open .nav-burger .icon--open { display: none; }
.nav-open .nav-burger .icon--close { display: block; }

.site-nav { background: var(--blue); color: #fff; }
.menu { list-style: none; display: flex; flex-wrap: wrap; }
.menu > li { position: relative; }
.menu-parent { display: flex; align-items: stretch; }
.menu-link {
	display: flex; align-items: center;
	padding: 15px 16px; color: #fff; text-decoration: none;
	font-weight: 700; font-size: 1rem; white-space: nowrap;
}
.menu > li > .menu-link, .menu > li > .menu-parent > .menu-link { padding-right: 14px; }
.menu > li > .menu-link:hover, .menu > li > .menu-parent > .menu-link:hover { color: #fff; }
.menu-toggle {
	display: flex; align-items: center; justify-content: center;
	background: transparent; border: 0; color: #fff; padding: 0 12px 0 0; cursor: pointer;
	opacity: 0.85;
}
.menu-toggle .icon { width: 1em; height: 1em; transition: transform .2s; }
.menu > li:hover > .menu-link, .menu > li:hover > .menu-parent, .menu > li.is-open > .menu-parent, .menu > li > .menu-parent:has(:focus-visible) { background: var(--blue-deep); }
.menu > li > .menu-parent > .menu-link { position: relative; }
.menu > li.current-menu-item > .menu-link::after,
.menu > li.current-menu-ancestor > .menu-parent > .menu-link::after,
.menu > li.current-menu-parent > .menu-parent > .menu-link::after {
	content: ""; position: absolute; left: 16px; right: 0; bottom: 8px; height: 3px; border-radius: 3px; background: var(--gold);
}
.menu > li > .menu-link { position: relative; }
.menu li.is-open > .menu-parent .menu-toggle .icon { transform: rotate(180deg); }

/* Dropdown */
.sub-menu {
	list-style: none;
	position: absolute; left: 0; top: 100%; min-width: 280px;
	background: var(--paper); color: var(--ink);
	border-radius: 0 0 var(--r-m) var(--r-m); box-shadow: var(--shadow);
	padding: 10px 0 12px;
	opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(6px);
	transition: opacity .15s, transform .15s, visibility 0s .15s;
	z-index: 60;
}
.menu > li.is-open > .sub-menu { opacity: 1; visibility: visible; pointer-events: auto; transform: none; transition-delay: 0s; }
.menu > li:last-child > .sub-menu, .menu > li:nth-last-child(2) > .sub-menu { left: auto; right: 0; }
.sub-menu:has(> li:nth-child(9)) { min-width: 560px; columns: 2; column-gap: 0; }
.sub-menu > li { break-inside: avoid; }
.sub-menu .menu-link {
	padding: 8px 22px; color: var(--ink); font-weight: 600; font-size: 0.98rem; white-space: normal;
	border-left: 3px solid transparent;
}
.sub-menu .menu-link:hover, .sub-menu li.current-menu-item > .menu-link { background: var(--sky); border-left-color: var(--gold); color: var(--blue-ink); }
.sub-menu .menu-link[aria-current] { font-weight: 800; }
/* Third level rendered inline as a group */
.sub-menu--nested {
	position: static; opacity: 1; visibility: inherit; pointer-events: inherit; transform: none;
	box-shadow: none; border-radius: 0; padding: 0 0 6px; min-width: 0; columns: auto;
	background: var(--cloud); margin: 2px 0 6px;
}
.sub-menu > li.menu-item-has-children > .menu-link { font-family: var(--font-head); font-weight: 500; color: var(--blue-ink); margin-top: 4px; }
.sub-menu--nested .menu-link { padding-left: 34px; font-size: 0.93rem; font-weight: 600; }

@media (max-width: 1023px) {
	.nav-burger { display: inline-flex; }
	.util-link span, .search-toggle span { display: none; }
	.util-link--mentor { display: none; }
	.search-toggle { padding: 8px; }
	.util-link { padding: 8px; }
	.brand__logo { height: 62px; }
	.site-nav {
		display: none; position: fixed; inset: var(--header-h, 92px) 0 0; overflow-y: auto;
		background: var(--blue-deep); padding: 8px 0 40px; z-index: 40;
	}
	.nav-open .site-nav { display: block; }
	.menu { flex-direction: column; }
	.menu > li { border-bottom: 1px solid rgba(255,255,255,.12); }
	.menu-link { padding: 14px 8px; font-size: 1.05rem; white-space: normal; }
	.menu-parent { justify-content: space-between; }
	.menu-parent > .menu-link { flex: 1; }
	.menu-toggle { padding: 0 8px 0 16px; }
	.menu-toggle .icon { width: 1.3em; height: 1.3em; }
	.menu > li.current-menu-item > .menu-link::after, .menu > li.current-menu-ancestor > .menu-parent > .menu-link::after { display: none; }
	.menu > li:hover > .menu-link, .menu > li:hover > .menu-parent { background: transparent; }
	.sub-menu {
		display: none; position: static; opacity: 1; visibility: visible; pointer-events: auto; transform: none;
		box-shadow: none; border-radius: var(--r-s); padding: 6px 0; margin: 0 0 12px; min-width: 0;
		columns: auto !important; min-width: 0 !important;
	}
	.menu > li.is-open > .sub-menu { display: block; }
	.sub-menu .menu-link { padding: 10px 18px; }
	.sub-menu--nested { display: block; background: rgba(0,0,0,.05); }
	.sub-menu--nested .menu-link { padding-left: 30px; }
}

/* =========================================================
   4. Front page
   ========================================================= */
.hero { position: relative; }
.hero__media { height: clamp(300px, 46vw, 560px); overflow: hidden; background: var(--sky-2); }
.hero__img { width: 100%; height: 100%; object-fit: cover; object-position: center 60%; }
.hero__img--empty { background: linear-gradient(135deg, var(--sky) 0%, var(--sky-2) 100%); }
.hero__inner { position: relative; }
.hero__plaque {
	position: absolute; left: 0; bottom: 0; transform: translateY(46%);
	max-width: min(560px, 100%);
	background: var(--paper); border-left: 8px solid var(--gold);
	padding: 22px 36px 22px 30px; border-radius: 0 var(--r-m) var(--r-m) 0;
	box-shadow: var(--shadow);
}
.hero__motto { font-size: clamp(1.5rem, 2.9vw, 2.35rem); font-weight: 600; margin: 0; color: var(--blue-ink); white-space: nowrap; }
@media (max-width: 720px) {
	.hero__plaque { position: static; transform: none; margin: -28px var(--gutter) 0; max-width: none; border-radius: var(--r-m); border-left-width: 6px; padding: 18px 20px; }
	.hero__motto { white-space: normal; }
	.hero__inner { width: auto; }
}

.quicklinks { padding: 96px 0 0; }
@media (max-width: 720px) { .quicklinks { padding-top: 20px; } }
.quicklinks__list { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; }
.quicklinks__list a {
	display: inline-flex; align-items: center;
	padding: 10px 18px; border-radius: 999px;
	background: var(--sky); color: var(--blue-ink); font-weight: 700; text-decoration: none; font-size: 0.98rem;
	transition: background-color .15s, color .15s;
}
.quicklinks__list a:hover { background: var(--blue); color: #fff; }

.front-grid {
	display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: clamp(32px, 5vw, 64px);
	padding: 44px 0 72px;
}
@media (max-width: 1023px) { .front-grid { grid-template-columns: 1fr; } }

.section-head {
	display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap;
	margin-bottom: 22px;
}
.section-head h2 { font-size: 1.65rem; margin: 0; position: relative; padding-bottom: 10px; }
.section-head h2::after { content: ""; position: absolute; left: 0; bottom: 0; width: 44px; height: 4px; border-radius: 4px; background: var(--gold); }
.section-head__link, .side__more {
	display: inline-flex; align-items: center; gap: 6px;
	font-weight: 700; text-decoration: none; color: var(--blue);
}
.section-head__link .icon, .side__more .icon { width: 1em; height: 1em; transition: transform .15s; }
.section-head__link:hover .icon, .side__more:hover .icon { transform: translateX(3px); }
.section-head__count { font-family: var(--font-head); color: var(--ink-3); font-size: 1rem; }
.section-head--side { margin-bottom: 14px; }
.section-head--side h2 { font-size: 1.3rem; display: flex; align-items: center; gap: 10px; padding-bottom: 0; }
.section-head--side h2::after { display: none; }
.section-head--side h2 .icon { color: var(--gold-deep); }

/* News cards */
.news__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 28px; }
.news__grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1023px) { .news__grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .news__grid, .news__grid--3 { grid-template-columns: 1fr; } }
.card { display: flex; flex-direction: column; min-width: 0; }
.card--featured { grid-column: 1 / -1; }
.card__media { display: block; position: relative; aspect-ratio: 16 / 10; border-radius: var(--r-m); overflow: hidden; background: var(--sky); }
.card--featured .card__media { aspect-ratio: 16 / 8; }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--blue); opacity: .5; }
.card__placeholder .icon { width: 44px; height: 44px; }
.card__body { padding: 14px 4px 0; }
.card__date { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 6px; font-size: 0.92rem; font-weight: 700; color: var(--gold-deep); }
.card__tag { display: inline-flex; align-items: center; gap: 4px; background: var(--sky); color: var(--blue-ink); padding: 2px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; }
.card__tag .icon { width: 0.95em; height: 0.95em; }
.card__title { font-size: 1.22rem; margin: 0 0 6px; }
.card--featured .card__title { font-size: clamp(1.45rem, 2.4vw, 1.9rem); }
.card__title a { color: inherit; text-decoration: none; }
.card__title a:hover { color: var(--blue); text-decoration: underline; text-decoration-thickness: 2px; text-decoration-color: var(--gold); }
.card__excerpt { margin: 0; color: var(--ink-2); max-width: 64ch; }

/* Sidebar */
.side { display: flex; flex-direction: column; gap: 36px; }
.agenda { list-style: none; }
.agenda__item { border-top: 1px solid var(--line); }
.agenda__item:last-child { border-bottom: 1px solid var(--line); }
.agenda__link { display: flex; gap: 14px; align-items: flex-start; padding: 12px 4px; text-decoration: none; color: inherit; border-radius: var(--r-s); }
a.agenda__link:hover { background: var(--cloud); color: inherit; }
a.agenda__link:hover .agenda__title { color: var(--blue); }
.agenda__body { min-width: 0; display: flex; flex-direction: column; gap: 2px; padding-top: 3px; }
.agenda__title { font-family: var(--font-head); font-weight: 500; color: var(--blue-ink); line-height: 1.3; }
.agenda__meta { font-size: 0.9rem; color: var(--ink-3); }
.agenda__excerpt { color: var(--ink-2); font-size: 0.95rem; margin-top: 4px; }
.datechip {
	flex: none; width: 58px; padding: 6px 0 7px; text-align: center;
	background: var(--sky); color: var(--blue-ink); border-radius: 10px; line-height: 1;
}
.datechip__day { display: block; font-family: var(--font-head); font-weight: 600; font-size: 1.45rem; }
.datechip__month { display: block; font-size: 0.78rem; font-weight: 700; margin-top: 3px; color: var(--blue); }
.datechip--gold { background: var(--gold-tint); }
.datechip--gold .datechip__day { color: var(--gold-deep); }
.datechip--gold .datechip__month { color: var(--gold-deep); }
.side__more { margin-top: 12px; }
.news__all { margin-top: 36px; text-align: center; }
.news__all .btn { padding-inline: 26px; }
.menu-card { background: var(--gold); border-radius: var(--r-m); padding: 24px 24px 22px; color: var(--blue-ink); }
.menu-card h2 { font-size: 1.3rem; display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.menu-card p { margin-bottom: 16px; }
.menu-card .btn { max-width: 100%; }
.menu-card .btn span, .menu-card .btn { overflow-wrap: anywhere; }

/* =========================================================
   5. Inner pages
   ========================================================= */
.page-head { background: linear-gradient(180deg, var(--sky) 0%, rgba(234,242,251,0) 100%); padding: 28px 0 26px; margin-bottom: 36px; }
.page-head__title { font-size: clamp(1.9rem, 3.6vw, 2.6rem); margin: 6px 0 0; }
.page-head__lead { font-size: 1.15rem; color: var(--ink-2); max-width: 70ch; margin: 12px 0 0; }
.page-head__meta { margin: 0; display: flex; align-items: center; gap: 12px; color: var(--gold-deep); font-weight: 700; font-size: 0.95rem; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; font-size: 0.9rem; margin-bottom: 4px; }
.crumbs li { display: flex; align-items: center; gap: 4px; }
.crumbs li + li::before { content: "/"; color: var(--ink-3); margin: 0 4px; }
.crumbs a { color: var(--ink-2); text-decoration: none; font-weight: 600; }
.crumbs a:hover { color: var(--blue); text-decoration: underline; }

.page-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(32px, 5vw, 72px); padding-bottom: 72px; }
.page-grid--single { grid-template-columns: minmax(0, 1fr); padding-bottom: 72px; }
@media (max-width: 900px) { .page-grid { grid-template-columns: 1fr; } }

.section-nav { align-self: start; position: sticky; top: 24px; background: var(--cloud); border-radius: var(--r-m); padding: 20px 22px; }
.section-nav__title { font-family: var(--font-head); font-weight: 600; font-size: 1.1rem; margin: 0 0 10px; }
.section-nav__title a { color: var(--blue-ink); text-decoration: none; }
.section-nav__list, .section-nav__list ul { list-style: none; }
.section-nav__list li { margin: 0; }
.section-nav__list a { display: block; padding: 6px 0 6px 12px; border-left: 3px solid transparent; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 0.95rem; line-height: 1.35; }
.section-nav__list a:hover { color: var(--blue); }
.section-nav__list .current_page_item > a { border-left-color: var(--gold); color: var(--blue-ink); font-weight: 800; }
.section-nav__list ul { margin-left: 12px; }
.section-nav__list ul a { font-size: 0.9rem; font-weight: 500; }

/* Prose */
.prose { max-width: 76ch; min-width: 0; }
.prose--intro { margin-bottom: 28px; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: 1.55rem; margin: 1.8em 0 0.5em; }
.prose h3 { font-size: 1.25rem; margin: 1.5em 0 0.4em; }
.prose h4 { font-size: 1.05rem; margin: 1.3em 0 0.4em; }
.prose p, .prose ul, .prose ol { margin-bottom: 1.1em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin-bottom: 0.35em; }
.prose li > ul, .prose li > ol { margin: 0.4em 0 0; }
.prose a { text-decoration-thickness: 1.5px; }
.prose img, .prose figure img { border-radius: 10px; }
.prose figure { margin: 1.6em 0; }
.prose figcaption { font-size: 0.9rem; color: var(--ink-3); margin-top: 8px; }
.prose__figure { margin: 0 0 28px; }
.prose__figure img { width: 100%; max-height: 70vh; object-fit: contain; background: var(--cloud); border-radius: var(--r-m); }
.prose blockquote { margin: 1.5em 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--gold); color: var(--ink-2); font-style: italic; }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: 0.97rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.prose th { background: var(--sky); font-family: var(--font-head); font-weight: 500; color: var(--blue-ink); }
.prose tr:nth-child(even) td { background: var(--cloud); }
.prose .wp-block-table { overflow-x: auto; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.prose .wp-block-button__link, .prose .wp-element-button { background: var(--blue); color: #fff; border-radius: 10px; padding: 12px 20px; font-weight: 700; text-decoration: none; }
.prose .wp-block-file { background: var(--cloud); border-radius: var(--r-s); padding: 12px 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.prose .wp-block-file__button { background: var(--blue); color: #fff; border-radius: 8px; padding: 8px 14px; font-weight: 700; text-decoration: none; }
.prose iframe, .prose embed, .prose object { max-width: 100%; }
.prose .wp-block-embed iframe, .prose .wp-block-embed object { width: 100%; }
.prose .wp-block-file object { width: 100%; height: 70vh; border-radius: var(--r-s); }
.prose .wp-block-gallery img, .prose .gallery img { border-radius: 10px; }
.prose .aligncenter { margin-inline: auto; }
.prose .wp-block-columns { gap: 24px; }
.prose strong { font-weight: 800; }
.page-links { margin: 1.5em 0; }

/* Child pages on an otherwise empty section page */
.child-pages { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin: 8px 0 32px; }
.child-pages a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-radius: var(--r-m); background: var(--cloud); color: var(--blue-ink); font-family: var(--font-head); font-weight: 500; text-decoration: none; }
.child-pages a:hover { background: var(--sky); color: var(--blue); }
.child-pages .icon { width: 1.1em; height: 1.1em; flex: none; }

/* More news under an article */
.more-news { grid-column: 1 / -1; margin-top: 56px; padding-top: 40px; border-top: 1px solid var(--line); }

/* Listings */
.listing { padding-bottom: 80px; }

/* Pagination */
.pagination { margin-top: 48px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pagination .page-numbers { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px; background: var(--cloud); color: var(--blue-ink); font-weight: 700; text-decoration: none; }
.pagination .page-numbers.current { background: var(--blue); color: #fff; }
.pagination a.page-numbers:hover { background: var(--sky-2); }

/* Search form */
.search-form { display: flex; gap: 8px; max-width: 440px; margin-top: 24px; }
.search-form input { flex: 1; min-width: 0; padding: 12px 16px; border: 2px solid var(--line); border-radius: 10px; font: inherit; }
.search-form input:focus { border-color: var(--blue); outline: none; }

/* =========================================================
   6. Staff
   ========================================================= */
.jumpbar { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); margin: -36px 0 40px; }
.jumpbar__list { list-style: none; display: flex; gap: 6px; overflow-x: auto; padding: 10px 0; scrollbar-width: none; }
.jumpbar__list::-webkit-scrollbar { display: none; }
.jumpbar__list a { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; padding: 8px 14px; border-radius: 999px; text-decoration: none; color: var(--ink-2); font-weight: 700; font-size: 0.95rem; }
.jumpbar__list a:hover { background: var(--cloud); color: var(--blue-ink); }
.jumpbar__list a.is-current { background: var(--blue-ink); color: #fff; }
.jumpbar__count { font-family: var(--font-head); font-weight: 400; font-size: 0.85rem; opacity: .7; }
.dept { margin-bottom: 64px; scroll-margin-top: 80px; }
.people { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 28px 22px; }
@media (max-width: 480px) { .people { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 14px; } }
.person { min-width: 0; }
.person__media { aspect-ratio: 4 / 5; border-radius: var(--r-m); overflow: hidden; background: var(--sky); margin-bottom: 12px; }
.person__media img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.person__initials { display: flex; align-items: center; justify-content: center; height: 100%; font-family: var(--font-head); font-weight: 600; font-size: 2.4rem; color: var(--blue); background: linear-gradient(160deg, var(--sky) 0%, var(--sky-2) 100%); }
.person__name { font-size: 1.05rem; margin: 0 0 3px; }
.person__role { margin: 0 0 6px; color: var(--ink-2); font-size: 0.93rem; line-height: 1.4; }
.person__mail { display: inline-flex; align-items: center; gap: 5px; font-size: 0.88rem; font-weight: 700; text-decoration: none; min-width: 0; max-width: 100%; }
.person__mail span { overflow-wrap: anywhere; }
.person__mail .icon { width: 1em; height: 1em; }
.person__mail:hover span { text-decoration: underline; }

/* =========================================================
   7. Myndasíður
   ========================================================= */
.years { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 28px; padding-bottom: 72px; }
.year { display: block; text-decoration: none; color: inherit; border-radius: var(--r-l); overflow: hidden; background: var(--cloud); box-shadow: var(--shadow-s); transition: transform .15s, box-shadow .15s; }
.year:hover { transform: translateY(-3px); box-shadow: var(--shadow); color: inherit; }
.year__media { display: block; position: relative; aspect-ratio: 16 / 10; background: var(--sky); }
.year__media img { width: 100%; height: 100%; object-fit: cover; }
.year__body { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 16px 20px 18px; }
.year__name { font-family: var(--font-head); font-weight: 600; font-size: 1.5rem; color: var(--blue-ink); }
.year__count { color: var(--ink-3); font-weight: 700; font-size: 0.92rem; }

.albums { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 28px 24px; }
.album { display: block; text-decoration: none; color: inherit; min-width: 0; }
.album:hover { color: inherit; }
.album__media { display: block; position: relative; aspect-ratio: 4 / 3; border-radius: var(--r-m); overflow: hidden; background: var(--sky); }
.album__media img { width: 100%; height: 100%; object-fit: cover; }
.album__body { display: block; padding: 12px 4px 0; }
.album__title { display: block; font-family: var(--font-head); font-weight: 600; font-size: 1.12rem; color: var(--blue-ink); line-height: 1.3; }
.album:hover .album__title { color: var(--blue); text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; }
.album__meta { display: block; color: var(--ink-3); font-weight: 700; font-size: 0.9rem; margin-top: 4px; }
.album-back { margin: 48px 0 72px; }

.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
@media (max-width: 560px) { .photos { grid-template-columns: repeat(2, 1fr); gap: 6px; } }
.photos__item { display: block; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--sky); }
.photos__item img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.photos__item:hover img { transform: scale(1.03); }
.photos__item:focus-visible { outline-offset: -3px; }

.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(10, 30, 56, 0.94); display: grid; place-items: center; padding: 56px 64px; }
.lightbox[hidden] { display: none; }
.lightbox__figure { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.lightbox__figure img { max-width: min(1400px, 100%); max-height: calc(100vh - 140px); width: auto; height: auto; border-radius: 6px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.lightbox__figure figcaption { color: #fff; opacity: .85; font-size: 0.95rem; text-align: center; }
.lightbox__figure figcaption:empty { display: none; }
.lightbox button { position: absolute; display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; cursor: pointer; }
.lightbox button:hover { background: rgba(255,255,255,.28); }
.lightbox button .icon { width: 26px; height: 26px; }
.lightbox__close { top: 16px; right: 16px; }
.lightbox__prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lightbox__prev .icon { transform: rotate(90deg); }
.lightbox__next { right: 12px; top: 50%; transform: translateY(-50%); }
.lightbox__next .icon { transform: rotate(-90deg); }
.lightbox__count { position: absolute; left: 20px; top: 26px; margin: 0; color: #fff; opacity: .8; font-weight: 700; }
@media (max-width: 640px) { .lightbox { padding: 64px 8px 24px; } .lightbox button { width: 42px; height: 42px; } }

/* Password gate */
.gate { padding: 40px 0 96px; display: flex; justify-content: center; }
.gate__card { width: min(560px, 100%); background: var(--paper); border-radius: var(--r-l); box-shadow: var(--shadow); padding: clamp(28px, 5vw, 44px); border-top: 8px solid var(--gold); }
.gate__icon { display: inline-flex; width: 56px; height: 56px; border-radius: 50%; background: var(--sky); color: var(--blue); align-items: center; justify-content: center; margin-bottom: 16px; }
.gate__icon .icon { width: 28px; height: 28px; }
.gate__card h1 { font-size: 1.9rem; margin-bottom: 8px; }
.gate__card p { color: var(--ink-2); }
.gate__error { background: #fdecea; color: #9b2c22; border-radius: var(--r-s); padding: 10px 14px; font-weight: 700; }
.gate__label { display: block; font-weight: 800; margin: 8px 0 6px; font-size: 0.95rem; }
.gate__row { display: flex; gap: 10px; flex-wrap: wrap; }
.gate__input { flex: 1; min-width: 200px; padding: 12px 16px; border: 2px solid var(--line); border-radius: 10px; font: inherit; font-size: 1.05rem; }
.gate__input:focus { outline: none; border-color: var(--blue); }
.gate__note { margin: 14px 0 0; font-size: 0.9rem; color: var(--ink-3); }

/* =========================================================
   8. Events list pages
   ========================================================= */
.month { margin-bottom: 44px; max-width: 760px; }
.month__title { font-size: 1.4rem; margin-bottom: 8px; }
.month__title span { color: var(--ink-3); font-weight: 400; }
.agenda--wide .agenda__link { padding: 14px 6px; gap: 18px; }
.agenda--wide .datechip { width: 64px; }

/* =========================================================
   9. Footer
   ========================================================= */
.site-footer { background: var(--blue-deep); color: #fff; margin-top: auto; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--gold); }
.site-footer__grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 40px; padding: 56px 0 40px; }
@media (max-width: 800px) { .site-footer__grid { grid-template-columns: 1fr; gap: 28px; padding: 40px 0 28px; } }
.site-footer__name { font-family: var(--font-head); font-weight: 600; font-size: 1.4rem; margin: 0 0 6px; }
.site-footer__motto { color: var(--gold); font-weight: 700; margin: 0 0 12px; }
.site-footer__about { margin: 0; max-width: 40ch; color: rgba(255,255,255,.82); font-size: 0.97rem; line-height: 1.55; }
.site-footer__contact { font-style: normal; }
.site-footer__contact p { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 10px; }
.site-footer__contact .icon { color: var(--gold); margin-top: 2px; }
.site-footer__contact a { text-decoration: none; }
.site-footer__contact a:hover { text-decoration: underline; }
.footer-menu { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-menu + .footer-menu { margin-top: 12px; }
.footer-menu a { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 600; }
.footer-menu a:hover { text-decoration: underline; }
.footer-menu .icon { color: var(--gold); }
.site-footer__bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 18px 0 24px; border-top: 1px solid rgba(255,255,255,.15); font-size: 0.9rem; opacity: .85; }
.site-footer__bottom p { margin: 0; }
.to-top { text-decoration: none; font-weight: 700; }

/* Sticky footer layout */
body { min-height: 100vh; display: flex; flex-direction: column; }
.site-main { flex: 1 0 auto; }

/* Events Calendar plugin views: keep them inside our width and fonts */
.tribe-common, .tribe-events { font-family: var(--font-body) !important; }
.tribe-events .tribe-events-l-container { padding-top: 24px !important; }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
	.site-nav, .nav-burger, .quicklinks, .site-footer, .jumpbar, .lightbox { display: none !important; }
}
