/* Пожелания.net – прост, бърз шаблон: хедър, съдържание + странична колона, футър */
:root {
	color-scheme: light;
	--bg: #ffffff;
	--soft: #f6f6f4;
	--line: #e4e6ea;
	--line-strong: #c9ced4;
	--ink: #1f2328;
	--muted: #5d6670;
	--brand: #c8102e;
	--brand-dark: #a00c24;
	--brand-soft: #fdeef0;
	--head: #c8102e;
	--on-brand: #ffffff;
	--ok: #1e6b34;
	--shadow: rgba(20, 24, 30, .14);
}
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		color-scheme: dark;
		--bg: #15171a; --soft: #1d2024; --line: #2d3137; --line-strong: #444a52;
		--ink: #e7e9ec; --muted: #a3aab3; --brand: #ff6b80; --brand-dark: #ff8e9d; --brand-soft: #2c1a1e;
		--head: #b20e29; --ok: #6fcf8a; --shadow: rgba(0, 0, 0, .5); --on-brand: #15171a;
	}
}
:root[data-theme="dark"] {
	color-scheme: dark;
	--bg: #15171a; --soft: #1d2024; --line: #2d3137; --line-strong: #444a52;
	--ink: #e7e9ec; --muted: #a3aab3; --brand: #ff6b80; --brand-dark: #ff8e9d; --brand-soft: #2c1a1e;
	--head: #b20e29; --ok: #6fcf8a; --shadow: rgba(0, 0, 0, .5); --on-brand: #15171a;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 3px; }
img { max-width: 100%; height: auto; display: block; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--bg); padding: 8px 12px; z-index: 50; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
html:not(.js) .js-only { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 2px solid var(--brand); }
.hdr { display: flex; align-items: center; gap: 16px; min-height: 64px; position: relative; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; font-size: 1.45rem; letter-spacing: -.01em; white-space: nowrap; }
.logo:hover { text-decoration: none; }
.logo-mark { width: 34px; height: 34px; flex: none; }
.logo b { color: var(--brand); font-weight: 700; }
#menu { margin-left: auto; }
#menu > ul { display: flex; list-style: none; margin: 0; padding: 0; }
#menu a { display: block; padding: 8px 10px; color: var(--ink); font-size: .95rem; font-weight: 500; border-radius: 6px; white-space: nowrap; }
#menu a:hover, #menu a.on, #menu a[aria-current] { color: var(--brand); text-decoration: none; }
.has-sub { position: relative; }
.has-sub > a::after { content: ""; display: inline-block; width: 6px; height: 6px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); margin: 0 0 3px 7px; }
.sub { display: none; position: absolute; top: 100%; left: 0; min-width: 230px; list-style: none; margin: 0; padding: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 30px var(--shadow); z-index: 30; }
.has-sub:hover .sub, .has-sub:focus-within .sub { display: block; }
.sub a:hover { background: var(--soft); }
.theme-btn, .menu-btn { flex: none; height: 40px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); cursor: pointer; font: inherit; font-weight: 600; }
.theme-btn { width: 40px; display: grid; place-items: center; }
.theme-btn:hover, .menu-btn:hover { border-color: var(--brand); color: var(--brand); }
.menu-btn { display: none; padding: 0 14px; margin-left: auto; }

/* ---------- page head ---------- */
main { padding-bottom: 48px; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: 16px 0 0; padding: 0; font-size: .9rem; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: 4px; }
.crumbs a { display: inline-block; padding: 3px 0; }
h1 { font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.25rem); line-height: 1.2; margin: 14px 0 8px; letter-spacing: -.01em; text-wrap: balance; }
main > h1:first-child { margin-top: 24px; }
.lead { font-size: 1.125rem; color: var(--muted); max-width: 40em; margin: 0 0 20px; text-wrap: pretty; }
.lead strong { color: var(--ink); font-weight: 600; }
.callout { background: var(--brand-soft); border-radius: 8px; padding: 14px 20px; max-width: 780px; margin: 0 0 32px; }
.callout p { margin: 0; }
.upd { font-size: .88rem; color: var(--muted); margin: 6px 0 0; }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 40px; align-items: start; }
/* JS задава --side-top: ако колоната е по-висока от екрана, тя превърта до долния си край и тогава залепва */
.side { position: sticky; top: var(--side-top, 84px); display: grid; gap: 28px; }
.block { margin: 0 0 44px; }
h2 { font-size: 1.5rem; line-height: 1.3; margin: 0 0 10px; text-wrap: balance; }
h2.sec { font-size: 1.25rem; margin: 36px 0 4px; }
h3 { font-size: 1.05rem; line-height: 1.35; margin: 0 0 8px; }
.muted { color: var(--muted); margin: 0 0 16px; }

/* раздели като „хапчета“ */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.chips a { border: 1px solid var(--line); border-radius: 99px; padding: 6px 14px; font-size: .92rem; }
.chips a span { color: var(--muted); margin-left: 2px; }
.chips a:hover { border-color: var(--brand); text-decoration: none; }

/* лента с филтри */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); position: sticky; top: 66px; background: var(--bg); z-index: 5; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button { font: inherit; font-size: .92rem; padding: 6px 14px; border: 1px solid var(--line); border-radius: 99px; background: var(--bg); color: var(--ink); cursor: pointer; }
.seg button:hover { border-color: var(--brand); color: var(--brand); }
.seg button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.name-field { display: flex; align-items: center; gap: 8px; font-size: .95rem; font-weight: 600; }
.name-field input { font: inherit; font-size: 1rem; font-weight: 400; width: 10em; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--bg); color: var(--ink); }
.name-field input::placeholder { color: var(--muted); }
#shown { margin-left: auto; font-size: .92rem; color: var(--muted); }
#shown b { color: var(--ink); }

/* ---------- пожелания ---------- */
.wishes { list-style: none; margin: 0; padding: 0; }
.wishes li { display: grid; grid-template-columns: 2.4rem minmax(0, 1fr); gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.wishes .n { color: var(--muted); font-size: .9rem; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; padding-top: 3px; }
.wishes .n:hover { color: var(--brand); }
.wishes blockquote { margin: 0; }
.wishes blockquote p { margin: 0; font-size: 1.06rem; white-space: pre-line; text-wrap: pretty; }
.act { display: flex; gap: 18px; margin-top: 4px; }
.act button { font: inherit; font-size: .88rem; font-weight: 600; background: none; border: 0; padding: 4px 0; min-height: 32px; color: var(--brand); cursor: pointer; }
.act button:hover { text-decoration: underline; text-underline-offset: 3px; }
.act button.done, .btn.done { color: var(--ok); }
.wishes li:target { background: var(--brand-soft); }
.empty { color: var(--muted); padding: 24px 0; }

.ad { margin: 24px 0; min-height: 120px; }
.ad::before { content: "Реклама"; display: block; font-size: .78rem; color: var(--muted); margin-bottom: 4px; }
.photo { margin: 24px 0; }
.photo img { width: 100%; border-radius: 8px; }
.photo figcaption { font-size: .88rem; color: var(--muted); margin-top: 6px; }

/* ---------- странична колона ---------- */
.today { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg); }
.today-hd { background: var(--head); color: #fff; display: flex; gap: 14px; align-items: center; padding: 16px 20px; }
.today-num { font-size: 2.6rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; min-width: 1.2em; }
.today-hd strong { display: block; font-size: 1.05rem; line-height: 1.3; }
.today-hd small { font-size: .88rem; opacity: .92; }
.today-bd { padding: 16px 20px; margin: 0; }
.today-text { margin: 0 0 14px; font-size: 1.02rem; white-space: pre-line; min-height: 5.5em; }
.today-text.swap { animation: swap .28s cubic-bezier(.22, 1, .36, 1); }
@keyframes swap { from { opacity: 0; transform: translateY(4px); } }
.today-act { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.today-link { font-size: .92rem; display: inline-block; padding: 3px 0; }
dl.today-bd { padding-top: 4px; padding-bottom: 8px; }
dl.today-bd div { padding: 10px 0; border-bottom: 1px solid var(--line); }
dl.today-bd div:last-child { border-bottom: 0; }
dl.today-bd dt { font-size: .82rem; font-weight: 600; color: var(--muted); }
dl.today-bd dd { margin: 2px 0 0; }
.btn { font: inherit; font-size: .92rem; font-weight: 600; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--brand); background: var(--brand); color: var(--on-brand); cursor: pointer; }
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--brand); }
.btn.ghost:hover { background: var(--brand-soft); }

.side-box h2 { font-size: 1.05rem; margin: 0 0 6px; }
.side-list { list-style: none; margin: 0; padding: 0; }
.side-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .95rem; }
.side-list li[hidden] { display: none; }
.side-list .c { color: var(--muted); white-space: nowrap; font-size: .88rem; font-variant-numeric: tabular-nums; }
.side-list .kid { padding-left: 14px; font-size: .92rem; }
.side-list .kid a::before { content: "– "; color: var(--muted); }
.side-list a[aria-current] { color: var(--ink); font-weight: 600; }
.side-list.cols { columns: 2; column-gap: 32px; }
.side-list.cols li { break-inside: avoid; }
.groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px 32px; }
.groups h3 { margin: 0 0 4px; }

/* ---------- таблица ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tbl th { text-align: left; background: var(--soft); font-weight: 600; padding: 10px 12px; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: baseline; }
.tbl td small { color: var(--muted); }
.tbl .in { color: var(--brand); font-weight: 600; white-space: nowrap; }
.tbl .in.far { color: var(--muted); font-weight: 400; }

/* ---------- цитати, текст, въпроси ---------- */
.quotes { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.quotes li { background: var(--soft); border-radius: 8px; padding: 16px 20px; }
.quotes blockquote { margin: 0 0 8px; }
.quotes p { margin: 0; font-size: 1.06rem; }
.quotes a { font-size: .92rem; font-weight: 600; }
.prose { max-width: 46em; }
.prose h2 { margin: 36px 0 10px; }
.prose > h2:first-child { margin-top: 0; }
.prose h3 { margin: 24px 0 6px; }
.prose p, .prose ul { margin: 0 0 14px; }
.prose ul { padding-left: 1.3em; }
.prose li { margin-bottom: 4px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { font-weight: 600; padding: 12px 28px 12px 0; cursor: pointer; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 10px; color: var(--brand); font-size: 1.2rem; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 14px; color: var(--muted); }

/* ---------- footer ---------- */
.site-footer { background: var(--soft); border-top: 1px solid var(--line); padding: 40px 0 24px; font-size: .92rem; }
.fcols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; }
.fh { font-weight: 700; margin: 0 0 8px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li a { display: inline-block; padding: 3px 0; color: var(--ink); }
.site-footer li a:hover { color: var(--brand); }
.fine { color: var(--muted); margin: 28px 0 0; padding-top: 16px; border-top: 1px solid var(--line); }

/* ---------- responsive ---------- */
@media (max-width: 1060px) {
	#menu a { padding: 8px 7px; font-size: .92rem; }
	.layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; }
}
@media (max-width: 860px) {
	.layout { grid-template-columns: minmax(0, 1fr); }
	/* страничните кутии – в мрежа под съдържанието (на таблет в две колони) */
	.side { position: static; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 24px 32px; align-items: start; }
	.layout.home .side { order: -1; }
}
@media (max-width: 980px) {
	.menu-btn { display: block; }
	#menu { display: none; position: absolute; left: -16px; right: -16px; top: 100%; margin-top: 2px; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 16px 16px; box-shadow: 0 10px 30px var(--shadow); }
	.site-header.open #menu { display: block; }
	html:not(.js) .hdr { flex-wrap: wrap; padding-bottom: 8px; }
	html:not(.js) #menu { display: block; position: static; margin: 0; padding: 0; box-shadow: none; border: 0; }
	html:not(.js) #menu > ul { flex-wrap: wrap; }
	.js #menu > ul { flex-direction: column; }
	.js .sub { display: block; position: static; border: 0; box-shadow: none; padding: 0 0 0 14px; min-width: 0; background: none; }
	.js .has-sub > a::after { display: none; }
	html:not(.js) .sub { display: none !important; }
}
@media (max-width: 640px) {
	.logo { font-size: 1.25rem; }
	.toolbar { position: static; }
	#shown { margin-left: 0; }
	.side-list.cols { columns: 1; }
	.hide-s { display: none; }
	.tbl th, .tbl td { padding: 8px 6px; }
	.wishes li { grid-template-columns: 1.8rem minmax(0, 1fr); gap: 8px; }
}
@media (max-width: 640px) {
	/* разделите – един ред с хоризонтално плъзгане вместо стена от бутони */
	.chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 16px; padding: 2px 16px 6px; scroll-snap-type: x proximity; scrollbar-width: none; overscroll-behavior-x: contain; }
	.chips::-webkit-scrollbar { display: none; }
	.chips a { flex: none; white-space: nowrap; scroll-snap-align: start; }
	.toolbar { gap: 8px 12px; }
	.seg { width: 100%; flex-wrap: nowrap; }
	.seg button { flex: 1 1 auto; padding: 6px 8px; white-space: nowrap; font-size: .88rem; }
	.name-field { flex: 1 1 0; min-width: 0; }
	.name-field input { flex: 1; width: 0; min-width: 0; }
	#shown { flex: none; }
	.tbl { font-size: .9rem; }
	.tbl td small { display: block; }
	.callout { padding: 12px 16px; }
}
@media (max-width: 380px) {
	.hdr { gap: 8px; }
	.logo { font-size: 1.1rem; gap: 7px; }
	.logo-mark { width: 28px; height: 28px; }
	.menu-btn { padding: 0 10px; }
}
/* телефон хоризонтално: нищо не залепва, за да остане място за текста */
@media (max-height: 500px) and (orientation: landscape) {
	.site-header, .toolbar { position: static; }
	html { scroll-padding-top: 16px; }
}
@media (pointer: coarse) {
	.chips a { min-height: 44px; display: inline-flex; align-items: center; }
	.act button, .seg button, .btn, .name-field input { min-height: 44px; }
	.side-list li { padding: 11px 0; }
}
@media (prefers-reduced-motion: reduce) { .today-text.swap { animation: none; } }
@media print {
	.site-header, .site-footer, .side, .toolbar, .ad, .act, .chips, #povodi { display: none !important; }
	.layout { display: block; }
	body { font-size: 12pt; }
}
