/*
Theme Name: Osumtech Blog
Theme URI: https://osumtech.net
Author: Osumtech
Description: Custom blog theme matching the design of osumtech.net — navy/blue palette, Fraunces + IBM Plex Sans, card-based layout.
Version: 1.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: osumtech-blog
*/

/* ---------- design tokens (matches osumtech.net) ---------- */

:root {
  --bg: #ffffff;
  --bg-soft: #f4f6fb;
  --surface: #ffffff;
  --border: #e7e9ee;
  --border-strong: #d7dbe3;

  --text: #0c1326;
  --text-dim: #3d4459;
  --text-faint: #74809a;

  --navy: #0f1b34;
  --accent: #2b58ff;
  --accent-hover: #1c43e0;
  --accent-soft: #e8edff;
  --accent-2: #00b8d9;

  --shadow-sm: 0 1px 2px rgba(12, 19, 38, 0.06);
  --shadow-md: 0 12px 28px rgba(12, 19, 38, 0.09);
  --shadow-lg: 0 24px 60px rgba(12, 19, 38, 0.16);

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "IBM Plex Sans", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.font-display {
  font-family: var(--font-display);
}

.eyebrow {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
}

/* ---------- header / nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.logo {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--navy);
}
.logo .tld {
  font-style: italic;
  font-weight: 500;
  color: var(--accent);
}

.primary-nav {
  display: none;
  align-items: center;
  gap: 32px;
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--text-dim);
}
.primary-nav a:hover {
  color: var(--navy);
}
.primary-nav a.current {
  color: var(--accent);
}

.nav-actions {
  display: none;
  align-items: center;
  gap: 16px;
}

.btn {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.85em 1.4em;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
  transition: background 0.2s ease, transform 0.2s ease;
}
.btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

/* mobile nav toggle — checkbox hack, no JS required */
.nav-toggle-input {
  display: none;
}
.nav-toggle-label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.nav-toggle-label span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
}
.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 18px;
  padding: 0 24px 24px;
  border-bottom: 1px solid var(--border);
}
.mobile-nav a {
  color: var(--text-dim);
  font-weight: 500;
}
.nav-toggle-input:checked ~ .mobile-nav {
  display: flex;
}

@media (min-width: 1024px) {
  .primary-nav,
  .nav-actions {
    display: flex;
  }
  .nav-toggle-label,
  .mobile-nav {
    display: none !important;
  }
}

/* ---------- blog hero ---------- */

.blog-hero {
  padding: 64px 0 40px;
  text-align: left;
}
.blog-hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 4.5vw, 3rem);
  color: var(--navy);
  margin: 12px 0 12px;
  line-height: 1.08;
}
.blog-hero p {
  color: var(--text-dim);
  font-size: 1.05rem;
  max-width: 620px;
  margin: 0;
}

/* ---------- post grid ---------- */

/* auto-fill + a capped column width means this looks right with 1 post
   or 50 — cards wrap naturally and stay centered instead of a fixed
   3-column grid pinning a lone post to a corner with empty tracks. */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 340px));
  justify-content: center;
  gap: 24px;
  padding: 24px 0 80px;
}
@media (max-width: 380px) {
  .post-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
}
.post-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
  transform: translateY(-4px);
}
.post-card .thumb {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--accent-soft), #fef1de);
  display: flex;
  align-items: center;
  justify-content: center;
}
.post-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.post-card .thumb .placeholder-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
}
.post-card-body {
  padding: 22px 22px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.post-card-date {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 10px;
}
.post-card h2 {
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 10px;
  line-height: 1.3;
}
.post-card p {
  color: var(--text-dim);
  font-size: 0.92rem;
  line-height: 1.6;
  margin: 0 0 18px;
  flex: 1;
}
.post-card .read-more {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--accent);
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ---------- pagination ---------- */

.pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding-bottom: 80px;
}
.pagination a,
.pagination span {
  padding: 0.6em 1em;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-dim);
}
.pagination .current {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ---------- single post ---------- */

.single-post {
  padding: 56px 0 40px;
  max-width: 1120px;
  margin: 0 auto;
}
.single-post .prose {
  max-width: 760px;
}
.single-post .breadcrumb {
  font-size: 0.85rem;
  color: var(--text-faint);
  margin-bottom: 24px;
}
.single-post .breadcrumb a:hover {
  color: var(--accent);
}
.single-post .post-date {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 14px;
}
.single-post h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  color: var(--navy);
  line-height: 1.12;
  margin: 0 0 28px;
}
.single-post .featured-image {
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 36px;
  border: 1px solid var(--border);
}

.prose {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-dim);
}
.prose h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--navy);
  margin: 2.2em 0 0.7em;
}
.prose h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--navy);
  margin: 1.8em 0 0.6em;
}
.prose p {
  margin: 0 0 1.3em;
}
.prose a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.prose ul,
.prose ol {
  margin: 0 0 1.3em;
  padding-left: 1.4em;
}
.prose li {
  margin-bottom: 0.5em;
}
.prose blockquote {
  margin: 1.8em 0;
  padding: 0.2em 0 0.2em 1.3em;
  border-left: 3px solid var(--accent);
  color: var(--navy);
  font-style: italic;
}
.prose img {
  border-radius: 16px;
  margin: 1.8em 0;
}
.prose code {
  background: var(--bg-soft);
  padding: 0.15em 0.4em;
  border-radius: 6px;
  font-size: 0.9em;
}
.prose pre {
  background: var(--navy);
  color: #eef1f8;
  padding: 1.2em;
  border-radius: 14px;
  overflow-x: auto;
}
.prose pre code {
  background: none;
  padding: 0;
  color: inherit;
}

/* ---------- post CTA ---------- */

.post-cta {
  margin-top: 56px;
  padding: 36px;
  border-radius: 22px;
  background: radial-gradient(120% 140% at 15% 0%, #16234a 0%, #0f1b34 55%, #0b1428 100%);
  color: #eef1f8;
  text-align: center;
}
.post-cta h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  margin: 0 0 10px;
}
.post-cta p {
  color: rgba(238, 241, 248, 0.7);
  margin: 0 0 22px;
}

/* ---------- footer ---------- */

.site-footer {
  background: #0b1428;
  color: rgba(238, 241, 248, 0.75);
  padding: 48px 0 28px;
  margin-top: 40px;
}
.site-footer .logo {
  color: #fff;
}
.site-footer .logo .tld {
  color: #7ea2ff;
}
.site-footer p {
  color: rgba(238, 241, 248, 0.5);
  font-size: 0.85rem;
  max-width: 360px;
}
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 32px;
  padding-top: 20px;
  font-size: 0.8rem;
  color: rgba(238, 241, 248, 0.4);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
}
.footer-bottom a:hover {
  color: #fff;
}

/* ---------- 404 ---------- */

.error-404 {
  padding: 100px 0;
  text-align: center;
}
.error-404 h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--navy);
}
