/*
Theme Name: CouponPress
Theme URI: https://yoursite.com
Author: Your Name
Description: Multi-brand affiliate coupon site with reveal & redirect. Custom post types for Brands and Coupons.
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: couponpress
*/

/* ─── Reset ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ─── Tokens ─────────────────────────────────────── */
:root {
  --accent:       #e8412a;
  --accent-2:     #7b3fa0;
  --accent-grad:  linear-gradient(135deg, #7b3fa0, #e8412a);
  --success:      #0f6e56;
  --success-grad: linear-gradient(135deg, #1d9e75, #0f6e56);
  --amber:        #c07820;
  --amber-grad:   linear-gradient(160deg, #c07820, #e8a020);

  --bg:        #f5f4f1;
  --surface:   #ffffff;
  --surface-2: #f0efec;
  --text:      #181816;
  --text-2:    #58574f;
  --text-3:    #98978f;
  --border:    rgba(0,0,0,0.08);
  --border-2:  rgba(0,0,0,0.14);

  --radius:    8px;
  --radius-lg: 14px;
  --shadow:    0 2px 12px rgba(0,0,0,0.07);
  --shadow-hover: 0 4px 20px rgba(0,0,0,0.11);

  --font-body:    'Inter', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'Courier New', monospace;
  --container:    1120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #151513;
    --surface:   #1f1f1d;
    --surface-2: #282826;
    --text:      #efeeea;
    --text-2:    #98978f;
    --text-3:    #58574f;
    --border:    rgba(255,255,255,0.07);
    --border-2:  rgba(255,255,255,0.13);
  }
}

/* ─── Base ─────────────────────────────────────── */
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.25rem;
}
.container--narrow { max-width: 720px; }

/* ─── Site Header ──────────────────────────────── */
.site-header {
  background: var(--surface);
  border-bottom: 0.5px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(8px);
}
.site-header__inner {
  display: flex; align-items: center;
  justify-content: space-between;
  height: 58px;
  gap: 1.5rem;
}
.site-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 18px; font-weight: 600; letter-spacing: 0.02em;
}
.site-logo__mark {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--accent-grad);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 16px; font-weight: 700;
}
.site-nav { display: flex; gap: 0.25rem; }
.site-nav a {
  font-size: 14px; color: var(--text-2); padding: 6px 12px;
  border-radius: var(--radius); transition: background 0.15s, color 0.15s;
}
.site-nav a:hover, .site-nav a.active {
  background: var(--surface-2); color: var(--text);
}
.header-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2); border: 0.5px solid var(--border);
  border-radius: var(--radius); padding: 6px 12px;
  font-size: 14px; color: var(--text-3);
  cursor: pointer; transition: border-color 0.15s;
}
.header-search:hover { border-color: var(--border-2); }
.header-search input {
  background: none; border: none; outline: none;
  color: var(--text); font-size: 14px; width: 160px;
}

/* ─── Hero Banner ──────────────────────────────── */
.hero-banner {
  background: var(--surface);
  border-bottom: 0.5px solid var(--border);
  padding: 3.5rem 1.25rem;
  text-align: center;
}
.hero-banner__eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff0ed; color: #c0394f;
  font-size: 12px; font-weight: 500;
  padding: 4px 12px; border-radius: 20px;
  border: 0.5px solid rgba(192,57,79,0.2);
  margin-bottom: 1.25rem;
}
@media (prefers-color-scheme: dark) {
  .hero-banner__eyebrow { background: rgba(192,57,79,0.15); }
}
.hero-banner h1 {
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 700; letter-spacing: -0.02em;
  line-height: 1.15; margin-bottom: 1rem;
}
.hero-banner h1 span {
  background: var(--accent-grad);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-banner p {
  font-size: 16px; color: var(--text-2);
  max-width: 520px; margin: 0 auto 2rem;
}
.hero-stats {
  display: flex; justify-content: center; gap: 2.5rem; flex-wrap: wrap;
}
.hero-stats__item { text-align: center; }
.hero-stats__num {
  font-size: 24px; font-weight: 700;
  background: var(--accent-grad);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-stats__label { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* ─── Section ──────────────────────────────────── */
.section { padding: 3rem 0; }
.section__header {
  display: flex; align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.section__title {
  font-size: 18px; font-weight: 600; letter-spacing: -0.01em;
}
.section__more {
  font-size: 13px; color: var(--accent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}
.section__more:hover { border-color: var(--accent); }

/* ─── Brand Grid ───────────────────────────────── */
.brand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.brand-card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1rem;
  text-align: center;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.brand-card:hover {
  border-color: rgba(232,65,42,0.3);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.brand-card__logo {
  width: 56px; height: 56px; border-radius: 12px;
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; color: white;
  overflow: hidden;
}
.brand-card__logo img { width: 100%; height: 100%; object-fit: contain; }
.brand-card__name { font-size: 14px; font-weight: 600; }
.brand-card__count {
  font-size: 12px; color: var(--text-3);
  background: var(--surface-2);
  padding: 2px 8px; border-radius: 20px;
}

/* ─── Coupon List ──────────────────────────────── */
.coupon-list { display: flex; flex-direction: column; gap: 10px; }
.coupon-item {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex; align-items: stretch;
  overflow: hidden;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.coupon-item:hover {
  border-color: rgba(232,65,42,0.3);
  box-shadow: var(--shadow);
}
.coupon-item__badge {
  width: 80px; flex-shrink: 0;
  background: var(--accent-grad);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 14px 8px;
  color: white;
}
.coupon-item__badge.amber { background: var(--amber-grad); }
.coupon-item__badge.success { background: var(--success-grad); }
.coupon-item__badge-value {
  font-size: 21px; font-weight: 700; line-height: 1;
}
.coupon-item__badge-label {
  font-size: 10px; opacity: 0.85; margin-top: 3px;
  letter-spacing: 0.05em; text-transform: uppercase;
}
.coupon-item__body {
  flex: 1; padding: 14px 16px; min-width: 0;
}
.coupon-item__brand {
  font-size: 11px; color: var(--text-3); text-transform: uppercase;
  letter-spacing: 0.07em; margin-bottom: 3px;
}
.coupon-item__title {
  font-size: 15px; font-weight: 600; margin-bottom: 4px;
}
.coupon-item__desc {
  font-size: 13px; color: var(--text-2); line-height: 1.5;
}
.coupon-item__meta {
  display: flex; gap: 12px; margin-top: 6px;
  font-size: 11px; color: var(--text-3);
  align-items: center;
}
.coupon-item__tag {
  background: var(--surface-2); padding: 2px 7px;
  border-radius: 20px; font-size: 11px; color: var(--text-2);
}
.coupon-item__action {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 6px; padding: 0 16px; flex-shrink: 0;
}

/* ─── Reveal Button ─────────────────────────────── */
.reveal-btn {
  position: relative;
  width: 120px; height: 42px;
  border-radius: var(--radius);
  border: none; cursor: pointer;
  background: var(--accent-grad);
  color: white; font-size: 13px; font-weight: 500;
  overflow: hidden;
  transition: opacity 0.15s;
}
.reveal-btn:hover { opacity: 0.88; }
.reveal-btn__default,
.reveal-btn__code {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  transition: transform 0.28s cubic-bezier(.4,0,.2,1), opacity 0.28s;
}
.reveal-btn__code {
  font-family: var(--font-mono);
  font-size: 13px; letter-spacing: 0.07em;
  transform: translateY(110%); opacity: 0;
}
.reveal-btn.is-revealed .reveal-btn__default {
  transform: translateY(-110%); opacity: 0;
}
.reveal-btn.is-revealed .reveal-btn__code {
  transform: translateY(0); opacity: 1;
}
.reveal-btn.is-revealed { background: var(--success-grad); }

.redirect-bar {
  display: none; align-items: center; gap: 5px;
  font-size: 11px; color: var(--text-3);
}
.redirect-bar.is-active { display: flex; }
.redirect-bar__dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent);
  animation: blink 0.75s ease-in-out infinite;
}
@keyframes blink { 0%,100%{opacity:0.2} 50%{opacity:1} }

/* ─── Brand Hero (single-brand.php) ────────────── */
.brand-hero {
  background: var(--surface);
  border-bottom: 0.5px solid var(--border);
  padding: 2.5rem 1.25rem;
}
.brand-hero__inner {
  display: flex; align-items: center; gap: 1.5rem;
  flex-wrap: wrap;
}
.brand-hero__logo {
  width: 72px; height: 72px; border-radius: 14px;
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700; color: white;
  overflow: hidden; flex-shrink: 0;
}
.brand-hero__logo img { width: 100%; height: 100%; object-fit: contain; }
.brand-hero__info h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.015em; }
.brand-hero__info p { font-size: 14px; color: var(--text-2); margin-top: 4px; max-width: 480px; }
.brand-hero__meta {
  display: flex; gap: 1rem; margin-top: 10px; flex-wrap: wrap;
}
.brand-hero__pill {
  font-size: 12px; color: var(--text-3);
  background: var(--surface-2); padding: 4px 10px; border-radius: 20px;
  display: flex; align-items: center; gap: 5px;
}

/* ─── Category Pills ────────────────────────────── */
.cat-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 1.5rem; }
.cat-pill {
  font-size: 13px; padding: 6px 14px; border-radius: 20px;
  background: var(--surface); border: 0.5px solid var(--border);
  color: var(--text-2); cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.cat-pill:hover, .cat-pill.is-active {
  background: #fff0ed; border-color: rgba(232,65,42,0.3); color: var(--accent);
}
@media (prefers-color-scheme: dark) {
  .cat-pill.is-active { background: rgba(232,65,42,0.12); }
}

/* ─── Notice / Trust bar ────────────────────────── */
.trust-bar {
  display: flex; justify-content: center; gap: 2rem;
  padding: 0.8rem 1.25rem; flex-wrap: wrap;
  background: var(--surface-2);
  border-bottom: 0.5px solid var(--border);
  font-size: 13px; color: var(--text-2);
}
.trust-bar__item { display: flex; align-items: center; gap: 6px; }
.trust-bar__item svg { color: var(--accent); }

/* ─── Footer ─────────────────────────────────────── */
.site-footer {
  background: var(--surface);
  border-top: 0.5px solid var(--border);
  padding: 2.5rem 1.25rem;
  margin-top: 3rem;
}
.site-footer__inner {
  display: flex; flex-direction: column;
  align-items: center; gap: 1rem; text-align: center;
}
.site-footer__links { display: flex; gap: 1.5rem; flex-wrap: wrap; justify-content: center; }
.site-footer__links a { font-size: 13px; color: var(--text-3); }
.site-footer__links a:hover { color: var(--text); }
.site-footer__copy { font-size: 12px; color: var(--text-3); }
.affiliate-notice {
  font-size: 12px; color: var(--text-3);
  background: var(--surface-2); padding: 8px 16px;
  border-radius: var(--radius); border: 0.5px solid var(--border);
}

/* ─── Utilities ─────────────────────────────────── */
.btn-primary {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--accent-grad); color: white;
  padding: 10px 22px; border-radius: var(--radius);
  font-size: 14px; font-weight: 500; border: none; cursor: pointer;
  text-decoration: none; transition: opacity 0.15s;
}
.btn-primary:hover { opacity: 0.88; }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 7px;
  background: transparent; color: var(--text);
  padding: 10px 20px; border-radius: var(--radius);
  font-size: 14px; font-weight: 500;
  border: 0.5px solid var(--border-2); cursor: pointer;
  text-decoration: none; transition: background 0.15s;
}
.btn-ghost:hover { background: var(--surface-2); }
.badge {
  display: inline-block; font-size: 11px; font-weight: 500;
  padding: 3px 8px; border-radius: 20px;
}
.badge--new { background: #e1f5ee; color: #0f6e56; }
.badge--hot { background: #fff0ed; color: #c0394f; }
.badge--verified { background: #f0efec; color: #58574f; }
@media (prefers-color-scheme: dark) {
  .badge--new { background: #04342c; color: #5dcaa5; }
  .badge--hot { background: #4a1b0c; color: #f09975; }
}

/* ─── Responsive ─────────────────────────────────── */
@media (max-width: 640px) {
  .brand-grid { grid-template-columns: repeat(2, 1fr); }
  .coupon-item__action { padding: 0 10px; }
  .reveal-btn { width: 100px; }
  .site-nav { display: none; }
  .hero-banner { padding: 2rem 1.25rem; }
}
