/*
 * Æskan – barnahreyfing IOGT á Íslandi
 *
 * The old site's identity, kept: the sky-to-meadow gradient, the IOGT roundel and the orange highlight.
 * Content sits on white paper in the middle of the sky; header and footer sit on the sky itself.
 */

:root {
	--sky: #96f2f5;
	--meadow: #aef59c;
	--ink: #14306b;
	--ink-soft: #46598a;
	--orange: #ff5b07;
	--orange-ink: #c43f00;
	--paper: #ffffff;
	--line: #dbe5ef;
	--wash: #f3f8fc;

	--font-display: "Baloo 2", "Trebuchet MS", sans-serif;
	--font-text: "Lexend", Verdana, sans-serif;

	--radius-sheet: 24px;
	--radius-small: 12px;
	--gutter: clamp(16px, 4vw, 40px);
}

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

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

body {
	margin: 0;
	min-height: 100vh;
	background: linear-gradient(180deg, var(--sky) 0%, var(--sky) 15%, var(--meadow) 100%) fixed;
	background-color: var(--sky);
	color: var(--ink);
	font-family: var(--font-text);
	font-size: 1.0625rem;
	line-height: 1.65;
}

strong,
b {
	font-weight: 600;
}

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

a {
	color: var(--orange-ink);
	text-decoration-thickness: 0.08em;
	text-underline-offset: 0.18em;
}

a:hover {
	color: var(--ink);
}

:focus-visible {
	outline: 3px solid var(--orange-ink);
	outline-offset: 2px;
	border-radius: 4px;
}

.skip {
	position: absolute;
	left: 16px;
	top: -100px;
	background: var(--paper);
	padding: 8px 16px;
	border-radius: var(--radius-small);
	z-index: 10;
}

.skip:focus {
	top: 16px;
}

/* Header: the roundel and the name, straight on the sky */

.masthead {
	max-width: 1120px;
	margin: 0 auto;
	padding: clamp(20px, 4vw, 40px) var(--gutter) 0;
}

.masthead-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.brand {
	display: flex;
	align-items: center;
	gap: clamp(12px, 2.5vw, 24px);
	color: var(--ink);
	text-decoration: none;
}

.brand:hover {
	color: var(--ink);
}

.brand-logo {
	width: clamp(64px, 11vw, 96px);
	height: auto;
	flex: none;
	filter: drop-shadow(0 4px 10px rgba(20, 48, 107, 0.18));
}

.brand-text {
	display: flex;
	flex-direction: column;
}

.brand-name {
	font-family: var(--font-display);
	font-weight: 800;
	font-size: clamp(2.75rem, 9vw, 4.75rem);
	line-height: 0.9;
	letter-spacing: -0.01em;
}

.brand-tagline {
	font-size: clamp(0.95rem, 2.2vw, 1.15rem);
	color: var(--ink-soft);
	margin-top: 6px;
}

.menu-toggle {
	display: none;
	font: inherit;
	font-family: var(--font-display);
	font-weight: 600;
	color: var(--ink);
	background: var(--paper);
	border: 0;
	border-radius: 999px;
	padding: 8px 18px;
	cursor: pointer;
}

.mainnav ul {
	list-style: none;
	margin: clamp(20px, 3vw, 32px) 0 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 4px 6px;
}

.mainnav a {
	display: block;
	padding: 8px clamp(10px, 1.2vw, 16px) 6px;
	border-radius: var(--radius-small) var(--radius-small) 0 0;
	font-family: var(--font-display);
	font-weight: 600;
	font-size: 1.15rem;
	color: var(--ink);
	text-decoration: none;
	border-bottom: 4px solid transparent;
}

.mainnav a:hover {
	background: rgba(255, 255, 255, 0.5);
}

.mainnav a[aria-current] {
	background: var(--paper);
	border-bottom-color: var(--orange);
}

/* The sheet: content, and the section's subpages beside it */

.sheet {
	max-width: 1120px;
	margin: 0 auto;
	background: var(--paper);
	border-radius: var(--radius-sheet);
	box-shadow: 0 18px 50px -20px rgba(20, 48, 107, 0.35);
	display: grid;
	grid-template-columns: minmax(0, 1fr) 260px;
	gap: 0 clamp(24px, 4vw, 56px);
	padding: clamp(28px, 5vw, 56px) var(--gutter);
}

.sheet:not(:has(.subnav)) {
	grid-template-columns: minmax(0, 1fr);
}

.content {
	min-width: 0;
}

@media (min-width: 900px) {
	.sheet-front .content {
		display: grid;
		grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
		grid-auto-flow: dense;
		gap: 0 clamp(32px, 5vw, 64px);
		align-items: start;
	}

	.sheet-front .content > * {
		grid-column: 1;
		max-width: none;
	}

	.sheet-front .content > .news-teaser {
		grid-column: 2;
		grid-row: 1 / span 20;
	}

	.sheet-front .block + .block {
		margin-top: 0;
	}

	.sheet-front .content > .block.text + .block.text {
		margin-top: 32px;
	}
}

.content > * {
	max-width: 68ch;
}

.page-title {
	font-family: var(--font-display);
	font-weight: 800;
	font-size: clamp(2rem, 5vw, 2.75rem);
	line-height: 1.1;
	margin: 0 0 24px;
}

.content h2 {
	font-family: var(--font-display);
	font-weight: 600;
	font-size: 1.6rem;
	line-height: 1.2;
	margin: 0 0 12px;
}

.content h3 {
	font-family: var(--font-display);
	font-weight: 600;
	font-size: 1.25rem;
	line-height: 1.25;
	margin: 0;
}

.block + .block {
	margin-top: 40px;
}

.prose p {
	margin: 0 0 1em;
}

.prose ul,
.prose ol {
	padding-left: 1.25em;
}

.prose::after {
	content: "";
	display: table;
	clear: both;
}

.prose table {
	border-collapse: collapse;
	max-width: 100%;
}

.prose td,
.prose th {
	padding: 4px 12px 4px 0;
	vertical-align: top;
}

/* Pictures placed in text, both ours (.pic) and those baked into old news by SoloWeb (.sw-image-holder) */

.pic,
.sw-image-holder {
	margin: 4px 0 16px;
}

.pic img,
.sw-image-holder img {
	display: block;
	border-radius: var(--radius-small);
	max-width: min(100%, 360px);
	height: auto;
}

.pic-left {
	float: left;
	margin-right: 24px;
}

.pic-right {
	float: right;
	margin-left: 24px;
}

/* SoloWeb sprinkled these into the middle of sentences; they read best simply in order */
.sw-image-holder {
	display: block;
	float: none;
	margin: 16px 0;
}

.pic-center {
	display: block;
	text-align: center;
}

.pic-center img {
	margin: 0 auto;
}

.pic-inline {
	display: inline-block;
	vertical-align: top;
	margin-right: 12px;
}

.pic-inline img {
	max-width: min(100%, 220px);
}

.pic figcaption {
	font-size: 0.9rem;
	color: var(--ink-soft);
	margin-top: 6px;
}

.block.image img {
	display: block;
	border-radius: var(--radius-small);
}

.block.media iframe,
.block.media object,
.block.media embed {
	display: block;
	width: 100%;
	max-width: 640px;
	height: auto;
	aspect-ratio: 16 / 9;
	border: 0;
	border-radius: var(--radius-small);
}

.child-list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	gap: 8px;
}

.child-list a {
	font-family: var(--font-display);
	font-weight: 600;
	font-size: 1.25rem;
}

/* News */

.news-list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	gap: 28px;
}

.news-entry {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 16px;
}

.news-entry:has(.news-thumb) {
	grid-template-columns: 112px minmax(0, 1fr);
}

.news-thumb img {
	display: block;
	width: 112px;
	height: 112px;
	object-fit: cover;
	border-radius: var(--radius-small);
}

.news-body time,
.dateline {
	display: block;
	font-size: 0.95rem;
	color: var(--ink-soft);
}

.news-body h3 a {
	color: var(--ink);
	text-decoration: none;
}

.news-body h3 a:hover {
	text-decoration: underline;
	text-decoration-color: var(--orange);
}

.news-excerpt {
	margin-top: 6px;
}

.news-excerpt p {
	margin: 0;
}

.news-teaser {
	background: var(--wash);
	border-radius: var(--radius-small);
	padding: 24px;
}

.more {
	margin: 20px 0 0;
	font-weight: 700;
}

.news-item .back {
	margin: 0 0 8px;
	font-weight: 700;
}

.news-item .page-title {
	margin-bottom: 8px;
}

.news-item .dateline {
	margin-bottom: 24px;
}

.lead-picture {
	margin: 0 0 24px;
}

.lead-picture img {
	display: block;
	border-radius: var(--radius-small);
	max-height: 400px;
	width: auto;
}

/* Subpages of the current section */

.subnav {
	border-left: 1px solid var(--line);
	padding-left: clamp(20px, 3vw, 32px);
	align-self: start;
}

.subnav-title {
	display: block;
	font-family: var(--font-display);
	font-weight: 600;
	font-size: 1.3rem;
	color: var(--ink);
	text-decoration: none;
	margin-bottom: 8px;
}

.subnav ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.subnav li a {
	display: block;
	padding: 6px 0 6px 14px;
	color: var(--ink);
	text-decoration: none;
	border-left: 4px solid transparent;
	margin-left: -18px;
}

.subnav li.sub-2 a {
	padding-left: 30px;
	font-size: 1rem;
}

.subnav li a:hover {
	color: var(--orange-ink);
}

.subnav li a[aria-current] {
	border-left-color: var(--orange);
	font-weight: 700;
}

/* Footer: partners and contact, on the meadow */

.sitefoot {
	max-width: 1120px;
	margin: 0 auto;
	padding: 40px var(--gutter) 48px;
}

.partners h2 {
	font-family: var(--font-display);
	font-weight: 600;
	font-size: 1.25rem;
	margin: 0 0 12px;
}

.partners ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.partners li {
	flex: 1 1 120px;
	max-width: 150px;
}

.partners a {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 88px;
	padding: 12px;
	background: var(--paper);
	border-radius: var(--radius-small);
}

.partners a:hover {
	box-shadow: 0 0 0 3px var(--orange);
}

.partners img {
	max-height: 64px;
	width: auto;
	object-fit: contain;
}

.contact {
	margin-top: 28px;
	font-size: 1rem;
}

.contact p {
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 0;
}

.contact .sep {
	display: inline-block;
	width: 1px;
	height: 1em;
	background: rgba(20, 48, 107, 0.35);
	margin: 0 12px;
}

/* Narrow screens */

@media (max-width: 760px) {

	.menu-toggle {
		display: block;
	}

	.mainnav {
		display: none;
	}

	.mainnav.is-open {
		display: block;
	}

	.mainnav ul {
		flex-direction: column;
		margin-top: 16px;
		gap: 2px;
	}

	.mainnav a {
		border-radius: var(--radius-small);
		border-bottom: 0;
		border-left: 4px solid transparent;
	}

	.mainnav a[aria-current] {
		border-left-color: var(--orange);
	}

	.sheet {
		grid-template-columns: minmax(0, 1fr);
		border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
		margin-top: 20px;
	}

	.subnav {
		border-left: 0;
		border-top: 1px solid var(--line);
		padding: 24px 0 0;
		margin-top: 40px;
	}

	.pic-left,
	.pic-right {
		float: none;
		margin: 4px 0 16px;
	}

	.news-entry:has(.news-thumb) {
		grid-template-columns: 80px minmax(0, 1fr);
	}

	.news-thumb img {
		width: 80px;
		height: 80px;
	}

	.news-teaser {
		padding: 20px 16px;
	}
}

@media (min-width: 761px) {
	.masthead-inner {
		justify-content: flex-start;
	}
}
