/* =========================================================================
   Heimat Beats — main stylesheet
   Ported from the original Lovable/React site's design tokens (src/index.css).
   Light base (:root) + .dark override on <html>. 3-way toggle in JS.
   ========================================================================= */

/* ---------- Tokens ---------- */
:root {
	--hb-bg:            #ffffff;
	--hb-surface:       rgba(255,255,255,0.92);
	--hb-surface-2:     rgba(255,255,255,0.86);
	--hb-surface-solid: #ffffff;
	--hb-text:          #111827;
	--hb-muted:         #6b7280;
	--hb-border:        rgba(17,24,39,0.10);
	--hb-shadow:        0 2px 16px rgba(0,0,0,0.08);
	--hb-shadow-card:   0 8px 24px rgba(0,0,0,0.12);

	--hb-accent:        #0a7f5a;
	--hb-accent-weak:   #e6f4ef;
	--hb-on-accent:     #ffffff;

	--hb-link:          #065f46;
	--hb-link-hover:    #0b7b5e;

	--hb-radius:        12px;
	--hb-maxw:          1400px;
	--hb-readw:         800px;
}

html.dark {
	--hb-bg:            #0f1115;
	--hb-surface:       rgba(22,24,30,0.92);
	--hb-surface-2:     rgba(22,24,30,0.86);
	--hb-surface-solid: #16181e;
	--hb-text:          #f3f4f6;
	--hb-muted:         #a1a1aa;
	--hb-border:        rgba(255,255,255,0.10);
	--hb-shadow:        0 2px 20px rgba(0,0,0,0.50);
	--hb-shadow-card:   0 8px 24px rgba(0,0,0,0.45);

	--hb-accent:        #19a874;
	--hb-accent-weak:   rgba(25,168,116,0.16);

	--hb-link:          #2dd4bf;
	--hb-link-hover:    #5eead4;
}

/* Per-region accents (subtle) */
.region-bavaria   { --hb-accent: #0a7f5a; }
.region-berlin    { --hb-accent: #d946ef; }
.region-rhineland { --hb-accent: #f59e0b; }
.region-sachsen   { --hb-accent: #22d3ee; }

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--hb-bg);
	color: var(--hb-text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
	font-size: 18px;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--hb-link); text-decoration: none; }
a:hover { color: var(--hb-link-hover); }
h1, h2, h3 { line-height: 1.2; }

.hb-container { width: 100%; max-width: var(--hb-maxw); margin: 0 auto; padding: 0 2rem; }
@media (max-width: 640px) { .hb-container { padding: 0 1rem; } }
.hb-narrow { max-width: 880px; }
.hb-main { min-height: 60vh; }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 1rem; top: 1rem; background: var(--hb-accent); color: #fff; padding: .5rem 1rem; border-radius: 8px; z-index: 100; }

/* ---------- Buttons ---------- */
.hb-btn {
	display: inline-flex; align-items: center; gap: .5rem;
	padding: .7rem 1.25rem; border-radius: 10px; font-weight: 600; font-size: .95rem;
	border: 1px solid transparent; cursor: pointer; transition: filter .15s ease, background .15s ease, color .15s ease;
}
.hb-btn-accent { background: var(--hb-accent); color: var(--hb-on-accent); }
.hb-btn-accent:hover { filter: brightness(1.07); color: var(--hb-on-accent); }
.hb-btn-outline { background: transparent; border-color: var(--hb-border); color: var(--hb-text); }
.hb-btn-outline:hover { border-color: var(--hb-accent); color: var(--hb-accent); }
.hb-btn-ghost { background: rgba(255,255,255,0.15); color: #fff; border-color: rgba(255,255,255,0.4); }
.hb-btn-ghost:hover { background: rgba(255,255,255,0.28); color: #fff; }

/* ---------- Pills ---------- */
.hb-pill {
	display: inline-block; padding: .3rem .8rem; border-radius: 999px;
	font-size: .8rem; font-weight: 500;
	background: var(--hb-accent-weak); color: var(--hb-accent);
}
.hb-pill-muted {
	background: var(--hb-surface-2); color: var(--hb-muted);
	border: 1px solid var(--hb-border);
}

/* ====================================================================== */
/* NAV                                                                      */
/* ====================================================================== */
.hb-nav {
	position: sticky; top: 0; z-index: 50;
	background: var(--hb-surface);
	border-bottom: 1px solid var(--hb-border);
	backdrop-filter: saturate(140%) blur(12px);
}
.hb-nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 1rem; }
.hb-nav-left { display: flex; align-items: center; gap: .5rem; }

.hb-brand { display: inline-flex; align-items: center; gap: .5rem; color: var(--hb-text); font-weight: 700; font-size: 1.25rem; }
.hb-brand:hover { opacity: .85; color: var(--hb-text); }
.hb-brand-icon { color: var(--hb-accent); }
.hb-brand-name { color: var(--hb-text); }

.hb-nav-links { display: none; align-items: center; gap: 1.4rem; font-size: .92rem; font-weight: 500; }
.hb-nav-links a { color: var(--hb-text); white-space: nowrap; }
.hb-brand-name { white-space: nowrap; }
.hb-nav-links a:hover { color: var(--hb-accent); }
.hb-support { display: inline-flex; align-items: center; gap: .35rem; }

.hb-nav-right { display: flex; align-items: center; gap: .5rem; }
.hb-theme-toggle, .hb-coffee-mobile, .hb-hamburger {
	display: inline-flex; align-items: center; justify-content: center;
	width: 40px; height: 40px; border-radius: 10px;
	background: var(--hb-surface-2); border: 1px solid var(--hb-border);
	color: var(--hb-text); cursor: pointer;
}
.hb-theme-toggle:hover, .hb-coffee-mobile:hover, .hb-hamburger:hover { border-color: var(--hb-accent); color: var(--hb-accent); }


/* theme icons: see music.css (sun in light, moon in dark, as in the original) */

.hb-coffee-mobile { display: inline-flex; }

/* mobile slide-in nav */
.hb-mobile-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 60; }
.hb-mobile-nav {
	position: fixed; top: 0; left: 0; bottom: 0; width: min(300px, 80vw); z-index: 70;
	background: var(--hb-surface-solid); border-right: 1px solid var(--hb-border);
	padding: 4.5rem 1.25rem 1.25rem; display: flex; flex-direction: column; gap: .25rem;
	transform: translateX(0);
}
.hb-mobile-nav a { color: var(--hb-text); padding: .65rem .5rem; border-radius: 8px; font-size: 1.05rem; }
.hb-mobile-nav a:hover { background: var(--hb-surface-2); color: var(--hb-accent); }
.hb-mobile-heading { color: var(--hb-muted); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin: 1rem .5rem .25rem; border-top: 1px solid var(--hb-border); padding-top: 1rem; }

/* ====================================================================== */
/* HOMEPAGE                                                                 */
/* ====================================================================== */
.hb-home-hero {
	position: relative; min-height: 600px; display: flex; align-items: center; justify-content: center;
	overflow: hidden; text-align: center; color: #fff; background: #0b3d33;
}
.hb-home-hero-inner { max-width: 760px; margin: 0 auto; }
.hb-home-hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 800; margin: 0 0 1rem; color: #fff; }
.hb-home-hero p { font-size: clamp(1.05rem, 2.5vw, 1.4rem); color: rgba(255,255,255,.92); margin: 0 0 1.75rem; }
.hb-home-hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }

.hb-section { padding: 3.5rem 0; }
.hb-section-alt { background: var(--hb-surface-2); }
.hb-section-head { margin-bottom: 2rem; }
.hb-section-title { font-size: clamp(1.6rem, 4vw, 2.25rem); font-weight: 800; margin: 0 0 .4rem; }
.hb-section-sub { color: var(--hb-muted); margin: 0; }
.hb-empty { text-align: center; color: var(--hb-muted); padding: 3rem 0; }

/* ---------- Card grid ---------- */
.hb-grid { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 768px)  { .hb-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .hb-grid { grid-template-columns: repeat(3, 1fr); } }

.hb-card {
	background: var(--hb-surface-solid); border: 1px solid var(--hb-border);
	border-radius: var(--hb-radius); overflow: hidden; box-shadow: var(--hb-shadow);
	transition: box-shadow .25s ease, transform .25s ease;
	height: 100%;
}
.hb-card:hover { box-shadow: var(--hb-shadow-card); transform: translateY(-2px); }
.hb-card-link { display: flex; flex-direction: column; height: 100%; color: inherit; }
.hb-card-link:hover { color: inherit; }
.hb-card-media { aspect-ratio: 16 / 9; overflow: hidden; background: var(--hb-surface-2); }
.hb-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.hb-card:hover .hb-card-media img { transform: scale(1.05); }
.hb-card-body { padding: 1.25rem; display: flex; flex-direction: column; gap: .6rem; flex: 1; }
.hb-card-title { font-size: 1.2rem; font-weight: 700; margin: 0; }
.hb-card:hover .hb-card-title { color: var(--hb-accent); }
.hb-card-excerpt { color: var(--hb-muted); font-size: .92rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hb-card-meta { display: flex; align-items: center; gap: .4rem; color: var(--hb-muted); font-size: .8rem; margin-top: auto; }
.hb-card-meta svg { flex-shrink: 0; }
.hb-card-dot { opacity: .6; }

/* ---------- Pagination ---------- */
.hb-pagination { margin-top: 2.5rem; }
.hb-pagination .nav-links { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; align-items: center; }
.hb-pagination a, .hb-pagination span {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 40px; height: 40px; padding: 0 .65rem; border-radius: 10px;
	border: 1px solid var(--hb-border); background: var(--hb-surface-2); color: var(--hb-text); font-weight: 600;
}
.hb-pagination a:hover { border-color: var(--hb-accent); color: var(--hb-accent); }
.hb-pagination .current { background: var(--hb-accent); color: var(--hb-on-accent); border-color: transparent; }

/* ====================================================================== */
/* REGION ARCHIVE                                                           */
/* ====================================================================== */
.hb-region-hero {
	padding: 4.5rem 0; text-align: center; color: #fff;
	background: linear-gradient(120deg, #0f172a, #1e293b);
}
.hb-region-hero.region-bavaria   { background: linear-gradient(120deg, #004b23, #007f5f); }
.hb-region-hero.region-berlin    { background: linear-gradient(120deg, #1f2937, #111827); }
.hb-region-hero.region-rhineland { background: linear-gradient(120deg, #003049, #669bbc); }
.hb-region-hero.region-sachsen   { background: linear-gradient(120deg, #093028, #237A57); }
.hb-region-title { font-size: clamp(2rem, 6vw, 3.5rem); font-weight: 800; margin: 0 0 .5rem; color: #fff; }
.hb-region-sub { font-size: 1.2rem; color: rgba(255,255,255,.9); margin: 0; }

/* ====================================================================== */
/* SINGLE POST                                                             */
/* ====================================================================== */
.hb-single { padding: 3rem 0 4rem; }

.hb-back-link { display: inline-flex; align-items: center; gap: .4rem; color: var(--hb-accent); font-weight: 600; font-size: .95rem; margin-bottom: 1.5rem; }
.hb-back-link:hover { color: var(--hb-link-hover); }

.hb-post-header .hb-pill-muted { margin-bottom: 1rem; }
.hb-post-title { font-size: clamp(2rem, 5.5vw, 3rem); font-weight: 800; margin: .5rem 0 1.25rem; line-height: 1.15; }

.hb-post-meta { display: flex; flex-wrap: wrap; gap: 1.5rem; color: var(--hb-muted); font-size: .95rem; margin-bottom: 2.5rem; }
.hb-meta-item { display: inline-flex; align-items: center; gap: .45rem; }

/* hero + inline figures */
.hb-hero, .hb-post-body figure {
	margin: 2.5rem 0; text-align: center;
}
.hb-hero img, .hb-post-body img {
	width: 100%; max-width: var(--hb-readw); margin: 0 auto;
	border-radius: var(--hb-radius); object-fit: cover;
	box-shadow: var(--hb-shadow-card); cursor: zoom-in;
	transition: transform .2s ease;
}
.hb-hero img:hover, .hb-post-body img:hover { transform: scale(1.01); }
.hb-hero figcaption, .hb-post-body figcaption {
	max-width: var(--hb-readw); margin: .75rem auto 0;
	color: var(--hb-muted); font-size: .9rem; font-style: italic; text-align: center;
}

/* excerpt blockquote — teal/green left border (matches screenshots) */
.hb-lead {
	max-width: var(--hb-readw); margin: 0 auto 2.5rem;
	border-left: 4px solid var(--hb-accent);
	padding: .25rem 0 .25rem 1.5rem;
	font-size: 1.25rem; line-height: 1.6; color: var(--hb-muted);
}

/* body */
.hb-post-body { max-width: var(--hb-readw); margin: 0 auto; }
.hb-post-body p { margin: 0 0 1.5rem; }
.hb-post-body h2 { font-size: 1.6rem; font-weight: 700; margin: 2.5rem 0 1rem; }
.hb-post-body h3 { font-size: 1.3rem; font-weight: 700; margin: 2rem 0 .75rem; }
.hb-post-body a { color: var(--hb-link); text-decoration: underline; text-underline-offset: 2px; }
.hb-post-body ul, .hb-post-body ol { margin: 0 0 1.5rem; padding-left: 1.25rem; }
.hb-post-body li { margin-bottom: .5rem; }
.hb-post-body blockquote {
	border-left: 4px solid var(--hb-accent); margin: 2rem 0; padding: .5rem 0 .5rem 1.5rem;
	color: var(--hb-muted); font-size: 1.1rem;
}
.hb-post-body hr { border: 0; border-top: 1px solid var(--hb-border); margin: 2.5rem auto; max-width: var(--hb-readw); }

/* closing image pair support: if a post ever has two adjacent figures with the
   .hb-pair class, lay them out as a 2-col grid (8px gap) with one shared caption.
   The migrated posts use a single composite image, so this is forward-support. */
.hb-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-width: var(--hb-readw); margin: 2.5rem auto 0; }
.hb-pair img { border-radius: var(--hb-radius); }

/* audio player (dormant unless _heimat_audio_url set) */
.hb-audio {
	max-width: var(--hb-readw); margin: 2.5rem auto 0;
	background: var(--hb-surface-2); border: 1px solid var(--hb-border);
	border-radius: var(--hb-radius); padding: 1rem 1.25rem;
}
.hb-audio-head { display: flex; align-items: center; gap: .5rem; color: var(--hb-accent); font-weight: 600; margin-bottom: .75rem; }
.hb-audio-el { width: 100%; }

/* post foot */
.hb-post-foot { max-width: var(--hb-readw); margin: 3.5rem auto 0; padding-top: 2.5rem; border-top: 1px solid var(--hb-border); }
.hb-support-banner {
	background: var(--hb-surface-2); border: 1px solid var(--hb-border);
	border-radius: var(--hb-radius); padding: 1.75rem; text-align: center;
	display: flex; flex-direction: column; gap: 1rem; align-items: center;
}
.hb-support-banner p { margin: 0; font-size: 1.1rem; font-weight: 600; }
.hb-support-banner-wide { max-width: 760px; margin: 0 auto; }
.hb-explore-more { text-align: center; margin-top: 2rem; }

/* ---------- Footer ---------- */
.hb-footer { border-top: 1px solid var(--hb-border); background: var(--hb-surface); padding: 3rem 0; margin-top: 2rem; }
.hb-footer-inner { display: flex; flex-direction: column; gap: 1rem; align-items: center; text-align: center; }
.hb-footer-tagline { color: var(--hb-muted); font-size: .9rem; margin: 0; }
.hb-footer-links { display: flex; gap: 1.5rem; font-size: .9rem; }
.hb-footer-links a { color: var(--hb-text); }
.hb-footer-links a:hover { color: var(--hb-accent); }

/* ---------- Lightbox ---------- */
.hb-lightbox {
	position: fixed; inset: 0; display: none; align-items: center; justify-content: center;
	background: rgba(0,0,0,.85); z-index: 90; cursor: zoom-out; padding: 2rem;
}
.hb-lightbox.is-open { display: flex; }
.hb-lightbox img { max-width: 96vw; max-height: 92vh; border-radius: var(--hb-radius); box-shadow: 0 12px 48px rgba(0,0,0,.5); cursor: default; }

/* ---------- Responsive nav switch ---------- */
@media (min-width: 1060px) {
	.hb-nav-links { display: flex; }
	.hb-hamburger { display: none; }
	.hb-coffee-mobile { display: none; }
}
@media (max-width: 1059px) {
	.hb-footer-inner { flex-direction: column; }
}

/* ---------- Footer layout on wide screens ---------- */
@media (min-width: 768px) {
	.hb-footer-inner { flex-direction: row; justify-content: space-between; text-align: left; }
}
