/*
Theme Name: StackReview
Theme URI: https://example.com/
Author: Cuong
Description: Theme review affiliate phong cách neobrutalism — lấy cảm hứng từ stackbalo.com. Card màu pastel, viền đen, bóng đổ cứng, badge rating, hộp pros/cons, nút CTA affiliate.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: stackreview
Tags: blog, news, two-columns, custom-logo, custom-menu, featured-images, translation-ready
*/

:root {
  --cream: #fbf3e6;
  --ink: #1a1a1a;
  --white: #fffdf8;
  --pink: #f06fae;
  --pink-soft: #f8e1e3;
  --yellow: #f6c947;
  --blue: #74b9e8;
  --green: #9fd468;
  --green-soft: #daedbc;
  --red-soft: #f5d3c8;
  --purple: #b79ce0;
  --border: 2px solid var(--ink);
  --radius: 16px;
  --shadow: 5px 5px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
}

img { max-width: 100%; height: auto; }
a { color: var(--ink); }

h1, h2, h3, h4, .site-title {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.01em;
}

.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 780px; margin: 0 auto; padding: 0 24px; }

/* ---------- Header ---------- */
.site-header {
  background: var(--cream);
  border-bottom: var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .container {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 64px;
}
.site-branding { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.site-logo-mark {
  width: 32px; height: 32px;
  background: var(--pink);
  border: var(--border);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 15px;
  flex-shrink: 0;
}
.custom-logo { width: 34px; height: 34px; object-fit: contain; border-radius: 9px; }
.site-title { font-size: 22px; margin: 0; }
.site-title a { text-decoration: none; }

.main-nav { flex: 1; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 22px; flex-wrap: wrap; }
.main-nav a { text-decoration: none; font-weight: 600; font-size: 14.5px; }
.main-nav li:nth-child(6n+1) > a { color: #d6438f; }
.main-nav li:nth-child(6n+2) > a { color: #c98a00; }
.main-nav li:nth-child(6n+3) > a { color: #4a9e2f; }
.main-nav li:nth-child(6n+4) > a { color: #d97706; }
.main-nav li:nth-child(6n+5) > a { color: #2f7fc1; }
.main-nav li:nth-child(6n+6) > a { color: #8b5cf6; }
.main-nav a:hover { text-decoration: underline; }

.header-actions { display: flex; align-items: center; gap: 12px; }
.header-search-toggle {
  background: none; border: none; cursor: pointer; font-size: 17px; padding: 6px;
}

/* ---------- Buttons & pills ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(100deg, var(--pink), #e0559b);
  color: #fff !important;
  font-weight: 700; font-size: 15px;
  padding: 11px 22px;
  border: var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s;
  font-family: var(--font-body);
}
.btn:hover { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn-dark { background: var(--ink); }

.pill {
  display: inline-block;
  font-size: 12.5px; font-weight: 700;
  padding: 4px 13px;
  background: var(--white);
  border: var(--border);
  border-radius: 999px;
  text-decoration: none;
  line-height: 1.5;
}
.pill:hover { background: var(--yellow); }
.pill-pink { color: #d6438f; }
.pill-yellow { color: #c98a00; }
.pill-green { color: #4a9e2f; }
.pill-blue { color: #2f7fc1; }
.pill-purple { color: #8b5cf6; }
.pill-orange { color: #d97706; }

.rating-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--ink);
  color: #fff;
  font-size: 13px; font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  line-height: 1.5;
}
.rating-badge .star { color: var(--yellow); }

/* ---------- Hero (home) ---------- */
.home-hero {
  background: linear-gradient(100deg, #f2c94c 0%, #f2a0c4 34%, #b79ce0 68%, #74b9e8 100%);
  border-bottom: var(--border);
  padding: 64px 0 56px;
}
.hero-badge {
  display: inline-block;
  background: var(--cream);
  border: var(--border);
  border-radius: 999px;
  font-size: 13px; font-weight: 600;
  padding: 5px 16px;
  margin-bottom: 20px;
}
.hero-title { font-size: clamp(38px, 6vw, 62px); margin: 0 0 12px; font-weight: 900; }
.hero-title .highlight {
  background: var(--ink); color: var(--cream);
  padding: 0 14px; border-radius: 8px;
  display: inline-block;
}
.hero-subtitle { font-size: 18px; margin: 0 0 26px; }
.hero-cats { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-cats .pill { padding: 8px 20px; font-size: 14px; }

/* ---------- Sections ---------- */
.section { padding: 48px 0 24px; }
.section-title { font-size: 30px; margin: 0 0 26px; display: flex; align-items: center; gap: 10px; }

/* ---------- Card grid ---------- */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
@media (max-width: 900px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .card-grid { grid-template-columns: 1fr; } }

.review-card {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  transition: transform .12s, box-shadow .12s;
  position: relative;
}
.review-card:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }

.card-thumb {
  height: 190px;
  border-bottom: var(--border);
  position: relative;
  background-size: cover;
  background-position: center;
}
.card-thumb.color-0 { background-color: var(--yellow); }
.card-thumb.color-1 { background-color: var(--green); }
.card-thumb.color-2 { background-color: var(--blue); }
.card-thumb.color-3 { background-color: #ef8fc0; }

.card-thumb .pill { position: absolute; top: 12px; left: 12px; }
.card-thumb .rating-badge { position: absolute; top: 12px; right: 12px; }

.card-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; }
.card-title { font-size: 19px; margin: 0; }
.card-title a { text-decoration: none; }
.card-title a:hover { text-decoration: underline; }
.card-excerpt { font-size: 14px; color: #555; margin: 0; }

/* ---------- Pagination ---------- */
.pagination { display: flex; justify-content: center; gap: 8px; padding: 30px 0 10px; flex-wrap: wrap; }
.pagination .page-numbers {
  display: inline-block;
  min-width: 40px; text-align: center;
  padding: 8px 14px;
  background: var(--white);
  border: var(--border);
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600; font-size: 14px;
}
.pagination .page-numbers.current { background: var(--ink); color: var(--cream); }
.pagination .page-numbers:hover:not(.current) { background: var(--yellow); }

/* ---------- Single post ---------- */
.single-hero {
  background: var(--pink-soft);
  border-bottom: var(--border);
  padding: 56px 0 48px;
}
.single-hero .pill { margin-bottom: 18px; }
.single-title { font-size: clamp(32px, 5vw, 52px); margin: 0 0 16px; font-weight: 900; }
.single-excerpt { font-size: 18px; color: #444; margin: 0 0 26px; max-width: 640px; }

.product-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.product-logo {
  width: 52px; height: 52px;
  border: var(--border); border-radius: 12px;
  background: #fff; object-fit: contain;
}
.product-name { font-family: var(--font-display); font-weight: 800; font-size: 24px; }
.product-row .rating-badge { font-size: 14px; padding: 6px 14px; }

/* ---------- Entry content ---------- */
.single-content { padding: 48px 0 30px; }
.entry-content { font-size: 17px; }
.entry-content h2 { font-size: 30px; margin: 44px 0 14px; }
.entry-content h3 { font-size: 23px; margin: 34px 0 12px; }
.entry-content a { color: #d6438f; font-weight: 600; }
.entry-content img,
.entry-content .wp-block-image img {
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.entry-content blockquote {
  border: var(--border); border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  margin: 28px 0; padding: 18px 24px;
  font-style: italic;
}
.entry-content table { border-collapse: collapse; width: 100%; background: var(--white); }
.entry-content th, .entry-content td { border: 1.5px solid var(--ink); padding: 10px 14px; text-align: left; }
.entry-content th { background: var(--yellow); font-weight: 700; }

.single-featured-image { margin: -80px auto 0; position: relative; z-index: 2; }
.single-featured-image img {
  display: block; width: 100%;
  border: var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- Pros / Cons ---------- */
.pros-cons { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 40px 0; }
@media (max-width: 640px) { .pros-cons { grid-template-columns: 1fr; } }
.pros-box, .cons-box {
  border: var(--border); border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}
.pros-box { background: var(--green-soft); }
.cons-box { background: var(--red-soft); }
.pros-box h3, .cons-box h3 { margin: 0 0 14px; font-size: 20px; }
.pros-box ul, .cons-box ul { list-style: none; margin: 0; padding: 0; }
.pros-box li, .cons-box li { padding: 5px 0 5px 28px; position: relative; font-size: 15px; }
.pros-box li::before { content: "✓"; position: absolute; left: 0; font-weight: 700; }
.cons-box li::before { content: "✕"; position: absolute; left: 0; font-weight: 700; }

/* ---------- Verdict / CTA box ---------- */
.verdict-box {
  border: var(--border); border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
  padding: 30px 32px;
  margin: 44px 0;
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
}
.verdict-box h3 { margin: 0 0 6px; font-size: 22px; }
.verdict-box p { margin: 0; color: #555; font-size: 15px; }

.affiliate-note { font-size: 13px; color: #777; margin-top: 10px; }

/* ---------- Related ---------- */
.related-section { padding: 20px 0 60px; }

/* ---------- Archive hero ---------- */
.archive-hero {
  background: linear-gradient(100deg, #f2c94c, #f2a0c4 55%, #74b9e8);
  border-bottom: var(--border);
  padding: 46px 0;
}
.archive-hero h1 { font-size: clamp(30px, 4.5vw, 44px); margin: 0; }
.archive-hero p { margin: 8px 0 0; }

/* ---------- Newsletter / footer ---------- */
.newsletter {
  border-top: var(--border);
  background: var(--purple);
  padding: 56px 0;
  text-align: center;
}
.newsletter h2 { font-size: 32px; margin: 0 0 8px; }
.newsletter p { margin: 0 0 22px; }
.newsletter-form { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.newsletter-form input[type="email"] {
  border: var(--border); border-radius: 999px;
  padding: 11px 20px; font-size: 15px; min-width: 280px;
  font-family: var(--font-body);
}

.site-footer {
  border-top: var(--border);
  background: var(--cream);
  padding: 28px 0;
  text-align: center;
  font-size: 13.5px;
  color: #666;
}
.site-footer p { margin: 4px 0; }

/* ---------- Search ---------- */
.search-form { display: flex; gap: 10px; flex-wrap: wrap; }
.search-form input[type="search"] {
  border: var(--border); border-radius: 999px;
  padding: 10px 18px; font-size: 15px; flex: 1; min-width: 200px;
  font-family: var(--font-body);
  background: var(--white);
}
.header-search { border-bottom: var(--border); background: var(--white); padding: 14px 0; display: none; }
.header-search.open { display: block; }

/* ---------- Page / misc ---------- */
.page-content { padding: 50px 0 60px; }
.error-404 { text-align: center; padding: 90px 24px; }
.error-404 h1 { font-size: 60px; margin: 0 0 10px; }

.comments-area { max-width: 780px; margin: 0 auto; padding: 0 24px 60px; }

.screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px);
  position: absolute !important;
  height: 1px; width: 1px; overflow: hidden;
}

@media (max-width: 760px) {
  .site-header .container { flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
  .main-nav { order: 3; width: 100%; }
  .home-hero { padding: 44px 0 40px; }
}
