/*
Theme Name: Haibo
Theme URI: https://sayhaibo.co.za
Author: Haibo
Description: News that hits your pocket, explained. A light, mobile-first news theme for simple explainers, with ad slots, a 10-second summary box and WhatsApp sign-up.
Version: 1.1.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: haibo
*/

:root {
	--ink: #121417;
	--body: #2a2f38;
	--muted: #5a6170;
	--line: #e4e6ea;
	--soft: #f6f7f9;
	--green: #0b7a4b;
	--green-dark: #075233;
	--green-tint: #e3f4ec;
	--yellow: #ffd84d;
	--yellow-tint: #fff4c7;
	--whatsapp: #25d366;
	--radius: 14px;
	--max: 1200px;
	--head: "Bricolage Grotesque", system-ui, sans-serif;
	--marker: "Permanent Marker", cursive;
	--orange: #e8590c;
	--text: "Inter", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: var(--text); color: var(--ink); background: #fff; line-height: 1.6; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-dark); text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--head); line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 .5em; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link:focus { position: static; width: auto; height: auto; clip: auto; padding: 8px 12px; background: var(--yellow); color: var(--ink); }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: #fff; }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.brand a.logo { font-family: var(--head); font-weight: 800; font-size: 36px; color: var(--ink); letter-spacing: -1px; display: inline-flex; align-items: baseline; line-height: 1.1; }
.hb-face { width: .6em; height: .6em; overflow: visible; margin: 0 .02em; vertical-align: -.02em; }
.slogan { font-family: var(--marker); font-size: 19px; color: var(--green); display: inline-block; transform: rotate(-3deg); }
.brand a.logo:hover { text-decoration: none; }
.brand a.logo .bang { color: var(--green); }
@keyframes hb-bang { 0%,70%,100% { transform: rotate(0) scale(1); } 75% { transform: rotate(-14deg) scale(1.35); } 82% { transform: rotate(12deg) scale(1.2); } 90% { transform: rotate(-6deg) scale(1.1); } }
.bang { display: inline-block; transform-origin: 50% 90%; animation: hb-bang 3.2s ease-in-out infinite; }
@keyframes hb-brow { 0%,70%,100% { transform: translateY(0); } 76%,86% { transform: translateY(-14px); } }
.hb-brows { animation: hb-brow 3.2s ease-in-out infinite; }
@keyframes hb-pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .bang, .hb-brows { animation: none; } }
/* Haibo-meter */
.meter { display: inline-flex; align-items: flex-end; gap: 2px; height: 17px; vertical-align: middle; }
.meter i { width: 4px; border-radius: 2px; background: #d5d9e0; }
.meter i.on { background: var(--green); }
.meter i.hot { background: var(--orange); }
.meter-label { font-weight: 600; color: #3a404c; }
/* Reaction box */
.reaction { border: 1.5px solid var(--line); border-radius: 16px; padding: 22px 24px; margin-top: 32px; }
.reaction h2 { font-size: 22px; margin: 0 0 14px; }
.reaction .btns { display: flex; flex-wrap: wrap; gap: 10px; }
.reaction .btn-haibo { background: #ffe8da; color: #8a3300; }
.reaction .btn-ahh { background: var(--green-tint); color: #0b6a41; }
.reaction .btn:hover { transform: translateY(-2px); }
.brand .tagline { font-size: 14px; color: var(--muted); }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px; }
.main-nav a { display: block; padding: 10px 12px; font-size: 15px; font-weight: 500; color: var(--ink); }
.main-nav .current-menu-item > a, .main-nav .current-cat > a { color: var(--green); font-weight: 600; box-shadow: inset 0 -2px 0 var(--green); }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 18px; border-radius: 999px; font-weight: 700; font-size: 15px; border: 0; cursor: pointer; font-family: inherit; }
.btn:hover { text-decoration: none; }
.btn-whatsapp { background: var(--whatsapp); color: #08331b; }
.btn-whatsapp:hover { color: #08331b; filter: brightness(.95); }
.btn-yellow { background: var(--yellow); color: var(--ink); border-radius: 10px; }

/* Ads */
.ad-slot { display: flex; align-items: center; justify-content: center; text-align: center; color: var(--muted); font-size: 13px; }
.ad-slot.is-empty { border: 1.5px dashed #b8bec8; border-radius: 10px; background: var(--soft); }
.ad-header { max-width: 728px; min-height: 90px; margin: 20px auto 0; }
.ad-sidebar { min-height: 250px; }
.ad-inarticle { min-height: 250px; margin: 28px 0; }
.ad-label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 4px; }

/* Layout */
.layout { display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-start; padding-top: 32px; padding-bottom: 64px; }
.content-area { flex: 999 1 560px; min-width: 0; }
.sidebar { flex: 1 1 300px; display: flex; flex-direction: column; gap: 28px; }

/* Story */
.story-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.pill { display: inline-block; background: var(--green-tint); color: #0b6a41; font-weight: 600; padding: 4px 10px; border-radius: 999px; font-size: 13px; }
.story-title { font-size: clamp(30px, 5vw, 46px); line-height: 1.08; margin-bottom: 14px; }
.sponsor-line { display: inline-block; font-size: 13px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; margin-bottom: 22px; }
.sponsor-line strong { color: var(--ink); }
.tldr { background: var(--yellow-tint); border-radius: 16px; padding: 22px 24px; margin: 0 0 28px; }
.tldr-label { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #6b5300; margin-bottom: 6px; }
.tldr p { margin: 0; font-size: 20px; line-height: 1.5; font-weight: 500; }
.story-image { margin: 0 0 28px; border-radius: var(--radius); overflow: hidden; }
.entry-content { font-size: 18px; color: var(--body); }
.entry-content h2 { font-size: 26px; margin-top: 1.6em; color: var(--ink); }
.entry-content h3 { font-size: 21px; margin-top: 1.4em; color: var(--ink); }
.entry-content ul, .entry-content ol { padding-left: 22px; }
.entry-content li { margin-bottom: .4em; }
.entry-content blockquote { margin: 1.5em 0; padding: 16px 20px; background: var(--soft); border-radius: 12px; }
.entry-content table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.entry-content td, .entry-content th { border-bottom: 1px solid var(--line); padding: 10px; text-align: left; }
.money-box { background: #0f2a1e; color: #fff; border-radius: 16px; padding: 24px; margin: 28px 0; }
.money-box h2 { color: #fff; margin-top: 0; font-size: 24px; }
.money-box .money-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.money-box .money-item { background: #1b3d2d; border-radius: 12px; padding: 16px; }
.money-box .money-item span { display: block; font-size: 14px; color: #b9d8c8; }
.money-box .money-item strong { font-family: var(--head); font-size: 24px; }
.sources { font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 16px; margin-top: 32px; }
.author-box { display: flex; gap: 14px; align-items: center; margin-top: 24px; padding: 16px; background: var(--soft); border-radius: 12px; font-size: 15px; }
.author-box img { border-radius: 50%; }

/* Cards and lists */
.lead-story { display: grid; gap: 20px; margin-bottom: 36px; }
.lead-story .story-title a { color: var(--ink); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
.card { display: flex; flex-direction: column; gap: 10px; }
.card-image { border-radius: 12px; overflow: hidden; aspect-ratio: 16 / 9; background: var(--soft); }
.card-image img { width: 100%; height: 100%; object-fit: cover; }
.card h2, .card h3 { font-size: 20px; margin: 0; }
.card h2 a, .card h3 a { color: var(--ink); }
.card p { margin: 0; font-size: 15px; color: var(--muted); }
.section-title { font-size: 22px; margin: 0 0 16px; }
.archive-header { margin-bottom: 28px; }
.pagination { margin-top: 36px; display: flex; gap: 8px; flex-wrap: wrap; }
.pagination .page-numbers { padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); }
.pagination .current { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Sidebar widgets */
.widget { margin: 0; }
.widget-title { font-size: 20px; margin: 0 0 8px; }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { border-bottom: 1px solid var(--line); }
.widget li:last-child { border-bottom: 0; }
.widget li a { display: block; padding: 12px 0; color: var(--ink); font-weight: 500; line-height: 1.4; }
.signup-box { background: var(--ink); color: #fff; border-radius: 16px; padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.signup-box h2 { font-size: 22px; margin: 0; color: #fff; }
.signup-box p { margin: 0; font-size: 15px; color: #c9cdd6; line-height: 1.5; }
.signup-box .btn { width: 100%; border-radius: 10px; }
.signup-box small { font-size: 12px; color: #a9afbb; }

/* Language switcher (Polylang) */
.lang-switch { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0 0 24px; padding: 0; }
.lang-switch a { display: inline-flex; min-height: 44px; align-items: center; padding: 0 16px; border: 1.5px solid #d5d9e0; border-radius: 999px; color: var(--body); font-weight: 600; font-size: 15px; }
.lang-switch .current-lang a { background: var(--ink); border-color: var(--ink); color: #fff; }

/* Search, forms */
.search-form { display: flex; gap: 8px; }
.search-form input[type="search"] { flex: 1; min-height: 46px; border: 1px solid var(--line); border-radius: 10px; padding: 0 14px; font: inherit; }
.search-form button { min-height: 46px; padding: 0 16px; border: 0; border-radius: 10px; background: var(--ink); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--soft); font-size: 14px; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding-top: 28px; padding-bottom: 28px; }
.footer-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 18px; }

@media (max-width: 640px) {
	.layout { padding-top: 20px; gap: 32px; }
	.entry-content { font-size: 17px; }
	.tldr p { font-size: 18px; }
	.header-cta { width: 100%; }
}
