/*
Theme Name: Jonny
Theme URI: https://www.jonny.nu/
Author: Jonny Zetterström
Author URI: https://www.jonny.nu/
Description: Ett luftigt, redaktionellt bloggtema för jonny.nu. Stor rubrik för senaste inlägget, en lugn inläggslista, sidokolumn med presentation, ämnen och arkiv per år, och en läsvänlig artikelsida.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: jonny
Tags: blog, one-column, two-columns, right-sidebar, custom-colors, custom-menu, featured-images, threaded-comments, translation-ready, editor-style, wide-blocks
*/

/* ---------- Tokens ---------- */
:root {
	--ground: #FFFFFF;
	--surface: #F2F3F5;
	--placeholder: #ECEEF1;
	--ink: #14161A;
	--body: #23262C;
	--text-2: #3A3F48;
	--muted: #5A606B;
	--rule: #E3E5E8;
	--rule-2: #D0D4DA;
	--accent: #2340C8;
	--accent-hover: #1A309A;
	--footer-dot: #8FA4FF;

	--font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
	--font-body: "Source Serif 4", Georgia, "Times New Roman", serif;

	--wrap: 1160px;
	--measure: 760px;
	--gutter: 32px;
	--radius: 20px;
}

/* ---------- Bas ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--ground);
	color: var(--ink);
	font-family: var(--font-body);
	font-size: 18px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}
img, video, iframe { max-width: 100%; height: auto; }
a { color: var(--ink); text-decoration: none; }
a:hover, a:focus-visible { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); color: var(--ink); }

.screen-reader-text {
	border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%);
	height: 1px; width: 1px; margin: -1px; overflow: hidden; padding: 0;
	position: absolute !important; word-wrap: normal !important;
}
.screen-reader-text:focus {
	clip: auto !important; clip-path: none; height: auto; width: auto; margin: 0;
	left: 16px; top: 16px; z-index: 100000; padding: 12px 18px;
	background: var(--ink); color: #fff; border-radius: 8px; font-family: var(--font-display);
}

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

.eyebrow {
	font-family: var(--font-display);
	font-size: 14px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 1.2px;
	color: var(--muted);
	margin: 0;
}

.button {
	display: inline-flex; align-items: center; gap: 10px;
	padding: 14px 22px; border-radius: 999px; border: 0;
	background: var(--ink); color: #fff;
	font-family: var(--font-display); font-weight: 700; font-size: 16px; line-height: 1.2;
	cursor: pointer;
}
.button:hover, .button:focus-visible { background: var(--accent); color: #fff; }
.button svg { flex: none; }

.pill {
	display: inline-flex; align-items: center;
	padding: 10px 16px; border: 1px solid var(--rule-2); border-radius: 999px;
	font-family: var(--font-display); font-size: 15px; font-weight: 600; line-height: 1.2;
}
.pill:hover, .pill:focus-visible { border-color: var(--accent); }

.placeholder {
	background: var(--placeholder);
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
	color: var(--muted); font-family: var(--font-display); font-size: 15px;
}

/* ---------- Sidhuvud ---------- */
.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap {
	padding-top: 28px; padding-bottom: 28px;
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
}
.site-branding { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.site-title {
	margin: 0;
	font-family: var(--font-display); font-weight: 800; font-size: 34px; line-height: 1.1; letter-spacing: -1px;
}
.site-title a { color: var(--ink); }
.site-title .dot, .site-footer .dot { color: var(--accent); }
.site-description { margin: 0; font-family: var(--font-display); font-size: 15px; color: var(--muted); }

.main-navigation ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.main-navigation a {
	display: block; padding: 12px 14px; border-radius: 8px;
	font-family: var(--font-display); font-size: 16px; font-weight: 600; line-height: 1.2;
}
.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a,
.main-navigation .current-menu-ancestor > a { background: var(--surface); }
.main-navigation .sub-menu { display: none; }

/* ---------- Hero: senaste inlägget ---------- */
.hero {
	padding: 64px 0 72px;
	display: flex; flex-wrap: wrap; gap: 48px; align-items: center;
	border-bottom: 1px solid var(--rule);
}
.hero__text { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.hero__meta {
	display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
	font-family: var(--font-display); font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: 1.2px;
	color: var(--muted);
}
.hero__meta .label { color: var(--accent); }
.hero__title {
	margin: 0; font-weight: 800; font-size: clamp(40px, 6vw, 64px); line-height: 1.02; letter-spacing: -2px;
	overflow-wrap: anywhere; hyphens: auto;
}
.hero__excerpt { margin: 0; font-size: 21px; line-height: 1.55; color: var(--text-2); }
.hero__excerpt p { margin: 0; }
.hero .button { align-self: flex-start; margin-top: 8px; }
.hero__media {
	flex: 1 1 420px; min-width: 0; margin: 0;
	aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; background: var(--placeholder);
}
.hero__media img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Innehåll + sidokolumn ---------- */
.content-columns { display: flex; flex-wrap: wrap; gap: 64px; padding: 64px 0 80px; }
.content-columns > .primary { flex: 999 1 560px; min-width: 0; }
.content-columns > .sidebar { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 40px; }

.section-title { margin: 0 0 8px; }

/* Inläggsrad */
.post-row {
	display: flex; flex-wrap: wrap; gap: 8px 32px;
	padding: 28px 0; border-bottom: 1px solid var(--rule);
}
.post-row__date { flex: 0 0 120px; font-family: var(--font-display); font-size: 14px; color: var(--muted); padding-top: 6px; }
.post-row__body { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.post-row__title { margin: 0; font-weight: 700; font-size: 26px; line-height: 1.2; letter-spacing: -0.4px; }
.post-row__excerpt { margin: 0; font-size: 18px; line-height: 1.55; color: var(--text-2); }
.post-row__excerpt p { margin: 0; }
.post-row__cat { font-family: var(--font-display); font-size: 13px; font-weight: 600; color: var(--accent); align-self: flex-start; }

.archive-header { padding: 64px 0 0; }
.archive-header h1 { margin: 0; font-weight: 800; font-size: clamp(36px, 5vw, 56px); line-height: 1.05; letter-spacing: -1.5px; }
.archive-header .archive-description { margin-top: 12px; font-size: 20px; color: var(--text-2); max-width: 680px; }
.archive-header + .content-columns { padding-top: 32px; }

/* Paginering */
.pagination, .posts-navigation { margin-top: 32px; font-family: var(--font-display); font-weight: 700; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pagination .page-numbers {
	display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px;
	padding: 0 14px; border-radius: 999px;
}
.pagination .page-numbers.current { background: var(--ink); color: #fff; }
.pagination a.page-numbers:hover { background: var(--surface); }
.pagination .prev, .pagination .next { border: 2px solid var(--ink); }

/* Sidokolumn */
.about-card {
	background: var(--surface); border-radius: var(--radius); padding: 32px;
	display: flex; flex-direction: column; gap: 14px;
}
.about-card__photo { width: 72px; height: 72px; border-radius: 999px; object-fit: cover; display: block; }
.about-card h2 { margin: 0; font-weight: 800; font-size: 26px; line-height: 1.2; }
.about-card p { margin: 0; font-size: 17px; line-height: 1.55; color: var(--text-2); }
.about-card .more { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--accent); padding: 10px 0; align-self: flex-start; }
.about-card .more:hover { color: var(--accent-hover); }

.sidebar-section { display: flex; flex-direction: column; gap: 14px; }
.pill-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.year-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; font-family: var(--font-display); font-size: 18px; font-weight: 600; }
.year-list a { display: inline-block; padding: 8px 0; }

.widget { font-size: 17px; }
.widget-title { margin: 0 0 12px; }
.widget ul { margin: 0; padding-left: 1.1em; }

/* Sök */
.search-form { display: flex; gap: 8px; flex-wrap: wrap; }
.search-form label { flex: 1 1 200px; }
.search-field {
	width: 100%; min-height: 48px; padding: 10px 16px; border: 1px solid var(--rule-2); border-radius: 999px;
	font: inherit; font-family: var(--font-display); font-size: 16px; background: #fff; color: var(--ink);
}
.search-submit {
	min-height: 48px; padding: 12px 22px; border-radius: 999px; border: 0; background: var(--ink); color: #fff;
	font-family: var(--font-display); font-weight: 700; font-size: 16px; cursor: pointer;
}
.search-submit:hover, .search-submit:focus-visible { background: var(--accent); }
.not-found .search-form { margin: 24px 0; max-width: 520px; }

/* ---------- Artikel ---------- */
.entry-header {
	max-width: var(--measure); margin: 0 auto; padding: 72px var(--gutter) 40px;
	display: flex; flex-direction: column; gap: 22px;
}
.entry-cat {
	align-self: flex-start; padding: 6px 0;
	font-family: var(--font-display); font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; color: var(--accent);
}
.entry-title { margin: 0; font-weight: 800; font-size: clamp(38px, 6vw, 60px); line-height: 1.03; letter-spacing: -2px; overflow-wrap: anywhere; hyphens: auto; }
.entry-dek { margin: 0; font-size: 22px; line-height: 1.5; color: var(--text-2); }
.entry-dek p { margin: 0; }
.entry-byline { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding-top: 8px; font-family: var(--font-display); font-size: 15px; color: var(--muted); }
.entry-byline strong { color: var(--ink); font-weight: 700; }
.entry-byline img { border-radius: 999px; display: block; }

.entry-hero { max-width: 1096px; margin: 0 auto; padding: 0 var(--gutter); }
.entry-hero img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); display: block; }
.entry-hero figcaption, .wp-element-caption, .wp-caption-text {
	margin-top: 12px; font-family: var(--font-display); font-size: 14px; line-height: 1.45; color: var(--muted);
}

.entry-content {
	max-width: var(--measure); margin: 0 auto; padding: 56px var(--gutter) 24px;
	font-size: 20px; line-height: 1.7; color: var(--body);
}
.entry-content > * { margin-top: 0; margin-bottom: 26px; }
.entry-content > .alignwide { width: 1032px; max-width: none; margin-left: calc((100% - 1032px) / 2); margin-right: calc((100% - 1032px) / 2); }
.entry-content > .alignfull { margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); max-width: 100vw; width: 100vw; }
@media (max-width: 1100px) {
	.entry-content > .alignwide { margin-left: 0; margin-right: 0; max-width: 100%; }
}
.entry-content a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.entry-content a:hover { color: var(--accent-hover); text-decoration-thickness: 2px; }
.entry-content h2 { margin-top: 42px; font-weight: 800; font-size: 30px; line-height: 1.2; letter-spacing: -0.5px; }
.entry-content h3 { margin-top: 34px; font-weight: 700; font-size: 24px; line-height: 1.25; }
.entry-content h4 { margin-top: 28px; font-weight: 700; font-size: 20px; }
.entry-content img { border-radius: 14px; }
.entry-content figure { margin-left: 0; margin-right: 0; }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }
.entry-content li + li { margin-top: 6px; }
.entry-content hr { border: 0; border-top: 1px solid var(--rule); margin: 48px 0; }

.entry-content blockquote, .wp-block-quote {
	margin: 42px 0; padding: 0; border: 0;
	font-family: var(--font-display); font-weight: 700; font-size: 34px; line-height: 1.2; letter-spacing: -0.6px; color: var(--ink);
}
.entry-content blockquote p { margin: 0 0 12px; }
.entry-content blockquote p:first-child::before { content: "”"; color: var(--accent); }
.entry-content blockquote cite, .wp-block-quote cite {
	display: block; font-size: 15px; font-weight: 600; letter-spacing: 0; color: var(--muted); font-style: normal;
}
.wp-block-pullquote { border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); padding: 32px 0; text-align: left; }
.wp-block-pullquote blockquote { margin: 0; }

.entry-content pre, .entry-content code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85em; }
.entry-content pre { background: var(--surface); padding: 20px; border-radius: 12px; overflow-x: auto; line-height: 1.5; }
.entry-content :not(pre) > code { background: var(--surface); padding: 2px 6px; border-radius: 6px; }
.entry-content table { width: 100%; border-collapse: collapse; font-size: 17px; }
.entry-content th, .entry-content td { border-bottom: 1px solid var(--rule); padding: 10px 8px; text-align: left; }
.wp-block-table { overflow-x: auto; }

/* Galleri – kort med bildtext, som rättgalleriet i designen */
.wp-block-gallery.has-nested-images { gap: 16px; }
.wp-block-gallery.has-nested-images figure.wp-block-image img { border-radius: 14px; }
.wp-block-gallery.has-nested-images figure.wp-block-image figcaption {
	position: static; background: none; color: var(--ink); padding: 10px 0 0; margin: 0;
	font-family: var(--font-display); font-size: 15px; font-weight: 600; line-height: 1.3; text-align: left; text-shadow: none;
	max-height: none; overflow: visible;
}
.wp-block-gallery.has-nested-images figure.wp-block-image:has(figcaption)::before { display: none; }
.wp-block-gallery.has-nested-images figure.wp-block-image { flex-direction: column; }

.wp-block-image figcaption { text-align: left; }
.alignleft { float: left; margin: 6px 28px 16px 0; }
.alignright { float: right; margin: 6px 0 16px 28px; }
.aligncenter { margin-left: auto; margin-right: auto; display: block; }

.entry-footer { max-width: var(--measure); margin: 0 auto; padding: 0 var(--gutter) 72px; }
.entry-footer__inner {
	border-top: 1px solid var(--rule); padding-top: 32px;
	display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
}
.entry-footer .pill-list .pill { font-size: 14px; }
.share-button {
	display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; min-height: 44px;
	border-radius: 999px; border: 0; background: var(--surface); color: var(--ink);
	font-family: var(--font-display); font-size: 15px; font-weight: 700; cursor: pointer;
}
.share-button:hover { background: var(--rule); }

.page-links { font-family: var(--font-display); font-weight: 700; margin: 24px 0; }

/* Föregående/tillbaka */
.post-nav { background: var(--surface); }
.post-nav__inner {
	max-width: 1096px; margin: 0 auto; padding: 56px var(--gutter);
	display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px;
	font-family: var(--font-display);
}
.post-nav a { background: #fff; border-radius: 16px; padding: 28px; display: flex; flex-direction: column; gap: 10px; }
.post-nav .eyebrow { font-size: 13px; }
.post-nav__title { font-size: 24px; font-weight: 700; line-height: 1.2; }

/* ---------- Kommentarer ---------- */
.comments-area { max-width: var(--measure); margin: 0 auto; padding: 0 var(--gutter) 72px; }
.comments-title, .comment-reply-title { font-weight: 800; font-size: 28px; letter-spacing: -0.4px; margin: 0 0 24px; }
.comment-list { list-style: none; margin: 0 0 40px; padding: 0; }
.comment-list .children { list-style: none; padding-left: 28px; border-left: 2px solid var(--rule); }
.comment-body { padding: 20px 0; border-bottom: 1px solid var(--rule); font-size: 18px; }
.comment-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; font-family: var(--font-display); font-size: 14px; color: var(--muted); }
.comment-author { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; }
.comment-author img { border-radius: 999px; }
.comment-author .says { display: none; }
.comment-metadata a { color: var(--muted); }
.reply a { font-family: var(--font-display); font-weight: 700; font-size: 14px; color: var(--accent); }
.comment-form { display: flex; flex-direction: column; gap: 16px; font-family: var(--font-display); }
.comment-form label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
	width: 100%; padding: 12px 14px; border: 1px solid var(--rule-2); border-radius: 12px; font: inherit; font-size: 16px; background: #fff; color: var(--ink);
}
.comment-form textarea { min-height: 160px; }
.comment-form .submit {
	padding: 14px 22px; border-radius: 999px; border: 0; background: var(--ink); color: #fff;
	font-family: var(--font-display); font-weight: 700; font-size: 16px; cursor: pointer;
}
.comment-form .submit:hover { background: var(--accent); }
.comment-form-cookies-consent { display: flex; gap: 8px; align-items: flex-start; }
.comment-form-cookies-consent label { font-weight: 400; }

/* ---------- 404 / tomt ---------- */
.not-found { padding: 96px 0; max-width: var(--measure); }
.not-found h1 { margin: 0 0 16px; font-weight: 800; font-size: clamp(40px, 6vw, 64px); letter-spacing: -2px; line-height: 1.02; }
.not-found p { font-size: 21px; color: var(--text-2); }

/* ---------- Sidfot ---------- */
.site-footer { background: var(--ink); color: #fff; }
.site-footer .wrap {
	padding-top: 48px; padding-bottom: 48px;
	display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 24px;
	font-family: var(--font-display);
}
.site-footer .brand { display: flex; flex-direction: column; gap: 6px; }
.site-footer .brand-name { font-weight: 800; font-size: 24px; }
.site-footer .dot { color: var(--footer-dot); }
.site-footer .copyright { font-size: 14px; color: #B4B9C2; }
.social-links { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; font-size: 15px; font-weight: 600; }
.social-links a { display: inline-block; color: #fff; padding: 12px 16px; border: 1px solid #3A3F48; border-radius: 999px; }
.social-links a:hover { border-color: #fff; color: #fff; }

/* ---------- Mobil ---------- */
@media (max-width: 640px) {
	:root { --gutter: 20px; }
	body { font-size: 17px; }
	.site-header .wrap { padding-top: 16px; padding-bottom: 16px; }
	.site-title { font-size: 26px; letter-spacing: -0.8px; }
	.site-description { display: none; }
	.main-navigation a { padding: 12px 10px; }
	.hero { padding: 24px 0 40px; gap: 24px; }
	.hero__media { order: -1; border-radius: 16px; }
	.hero__title { letter-spacing: -1.2px; }
	.hero__excerpt { font-size: 18px; }
	.content-columns { padding: 40px 0 56px; gap: 48px; }
	.post-row { padding: 20px 0; }
	.post-row__date { flex-basis: 100%; padding-top: 0; }
	.post-row__title { font-size: 21px; }
	.entry-header { padding-top: 40px; }
	.entry-dek { font-size: 19px; }
	.entry-content { font-size: 18px; padding-top: 36px; }
	.entry-content blockquote { font-size: 27px; }
	.alignleft, .alignright { float: none; margin: 0 0 24px; }
}

@media print {
	.site-header nav, .sidebar, .post-nav, .comments-area, .site-footer, .share-button { display: none !important; }
	body { font-size: 12pt; }
}
