/*
Theme Name: FreeGoods
Theme URI: https://freegoods.org
Author: Rafi Naufal
Author URI: https://freegoods.org
Description: Dark editorial magazine theme for FreeGoods.org — honest online shopping recommendations, Shopee affiliate blog.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: freegoods
Tags: blog, affiliate, magazine, dark, editorial
*/

/* ============================================================
   GOOGLE FONTS
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,700;0,900;1,700&family=DM+Sans:wght@300;400;500&family=DM+Mono:wght@400;500&display=swap');

/* ============================================================
   CSS VARIABLES
   ============================================================ */
:root {
  --bg-primary:    #0a0a08;
  --bg-surface:    #111110;
  --bg-card:       #161614;
  --bg-hover:      #1e1e1b;
  --text-primary:  #f0ede6;
  --text-muted:    rgba(240, 237, 230, 0.5);
  --text-faint:    rgba(240, 237, 230, 0.3);
  --text-hint:     rgba(240, 237, 230, 0.18);
  --accent:        #b8f07a;
  --accent-dark:   #8ecf50;
  --border:        rgba(240, 237, 230, 0.1);
  --border-light:  rgba(240, 237, 230, 0.06);
  --font-display:  'Playfair Display', Georgia, serif;
  --font-body:     'DM Sans', system-ui, sans-serif;
  --font-mono:     'DM Mono', 'Courier New', monospace;
  --radius-sm:     4px;
  --radius-md:     8px;
  --radius-lg:     12px;
  --max-width:     1160px;
  --gap:           28px;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--text-primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent); }

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

ul, ol { list-style: none; }

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.site-wrapper { min-height: 100vh; display: flex; flex-direction: column; }
.site-content { flex: 1; }

/* ============================================================
   NAVIGATION
   ============================================================ */
.site-header {
  border-bottom: 0.5px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 8, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
}

.site-logo {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  text-decoration: none;
}

.site-logo span { color: var(--accent); }

.main-nav { display: flex; gap: 28px; align-items: center; }

.main-nav a {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.main-nav a:hover,
.main-nav a.active { color: var(--text-primary); }

.nav-search {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-faint);
  cursor: pointer;
  border: none;
  background: none;
  letter-spacing: 0.06em;
  padding: 6px 12px;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.nav-search:hover { border-color: rgba(240,237,230,0.3); color: var(--text-primary); }

/* Mobile hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 4px;
  font-size: 22px;
}

/* ============================================================
   TICKER BAR
   ============================================================ */
.ticker-bar {
  display: flex;
  border-bottom: 0.5px solid var(--border);
  overflow: hidden;
}

.ticker-label {
  background: var(--accent);
  color: #0a0a08;
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 9px 16px;
  white-space: nowrap;
  flex-shrink: 0;
}

.ticker-track {
  overflow: hidden;
  flex: 1;
  position: relative;
}

.ticker-items {
  display: flex;
  gap: 40px;
  padding: 9px 20px;
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  color: var(--text-muted);
  animation: ticker-scroll 30s linear infinite;
  white-space: nowrap;
}

@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.ticker-items:hover { animation-play-state: paused; }

.ticker-sep { color: var(--text-hint); }

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero-section {
  padding: 52px 0 40px;
  border-bottom: 0.5px solid var(--border);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.hero-tag {
  font-size: 10px;
  font-family: var(--font-mono);
  letter-spacing: 0.14em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 20px;
}

.hero-headline {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 900;
  line-height: 1.04;
  letter-spacing: -1.5px;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.hero-headline em {
  font-style: italic;
  color: var(--accent);
}

.hero-sub {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 380px;
  margin-bottom: 28px;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #0a0a08;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background 0.2s;
}

.hero-cta:hover { background: var(--accent-dark); color: #0a0a08; }

/* Hero sidebar — latest posts list */
.hero-sidebar { border-left: 0.5px solid var(--border); padding-left: 48px; }

.hero-list-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 18px 0;
  border-bottom: 0.5px solid var(--border-light);
  transition: opacity 0.2s;
}

.hero-list-item:first-child { padding-top: 0; }
.hero-list-item:last-child  { border-bottom: none; padding-bottom: 0; }
.hero-list-item:hover { opacity: 0.75; }

.hero-list-num {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--text-hint);
  line-height: 1;
  min-width: 28px;
}

.hero-list-title {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text-primary);
  margin-bottom: 5px;
}

.hero-list-meta {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-faint);
  letter-spacing: 0.04em;
}

/* ============================================================
   SECTION HEADER
   ============================================================ */
.section-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 28px 0 20px;
}

.section-label {
  font-size: 10px;
  font-family: var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  white-space: nowrap;
}

.section-line {
  flex: 1;
  height: 0.5px;
  background: var(--border);
}

.section-more {
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.2s;
}

.section-more:hover { opacity: 0.7; color: var(--accent); }

/* ============================================================
   POST CARDS GRID
   ============================================================ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 0.5px solid var(--border);
  margin-bottom: 0;
}

.post-card {
  padding: 20px;
  border-right: 0.5px solid var(--border);
  border-bottom: 0.5px solid var(--border);
  transition: background 0.2s;
  display: flex;
  flex-direction: column;
}

.post-card:hover { background: var(--bg-card); }

.cards-grid .post-card:nth-child(3n) { border-right: none; }

.post-card-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  overflow: hidden;
  position: relative;
}

.post-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.post-card:hover .post-card-thumb img { transform: scale(1.03); }

.post-card-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: var(--text-hint);
}

.post-card-cat {
  font-size: 10px;
  font-family: var(--font-mono);
  letter-spacing: 0.12em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 8px;
  text-decoration: none;
}

.post-card-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
  margin-bottom: 10px;
  flex: 1;
}

.post-card-excerpt {
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-muted);
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-faint);
}

.post-rating { color: var(--accent); letter-spacing: 2px; }

/* ============================================================
   FEATURED / WIDE CARD
   ============================================================ */
.featured-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 40px;
  transition: background 0.2s;
}

.featured-card:hover { background: var(--bg-card); }

.featured-card-thumb {
  background: var(--bg-surface);
  min-height: 260px;
  overflow: hidden;
}

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

.featured-card-body {
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-badge {
  display: inline-block;
  font-size: 10px;
  font-family: var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--accent);
  color: #0a0a08;
  padding: 4px 12px;
  border-radius: 2px;
  margin-bottom: 16px;
}

.featured-card-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.featured-card-excerpt {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.featured-card-link {
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  color: var(--accent);
  text-decoration: none;
  text-transform: uppercase;
}

.featured-card-link:hover { color: var(--accent-dark); }

/* ============================================================
   SIDEBAR LAYOUT (blog page)
   ============================================================ */
.content-area {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
  padding: 40px 0;
}

/* ============================================================
   SIDEBAR WIDGETS
   ============================================================ */
.sidebar { display: flex; flex-direction: column; gap: 32px; }

.widget {
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.widget-title {
  font-size: 10px;
  font-family: var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 14px 16px;
  border-bottom: 0.5px solid var(--border);
}

.widget-content { padding: 16px; }

/* Category pills */
.cat-pills { display: flex; flex-wrap: wrap; gap: 8px; }

.cat-pill {
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border: 0.5px solid var(--border);
  padding: 5px 12px;
  border-radius: 2px;
  text-decoration: none;
  transition: all 0.2s;
}

.cat-pill:hover { border-color: var(--accent); color: var(--accent); }

/* Shopee deal widget */
.deal-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 0.5px solid var(--border-light);
  align-items: flex-start;
}

.deal-item:last-child { border-bottom: none; padding-bottom: 0; }

.deal-thumb {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  flex-shrink: 0;
  overflow: hidden;
}

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

.deal-name { font-size: 12px; font-weight: 500; line-height: 1.35; margin-bottom: 3px; }

.deal-price {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--accent);
}

.deal-original {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-faint);
  text-decoration: line-through;
  margin-left: 6px;
}

/* ============================================================
   SINGLE POST
   ============================================================ */
.post-header { padding: 48px 0 32px; border-bottom: 0.5px solid var(--border); margin-bottom: 40px; }

.post-category {
  font-size: 10px;
  font-family: var(--font-mono);
  letter-spacing: 0.14em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 16px;
  display: block;
}

.post-title {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -1.5px;
  color: var(--text-primary);
  margin-bottom: 20px;
  max-width: 800px;
}

.post-meta {
  display: flex;
  gap: 20px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-faint);
  letter-spacing: 0.04em;
}

.post-meta span { display: flex; align-items: center; gap: 6px; }

/* Post body */
.post-body {
  font-size: 17px;
  line-height: 1.8;
  color: rgba(240, 237, 230, 0.85);
  max-width: 720px;
}

.post-body h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 40px 0 16px;
  letter-spacing: -0.5px;
}

.post-body h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 32px 0 12px;
}

.post-body p { margin-bottom: 24px; }

.post-body a { color: var(--accent); text-decoration: underline; text-decoration-color: rgba(184,240,122,0.4); }
.post-body a:hover { text-decoration-color: var(--accent); }

.post-body ul, .post-body ol { margin: 0 0 24px 20px; }
.post-body li { margin-bottom: 8px; }
.post-body ul { list-style: disc; }
.post-body ol { list-style: decimal; }

.post-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 24px;
  margin: 32px 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-style: italic;
  color: var(--text-muted);
}

/* ============================================================
   AFFILIATE CTA BOX
   ============================================================ */
.affiliate-box {
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  margin: 40px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.affiliate-box-text { flex: 1; }

.affiliate-box-label {
  font-size: 10px;
  font-family: var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.affiliate-box-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.affiliate-box-price {
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.shopee-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ee4d2d;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s;
}

.shopee-btn:hover { background: #d43d1f; color: #fff; }

.shopee-btn svg { width: 16px; height: 16px; }

/* ============================================================
   PRODUCT REVIEW SCORE BOX
   ============================================================ */
.review-box {
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px;
  margin: 40px 0;
}

.review-box-title {
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 16px;
}

.review-score-big {
  font-family: var(--font-display);
  font-size: 64px;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 4px;
}

.review-score-label {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-faint);
  margin-bottom: 24px;
}

.review-criteria { display: flex; flex-direction: column; gap: 12px; }

.review-row { display: flex; align-items: center; gap: 12px; }

.review-row-label {
  font-size: 12px;
  color: var(--text-muted);
  width: 100px;
  flex-shrink: 0;
}

.review-bar-track {
  flex: 1;
  height: 3px;
  background: var(--bg-hover);
  border-radius: 2px;
  overflow: hidden;
}

.review-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
}

.review-row-score {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-faint);
  width: 28px;
  text-align: right;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  border-top: 0.5px solid var(--border);
  padding: 48px 0 24px;
  margin-top: 80px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand .site-logo { font-size: 22px; margin-bottom: 14px; display: block; }

.footer-brand p {
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-muted);
  max-width: 280px;
}

.footer-col h4 {
  font-size: 10px;
  font-family: var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 14px;
}

.footer-col ul { display: flex; flex-direction: column; gap: 8px; }

.footer-col ul li a {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-col ul li a:hover { color: var(--text-primary); }

.footer-bottom {
  border-top: 0.5px solid var(--border);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-faint);
  letter-spacing: 0.04em;
}

.affiliate-disclaimer {
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.6;
  margin-bottom: 24px;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 40px 0;
}

.page-numbers {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.2s;
}

.page-numbers:hover,
.page-numbers.current {
  border-color: var(--accent);
  color: var(--accent);
}

/* ============================================================
   SEARCH OVERLAY
   ============================================================ */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,10,8,0.97);
  z-index: 999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 120px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.search-overlay.open { opacity: 1; pointer-events: all; }

.search-input-wrap {
  width: 100%;
  max-width: 600px;
  position: relative;
  padding: 0 24px;
}

.search-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  padding: 16px 0;
  outline: none;
  caret-color: var(--accent);
}

.search-input::placeholder { color: var(--text-hint); }

.search-close {
  position: fixed;
  top: 28px;
  right: 28px;
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: 28px;
  cursor: pointer;
}

/* ============================================================
   UTILITIES
   ============================================================ */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-sidebar { border-left: none; padding-left: 0; border-top: 0.5px solid var(--border); padding-top: 32px; }
  .hero-headline { font-size: 36px; }
  .cards-grid { grid-template-columns: 1fr 1fr; }
  .cards-grid .post-card:nth-child(3n) { border-right: 0.5px solid var(--border); }
  .cards-grid .post-card:nth-child(2n) { border-right: none; }
  .featured-card { grid-template-columns: 1fr; }
  .content-area { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  :root { --gap: 16px; }
  .hero-headline { font-size: 28px; }
  .cards-grid { grid-template-columns: 1fr; }
  .cards-grid .post-card { border-right: none; }
  .main-nav { display: none; }
  .main-nav.open { display: flex; flex-direction: column; position: fixed; inset: 0; background: var(--bg-primary); z-index: 200; align-items: center; justify-content: center; gap: 32px; }
  .main-nav.open a { font-size: 18px; }
  .nav-toggle { display: block; }
  .post-title { font-size: 28px; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
}
