/*
Theme Name: StackUnpacked
Template: generatepress
Version: 1.0
Description: StackUnpacked child theme
*/

/* ============================================================
   GLOBAL
   ============================================================ */
:root {
  --brand: #1a56db;
  --brand-dark: #1e429f;
  --accent: #ff6b35;
  --text: #1a1a2e;
  --muted: #6b7280;
  --bg: #ffffff;
  --bg-soft: #f8f9fc;
  --border: #e5e7eb;
  --max-width: 760px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-size-base: 17px;
  --line-height: 1.75;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

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

html { font-size: var(--font-size-base); }

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: var(--line-height);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); text-decoration: underline; }

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

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.site-header .inside-header {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0;
}

.site-title a {
  color: var(--text) !important;
  text-decoration: none !important;
}

.site-title a:hover { color: var(--brand) !important; }

.site-description { display: none; }

/* Nav */
.main-navigation {
  background: transparent;
}

.main-navigation .inside-navigation {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
}

.nav-float-right .main-navigation {
  float: right;
}

.main-navigation ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 4px;
}

.main-navigation ul li a {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 6px;
  transition: all .15s;
}

.main-navigation ul li a:hover {
  color: var(--brand);
  background: var(--bg-soft);
  text-decoration: none;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.site-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px;
}

.content-area {
  max-width: var(--max-width);
  margin: 0 auto;
}

/* Single post: no sidebar */
.single .content-area,
.page .content-area {
  max-width: var(--max-width);
  float: none;
  width: 100%;
}

/* Grid layout for home/archive */
.home .site-content,
.archive .site-content,
.blog .site-content {
  max-width: 1100px;
}

/* ============================================================
   ARTICLE HEADER
   ============================================================ */
.entry-header {
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.entry-title {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
  color: var(--text);
}

.entry-meta {
  font-size: 0.875rem;
  color: var(--muted);
}

.entry-meta .posted-on,
.entry-meta .byline {
  margin-right: 16px;
}

/* ============================================================
   ARTICLE BODY
   ============================================================ */
.entry-content {
  font-size: 1rem;
  line-height: var(--line-height);
}

.entry-content h2 {
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 2.5rem 0 1rem;
  color: var(--text);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--bg-soft);
}

.entry-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
  color: var(--text);
}

.entry-content p {
  margin: 0 0 1.25rem;
  color: #374151;
}

.entry-content ul,
.entry-content ol {
  margin: 0 0 1.25rem 1.5rem;
  padding: 0;
}

.entry-content li {
  margin-bottom: 0.5rem;
}

.entry-content strong {
  font-weight: 600;
  color: var(--text);
}

/* Tables */
.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

.entry-content table th {
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  padding: 12px 16px;
  text-align: left;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.entry-content table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  color: #374151;
}

.entry-content table tr:nth-child(even) td {
  background: var(--bg-soft);
}

.entry-content table tr:last-child td {
  border-bottom: none;
}

/* Blockquotes */
.entry-content blockquote {
  border-left: 4px solid var(--brand);
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  background: var(--bg-soft);
  border-radius: 0 8px 8px 0;
  font-style: normal;
  color: var(--text);
}

/* Affiliate link CTA */
.entry-content a[href="#"] {
  color: var(--accent);
  font-weight: 600;
}

/* Horizontal rules - hide markdown artifacts */
.entry-content hr,
.entry-content p:has(> strong:only-child):empty {
  display: none;
}

/* Remove --- artifacts */
.entry-content p {
  /* rendered --- as em dash in text, keep them */
}

/* Rating display */
.entry-content p strong:first-child {
  color: var(--text);
}

/* ============================================================
   POST CARDS (HOME / ARCHIVE)
   ============================================================ */
.posts-container,
.home .site-main,
.blog .site-main {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}

article.post {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
  display: flex;
  flex-direction: column;
}

article.post:hover {
  box-shadow: 0 8px 30px rgba(0,0,0,.1);
  transform: translateY(-2px);
}

.home .entry-header,
.blog .entry-header,
.archive .entry-header {
  border-bottom: none;
  padding: 24px 24px 0;
  margin-bottom: 0;
}

.home .entry-title,
.blog .entry-title,
.archive .entry-title {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 8px;
}

.home .entry-title a,
.blog .entry-title a,
.archive .entry-title a {
  color: var(--text) !important;
  text-decoration: none;
}

.home .entry-title a:hover,
.blog .entry-title a:hover,
.archive .entry-title a:hover {
  color: var(--brand) !important;
}

.entry-summary {
  padding: 12px 24px 24px;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
  flex: 1;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brand);
  margin: 0 24px 20px;
  text-decoration: none;
}

.read-more:hover { color: var(--brand-dark); text-decoration: underline; }

/* Category badge */
.cat-links a {
  background: var(--bg-soft);
  color: var(--brand);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
  border: 1px solid var(--border);
}

/* ============================================================
   VERDICT BOX (auto-styled for rating lines)
   ============================================================ */
.entry-content p:has(strong:first-child) {
  /* No special treatment by default */
}

/* Final verdict section */
.entry-content h2:last-of-type + p,
.entry-content h2 + p strong {
  /* clean */
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: #111827;
  color: #9ca3af;
  padding: 40px 24px;
  margin-top: 80px;
  font-size: 0.875rem;
}

.site-footer .inside-footer {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.site-footer a { color: #9ca3af; }
.site-footer a:hover { color: #fff; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .entry-title { font-size: 1.75rem; }
  .site-content { padding: 32px 16px; }

  .posts-container,
  .home .site-main,
  .blog .site-main {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   MISC
   ============================================================ */
.page-title {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 32px;
}

/* Hide sidebar on single posts */
.single .widget-area,
.page .widget-area {
  display: none;
}

/* GeneratePress container override */
.grid-container {
  max-width: 1200px !important;
}

/* Sticky header GeneratePress compat */
.is-sticky .site-header {
  box-shadow: 0 2px 10px rgba(0,0,0,.1);
}

/* ============================================================
   CONTENT PADDING FIX — text too close to container edge
   ============================================================ */
.single .inside-article,
.page .inside-article {
  padding: 40px 48px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--border);
}

@media (max-width: 768px) {
  .single .inside-article,
  .page .inside-article {
    padding: 24px 20px;
  }
}

/* ============================================================
   CONTENT PADDING FIX v2
   ============================================================ */
.single .inside-article {
  padding: 40px 48px !important;
}

.single .entry-content {
  padding: 0 !important;
}

@media (max-width: 768px) {
  .single .inside-article {
    padding: 24px 20px !important;
  }
}
