/*
Theme Name: Julmarknader
Description: Julmarknader i Sverige – vilka julmarknader är öppna i helgen? Lätt tema utan jQuery, med självhostade typsnitt.
Version: 1.1.7
Requires at least: 6.4
Requires PHP: 8.0
Text Domain: julmarknader
*/

@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 800; font-display: swap; src: url(assets/fonts/fraunces-800.woff2) format('woff2'); }
@font-face { font-family: 'Karla'; font-style: normal; font-weight: 200 800; font-display: swap; src: url(assets/fonts/karla-var.woff2) format('woff2'); }

:root {
	--wine: #5b1a24;
	--wine-dark: #45121b;
	--berry: #a8323f;
	--gold: #f2b84b;
	--cream: #fbe9c8;
	--paper: #fbf7f2;
	--sand: #efe4d8;
	--chip: #f6ebdc;
	--chip-ink: #6b4a2a;
	--ink: #2a1d1a;
	--muted: #5c4a44;
	--line: #d9c6b4;
	--pine: #1e4634;
	--pine-soft: #e3eee6;
	--flake: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23fff' stroke-opacity='.16' stroke-width='1.2' stroke-linecap='round'%3E%3Cg transform='translate(28 30)'%3E%3Cpath d='M0-9V9M-7.8-4.5L7.8 4.5M-7.8 4.5L7.8-4.5'/%3E%3C/g%3E%3Cg transform='translate(88 82) scale(.7)'%3E%3Cpath d='M0-9V9M-7.8-4.5L7.8 4.5M-7.8 4.5L7.8-4.5'/%3E%3C/g%3E%3C/g%3E%3Cg fill='%23fff' fill-opacity='.22'%3E%3Ccircle cx='80' cy='20' r='1.6'/%3E%3Ccircle cx='18' cy='92' r='1.3'/%3E%3Ccircle cx='58' cy='60' r='1'/%3E%3C/g%3E%3C/svg%3E");
	--shadow: 0 1px 3px rgba(91, 26, 36, .12);
	--display: 'Fraunces', Georgia, serif;
	--body: 'Karla', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper) radial-gradient(circle at 1px 1px, rgba(168, 50, 63, .07) 1px, transparent 1.5px) 0 0 / 22px 22px; color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.55; }
img { max-width: 100%; height: auto; }
a { color: #7a1f2b; }
a:hover { color: var(--wine-dark); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.jm-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.jm-skip { position: absolute; left: 12px; top: -60px; background: #fff; color: var(--ink); padding: 10px 16px; border-radius: 8px; z-index: 10; }
.jm-skip:focus { top: 12px; }
.jm-wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 700px) { .jm-wrap { padding: 0 24px; } }
.jm-narrow { max-width: 920px; }
.jm-stack { display: flex; flex-direction: column; gap: 24px; }
.jm-main { padding: 32px 0 72px; }
.jm-muted { color: var(--muted); font-size: 15px; margin: 0; }

/* Header */
.jm-header { position: relative; background: var(--flake) 0 0 / 120px 120px, linear-gradient(180deg, var(--wine-dark), var(--wine)); color: var(--cream); padding-bottom: 6px; }
/* String of Christmas lights under the menu */
.jm-header::after { content: ''; position: absolute; left: 0; right: 0; bottom: -14px; height: 22px; z-index: 1; pointer-events: none;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='22' viewBox='0 0 120 22'%3E%3Cpath d='M0 3Q30 13 60 3T120 3' fill='none' stroke='%232a1a14' stroke-width='1.5'/%3E%3Cg%3E%3Crect x='13' y='8' width='3' height='3' fill='%23333'/%3E%3Cellipse cx='14.5' cy='15' rx='3.6' ry='5' fill='%23f2b84b'/%3E%3Crect x='43' y='8' width='3' height='3' fill='%23333'/%3E%3Cellipse cx='44.5' cy='15' rx='3.6' ry='5' fill='%23e04a4a'/%3E%3Crect x='73' y='8' width='3' height='3' fill='%23333'/%3E%3Cellipse cx='74.5' cy='15' rx='3.6' ry='5' fill='%237fd1a0'/%3E%3Crect x='103' y='8' width='3' height='3' fill='%23333'/%3E%3Cellipse cx='104.5' cy='15' rx='3.6' ry='5' fill='%23fff1c4'/%3E%3C/g%3E%3C/svg%3E") repeat-x 0 0 / 120px 22px; }
.jm-header__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-top: 16px; padding-bottom: 6px; }
.jm-logo { display: flex; align-items: center; gap: 10px; color: var(--cream); text-decoration: none; min-height: 44px; }
.jm-logo:hover { color: var(--cream); }
/* The logo has dark text, so it sits on a cream badge against the wine header */
.jm-logo__img { display: block; width: auto; height: 52px; max-width: 100%; background: var(--cream); border-radius: 12px; padding: 4px 12px; box-shadow: 0 0 0 2px rgba(242, 184, 75, .55), 0 4px 14px rgba(0, 0, 0, .25); }
@media (min-width: 700px) { .jm-logo__img { height: 64px; padding: 6px 16px; } }
.jm-search { display: flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(251, 233, 200, .35); border-radius: 999px; padding: 0 16px; min-height: 44px; color: #e8cfa8; flex: 0 1 320px; }
.jm-search input { background: transparent; border: 0; color: #fff; font: inherit; font-size: 15px; width: 100%; min-height: 42px; outline: none; }
.jm-search input::placeholder { color: #e8cfa8; }
.jm-search:focus-within { border-color: var(--gold); }
.jm-nav { display: flex; gap: 2px 20px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.jm-nav a { color: #e8cfa8; text-decoration: none; font-weight: 800; font-size: 15px; padding: 10px 0; white-space: nowrap; }
.jm-nav a:hover { color: #fff; }

/* Type */
.jm-display { font-family: var(--display); font-weight: 800; font-size: clamp(32px, 6vw, 50px); line-height: 1.04; margin: 0; color: var(--wine); letter-spacing: -.5px; }
.jm-h2 { font-family: var(--display); font-weight: 800; font-size: 28px; margin: 0; color: var(--wine); }
.jm-h2::before { content: '✦'; color: var(--gold); margin-right: 10px; font-size: .8em; vertical-align: .08em; }
.jm-kicker { margin: 0; font-size: 13px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; color: var(--berry); }
.jm-kicker::before { content: '✦ '; color: var(--gold); }
.jm-lead { margin: 0; font-size: 18px; color: var(--muted); max-width: 660px; }
.jm-lead p { margin: 0; }
/* Hero: illustrated Christmas market at dusk; text over the sky on wide screens, above it on phones */
.jm-hero { position: relative; display: flex; flex-direction: column-reverse; border-radius: 24px; overflow: hidden; background: #141a38; box-shadow: 0 12px 30px rgba(20, 26, 56, .25); margin-top: 8px; }
.jm-hero__art { display: block; width: 100%; height: auto; aspect-ratio: 2048 / 768; object-fit: cover; object-position: 75% 100%; min-height: 200px; }
.jm-hero__text { display: flex; flex-direction: column; gap: 10px; padding: 26px 22px 6px; }
.jm-hero .jm-display { color: #fff6e6; text-shadow: 0 2px 12px rgba(0, 0, 0, .35); }
.jm-hero .jm-kicker { color: var(--gold); }
.jm-hero .jm-lead { color: #e9dcc8; }
@media (min-width: 860px) {
	.jm-hero { display: block; }
	.jm-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(14, 18, 44, .72) 0%, rgba(14, 18, 44, .45) 38%, rgba(14, 18, 44, 0) 62%); pointer-events: none; }
	.jm-hero__text { z-index: 1; }
	.jm-hero__text { position: absolute; top: 0; left: 0; max-width: 660px; padding: 40px 44px; }
	.jm-hero .jm-display { font-size: clamp(38px, 4.2vw, 48px); }
	.jm-hero .jm-lead { max-width: 440px; }
}

/* Guide panel */
.jm-panel { display: flex; flex-direction: column; gap: 14px; background: #fff; border-radius: 18px; padding: 18px; box-shadow: var(--shadow); border-top: 4px solid var(--pine); }
.jm-weekends { display: flex; flex-wrap: wrap; gap: 8px; }
.jm-weekend { min-height: 56px; padding: 8px 16px; border-radius: 14px; text-align: left; font: inherit; cursor: pointer; background: #fff; color: var(--ink); border: 1px solid var(--line); }
.jm-weekend:hover { border-color: var(--wine); }
.jm-weekend[aria-pressed="true"] { background: var(--wine); color: var(--cream); border-color: var(--wine); box-shadow: inset 0 -3px 0 var(--gold); }
.jm-weekend__label { display: block; font-weight: 800; font-size: 15px; }
.jm-weekend__sub { display: block; font-size: 13px; }
.jm-panel__row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.jm-panel__label { font-weight: 800; font-size: 14px; }
.jm-select { min-height: 44px; border-radius: 10px; border: 1px solid var(--line); padding: 0 12px; font: inherit; background: #fff; color: var(--ink); }
.jm-count { font-size: 14px; color: var(--muted); }
.jm-empty { margin: 0; padding: 20px; background: #fff; border-radius: 14px; color: var(--muted); }
.jm-more { align-self: center; min-height: 48px; padding: 0 28px; border-radius: 999px; border: 2px solid var(--wine); background: #fff; color: var(--wine); font: inherit; font-weight: 800; cursor: pointer; }
.jm-more:hover { background: var(--wine); color: var(--cream); }
.jm-more--link { display: inline-flex; align-items: center; text-decoration: none; }

/* Cards */
.jm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; }
.jm-grid--small { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.jm-card { display: flex; flex-direction: column; background: #fff; border-radius: 18px; overflow: hidden; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease; }
.jm-card:hover { color: var(--ink); transform: translateY(-2px); box-shadow: 0 0 0 2px var(--gold), 0 10px 22px rgba(91, 26, 36, .16); }
.jm-card__media { position: relative; height: 170px; display: block; background-color: var(--sand); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 24 24' fill='none' stroke='%23d9c6b4' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10l9-6 9 6'/%3E%3Cpath d='M5 10v10h14V10'/%3E%3Cpath d='M9 20v-5h6v5'/%3E%3Cpath d='M3 10h18'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: center; }
.jm-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.jm-datebadge { position: absolute; left: 14px; bottom: -22px; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 14px; background: var(--wine); color: var(--cream); border: 2px solid var(--gold); box-shadow: 0 6px 14px rgba(0, 0, 0, .2); }
.jm-datebadge--old { background: #8a7a72; }
.jm-datebadge__day { font-family: var(--display); font-size: 24px; font-weight: 800; line-height: 1; }
.jm-datebadge__mon { font-size: 12px; font-weight: 800; text-transform: uppercase; color: var(--gold); }
.jm-datebadge--old .jm-datebadge__mon { color: #fff; }
.jm-card__body { padding: 32px 18px 18px; display: flex; flex-direction: column; gap: 6px; }
.jm-card__title { font-family: var(--display); font-size: 21px; font-weight: 800; line-height: 1.2; color: var(--wine); }
.jm-card__place { font-size: 14px; color: var(--muted); }
.jm-card__when { font-size: 14px; font-weight: 600; }
.jm-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 0; }
.jm-chip { font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 999px; background: var(--pine-soft); color: var(--pine); text-decoration: none; }
a.jm-chip { font-size: 14px; padding: 8px 14px; }
a.jm-chip:hover { background: var(--wine); color: var(--cream); }

/* Fair page */
.jm-back { align-self: flex-start; display: inline-flex; align-items: center; min-height: 44px; font-weight: 800; text-decoration: none; }
.jm-fair__figure { margin: 0; }
.jm-fair__image { width: 100%; max-height: 380px; object-fit: cover; border-radius: 20px; display: block; }
.jm-fair__image--mood { max-height: 220px; }
.jm-fair__figure figcaption { font-size: 13px; color: var(--muted); margin-top: 6px; }
.jm-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.jm-fact { background: #fff; border-radius: 14px; padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; }
.jm-fact span { font-size: 12px; font-weight: 800; text-transform: uppercase; color: var(--berry); }
.jm-fact strong { font-size: 18px; }
.jm-fact em { font-style: normal; font-size: 14px; color: var(--muted); }
.jm-fact--dark { background: var(--wine); color: var(--cream); }
.jm-fact--dark span { color: var(--gold); }
.jm-fact--dark em { color: var(--cream); }
.jm-fair__text { margin: 0; font-size: 18px; line-height: 1.65; }
.jm-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.jm-btn { display: inline-flex; align-items: center; min-height: 48px; padding: 0 22px; border-radius: 999px; background: var(--wine); color: var(--cream); font-weight: 800; text-decoration: none; border: 2px solid var(--wine); }
.jm-btn:hover { background: var(--wine-dark); color: var(--cream); }
.jm-btn--ghost { background: #fff; color: var(--wine); }
.jm-btn--ghost:hover { background: var(--wine); color: var(--cream); }

/* Articles, regions, archives */
.jm-card-box { background: #fff; border-radius: 20px; box-shadow: var(--shadow); }
.jm-prose { padding: 28px; }
.jm-prose > :first-child { margin-top: 0; }
.jm-prose h1, .jm-prose h2, .jm-prose h3 { font-family: var(--display); color: var(--wine); line-height: 1.15; }
.jm-prose img { border-radius: 12px; }
.jm-prose .alignright { float: right; max-width: 45%; margin: 4px 0 16px 24px; }
.jm-prose .alignleft { float: left; max-width: 45%; margin: 4px 24px 16px 0; }
.jm-prose .aligncenter { display: block; margin: 0 auto 16px; }
.jm-prose::after { content: ''; display: block; clear: both; }
.jm-prose table { width: 100%; border-collapse: collapse; margin: 0 0 1.2em; font-size: 16px; }
.jm-prose th, .jm-prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.jm-prose thead th { background: var(--pine); color: #fff; }
.jm-prose tbody tr:nth-child(even) { background: var(--pine-soft); }
.jm-prose blockquote { margin: 1.4em 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--gold); font-family: var(--display); font-size: 21px; line-height: 1.35; color: var(--wine); }
.jm-prose blockquote p { margin: 0; }
@media (max-width: 560px) { .jm-prose .alignright, .jm-prose .alignleft { float: none; max-width: 100%; margin: 0 0 16px; } }
.jm-articles { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.jm-article { display: flex; gap: 14px; align-items: flex-start; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--ink); }
.jm-article:hover { color: var(--ink); border-color: var(--pine); box-shadow: 0 6px 16px rgba(30, 70, 52, .12); }
.jm-article__thumb { flex: 0 0 76px; height: 76px; border-radius: 10px; overflow: hidden; background: var(--pine) var(--flake) 0 0 / 60px 60px; display: grid; place-items: center; }
.jm-article__thumb:empty::before { content: '✦'; color: var(--gold); font-size: 28px; }
.jm-article__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.jm-article__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.jm-article__title { font-family: var(--display); font-weight: 800; font-size: 17px; line-height: 1.2; color: var(--pine); }
.jm-article__text { font-size: 14px; color: var(--muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.jm-article__more { font-weight: 800; color: var(--berry); font-size: 13px; }
.jm-archive-head { display: flex; flex-direction: column; gap: 8px; }
.jm-regions { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.jm-region { display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: 14px; background: #fff; box-shadow: var(--shadow); text-decoration: none; color: var(--ink); min-height: 44px; }
.jm-region:hover { color: var(--ink); box-shadow: 0 10px 22px rgba(91, 26, 36, .16); }
.jm-region__name { font-family: var(--display); font-weight: 800; font-size: 22px; color: var(--wine); }
.jm-region__count { font-size: 14px; color: var(--muted); }
.jm-region__count strong { color: var(--berry); font-size: 18px; }
.jm-region__bar { display: block; height: 4px; background: var(--sand); border-radius: 4px; }
.jm-region__bar span { display: block; height: 4px; background: var(--gold); border-radius: 4px; }
.jm-pager { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.jm-pager .page-numbers { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0 12px; border-radius: 999px; background: #fff; color: var(--wine); text-decoration: none; font-weight: 800; box-shadow: var(--shadow); }
.jm-pager .current { background: var(--wine); color: var(--cream); }

/* Footer */
.jm-footer { position: relative; background: var(--flake) 0 0 / 120px 120px, var(--wine); color: #e8cfa8; font-size: 14px; margin-top: 40px; }
/* Snowdrifts along the top of the footer */
.jm-footer::before { content: ''; position: absolute; left: 0; right: 0; top: -1px; height: 26px; pointer-events: none;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='26' viewBox='0 0 400 26' preserveAspectRatio='none'%3E%3Cpath d='M0 0H400V8C360 22 330 6 290 14S220 24 180 12 110 20 70 10 20 18 0 8Z' fill='%23fbf7f2'/%3E%3C/svg%3E") repeat-x 0 0 / 400px 26px; }
.jm-footer__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 28px; padding-top: 52px; padding-bottom: 12px; }
.jm-footer__cols h2 { font-family: var(--display); font-weight: 800; font-size: 18px; color: #fff; margin: 0 0 10px; }
.jm-footer__cols ul { list-style: none; margin: 0; padding: 0; }
.jm-footer__twocol { columns: 2; column-gap: 16px; }
.jm-footer__cols a { color: #e8cfa8; text-decoration: none; display: inline-block; padding: 5px 0; }
.jm-footer__cols a:hover { color: #fff; text-decoration: underline; }
.jm-footer__bottom { border-top: 1px solid rgba(251, 233, 200, .2); }
.jm-footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 20px; padding-bottom: 24px; font-size: 13px; }

@media (prefers-reduced-motion: reduce) { .jm-card { transition: none; } .jm-card:hover { transform: none; } }
