/*
Theme Name: Karzone Blog
Theme URI: https://karzone.io/blog
Author: Karzone
Description: Blog theme for karzone.io/blog. Matches the live site's header, footer, fonts and colours.
Version: 2.0.0
Requires at least: 6.3
Requires PHP: 7.4
Text Domain: karzone-blog
*/

:root {
  --bg: #F5F0E6;
  --surface: #FFFDF8;
  --ink: #14202B;
  --navy: #1B2A44;
  --teal: #1FAE8C;
  --accent: #C4532A;
  --accent-dark: #A8441F;
  --muted: #4A5562;
  --soft: #6B7480;
  --hair: rgba(20, 32, 43, 0.08);
  --line: rgba(20, 32, 43, 0.18);
  --serif: 'DM Serif Display', Georgia, serif;
  --sans: 'Figtree', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.6;
  overflow-x: hidden; min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; }
img, svg, video { max-width: 100%; height: auto; }
iframe { max-width: 100%; }
a { color: inherit; text-decoration: none; }

.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap;
}
.screen-reader-text:focus { clip: auto; width: auto; height: auto; padding: 8px 12px; background: var(--ink); color: var(--bg); z-index: 999; left: 8px; top: 8px; }

/* ---------- Header (matches karzone.io) ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(245, 240, 230, 0.92);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hair);
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 0; } }
.header-bar {
  max-width: 1200px; margin: 0 auto; padding: 14px 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px 24px;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 21px; letter-spacing: -0.01em; color: var(--ink); }
.logo-dots { display: grid; grid-template-columns: repeat(2, 6px); gap: 3px; }
.logo-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--navy); }
.logo-dots i:nth-child(2), .logo-dots i:nth-child(3) { background: var(--teal); }

.main-nav { display: flex; gap: 8px 24px; font-size: 15px; font-weight: 500; flex-wrap: wrap; }
.main-nav a { color: var(--muted); }
.main-nav a:hover, .main-nav a.is-active { color: var(--ink); }
.main-nav a.is-active { text-decoration: underline; text-decoration-color: var(--teal); text-decoration-thickness: 2px; text-underline-offset: 6px; }

.header-ctas { display: flex; align-items: center; gap: 18px; }
.header-ctas .demo { font-size: 15px; font-weight: 600; color: var(--ink); }
.btn-dark {
  background: var(--ink); color: var(--bg) !important; padding: 11px 18px; border-radius: 8px;
  font-size: 15px; font-weight: 600; white-space: nowrap; transition: background .15s ease;
}
.btn-dark:hover { background: var(--accent); color: #fff !important; }

.nav-toggle { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.burger {
  display: none; width: 44px; height: 44px; border-radius: 10px; border: 1.5px solid var(--line);
  background: transparent; cursor: pointer; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.burger span { width: 18px; height: 2px; background: var(--ink); transition: transform .2s ease, opacity .2s ease; }
.nav-toggle:checked ~ .header-bar .burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle:checked ~ .header-bar .burger span:nth-child(2) { opacity: 0; }
.nav-toggle:checked ~ .header-bar .burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.mobile-menu { display: none; max-width: 1200px; margin: 0 auto; padding: 0 32px 16px; border-top: 1px solid var(--hair); }
.mobile-menu nav { display: flex; flex-direction: column; gap: 4px; font-size: 18px; font-weight: 500; padding: 8px 0 4px; }
.mobile-menu a { display: block; padding: 10px 0; color: var(--muted); }
.mobile-menu a.is-active { color: var(--ink); }
.mobile-menu .demo { font-weight: 600; color: var(--ink); }

@media (max-width: 1020px) {
  .main-nav, .header-ctas { display: none; }
  .burger { display: flex; }
  .nav-toggle:checked ~ .mobile-menu { display: block; }
}
@media (max-width: 600px) {
  .header-bar { padding: 12px 16px; }
  .mobile-menu { padding: 0 16px 16px; }
}

/* ---------- Shared type ---------- */
.eyebrow { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .18em; color: var(--soft); margin-bottom: 16px; }

/* ---------- Blog list ---------- */
.blog-hero { max-width: 1200px; margin: 0 auto; padding: 64px 32px 36px; position: relative; isolation: isolate; }
.blog-hero::before {
  content: ''; position: absolute; inset: -40px 0 0 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(rgba(20,32,43,0.22) 1.2px, transparent 1.6px); background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 45% 70% at 80% 40%, #000 0%, transparent 100%);
  mask-image: radial-gradient(ellipse 45% 70% at 80% 40%, #000 0%, transparent 100%);
}
.blog-hero h1 {
  font-family: var(--serif); font-weight: 400; font-size: clamp(42px, 5.4vw, 72px); line-height: 1.06;
  letter-spacing: -0.025em; margin: 0; max-width: 820px; text-wrap: balance;
}
.blog-hero h1 em { font-style: italic; color: var(--accent); }
.blog-hero p { font-size: 19px; line-height: 1.6; color: var(--muted); max-width: 600px; margin: 20px 0 0; }

.post-grid {
  max-width: 1200px; margin: 0 auto; padding: 16px 32px 96px;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px;
}
.post-card {
  display: flex; flex-direction: column; background: var(--surface); border-radius: 16px;
  overflow: hidden; border: 1px solid var(--hair);
  transition: transform .2s ease, box-shadow .2s ease;
}
.post-card:hover { transform: translateY(-3px); box-shadow: 0 24px 48px -28px rgba(20,32,43,.3); }
.post-card a.card-link { display: flex; flex-direction: column; height: 100%; }
.post-card .thumb { aspect-ratio: 16 / 9; background: #E9E1D0; overflow: hidden; }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-card .body { padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.post-card h2 { font-family: var(--serif); font-weight: 400; font-size: 25px; line-height: 1.2; letter-spacing: -0.01em; margin: 0; }
.post-card .excerpt { font-size: 15px; line-height: 1.6; color: var(--muted); margin: 0; }
.post-meta { font-size: 13px; color: var(--soft); }
.post-card .read-more { margin-top: auto; padding-top: 6px; font-size: 15px; font-weight: 600; color: var(--accent); }

.post-grid .post-card.is-featured { grid-column: 1 / -1; }
.post-grid .post-card.is-featured a.card-link { flex-direction: row; }
.post-grid .post-card.is-featured .thumb { flex: 1.3; aspect-ratio: auto; min-height: 340px; }
.post-grid .post-card.is-featured .body { flex: 1; padding: 40px; justify-content: center; }
.post-grid .post-card.is-featured h2 { font-size: 36px; line-height: 1.1; }

.pagination { max-width: 1200px; margin: -64px auto 96px; padding: 0 32px; display: flex; gap: 8px; flex-wrap: wrap; }
.pagination .page-numbers { padding: 8px 14px; border-radius: 8px; border: 1.5px solid var(--line); color: var(--muted); font-weight: 600; font-size: 14px; }
.pagination .page-numbers.current { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.empty-state { max-width: 1200px; margin: 0 auto; padding: 24px 32px 120px; color: var(--muted); font-size: 17px; }

/* ---------- Single article ---------- */
.article-head { max-width: 760px; margin: 0 auto; padding: 56px 24px 28px; }
.back-link { font-size: 15px; font-weight: 600; color: var(--muted); display: inline-block; margin-bottom: 28px; }
.back-link:hover { color: var(--ink); }
.article-head h1 {
  font-family: var(--serif); font-weight: 400; font-size: clamp(36px, 4.6vw, 56px); line-height: 1.08;
  letter-spacing: -0.02em; margin: 0 0 18px; text-wrap: balance;
}
.article-head .post-meta { font-size: 14px; }
.article-cover { max-width: 1040px; margin: 8px auto 0; padding: 0 24px; }
.article-cover img { width: 100%; border-radius: 16px; display: block; }

.entry-content { max-width: 760px; margin: 0 auto; padding: 44px 24px 40px; font-size: 18px; line-height: 1.75; }
.entry-content > * { margin-top: 0; margin-bottom: 1.3em; }
.entry-content h2, .entry-content h3, .entry-content h4 { font-family: var(--serif); font-weight: 400; line-height: 1.2; letter-spacing: -0.01em; margin-top: 1.8em; margin-bottom: .55em; }
.entry-content h2 { font-size: 34px; }
.entry-content h3 { font-size: 26px; }
.entry-content h4 { font-size: 21px; }
.entry-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.entry-content strong { font-weight: 700; }
.entry-content img { border-radius: 12px; }
.entry-content figure { margin-left: 0; margin-right: 0; }
.entry-content figcaption { font-size: 14px; color: var(--soft); text-align: center; margin-top: 8px; }
.entry-content blockquote {
  margin-left: 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--teal);
  font-family: var(--serif); font-size: 26px; line-height: 1.35;
}
.entry-content blockquote p { margin: 0 0 .4em; }
.entry-content blockquote cite { display: block; font-family: var(--sans); font-size: 14px; font-style: normal; color: var(--soft); }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }
.entry-content li { margin-bottom: .4em; }
.entry-content li::marker { color: var(--teal); }
.entry-content hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }
.entry-content pre, .entry-content code { font-size: 15px; background: #E9E1D0; border-radius: 6px; }
.entry-content code { padding: 2px 6px; }
.entry-content pre { padding: 16px; overflow-x: auto; }
.entry-content video { width: 100%; border-radius: 12px; background: #000; }
.entry-content .wp-block-embed__wrapper iframe { border-radius: 12px; }
.entry-content .alignwide { max-width: 1040px; margin-left: calc(50% - min(520px, 50vw - 24px)); margin-right: calc(50% - min(520px, 50vw - 24px)); }
.entry-content .alignfull { width: 100vw; max-width: 100vw; margin-left: calc(50% - 50vw); }
.entry-content .alignfull img { border-radius: 0; }
.entry-content .wp-block-button__link { background: var(--accent); color: #fff; border-radius: 10px; padding: 14px 24px; font-weight: 600; text-decoration: none; }

.article-cta { max-width: 760px; margin: 16px auto 96px; padding: 0 24px; }
.article-cta .box {
  background: var(--ink); color: var(--bg); border-radius: 16px; padding: 36px;
  display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap;
}
.article-cta h3 { font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1.15; margin: 0 0 6px; }
.article-cta h3 em { font-style: italic; color: #E58A62; }
.article-cta p { margin: 0; color: rgba(245,240,230,.75); font-size: 16px; }
.article-cta .actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-accent { padding: 14px 22px; border-radius: 10px; background: var(--accent); color: #fff !important; font-weight: 600; font-size: 16px; white-space: nowrap; }
.btn-accent:hover { background: var(--accent-dark); }
.btn-ghost-light { padding: 13px 20px; border-radius: 10px; border: 1.5px solid rgba(245,240,230,.5); color: var(--bg) !important; font-weight: 600; font-size: 16px; white-space: nowrap; }
.btn-ghost-light:hover { border-color: var(--bg); }

/* ---------- Footer (matches karzone.io) ---------- */
.site-footer { margin-top: auto; }
.site-footer .inner {
  max-width: 1200px; margin: 0 auto; padding: 40px 32px;
  display: flex; justify-content: space-between; align-items: center; gap: 20px 40px; flex-wrap: wrap;
  font-size: 14px; color: var(--muted);
}
.site-footer .brand { font-weight: 700; color: var(--ink); }
.site-footer nav { display: flex; gap: 8px 24px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--ink); }

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .blog-hero { padding: 40px 16px 24px; }
  .blog-hero p { font-size: 17px; }
  .post-grid { grid-template-columns: 1fr; padding: 8px 16px 72px; gap: 20px; }
  .post-grid .post-card.is-featured a.card-link { flex-direction: column; }
  .post-grid .post-card.is-featured .thumb { min-height: 0; aspect-ratio: 16 / 9; flex: none; }
  .post-grid .post-card.is-featured .body { padding: 22px 24px 26px; }
  .post-grid .post-card.is-featured h2 { font-size: 28px; }
  .pagination { margin-top: -48px; padding: 0 16px; }
  .article-head { padding: 36px 16px 20px; }
  .article-cover { padding: 0 16px; }
  .entry-content { padding: 28px 16px; font-size: 17px; }
  .entry-content h2 { font-size: 28px; }
  .entry-content h3 { font-size: 22px; }
  .entry-content blockquote { font-size: 22px; }
  .article-cta { padding: 0 16px; margin-bottom: 64px; }
  .article-cta .box { padding: 26px 22px; }
  .article-cta h3 { font-size: 26px; }
  .site-footer .inner { padding: 32px 16px; flex-direction: column; align-items: flex-start; }
}
