/*
Theme Name: Craftsman Press
Theme URI: https://developer.dev
Author: Developer
Author URI: https://developer.dev
Description: A premium blog theme with warm editorial design. Sage/stone/amber palette, callout boxes, stat cards, related articles.
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: craftsman-press
Tags: blog, one-column, custom-menu, featured-images, theme-options
*/

/* ══════════════════════════════════════ */
/*              CSS VARIABLES             */
/* ══════════════════════════════════════ */
:root {
  --stone-50: #fafaf9;
  --stone-100: #f5f5f4;
  --stone-200: #e7e5e4;
  --stone-300: #d6d3d1;
  --stone-400: #a8a29e;
  --stone-500: #78716c;
  --stone-600: #57534e;
  --stone-700: #44403c;
  --stone-800: #292524;
  --stone-900: #1c1917;
  --amber-400: #fbbf24;
  --amber-500: #f59e0b;
  --amber-600: #d97706;
  --amber-700: #b45309;
  --sage: #5a6b52;
  --sage-light: #7a8b72;
  --sage-bg: #f0f2ed;
  --sage-dark: #3d4a37;
  --cream: #fdfbf7;
  --rust: #c2410c;
  --rust-bg: #fff7ed;
  --blue: #1d4ed8;
  --blue-bg: #eff6ff;
  --blue-border: #bfdbfe;
  --serif: 'DM Serif Display', Georgia, serif;
  --sans: 'Plus Jakarta Sans', system-ui, sans-serif;
}

/* ══════════════════════════════════════ */
/*                 RESET                  */
/* ══════════════════════════════════════ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: var(--sans);
  background: var(--stone-100);
  color: var(--stone-800);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

/* ══════════════════════════════════════ */
/*              SITE HEADER               */
/* ══════════════════════════════════════ */
.site-header {
  background: var(--cream);
  border-bottom: 1px solid var(--stone-200);
}
.header-top {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}
.logo-icon {
  width: 44px;
  height: 44px;
  background: var(--sage);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
}
.site-logo .site-name {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--stone-900);
  letter-spacing: -0.5px;
}
.site-logo .site-tagline {
  font-size: 12px;
  color: var(--stone-500);
  margin-top: 1px;
}
.header-nav { display: flex; gap: 28px; align-items: center; }
.header-nav a {
  color: var(--stone-600);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}
.header-nav a:hover,
.header-nav a.current { color: var(--sage); }

/* ══════════════════════════════════════ */
/*         HOMEPAGE HERO                  */
/* ══════════════════════════════════════ */
.hero {
  background: linear-gradient(170deg, var(--stone-900) 0%, var(--stone-800) 60%, var(--sage-dark) 100%);
  padding: 80px 32px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(90,107,82,0.2) 0%, transparent 70%);
  border-radius: 50%;
}
.hero-badge {
  display: inline-block;
  background: rgba(245,158,11,0.15);
  color: var(--amber-500);
  padding: 6px 18px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 24px;
  position: relative;
}
.hero h1 {
  font-family: var(--serif);
  font-size: 48px;
  color: white;
  max-width: 700px;
  margin: 0 auto 16px;
  line-height: 1.15;
  position: relative;
}
.hero p {
  color: var(--stone-400);
  font-size: 17px;
  max-width: 540px;
  margin: 0 auto;
  position: relative;
}

/* ══════════════════════════════════════ */
/*       FEATURED POST (HOMEPAGE)         */
/* ══════════════════════════════════════ */
.featured-section {
  max-width: 1200px;
  margin: -40px auto 0;
  padding: 0 32px;
  position: relative;
  z-index: 2;
}
.featured-post {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}
.featured-image {
  min-height: 360px;
  background: var(--stone-300);
  background-size: cover;
  background-position: center;
}
.featured-content {
  padding: 44px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.featured-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--amber-600);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 16px;
}
.featured-content h2 {
  font-family: var(--serif);
  font-size: 28px;
  color: var(--stone-900);
  margin-bottom: 14px;
  line-height: 1.3;
}
.featured-content p {
  color: var(--stone-500);
  font-size: 15px;
  margin-bottom: 24px;
  line-height: 1.7;
}
.featured-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--stone-400);
}

/* ══════════════════════════════════════ */
/*       CONTENT AREA & SIDEBAR           */
/* ══════════════════════════════════════ */
.content-area {
  max-width: 1200px;
  margin: 48px auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 40px;
  align-items: start;
}

/* ── Section Labels ── */
.section-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.section-label h2 {
  font-family: var(--serif);
  font-size: 24px;
  color: var(--stone-900);
  white-space: nowrap;
}
.section-label .line {
  flex: 1;
  height: 1px;
  background: var(--stone-200);
}

/* ── Post Cards ── */
.post-card {
  display: grid;
  grid-template-columns: 220px 1fr;
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  margin-bottom: 20px;
  transition: box-shadow 0.2s, transform 0.2s;
}
.post-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}
.post-card-image {
  min-height: 200px;
  background: var(--stone-200);
  background-size: cover;
  background-position: center;
}
.post-card-content {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.post-card-cat {
  font-size: 11px;
  font-weight: 700;
  color: var(--sage);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
}
.post-card-content h3 {
  font-family: var(--serif);
  font-size: 19px;
  color: var(--stone-900);
  margin-bottom: 8px;
  line-height: 1.35;
}
.post-card-content p {
  color: var(--stone-500);
  font-size: 14px;
  margin-bottom: 14px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card-meta {
  font-size: 12px;
  color: var(--stone-400);
}

/* ── Sidebar ── */
.sidebar-widget {
  background: white;
  border: 1px solid var(--stone-200);
  border-radius: 14px;
  padding: 28px;
  margin-bottom: 24px;
}
.widget-title {
  font-family: var(--serif);
  font-size: 18px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--stone-200);
  color: var(--stone-900);
}
.widget-cats { list-style: none; }
.widget-cats li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--stone-100);
  font-size: 14px;
  color: var(--stone-600);
  transition: color 0.2s;
}
.widget-cats li:hover { color: var(--sage); }
.widget-cats li:last-child { border-bottom: none; }
.widget-cats .count {
  background: var(--sage-bg);
  color: var(--sage);
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
}
.popular-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--stone-100);
}
.popular-item:last-child { border-bottom: none; }
.popular-num {
  font-family: var(--serif);
  font-size: 28px;
  color: var(--stone-200);
  line-height: 1;
  min-width: 30px;
}
.popular-title { font-size: 14px; font-weight: 600; color: var(--stone-700); line-height: 1.4; }
.popular-date { font-size: 12px; color: var(--stone-400); margin-top: 4px; }

/* ══════════════════════════════════════ */
/*     SINGLE POST — PREMIUM DESIGN       */
/* ══════════════════════════════════════ */
.single-hero-premium {
  background: linear-gradient(170deg, var(--stone-900) 0%, var(--stone-800) 60%, var(--sage-dark) 100%);
  padding: 72px 32px 100px;
  position: relative;
  overflow: hidden;
}
.single-hero-premium::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(90,107,82,0.2) 0%, transparent 70%);
  border-radius: 50%;
}
.single-hero-premium::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(245,158,11,0.08) 0%, transparent 70%);
  border-radius: 50%;
}
.single-hero-inner {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.single-hero-breadcrumb {
  font-size: 13px;
  color: var(--stone-400);
  margin-bottom: 20px;
}
.single-hero-breadcrumb a { color: var(--stone-400); transition: color 0.2s; }
.single-hero-breadcrumb a:hover { color: var(--amber-500); }
.single-hero-breadcrumb .sep { margin: 0 8px; opacity: 0.5; }
.single-hero-cat {
  display: inline-block;
  background: rgba(90,107,82,0.3);
  color: var(--sage-light);
  padding: 4px 14px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 20px;
}
.single-hero-premium h1 {
  font-family: var(--serif);
  font-size: 42px;
  color: white;
  line-height: 1.2;
  margin-bottom: 20px;
}
.single-hero-excerpt {
  font-size: 17px;
  color: var(--stone-400);
  line-height: 1.7;
  margin-bottom: 24px;
}
.single-hero-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 13px;
  color: var(--stone-400);
}
.single-hero-meta .dot { opacity: 0.4; }

/* Featured image below hero */
.single-featured-img {
  max-width: 900px;
  margin: -60px auto 0;
  padding: 0 32px;
  position: relative;
  z-index: 2;
}
.single-featured-img img {
  width: 100%;
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.15);
  aspect-ratio: 16/9;
  object-fit: cover;
}

/* ── Single Post Content ── */
.single-content {
  max-width: 760px;
  margin: 48px auto;
  padding: 0 32px;
}
.single-content h2 {
  font-family: var(--serif);
  font-size: 28px;
  color: var(--stone-900);
  margin: 48px 0 16px;
  line-height: 1.3;
}
.single-content h3 {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--stone-800);
  margin: 36px 0 12px;
}
.single-content p {
  font-size: 16px;
  color: var(--stone-600);
  line-height: 1.8;
  margin-bottom: 20px;
}
.single-content ul, .single-content ol {
  padding-left: 24px;
  margin-bottom: 20px;
  list-style: disc;
}
.single-content li {
  font-size: 16px;
  color: var(--stone-600);
  line-height: 1.8;
  margin-bottom: 8px;
}
.single-content a { color: var(--sage); font-weight: 500; border-bottom: 1px solid rgba(90,107,82,0.3); transition: border-color 0.2s; }
.single-content a:hover { border-color: var(--sage); }
.single-content img {
  border-radius: 12px;
  margin: 32px 0;
}

/* ── Key Takeaway Box ── */
.key-takeaway {
  background: var(--stone-900);
  border-radius: 14px;
  padding: 28px 32px;
  margin: 36px 0;
  position: relative;
  overflow: hidden;
}
.key-takeaway::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--amber-500), var(--sage));
}
.key-takeaway-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--amber-500);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
}
.key-takeaway p {
  color: var(--stone-300) !important;
  font-size: 15px !important;
  line-height: 1.7;
  margin-bottom: 0 !important;
}

/* ── Pro Tip Box ── */
.pro-tip {
  background: var(--sage-bg);
  border: 1px solid rgba(90,107,82,0.2);
  border-radius: 14px;
  padding: 24px 28px;
  margin: 32px 0;
}
.pro-tip-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--sage);
  margin-bottom: 10px;
}
.pro-tip p {
  color: var(--sage-dark) !important;
  font-size: 15px !important;
  margin-bottom: 0 !important;
}

/* ── Warning Box ── */
.warning-box {
  background: var(--rust-bg);
  border: 1px solid rgba(194,65,12,0.2);
  border-left: 4px solid var(--rust);
  border-radius: 14px;
  padding: 24px 28px;
  margin: 32px 0;
}
.warning-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--rust);
  margin-bottom: 10px;
}
.warning-box p {
  color: var(--stone-700) !important;
  font-size: 15px !important;
  margin-bottom: 0 !important;
}

/* ── Checklist Box ── */
.checklist-box {
  background: var(--blue-bg);
  border: 1px solid var(--blue-border);
  border-radius: 14px;
  padding: 28px 32px;
  margin: 32px 0;
}
.checklist-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 16px;
}
.checklist-box ul { list-style: none; padding: 0; }
.checklist-box li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  font-size: 15px;
  color: var(--stone-700);
  line-height: 1.5;
}
.checklist-box li::before {
  content: '✓';
  font-weight: 700;
  color: var(--sage);
  font-size: 14px;
  margin-top: 2px;
  flex-shrink: 0;
}

/* ── Stat Row ── */
.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 36px 0;
}
.stat-card {
  background: white;
  border: 1px solid var(--stone-200);
  border-radius: 14px;
  padding: 24px;
  text-align: center;
}
.stat-number {
  font-family: var(--serif);
  font-size: 32px;
  color: var(--sage);
  margin-bottom: 4px;
}
.stat-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--stone-800);
  margin-bottom: 4px;
}
.stat-sub {
  font-size: 12px;
  color: var(--stone-400);
}

/* ── Blockquote ── */
.single-content blockquote {
  position: relative;
  background: var(--cream);
  border: 1px solid var(--stone-200);
  border-radius: 14px;
  padding: 32px 32px 32px 48px;
  margin: 36px 0;
  font-style: italic;
}
.single-content blockquote::before {
  content: '"';
  position: absolute;
  top: 16px;
  left: 16px;
  font-family: var(--serif);
  font-size: 60px;
  color: var(--stone-200);
  line-height: 1;
}
.single-content blockquote p {
  color: var(--stone-700) !important;
  font-size: 17px !important;
  font-style: italic;
}
.single-content blockquote cite {
  display: block;
  font-style: normal;
  font-size: 13px;
  color: var(--stone-400);
  margin-top: 12px;
  font-weight: 600;
}

/* ── Post Tags ── */
.post-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--stone-200);
}
.post-tag {
  background: var(--sage-bg);
  color: var(--sage);
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
}

/* ── Author Box ── */
.author-box {
  display: flex;
  gap: 24px;
  align-items: center;
  background: var(--cream);
  border: 1px solid var(--stone-200);
  border-radius: 16px;
  padding: 28px 32px;
  margin-top: 40px;
}
.author-avatar {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, var(--sage) 0%, var(--sage-light) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 28px;
  font-family: var(--serif);
  flex-shrink: 0;
  overflow: hidden;
}
.author-avatar img { width: 100%; height: 100%; object-fit: cover; }
.author-info h4 { font-family: var(--serif); font-size: 18px; color: var(--stone-900); margin-bottom: 4px; }
.author-info .role { font-size: 13px; color: var(--sage); font-weight: 600; margin-bottom: 6px; }
.author-info p { font-size: 14px; color: var(--stone-500); line-height: 1.6; }

/* ══════════════════════════════════════ */
/*       RELATED ARTICLES SECTION         */
/* ══════════════════════════════════════ */
.related-section {
  background: var(--stone-900);
  padding: 56px 32px;
  margin-top: 56px;
}
.related-inner { max-width: 1000px; margin: 0 auto; }
.related-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 36px;
}
.related-header h2 {
  font-family: var(--serif);
  font-size: 28px;
  color: white;
  white-space: nowrap;
}
.related-header .line { flex: 1; height: 1px; background: var(--stone-700); }
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.related-card {
  background: var(--stone-800);
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.2s;
}
.related-card:hover { transform: translateY(-4px); }
.related-card-image {
  height: 180px;
  background: var(--stone-700);
  background-size: cover;
  background-position: center;
}
.related-card-content { padding: 20px; }
.related-card-cat {
  font-size: 11px;
  font-weight: 700;
  color: var(--amber-500);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
}
.related-card-content h3 {
  font-family: var(--serif);
  font-size: 17px;
  color: white;
  line-height: 1.35;
  margin-bottom: 12px;
}
.related-card-meta { font-size: 12px; color: var(--stone-400); }

/* ══════════════════════════════════════ */
/*              PAGINATION                */
/* ══════════════════════════════════════ */
.pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 40px;
}
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
}
.pagination a {
  background: var(--cream);
  border: 1px solid var(--stone-200);
  color: var(--stone-600);
}
.pagination a:hover { background: var(--sage-bg); border-color: var(--sage); color: var(--sage); }
.pagination .current {
  background: var(--sage);
  color: white;
  border: 1px solid var(--sage);
}

/* ══════════════════════════════════════ */
/*              SITE FOOTER               */
/* ══════════════════════════════════════ */
.site-footer {
  background: var(--stone-900);
  color: var(--stone-400);
  padding: 56px 32px 32px;
}
.site-footer.post-footer {
  margin-top: 0;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--stone-800);
}
.footer-brand .footer-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.footer-brand .footer-logo .logo-icon { background: var(--sage); width: 36px; height: 36px; font-size: 16px; }
.footer-brand .footer-logo span { font-family: var(--serif); font-size: 18px; color: white; }
.footer-brand p { font-size: 14px; line-height: 1.7; color: var(--stone-400); }
.footer-col h4 { color: white; font-size: 14px; font-weight: 700; margin-bottom: 16px; letter-spacing: 0.5px; }
.footer-col a { display: block; font-size: 14px; color: var(--stone-400); padding: 4px 0; transition: color 0.2s; }
.footer-col a:hover { color: var(--sage-light); }
.footer-bottom {
  max-width: 1200px;
  margin: 24px auto 0;
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

/* ══════════════════════════════════════ */
/*              404 PAGE                  */
/* ══════════════════════════════════════ */
.page-404 {
  max-width: 600px;
  margin: 80px auto;
  text-align: center;
  padding: 0 32px;
}
.page-404 h1 {
  font-family: var(--serif);
  font-size: 80px;
  color: var(--stone-200);
}
.page-404 h2 {
  font-family: var(--serif);
  font-size: 28px;
  margin-bottom: 16px;
}
.page-404 p { color: var(--stone-500); margin-bottom: 32px; }
.page-404 a {
  display: inline-block;
  background: var(--sage);
  color: white;
  padding: 12px 28px;
  border-radius: 10px;
  font-weight: 600;
}

/* ══════════════════════════════════════ */
/*              RESPONSIVE                */
/* ══════════════════════════════════════ */
@media (max-width: 900px) {
  .content-area { grid-template-columns: 1fr; }
  .post-card { grid-template-columns: 1fr; }
  .post-card-image { min-height: 200px; }
  .featured-post { grid-template-columns: 1fr; }
  .featured-image { min-height: 240px; }
  .related-grid { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .header-top { flex-direction: column; gap: 16px; }
  .header-nav { flex-wrap: wrap; justify-content: center; }
  .hero h1 { font-size: 36px; }
  .single-hero-premium h1 { font-size: 32px; }
}
