/*
Theme Name: Code with Varun
Theme URI: http://localhost:8080
Author: Varun Dwarkani
Description: A dark, course-style theme for Android and software engineering articles.
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 7.4
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: codewithvarun
*/

:root {
  --bg: #07070b;
  --bg-soft: #0e0e14;
  --card: #14141c;
  --card-hover: #1b1b26;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f5f5f7;
  --muted: #9b9ba8;
  --accent: #6ee7b7;
  --accent-dim: rgba(110, 231, 183, 0.12);
  --gold: #f5c518;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --max: 1180px;
  --header-h: 76px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(7, 7, 11, 0.82);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 1.05rem;
}

.logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #22d3ee);
  color: #07110c;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
}

.primary-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.primary-menu a {
  padding: 8px 12px;
  color: var(--muted);
  font-size: 0.95rem;
  border-radius: 999px;
}

.primary-menu a:hover,
.primary-menu .current-menu-item a,
.primary-menu .current_page_item a {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  padding: 12px 20px;
  font-weight: 600;
  border: 0;
  cursor: pointer;
}

.btn-primary {
  background: #fff;
  color: #0b0b10;
}

.btn-primary:hover {
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.hero {
  padding: 88px 0 48px;
}

.hero-kicker {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 16px;
}

.hero h1,
.page-hero h1,
.article-hero h1 {
  font-size: clamp(2.4rem, 6vw, 5rem);
  line-height: 1.02;
  letter-spacing: -0.05em;
  margin: 0 0 18px;
  max-width: 16ch;
}

.hero p.lede,
.page-hero p {
  color: var(--muted);
  font-size: 1.15rem;
  max-width: 42rem;
  margin: 0 0 28px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 36px;
}

.rating {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.95rem;
}

.stars {
  color: var(--gold);
  letter-spacing: 1px;
}

.section {
  padding: 72px 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 28px;
}

.section-head h2 {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  letter-spacing: -0.04em;
  margin: 0;
}

.section-head p,
.eyebrow {
  color: var(--muted);
  margin: 0 0 8px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.article-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.article-card:hover {
  transform: translateY(-4px);
  background: var(--card-hover);
  border-color: rgba(110, 231, 183, 0.28);
}

.article-card .thumb {
  aspect-ratio: 16 / 10;
  background: #0b0b12;
  overflow: hidden;
}

.article-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-card .thumb-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 20% 20%, rgba(110, 231, 183, 0.2), transparent 40%),
    linear-gradient(135deg, #151522, #0c0c12);
  color: var(--accent);
  font-weight: 700;
}

.card-body {
  padding: 18px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.82rem;
}

.badge {
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 999px;
  padding: 3px 8px;
  font-weight: 600;
}

.badge-gold {
  background: rgba(245, 197, 24, 0.12);
  color: var(--gold);
}

.card-body h3 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  line-height: 1.3;
}

.card-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.feature .eyebrow {
  color: var(--accent);
  font-weight: 600;
}

.feature h3 {
  margin: 0 0 10px;
  letter-spacing: -0.03em;
}

.feature p {
  color: var(--muted);
  margin: 0;
}

.about-split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

.about-photo {
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--card);
}

.about-photo img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.cta-band {
  background:
    radial-gradient(circle at 10% 10%, rgba(110, 231, 183, 0.16), transparent 35%),
    var(--card);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.cta-band h2 {
  margin: 0 0 8px;
  letter-spacing: -0.04em;
  font-size: 2rem;
}

.cta-band p {
  margin: 0;
  color: var(--muted);
}

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 36px 0 48px;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: 16px;
}

.page-hero,
.article-hero {
  padding: 56px 0 24px;
}

.article-hero h1 {
  max-width: 20ch;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 760px);
  justify-content: center;
  padding-bottom: 80px;
}

.entry-content {
  font-size: 1.08rem;
  line-height: 1.8;
  color: #e8e8ee;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
  letter-spacing: -0.03em;
  line-height: 1.25;
  margin: 2em 0 0.7em;
  color: var(--text);
}

.entry-content p,
.entry-content ul,
.entry-content ol {
  margin: 0 0 1.25em;
}

.entry-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.entry-content pre,
.entry-content code {
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}

.entry-content pre {
  background: #101018;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.55;
}

.entry-content :not(pre) > code {
  background: rgba(255, 255, 255, 0.06);
  padding: 0.1em 0.35em;
  border-radius: 6px;
}

.entry-content figure {
  margin: 2em 0;
}

.entry-content figcaption {
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 8px;
  text-align: center;
}

.entry-content img {
  border-radius: 14px;
  border: 1px solid var(--border);
}

.entry-content blockquote {
  margin: 1.5em 0;
  padding: 4px 0 4px 18px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}

.featured-image {
  margin: 0 0 32px;
}

.featured-image img {
  width: 100%;
  border-radius: 18px;
  border: 1px solid var(--border);
}

.gist-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  margin: 1.5em 0;
}

.gist-card strong {
  display: block;
  margin-bottom: 6px;
}

.gist-card a {
  display: inline-block;
}

.nav-links {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.nav-links a,
.nav-links span {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
}

.nav-links .current {
  color: #0b0b10;
  background: #fff;
  border-color: #fff;
}

.article-footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--muted);
}

.search-form {
  display: flex;
  gap: 8px;
}

.search-form input[type="search"] {
  flex: 1;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 12px 16px;
}

.search-form input[type="submit"] {
  background: #fff;
  color: #111;
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  font-weight: 600;
}

@media (max-width: 960px) {
  .card-grid,
  .features,
  .about-split {
    grid-template-columns: 1fr;
  }

  .cta-band {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .primary-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: var(--header-h);
    background: #0b0b12;
    border-bottom: 1px solid var(--border);
    padding: 16px 20px 24px;
  }

  .primary-nav.is-open {
    display: block;
  }

  .primary-menu {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero h1 {
    max-width: none;
  }
}
