/*
Theme Name: Черенпетък.бг
Theme URI: https://черенпетък.бг/
Author: черенпетък.бг
Description: Тема за сайт за Черен петък – кампании на eMAG и магазини от Profitshare, ~170 категории, без цени, директни партньорски линкове, „Източник“ при съдържание от магазин.
Version: 1.0.0
Requires at least: 6.3
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: cherenpetak
*/

:root {
	--ink: #0d0d10;
	--ink-2: #1b1b22;
	--paper: #f6f5f1;
	--card: #ffffff;
	--line: #e4e1d8;
	--muted: #6b6a66;
	--accent: #ffd21f;
	--accent-ink: #1a1400;
	--hot: #e2261c;
	--ok: #13854a;
	--soon: #b86e00;
	--radius: 14px;
	--shadow: 0 1px 2px rgba(0,0,0,.05), 0 6px 20px rgba(0,0,0,.05);
	--font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	--display: "Manrope", "Inter", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.6 var(--font); color: var(--ink); background: var(--paper); }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #000; }
h1, h2, h3 { font-family: var(--display); line-height: 1.2; letter-spacing: -.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.8rem, 1.2rem + 2.2vw, 2.8rem); font-weight: 800; }
h2 { font-size: clamp(1.3rem, 1.1rem + .8vw, 1.7rem); font-weight: 800; }
h3 { font-size: 1.05rem; font-weight: 700; }
.wrap { width: min(1240px, 100% - 32px); margin-inline: auto; }
.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 99; background: var(--accent); padding: 8px 12px; }

/* ---------- Top bar & header ---------- */
.topbar { background: var(--accent); color: var(--accent-ink); text-align: center; font-weight: 700; font-size: .92rem; padding: 8px 16px; }
.topbar a { text-decoration: none; }
.site-header { background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 50; }
.header-row { display: flex; align-items: center; gap: 18px; padding: 12px 0; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; flex-shrink: 0; }
.brand:hover { color: #fff; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font: 800 1rem var(--display); }
.brand-name { font: 800 1.25rem var(--display); letter-spacing: -.02em; }
.brand-name b { color: var(--accent); }
.brand-logo { max-height: 44px; width: auto; }
.search { flex: 1; display: flex; max-width: 520px; background: #fff; border-radius: 999px; overflow: hidden; }
.search input { flex: 1; border: 0; padding: 10px 16px; font: inherit; min-width: 0; }
.search input:focus { outline: none; }
.search button { border: 0; background: var(--accent); padding: 0 16px; cursor: pointer; font-size: 1rem; }
.bf-pill { margin-left: auto; text-align: right; line-height: 1.15; font-size: .78rem; color: #c9c7c0; }
.bf-pill strong { display: block; color: var(--accent); font: 800 .98rem var(--display); }
.nav-toggle { display: none; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 10px; padding: 9px 12px; font-weight: 800; cursor: pointer; }

/* Mega menu */
.primary-nav { background: var(--ink-2); border-top: 1px solid #2a2a33; }
.mega { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.mega > li { position: relative; }
.mega > li > a { display: block; padding: 10px 11px; color: #eee; text-decoration: none; font-weight: 600; font-size: .93rem; white-space: nowrap; }
.mega > li > a:hover, .mega > li:focus-within > a { color: var(--accent); }
.mega > li.menu-emag > a { color: var(--accent); }
.mega .sub-menu { display: none; position: absolute; left: 0; top: 100%; z-index: 60; list-style: none; margin: 0; padding: 14px; background: #fff; color: var(--ink); border-radius: 0 0 var(--radius) var(--radius); box-shadow: 0 16px 40px rgba(0,0,0,.18); columns: 2; column-gap: 20px; width: 480px; }
.mega > li:nth-last-child(-n+4) .sub-menu { left: auto; right: 0; }
.mega > li:hover .sub-menu, .mega > li:focus-within .sub-menu { display: block; }
.mega .sub-menu a { display: block; padding: 5px 6px; border-radius: 6px; text-decoration: none; font-size: .92rem; break-inside: avoid; }
.mega .sub-menu a:hover { background: var(--paper); }

/* ---------- Layout ---------- */
.site-main { min-height: 60vh; padding-bottom: 48px; }
.crumbs { font-size: .85rem; color: var(--muted); padding: 14px 0 0; }
.crumbs a { color: var(--muted); }
.crumbs i { font-style: normal; margin: 0 4px; }
.page-head { padding: 22px 0 10px; }
.page-head .intro, .lead { color: #3c3b38; font-size: 1.07rem; max-width: 760px; }
.page-head--store { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.page-head--store > div { flex: 1; min-width: 260px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: start; }
.side { position: sticky; top: 130px; display: grid; gap: 16px; }
.side-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.side-box .current a { font-weight: 800; }
.section { margin-block: 34px; }
.section--narrow { max-width: 820px; margin-inline: auto; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.section-head h2 { margin: 0; }
.section-head a { font-weight: 700; font-size: .95rem; }
.flat { list-style: none; margin: 0; padding: 0; }
.flat li { padding: 3px 0; }
.empty { color: var(--muted); background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); padding: 18px; }

/* ---------- Hero ---------- */
.hero { background: radial-gradient(1200px 400px at 85% -10%, #3a2f00 0%, transparent 60%), var(--ink); color: #fff; padding: 46px 0 52px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; align-items: center; }
.hero h1 { color: #fff; max-width: 760px; }
.hero .lead { color: #cfcdc6; }
.eyebrow { color: var(--accent); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; margin: 0 0 10px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }

/* BF date */
.bf-date { background: var(--accent); color: var(--accent-ink); border-radius: 20px; padding: 22px 24px; text-align: center; }
.bf-date p { margin: 0; }
.bf-label { font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: .8rem; }
.bf-day { font: 800 2rem/1.1 var(--display); margin: 6px 0 !important; }
.bf-left { font-weight: 700; }
.bf-link { display: inline-block; margin-top: 12px; font-weight: 700; font-size: .9rem; }
.bf-date--small { border-radius: var(--radius); padding: 16px; }
.bf-date--small .bf-day { font-size: 1.4rem; }

/* ---------- Buttons & chips ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; background: var(--accent); color: var(--accent-ink); font-weight: 800; text-decoration: none; padding: 10px 16px; border-radius: 10px; border: 2px solid var(--accent); transition: transform .12s ease, background .12s; font-size: .95rem; }
.btn:hover { transform: translateY(-1px); background: #ffe25c; color: var(--accent-ink); }
.btn--big { padding: 13px 22px; font-size: 1.02rem; }
.btn--ghost { background: transparent; color: #fff; border-color: #fff3; }
.btn--ghost:hover { background: #ffffff14; color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 18px; }
.chip { display: inline-block; padding: 7px 13px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); text-decoration: none; font-size: .9rem; font-weight: 600; cursor: pointer; font-family: inherit; }
.chip:hover, .chip.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- Grids & cards ---------- */
.grid { display: grid; gap: 16px; }
.grid--campaigns { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid--products { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.grid--stores { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.grid--posts { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; }
.card-title { margin: 0; font-size: 1.05rem; }
.card-title a { text-decoration: none; }
.card-text { margin: 0; color: #46453f; font-size: .94rem; }
.card-foot { margin-top: auto; padding-top: 6px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card-store { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 700; font-size: .92rem; }
.card-banner img { border-radius: 8px; }
.card--campaign.is-ended { opacity: .62; box-shadow: none; }
.claim { margin: 0; font-weight: 800; color: var(--hot); }
.period { margin: 0; font-size: .9rem; color: var(--muted); }
.source { margin: 0; font-size: .74rem; color: var(--muted); }
.status { display: inline-block; font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: 3px 8px; border-radius: 6px; background: #eee; color: #555; margin: 0; }
.status--active { background: #e2f5ea; color: var(--ok); }
.status--upcoming { background: #fff1d9; color: var(--soon); }
.status--always { background: #e9eefc; color: #2747a8; }
.logo { width: 120px; height: 48px; object-fit: contain; }
.card-store .logo { width: 64px; height: 28px; }
.logo--txt { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: var(--ink); color: var(--accent); font: 800 1rem var(--display); text-transform: uppercase; }
.card-store .logo--txt { width: 30px; height: 30px; font-size: .8rem; border-radius: 8px; }
.card--store { align-items: flex-start; }
.store-link { display: flex; flex-direction: column; gap: 8px; text-decoration: none; }
.store-link h3 { margin: 0; }
.card--store .more { font-weight: 700; font-size: .9rem; margin-top: auto; }
.product-img { margin: 0; background: #fff; border-radius: 10px; }
.product-img img { aspect-ratio: 1; object-fit: contain; width: 100%; }
.product-img figcaption { font-size: .72rem; color: var(--muted); margin-top: 4px; }
.post-thumb img { border-radius: 10px; aspect-ratio: 16/10; object-fit: cover; width: 100%; }

/* Category groups */
.groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.group { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.group h3 a { text-decoration: none; }
.group .ico { font-size: 1.2rem; }
.group ul { list-style: none; margin: 0; padding: 0; }
.group li { padding: 3px 0; font-size: .94rem; }
.group li a { text-decoration: none; }
.group li a:hover { text-decoration: underline; }
.group li.all a { font-weight: 700; }

/* Boxes */
.box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.box--emag { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; border: 2px solid var(--accent); background: #fffbe6; }
.box--emag h2 { margin: 0 0 4px; font-size: 1.3rem; }
.box--emag p { margin: 0; }
.banner { margin: 20px 0; display: flex; justify-content: center; }
.official { margin: 20px 0; padding: 16px 20px; background: var(--card); border-left: 4px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0; }
.disclosure { font-size: .82rem; color: var(--muted); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }

/* Prose & FAQ */
.prose { font-size: 1.03rem; }
.prose h2 { margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin: .3em 0; }
.meta { color: var(--muted); font-size: .9rem; }
.post-hero { margin: 0 0 20px; }
.post-hero img { border-radius: var(--radius); }
.post-hero figcaption { font-size: .78rem; color: var(--muted); }
.faq { margin-block: 36px; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; }
.faq summary { cursor: pointer; padding: 14px 16px; font-weight: 700; list-style: none; position: relative; padding-right: 40px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 16px; top: 10px; font-size: 1.4rem; color: var(--muted); }
.faq details[open] summary::after { content: "–"; }
.faq details > div { padding: 0 16px 6px; color: #3c3b38; }

/* Footer */
.site-footer { background: var(--ink); color: #cfcdc6; padding: 40px 0 20px; font-size: .94rem; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.site-footer h3 { color: #fff; font-size: .95rem; text-transform: uppercase; letter-spacing: .06em; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; }
.footer-brand { font: 800 1.4rem var(--display); color: #fff; margin: 0 0 8px; }
.footer-brand b { color: var(--accent); }
.footer-legal { border-top: 1px solid #2a2a33; margin-top: 28px; padding-top: 16px; font-size: .8rem; color: #8f8d86; }
.nav-links { display: flex; gap: 8px; margin-top: 20px; }
.page-numbers { padding: 6px 12px; border-radius: 8px; background: var(--card); border: 1px solid var(--line); text-decoration: none; }
.page-numbers.current { background: var(--ink); color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
	.layout, .hero-grid { grid-template-columns: 1fr; }
	.side { position: static; }
	.footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
	.header-row { flex-wrap: wrap; gap: 10px; }
	.search { order: 3; flex-basis: 100%; max-width: none; }
	.bf-pill { display: none; }
	.nav-toggle { display: block; margin-left: auto; }
	.primary-nav { display: none; max-height: calc(100vh - 120px); overflow: auto; }
	.primary-nav.is-open { display: block; }
	.mega { flex-direction: column; }
	.mega .sub-menu { position: static; display: none; width: auto; columns: 2; box-shadow: none; border-radius: 0; background: #23232b; padding: 6px 12px 12px; }
	.mega .sub-menu a { color: #ddd; }
	.mega .sub-menu a:hover { background: #2f2f39; }
	.mega > li.is-open .sub-menu { display: block; }
	.mega > li:hover .sub-menu { display: none; }
	.mega > li.is-open:hover .sub-menu { display: block; }
	.mega > li.menu-item-has-children > a::after { content: " ▾"; color: #888; }
}
@media (max-width: 560px) {
	.footer-grid { grid-template-columns: 1fr; }
	.grid--stores { grid-template-columns: repeat(2, 1fr); }
	.grid--products { grid-template-columns: repeat(2, 1fr); }
	.mega .sub-menu { columns: 1; }
	.hero { padding: 30px 0 36px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
