/*
Theme Name: ZB Viral
Theme URI: https://zbviral.xyz/
Author: ZB Viral
Description: A light, fast blog theme for ZB Viral: everyday hacks for home, kitchen, money, tech and habits.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: zbviral
*/

:root {
	--ink: #1d1b2f;
	--ink-2: #4a4760;
	--muted: #6b6880;
	--bg: #fffaf5;
	--card: #ffffff;
	--line: #ece4da;
	--coral: #ff4d6d;
	--coral-d: #e03357;
	--purple: #7b5cff;
	--yellow: #ffc43d;
	--radius: 18px;
	--shadow: 0 1px 2px rgba(29, 27, 47, .05), 0 8px 24px rgba(29, 27, 47, .06);
	--wrap: 1160px;
	--font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.65 var(--font); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--coral-d); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.01em; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 10px; left: 10px; z-index: 100; width: auto; height: auto; clip: auto; padding: 10px 16px; background: var(--ink); color: #fff; border-radius: 10px; }
:focus-visible { outline: 3px solid var(--purple); outline-offset: 2px; }

/* Header */
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 0; position: relative; } }
.header-in { display: flex; align-items: center; gap: 20px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 24px; letter-spacing: -.02em; }
.brand img { width: 36px; height: 36px; }
.brand span { color: var(--coral); }
.main-nav { margin-left: auto; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; flex-wrap: wrap; }
.main-nav a { display: block; padding: 8px 12px; border-radius: 999px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 15px; }
.main-nav a:hover, .main-nav .current-menu-item > a, .main-nav .current-category-ancestor > a { background: #fff0f3; color: var(--coral-d); }
.header-search { display: flex; }
.header-search input { width: 170px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; font: inherit; font-size: 15px; background: var(--bg); }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; font: inherit; font-weight: 700; color: var(--ink); cursor: pointer; }
@media (max-width: 960px) {
	.nav-toggle { display: block; }
	.main-nav, .header-search { display: none; }
	.nav-open .main-nav, .nav-open .header-search { display: block; width: 100%; }
	.header-in { flex-wrap: wrap; padding: 10px 0; }
	.nav-open .main-nav ul { flex-direction: column; padding-bottom: 8px; }
	.nav-open .header-search { padding-bottom: 14px; }
	.header-search input { width: 100%; }
}

/* Hero */
.hero { padding: 56px 0 40px; }
.hero-in { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.eyebrow { display: inline-block; background: #fff0f3; color: var(--coral-d); font-weight: 700; font-size: 14px; padding: 6px 12px; border-radius: 999px; margin-bottom: 14px; }
.hero h1 { font-size: clamp(34px, 5vw, 56px); margin: 0 0 16px; font-weight: 800; }
.hero h1 em { font-style: normal; color: var(--coral); }
.hero p { font-size: 19px; color: var(--ink-2); margin: 0 0 24px; max-width: 560px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; background: #fff; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; }
.chip i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.chip:hover { border-color: var(--coral); color: var(--coral-d); }
.hero-card { display: block; background: #fff; border-radius: 24px; overflow: hidden; box-shadow: var(--shadow); text-decoration: none; color: var(--ink); transform: rotate(1.2deg); transition: transform .2s; }
.hero-card:hover { transform: rotate(0); color: var(--ink); }
.hero-card .t { display: block; padding: 16px 22px 22px; font-weight: 800; font-size: 20px; line-height: 1.3; }
.hero-card .k { font-size: 13px; font-weight: 700; color: var(--coral-d); text-transform: uppercase; letter-spacing: .06em; display: block; margin-bottom: 4px; }
@media (max-width: 860px) { .hero-in { grid-template-columns: 1fr; } .hero-card { transform: none; } .hero { padding-top: 32px; } }

/* Sections and cards */
.section { padding: 28px 0 44px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-head h2 { margin: 0; font-size: 28px; }
.section-head a { font-weight: 700; text-decoration: none; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 960px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid { grid-template-columns: 1fr; } }
.card { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(29,27,47,.06), 0 16px 32px rgba(29,27,47,.1); }
.card-img { display: block; aspect-ratio: 16 / 9; background: var(--line); }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.cat-label { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; text-decoration: none; }
.card h3 { margin: 0; font-size: 20px; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { color: var(--coral-d); }
.card p { margin: 0; color: var(--muted); font-size: 15.5px; }
.meta { font-size: 14px; color: var(--muted); margin-top: auto; }

.cat-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
@media (max-width: 960px) { .cat-strip { grid-template-columns: repeat(2, 1fr); } }
.cat-tile { display: block; padding: 20px; border-radius: var(--radius); color: #fff; text-decoration: none; font-weight: 800; font-size: 18px; line-height: 1.3; min-height: 110px; position: relative; overflow: hidden; }
.cat-tile small { display: block; font-weight: 600; font-size: 14px; opacity: .9; margin-top: 6px; }
.cat-tile:hover { color: #fff; filter: brightness(1.05); }
.cat-tile::after { content: ""; position: absolute; right: -24px; bottom: -24px; width: 90px; height: 90px; border-radius: 50%; background: rgba(255,255,255,.18); }

.newsletter { background: var(--ink); color: #fff; border-radius: 24px; padding: 36px; display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; }
.newsletter h2 { margin: 0 0 6px; font-size: 26px; }
.newsletter p { margin: 0; color: #d6d2e6; }
.btn { display: inline-block; background: var(--coral); color: #fff; border: 0; padding: 12px 22px; border-radius: 999px; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--coral-d); color: #fff; }
@media (max-width: 700px) { .newsletter { grid-template-columns: 1fr; padding: 26px; } }

/* Archive header */
.archive-head { padding: 40px 0 8px; }
.archive-head h1 { margin: 0 0 8px; font-size: clamp(30px, 4vw, 42px); }
.archive-head p { margin: 0; color: var(--ink-2); max-width: 680px; }
.pagination { margin-top: 32px; display: flex; gap: 8px; flex-wrap: wrap; }
.pagination .page-numbers { padding: 8px 14px; border-radius: 10px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 600; }
.pagination .current { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Single article */
.article { padding: 32px 0 20px; }
.article-head { max-width: 780px; margin: 0 auto; text-align: center; }
.article-head h1 { font-size: clamp(30px, 4.4vw, 46px); margin: 10px 0 14px; font-weight: 800; }
.article-head .meta { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.article-hero { max-width: 980px; margin: 26px auto 0; border-radius: 24px; overflow: hidden; box-shadow: var(--shadow); }
.breadcrumbs { font-size: 14px; color: var(--muted); }
.breadcrumbs a { color: var(--muted); }
.entry { max-width: 720px; margin: 36px auto 0; font-size: 18px; }
.entry h2 { font-size: 28px; margin: 1.8em 0 .5em; }
.entry h3 { font-size: 21px; margin: 1.5em 0 .4em; }
.entry p, .entry ul, .entry ol { margin: 0 0 1.1em; }
.entry li { margin-bottom: .4em; }
.entry ol li::marker { color: var(--coral); font-weight: 800; }
.entry ul li::marker { color: var(--coral); }
.entry blockquote { margin: 1.4em 0; padding: 4px 22px; border-left: 4px solid var(--purple); color: var(--ink-2); }
.entry table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: 16px; background: #fff; border-radius: 12px; overflow: hidden; display: block; overflow-x: auto; }
.entry th, .entry td { padding: 11px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.entry thead th { background: #fff0f3; }
.zb-tip { background: #fff8e1; border: 1px solid #ffe29a; border-radius: 14px; padding: 16px 20px; margin: 1.6em 0; }
.zb-tip p { margin: 0; }
.share { max-width: 720px; margin: 30px auto 0; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-weight: 700; }
.share a, .share button { font: inherit; font-size: 14px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); text-decoration: none; cursor: pointer; }
.share a:hover, .share button:hover { border-color: var(--coral); color: var(--coral-d); }
.author-box { max-width: 720px; margin: 30px auto 0; display: flex; gap: 16px; padding: 20px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.author-box img { width: 56px; height: 56px; flex: none; }
.author-box p { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.related { padding: 40px 0 20px; }

/* Pages */
.page-wrap { max-width: 760px; margin: 0 auto; padding: 40px 0 20px; }
.page-wrap h1 { font-size: clamp(30px, 4vw, 42px); margin: 0 0 20px; }
.zb-form { display: grid; gap: 14px; margin-top: 20px; }
.zb-form label { font-weight: 700; font-size: 15px; display: grid; gap: 6px; }
.zb-form input, .zb-form textarea { font: inherit; padding: 12px 14px; border: 1px solid #d9d0c4; border-radius: 12px; background: #fff; width: 100%; }
.zb-form textarea { min-height: 160px; resize: vertical; }
.zb-form .hp { position: absolute; left: -9999px; }
.notice { padding: 14px 18px; border-radius: 12px; margin: 16px 0; font-weight: 600; }
.notice.ok { background: #e7f8ef; color: #136b3f; }
.notice.err { background: #ffecef; color: #a3122f; }

/* Search, 404 */
.search-big { display: flex; gap: 10px; max-width: 560px; margin-top: 18px; }
.search-big input { flex: 1; padding: 12px 16px; border: 1px solid var(--line); border-radius: 999px; font: inherit; }

/* Footer */
.site-footer { margin-top: 56px; background: #fff; border-top: 1px solid var(--line); padding: 44px 0 26px; font-size: 15px; color: var(--ink-2); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.footer-grid h3 { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; margin: 0 0 12px; color: var(--ink); }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-grid a { color: var(--ink-2); text-decoration: none; }
.footer-grid a:hover { color: var(--coral-d); }
.footer-bottom { border-top: 1px solid var(--line); margin-top: 32px; padding-top: 18px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

/* Cookie notice */
.cookie-bar { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60; max-width: 560px; margin: 0 auto; background: var(--ink); color: #fff; border-radius: 16px; padding: 16px 18px; display: flex; gap: 14px; align-items: center; font-size: 14.5px; box-shadow: 0 12px 30px rgba(0,0,0,.2); }
.cookie-bar a { color: var(--yellow); }
.cookie-bar[hidden] { display: none; }
.cookie-bar .btn { padding: 8px 16px; flex: none; }
