/*
Theme Name: Skylight
Theme URI: https://inuweb.no
Author: Oyvind Nilsen
Author URI: https://inuweb.no
Description: A modern, minimal and very fast light-blue blog theme. No images, no web fonts, no jQuery — a single small stylesheet and about a kilobyte of JavaScript for the mobile menu. Sticky posts are pinned to the top of the front page as a featured card.
Version: 1.4.1
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: skylight
Tags: blog, one-column, custom-menu, featured-images, sticky-post, translation-ready, accessibility-ready
*/

/* ==========================================================================
   1. Design tokens
   ========================================================================== */

:root {
	/* The page itself carries the light blue. */
	--sl-page-bg:       #e8f2fb;
	/* The top bar sits a step darker and bluer than the page. */
	--sl-bar-bg:        #c4dff7;
	--sl-bar-border:    #a8cdee;
	/* The footer is neutral grey rather than blue. */
	--sl-footer-bg:     #ebebeb;
	--sl-footer-border: #d9d9d9;
	/* Cards and code blocks lift off the blue by going white. */
	--sl-featured-bg:   #ffffff;
	--sl-accent:        #1f6fb2;
	--sl-accent-hover:  #14548a;
	--sl-accent-soft:   #d7e9f8;
	/* Facebook's own brand blue, for the share button. */
	--sl-facebook:      #1877f2;
	--sl-facebook-hover:#0c63d4;
	--sl-ink:           #16202b;
	--sl-ink-soft:      #33465a;
	--sl-muted:         #56687a;
	--sl-border:        #cddfee;
	--sl-radius:        10px;
	--sl-wrap:          820px;
	--sl-bar-h:         58px;
	--sl-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
	--sl-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ==========================================================================
   2. Reset & base
   ========================================================================== */

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

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

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
	}
}

body {
	margin: 0;
	background: var(--sl-page-bg);
	color: var(--sl-ink);
	font-family: var(--sl-font);
	font-size: 17px;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

img, svg, video, iframe { max-width: 100%; height: auto; }
img { display: block; }

a { color: var(--sl-accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover, a:focus { color: var(--sl-accent-hover); }

:focus-visible {
	outline: 2px solid var(--sl-accent);
	outline-offset: 2px;
	border-radius: 3px;
}

h1, h2, h3, h4 {
	line-height: 1.25;
	letter-spacing: -0.015em;
	margin: 0 0 0.5em;
	color: var(--sl-ink);
	font-weight: 700;
}

p, ul, ol, blockquote, pre, table, figure { margin: 0 0 1.15em; }

code, kbd, pre { font-family: var(--sl-mono); font-size: 0.9em; }

pre {
	background: var(--sl-featured-bg);
	border: 1px solid var(--sl-border);
	border-radius: var(--sl-radius);
	padding: 16px;
	overflow-x: auto;
}

blockquote {
	border-left: 3px solid var(--sl-bar-border);
	margin-left: 0;
	padding: 2px 0 2px 18px;
	color: var(--sl-ink-soft);
}

table { border-collapse: collapse; width: 100%; }
th, td { border: 1px solid var(--sl-border); padding: 8px 10px; text-align: left; }

hr { border: 0; border-top: 1px solid var(--sl-border); margin: 2em 0; }

/* ==========================================================================
   3. Layout helpers
   ========================================================================== */

.sl-wrap {
	width: 100%;
	max-width: var(--sl-wrap);
	margin-inline: auto;
	padding-inline: 20px;
}

.sl-skip {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 999;
	background: var(--sl-accent);
	color: #fff;
	padding: 10px 16px;
	border-radius: 0 0 var(--sl-radius) 0;
	text-decoration: none;
}
.sl-skip:focus {
	left: 0;
	color: #fff;
}

.screen-reader-text {
	border: 0;
	clip-path: inset(50%);
	height: 1px;
	width: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	white-space: nowrap;
}

/* ==========================================================================
   4. Top bar
   ========================================================================== */

.sl-bar {
	background: var(--sl-bar-bg);
	border-bottom: 1px solid var(--sl-bar-border);
	position: sticky;
	top: 0;
	z-index: 100;
}

.sl-bar-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: var(--sl-bar-h);
	/* Lets the bar grow to fit the larger site name instead of clipping it. */
	padding-block: 10px;
}

.sl-site-name {
	margin: 0;
	font-size: 2.125rem;
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.2;
}
.sl-site-name a {
	color: var(--sl-ink);
	text-decoration: none;
}
.sl-site-name a:hover,
.sl-site-name a:focus { color: var(--sl-accent); }

.sl-nav ul {
	list-style: none;
	display: flex;
	align-items: center;
	gap: 4px;
	margin: 0;
	padding: 0;
}

.sl-nav a {
	display: block;
	padding: 7px 11px;
	border-radius: 7px;
	color: var(--sl-ink-soft);
	font-size: 0.9375rem;
	font-weight: 500;
	text-decoration: none;
	transition: background-color 0.15s ease, color 0.15s ease;
}
.sl-nav a:hover,
.sl-nav a:focus { background: rgba(255, 255, 255, 0.75); color: var(--sl-accent); }

.sl-nav .current-menu-item > a,
.sl-nav .current_page_item > a {
	background: #fff;
	color: var(--sl-accent);
}

/* Hamburger — hidden on laptop/desktop */
.sl-toggle {
	display: none;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	background: transparent;
	border: 1px solid var(--sl-bar-border);
	border-radius: 8px;
	cursor: pointer;
	color: var(--sl-ink);
}
.sl-toggle:hover { background: rgba(255, 255, 255, 0.75); }
.sl-toggle-bars,
.sl-toggle-bars::before,
.sl-toggle-bars::after {
	display: block;
	width: 17px;
	height: 2px;
	background: currentColor;
	border-radius: 2px;
	transition: transform 0.18s ease, opacity 0.18s ease;
}
.sl-toggle-bars { position: relative; }
.sl-toggle-bars::before,
.sl-toggle-bars::after { content: ""; position: absolute; left: 0; }
.sl-toggle-bars::before { top: -5px; }
.sl-toggle-bars::after  { top: 5px; }

.sl-toggle[aria-expanded="true"] .sl-toggle-bars { background: transparent; }
.sl-toggle[aria-expanded="true"] .sl-toggle-bars::before { transform: translateY(5px) rotate(45deg); }
.sl-toggle[aria-expanded="true"] .sl-toggle-bars::after  { transform: translateY(-5px) rotate(-45deg); }

@media (max-width: 720px) {
	.sl-toggle { display: flex; }

	.sl-nav {
		display: none;
		position: absolute;
		left: 0;
		right: 0;
		top: 100%;
		background: var(--sl-bar-bg);
		border-bottom: 1px solid var(--sl-bar-border);
		padding: 6px 20px 14px;
	}
	.sl-nav.is-open { display: block; }

	.sl-nav ul { flex-direction: column; align-items: stretch; gap: 2px; }
	.sl-nav a { padding: 11px 12px; font-size: 1rem; }
}

/* ==========================================================================
   5. Post list (front page / archives)
   ========================================================================== */

.sl-main { padding-block: 40px 56px; }

.sl-archive-head { margin-bottom: 28px; }
.sl-archive-title { font-size: 1.5rem; margin-bottom: 6px; }
.sl-archive-desc { color: var(--sl-muted); margin: 0; }

.sl-pill {
	display: inline-block;
	background: var(--sl-accent-soft);
	color: var(--sl-accent-hover);
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	padding: 4px 9px;
	border-radius: 999px;
	margin-bottom: 12px;
}

.sl-meta {
	color: var(--sl-muted);
	font-size: 0.875rem;
	font-style: italic;
	margin: 0 0 14px;
}
/* Upright so the rule stays vertical next to the italic text. */
.sl-meta .sl-sep {
	margin-inline: 9px;
	opacity: 0.45;
	font-style: normal;
}
/* Small blue author glyph before the writer's name. */
.sl-meta-icon {
	display: inline-block;
	vertical-align: -2px;
	margin-right: 6px;
	color: var(--sl-accent);
}

.sl-thumb {
	display: block;
	margin-bottom: 16px;
	border-radius: var(--sl-radius);
	overflow: hidden;
	border: 1px solid var(--sl-border);
}
.sl-thumb img { width: 100%; }

/* Featured card */
.sl-featured {
	background: var(--sl-featured-bg);
	border: 1px solid var(--sl-border);
	border-radius: var(--sl-radius);
	padding: 30px 30px 26px;
	margin-bottom: 34px;
}
.sl-featured .sl-entry-title { font-size: 1.75rem; }

/* Regular card */
.sl-card {
	padding-bottom: 30px;
	margin-bottom: 30px;
	border-bottom: 1px solid var(--sl-border);
}
.sl-card:last-of-type { border-bottom: 0; margin-bottom: 0; }

.sl-entry-title {
	font-size: 1.3125rem;
	margin-bottom: 8px;
}
.sl-entry-title a { color: var(--sl-ink); text-decoration: none; }
.sl-entry-title a:hover,
.sl-entry-title a:focus { color: var(--sl-accent); }

.sl-excerpt { color: var(--sl-ink-soft); margin-bottom: 14px; }
.sl-excerpt > :last-child { margin-bottom: 0; }

.sl-more {
	display: inline-flex;
	align-items: center;
	padding: 9px 17px;
	border-radius: 8px;
	background: var(--sl-accent);
	color: #fff;
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
	transition: background-color 0.15s ease;
}
.sl-more:hover, .sl-more:focus {
	background: var(--sl-accent-hover);
	color: #fff;
	text-decoration: none;
}

/* ==========================================================================
   5b. Share button (single posts)
   ========================================================================== */

.sl-share { margin: 0 0 22px; }

.sl-share-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 9px 16px;
	border: 0;
	border-radius: 8px;
	background: var(--sl-facebook);
	color: #fff;
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
	transition: background-color 0.15s ease;
}
.sl-share-btn:hover,
.sl-share-btn:focus {
	background: var(--sl-facebook-hover);
	color: #fff;
	text-decoration: none;
}
.sl-share-icon { flex: 0 0 auto; display: block; }

/* ==========================================================================
   6. Single post & pages
   ========================================================================== */

.sl-single { padding-block: 44px 56px; }

.sl-single-title {
	font-size: 2rem;
	margin-bottom: 12px;
}

.sl-content > :first-child { margin-top: 0; }
.sl-content > :last-child { margin-bottom: 0; }
.sl-content h2 { font-size: 1.5rem; margin-top: 1.6em; }
.sl-content h3 { font-size: 1.25rem; margin-top: 1.5em; }
.sl-content ul, .sl-content ol { padding-left: 1.4em; }
.sl-content li { margin-bottom: 0.35em; }
.sl-content img { border-radius: var(--sl-radius); }

.sl-content .wp-block-image,
.sl-content figure { margin-inline: 0; }

.sl-page-links { margin-top: 1.5em; font-size: 0.9375rem; color: var(--sl-muted); }

/* Prev / next */
.sl-postnav {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	justify-content: space-between;
	margin-top: 44px;
	padding-top: 26px;
	border-top: 1px solid var(--sl-border);
	font-size: 0.9375rem;
}
.sl-postnav a { text-decoration: none; font-weight: 600; }
.sl-postnav a:hover, .sl-postnav a:focus { text-decoration: underline; }
.sl-postnav-label { display: block; color: var(--sl-muted); font-weight: 400; font-size: 0.8125rem; }
.sl-postnav .sl-next { text-align: right; margin-left: auto; }

/* ==========================================================================
   7. Pagination
   ========================================================================== */

.sl-main .pagination,
.sl-main .navigation.pagination {
	margin-top: 40px;
	padding-top: 26px;
	border-top: 1px solid var(--sl-border);
}
.nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
}
.nav-links .page-numbers {
	display: inline-block;
	min-width: 38px;
	padding: 7px 11px;
	text-align: center;
	border: 1px solid var(--sl-border);
	border-radius: 8px;
	text-decoration: none;
	font-size: 0.9375rem;
	color: var(--sl-ink-soft);
}
.nav-links .page-numbers:hover,
.nav-links .page-numbers:focus { background: var(--sl-featured-bg); color: var(--sl-accent); }
.nav-links .page-numbers.current {
	background: var(--sl-accent);
	border-color: var(--sl-accent);
	color: #fff;
	font-weight: 600;
}
.nav-links .page-numbers.dots { border-color: transparent; }

/* ==========================================================================
   8. Search form & 404
   ========================================================================== */

.sl-searchform {
	display: flex;
	gap: 8px;
	max-width: 420px;
	margin-top: 18px;
}
.sl-searchform input[type="search"] {
	flex: 1 1 auto;
	min-width: 0;
	font: inherit;
	font-size: 1rem;
	padding: 9px 12px;
	border: 1px solid var(--sl-border);
	border-radius: 8px;
	background: #fff;
	color: var(--sl-ink);
}
.sl-searchform input[type="search"]:focus { border-color: var(--sl-accent); }
.sl-searchform button {
	font: inherit;
	font-size: 0.9375rem;
	font-weight: 600;
	padding: 9px 16px;
	border: 0;
	border-radius: 8px;
	background: var(--sl-accent);
	color: #fff;
	cursor: pointer;
}
.sl-searchform button:hover { background: var(--sl-accent-hover); }

.sl-empty { color: var(--sl-ink-soft); }

/* ==========================================================================
   9. Footer
   ========================================================================== */

.sl-footer {
	border-top: 1px solid var(--sl-footer-border);
	background: var(--sl-footer-bg);
	padding-block: 10px;
	margin-top: auto;
}
.sl-footer-inner {
	display: flex;
	flex-wrap: wrap;
	gap: 0 10px;
	align-items: baseline;
	justify-content: center;
	text-align: center;
	color: var(--sl-muted);
	font-size: 0.875rem;
	line-height: 1.5;
}
.sl-footer-inner p { margin: 0; }

.sl-footer-sep { opacity: 0.5; }

.sl-footer-link {
	color: var(--sl-accent-hover);
	font-weight: 600;
	text-decoration: none;
}
.sl-footer-link:hover,
.sl-footer-link:focus { text-decoration: underline; }

/* Sticky footer on short pages */
body { min-height: 100vh; display: flex; flex-direction: column; }
.sl-bar, .sl-footer { flex: 0 0 auto; }
.sl-site-main { flex: 1 0 auto; }

/* ==========================================================================
   10. WordPress core alignment / caption classes
   ========================================================================== */

.alignleft  { float: left;  margin: 0.4em 1.4em 1em 0; }
.alignright { float: right; margin: 0.4em 0 1em 1.4em; }
.aligncenter { display: block; margin-inline: auto; }
.alignwide, .alignfull { max-width: 100%; }

.wp-caption { max-width: 100%; }
.wp-caption-text,
.wp-element-caption,
figcaption {
	font-size: 0.8125rem;
	color: var(--sl-muted);
	text-align: center;
	margin-top: 8px;
}

.sticky, .gallery-caption, .bypostauthor { /* required by the theme review guidelines */ }

/* ==========================================================================
   11. Small screens
   ========================================================================== */

@media (max-width: 600px) {
	body { font-size: 16px; }
	/* Slightly reduced so a longer site name does not wrap next to the
	   hamburger button. Delete this line to keep it at full size. */
	.sl-site-name { font-size: 1.75rem; }
	.sl-main { padding-block: 30px 44px; }
	.sl-single { padding-block: 32px 44px; }
	.sl-single-title { font-size: 1.625rem; }
	.sl-featured { padding: 22px 20px 20px; }
	.sl-featured .sl-entry-title { font-size: 1.4375rem; }
	.sl-entry-title { font-size: 1.1875rem; }
}

/* ==========================================================================
   12. Print
   ========================================================================== */

@media print {
	.sl-bar, .sl-footer, .sl-postnav, .sl-more, .navigation { display: none !important; }
	body { font-size: 12pt; }
	a { text-decoration: underline; }
}
