/**
 * tobalt-maudyklos — site design system.
 * Aesthetic: "Baltic summer / clear water" — editorial-coastal.
 * Author: Tobalt — https://tobalt.lt
 */

/* ── Fonts (self-hosted, latin-ext for Lithuanian) ───────────────────────── */
@font-face {
	font-family: 'Fraunces';
	src: url('../fonts/Fraunces.woff2') format('woff2');
	font-weight: 300 700;
	font-display: swap;
	font-style: normal;
}
@font-face {
	font-family: 'Hanken Grotesk';
	src: url('../fonts/HankenGrotesk.woff2') format('woff2');
	font-weight: 300 800;
	font-display: swap;
	font-style: normal;
}

/* ── Tokens (on :root so the body + theme header can resolve them too) ────── */
:root {
	--deep:   #0b3a44;
	--sea:    #11707f;
	--sea-2:  #1d8fa0;
	--foam:   #e6f4f6;
	--foam-2: #cfeaf0;
	--sand:   #f2ece1;
	--paper:  #fbf8f2;
	--ink:    #16282e;
	--muted:  #5d7177;
	--safe:   #1a9850;
	--warn:   #d73027;
	--none:   #93a3a6;
	--sun:    #f2b13c;
	--line:   rgba(11,58,68,.13);
	--shadow: 0 1px 2px rgba(11,58,68,.06), 0 12px 30px -12px rgba(11,58,68,.22);
	--shadow-sm: 0 1px 2px rgba(11,58,68,.05), 0 6px 16px -10px rgba(11,58,68,.20);
	--radius: 18px;
	--radius-sm: 11px;
	--font-display: 'Fraunces', 'Times New Roman', serif;
	--font-body: 'Hanken Grotesk', system-ui, -apple-system, sans-serif;
	--maxw: 1180px;
}

.tm-scope {
	font-family: var(--font-body);
	color: var(--ink);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

/* Page canvas — sand with a soft water glow at the top. */
body.tm-page {
	background:
		radial-gradient(120% 60% at 50% -10%, var(--foam) 0%, rgba(230,244,246,0) 55%),
		var(--sand);
	overflow-x: hidden;
}

/* ── Theme integration (scoped to maudyklos views only) ──────────────────── */
/* Hide the theme's duplicate page title — our hero supplies its own. */
body.tm-page .page-header { display: none; }
/* Let our sections control their own width (full-bleed backgrounds). */
body.tm-page #content,
body.tm-page .site-main,
body.tm-page .page-content { max-width: none; width: auto; padding: 0; margin: 0; }
/* Restyle the bare site header to match the aesthetic. */
body.tm-page #site-header.site-header {
	background: var(--paper);
	border-bottom: 1px solid var(--line);
	padding: 0;
	text-align: left;
}
body.tm-page #site-header .site-branding {
	max-width: var(--maxw); margin-inline: auto; text-align: left;
	padding: 1.05rem clamp(18px, 5vw, 40px);
}
body.tm-page #site-header .site-title { margin: 0; font-size: inherit; }
body.tm-page #site-header .site-title a {
	font-family: var(--font-display) !important; font-weight: 560; font-size: 1.32rem;
	letter-spacing: -.01em; color: var(--deep) !important; text-decoration: none;
	display: inline-flex; align-items: baseline; gap: .4em;
}
body.tm-page #site-header .site-title a::before { content: '≈'; color: var(--sea); font-style: italic; }
body.tm-page #site-header .site-title a:hover { color: var(--sea) !important; }

.tm-scope *, .tm-scope *::before, .tm-scope *::after { box-sizing: border-box; }
.tm-wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(18px, 5vw, 40px); }

/* ── Typography ───────────────────────────────────────────────────────────── */
.tm-scope h1, .tm-scope h2, .tm-scope h3 {
	font-family: var(--font-display);
	font-weight: 540;
	line-height: 1.04;
	letter-spacing: -0.015em;
	color: var(--deep);
	margin: 0;
	font-optical-sizing: auto;
}
.tm-kicker {
	font-family: var(--font-body);
	font-weight: 680;
	font-size: .74rem;
	letter-spacing: .18em;
	text-transform: uppercase;
	color: var(--sea);
	display: inline-flex;
	align-items: center;
	gap: .6em;
}
.tm-kicker::before {
	content: ''; width: 26px; height: 2px; background: var(--sun); border-radius: 2px;
}
.tm-lede { font-size: clamp(1.05rem, 1.6vw, 1.28rem); line-height: 1.5; color: var(--muted); max-width: 46ch; }

/* ── Hero (homepage) ──────────────────────────────────────────────────────── */
.tm-hero {
	position: relative;
	padding: clamp(40px, 7vw, 88px) 0 0;
	overflow: hidden;
}
.tm-hero__inner { position: relative; z-index: 2; }
.tm-hero h1 {
	font-size: clamp(2.6rem, 6.4vw, 5rem);
	font-weight: 500;
	margin: .28em 0 .32em;
	max-width: 16ch;
}
.tm-hero h1 em {
	font-style: italic;
	color: var(--sea);
}
.tm-hero__cta { margin-top: 1.8em; display: flex; gap: .8rem; flex-wrap: wrap; }

.tm-btn {
	display: inline-flex; align-items: center; gap: .55em;
	font-weight: 640; font-size: .98rem;
	padding: .82em 1.4em; border-radius: 100px;
	text-decoration: none; cursor: pointer; border: 1.5px solid transparent;
	transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.tm-btn--primary { background: var(--deep); color: #fff; box-shadow: var(--shadow-sm); }
.tm-btn--primary:hover { transform: translateY(-2px); background: var(--sea); }
.tm-btn--ghost { background: transparent; color: var(--deep); border-color: var(--line); }
.tm-btn--ghost:hover { border-color: var(--sea); color: var(--sea); transform: translateY(-2px); }

/* Stat row */
.tm-stats { display: flex; flex-wrap: wrap; gap: clamp(1.4rem, 4vw, 3.4rem); margin-top: 2.6em; }
.tm-stat { position: relative; }
.tm-stat__num {
	font-family: var(--font-display);
	font-weight: 500;
	font-size: clamp(2rem, 4vw, 3rem);
	color: var(--deep);
	line-height: 1;
	font-variant-numeric: tabular-nums;
}
.tm-stat__num small { font-size: .5em; color: var(--sea); font-weight: 600; }
.tm-stat__label { font-size: .82rem; color: var(--muted); margin-top: .5em; font-weight: 560; letter-spacing: .01em; }

/* Decorative wave at the bottom of the hero */
.tm-wave { display: block; width: 100%; height: auto; margin-top: clamp(28px, 5vw, 56px); color: var(--paper); }
.tm-hero__blob {
	position: absolute; z-index: 1; right: -8%; top: -12%;
	width: min(46vw, 560px); aspect-ratio: 1; pointer-events: none;
	background: radial-gradient(closest-side, rgba(29,143,160,.20), rgba(29,143,160,0) 70%);
	filter: blur(6px);
}

/* ── Map block ────────────────────────────────────────────────────────────── */
.tm-mapsection { background: var(--paper); position: relative; }
.tm-mapsection__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.4rem; flex-wrap: wrap; padding-top: clamp(20px, 4vw, 38px); }
.tm-mapsection h2 { font-size: clamp(1.7rem, 3vw, 2.5rem); font-weight: 520; }

.tm-controls { display: flex; flex-wrap: wrap; gap: .7rem; margin: 1.4em 0; align-items: center; }
.tm-controls select, .tm-controls input[type="search"], .tm-controls input[type="text"] {
	font-family: var(--font-body); font-size: .95rem; color: var(--ink);
	padding: .68em 1em; border: 1.5px solid var(--line); border-radius: 100px;
	background: #fff; min-width: 0;
	transition: border-color .16s ease, box-shadow .16s ease;
}
.tm-controls input { flex: 1 1 220px; }
.tm-controls select { appearance: none; padding-right: 2.4em;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2311707f' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat; background-position: right .95em center; }
.tm-controls select:focus, .tm-controls input:focus { outline: none; border-color: var(--sea); box-shadow: 0 0 0 4px rgba(29,143,160,.12); }
.tm-toggle { display: inline-flex; align-items: center; gap: .55em; font-weight: 560; font-size: .92rem; color: var(--muted); cursor: pointer; user-select: none; }
.tm-toggle input { width: 1.1em; height: 1.1em; accent-color: var(--safe); }

#tobalt-maudyklos-map {
	height: clamp(420px, 64vh, 680px); width: 100%;
	border-radius: var(--radius); overflow: hidden;
	border: 1px solid var(--line); box-shadow: var(--shadow);
	background: var(--foam);
}
.leaflet-container { font-family: var(--font-body); }
.leaflet-popup-content-wrapper { border-radius: 14px; box-shadow: var(--shadow); }
.leaflet-popup-content { margin: 14px 16px; font-size: .92rem; line-height: 1.45; }
.leaflet-popup-content strong { font-family: var(--font-display); font-weight: 560; font-size: 1.08rem; color: var(--deep); display: block; }
.tobalt-maudyklos-popup__mun { margin: .5em 0 .2em; font-size: .82rem; color: var(--muted); }
.tobalt-maudyklos-popup__mun span { color: var(--ink); font-weight: 620; }
.tobalt-maudyklos-popup__latest { margin: .2em 0 .7em; font-size: .88rem; color: var(--ink); }
.tobalt-maudyklos-popup__link { display: inline-flex; align-items: center; gap: .35em; color: var(--sea); font-weight: 660; text-decoration: none; font-size: .9rem; }
.tobalt-maudyklos-popup__link::after { content: '→'; transition: transform .15s ease; }
.tobalt-maudyklos-popup__link:hover::after { transform: translateX(3px); }

/* Legend */
.tm-legend { display: flex; flex-wrap: wrap; gap: 1.2rem; margin: 1.2em 0 0; font-size: .88rem; color: var(--muted); }
.tm-legend span { display: inline-flex; align-items: center; gap: .5em; font-weight: 560; }
.tm-dot { width: .78em; height: .78em; border-radius: 50%; box-shadow: 0 0 0 3px rgba(255,255,255,.7), 0 1px 3px rgba(0,0,0,.2); }
.tm-dot--safe { background: var(--safe); }
.tm-dot--warn { background: var(--warn); }
.tm-dot--none { background: var(--none); }

/* ── Status pill ──────────────────────────────────────────────────────────── */
.tm-pill {
	display: inline-flex; align-items: center; gap: .5em;
	font-weight: 660; font-size: .82rem; letter-spacing: .01em;
	padding: .42em .9em .42em .8em; border-radius: 100px; white-space: nowrap;
}
.tm-pill::before { content: ''; width: .62em; height: .62em; border-radius: 50%; background: currentColor; }
.tm-pill--atitinka   { color: #0c6e39; background: #d9f2e2; }
.tm-pill--neatitinka { color: #a51f18; background: #fbe0dd; }
.tm-pill--nera       { color: #4a5b5e; background: #e7eced; }

/* ── "How it works" strip ─────────────────────────────────────────────────── */
.tm-how { padding: clamp(48px, 8vw, 96px) 0; }
.tm-how__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: clamp(1.4rem, 3vw, 2.4rem); margin-top: 2.4em; }
.tm-step { position: relative; padding-top: 1.2em; border-top: 2px solid var(--line); }
.tm-step__n { font-family: var(--font-display); font-style: italic; font-weight: 500; font-size: 1.3rem; color: var(--sun); }
.tm-step h3 { font-size: 1.22rem; font-weight: 560; margin: .3em 0 .4em; }
.tm-step p { color: var(--muted); font-size: .96rem; line-height: 1.5; margin: 0; }

/* ── Archive grid ─────────────────────────────────────────────────────────── */
.tm-archive { padding: clamp(30px, 5vw, 56px) 0 clamp(60px, 9vw, 110px); }
.tm-archive__head { margin-bottom: 1.6em; }
.tm-archive__head h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 510; }
.tm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: clamp(1rem, 2vw, 1.5rem); }
.tm-card {
	position: relative; display: flex; flex-direction: column;
	background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
	padding: 1.3rem 1.3rem 1.15rem; text-decoration: none; color: inherit;
	box-shadow: var(--shadow-sm);
	transition: transform .2s cubic-bezier(.2,.7,.2,1), box-shadow .2s ease, border-color .2s ease;
	overflow: hidden;
}
.tm-card::after {
	content: ''; position: absolute; left: 0; top: 0; width: 4px; height: 100%;
	background: var(--accent, var(--none));
}
.tm-card--atitinka   { --accent: var(--safe); }
.tm-card--neatitinka { --accent: var(--warn); }
.tm-card--nera       { --accent: var(--none); }
.tm-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: rgba(29,143,160,.4); }
.tm-card__muni { font-size: .76rem; font-weight: 660; letter-spacing: .08em; text-transform: uppercase; color: var(--sea); }
.tm-card__title { font-family: var(--font-display); font-weight: 540; font-size: 1.28rem; line-height: 1.12; color: var(--deep); margin: .35em 0 .9em; }
.tm-card__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.tm-card__date { font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.tm-empty { color: var(--muted); font-size: 1.05rem; padding: 3rem 0; text-align: center; }

/* ── Single page ──────────────────────────────────────────────────────────── */
.tm-single { padding-bottom: clamp(60px, 9vw, 110px); }
.tm-crumb { display: inline-flex; align-items: center; gap: .5em; font-size: .86rem; font-weight: 580; color: var(--sea); text-decoration: none; padding: clamp(22px,4vw,40px) 0 0; }
.tm-crumb:hover { color: var(--deep); }
.tm-crumb svg { width: 1em; height: 1em; }

.tm-single__head { padding: 1.6em 0 1.8em; border-bottom: 1px solid var(--line); margin-bottom: 2em; }
.tm-single__head .tm-card__muni { font-size: .8rem; }
.tm-single h1 { font-size: clamp(2.2rem, 5vw, 3.7rem); font-weight: 500; margin: .2em 0 .55em; max-width: 18ch; }
.tm-single__meta { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.4rem; color: var(--muted); font-size: .95rem; }
.tm-single__meta b { color: var(--ink); font-weight: 620; }

.tm-single__layout { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(1.6rem, 3vw, 2.8rem); align-items: start; }
@media (max-width: 880px) { .tm-single__layout { grid-template-columns: 1fr; } }

#tobalt-maudyklos-mini-map {
	height: clamp(280px, 42vh, 420px); width: 100%;
	border-radius: var(--radius); overflow: hidden;
	border: 1px solid var(--line); box-shadow: var(--shadow-sm); background: var(--foam);
	position: sticky; top: 24px;
}

.tm-section-title { font-family: var(--font-display); font-weight: 540; font-size: 1.5rem; color: var(--deep); margin: 0 0 1em; }

/* Sample history table */
.tm-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow-sm); }
.tm-table { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 460px; }
.tm-table thead th {
	text-align: left; font-weight: 660; font-size: .73rem; letter-spacing: .07em; text-transform: uppercase;
	color: var(--sea); padding: 1em 1.1em; border-bottom: 1.5px solid var(--line); white-space: nowrap; background: var(--foam);
}
.tm-table td { padding: .9em 1.1em; border-bottom: 1px solid var(--line); color: var(--ink); vertical-align: middle; }
.tm-table tbody tr:last-child td { border-bottom: none; }
.tm-table tbody tr:hover td { background: rgba(230,244,246,.5); }
.tm-table .tm-date { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--deep); white-space: nowrap; }
.tm-table .tm-yes { color: #0c6e39; font-weight: 640; }
.tm-table .tm-no { color: #a51f18; font-weight: 640; }

.tm-note { font-size: .85rem; color: var(--muted); margin-top: 1.2em; line-height: 1.5; }
.tm-note b { color: var(--ink); }

/* ── Footer wave accent ───────────────────────────────────────────────────── */
.tm-foot { padding: clamp(40px,6vw,72px) 0; text-align: center; }
.tm-foot__src { font-size: .85rem; color: var(--muted); }
.tm-foot__src a { color: var(--sea); text-decoration: none; font-weight: 600; }
.tm-foot__src a:hover { text-decoration: underline; }

@media (prefers-reduced-motion: no-preference) {
	.tm-hero__inner > * { animation: tm-rise .7s cubic-bezier(.2,.7,.2,1) both; }
	.tm-hero .tm-kicker { animation-delay: .02s; }
	.tm-hero h1 { animation-delay: .08s; }
	.tm-hero .tm-lede { animation-delay: .16s; }
	.tm-hero .tm-hero__cta { animation-delay: .24s; }
	.tm-hero .tm-stats { animation-delay: .32s; }
	@keyframes tm-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
}
