/* =============================================================
   DiscountTemu — main.css
   Design language: "the coupon as a physical ticket".
   Warm receipt-paper background, espresso ink, hot deal orange,
   verified green. Display: Bricolage Grotesque. Body: Instrument
   Sans. Codes: JetBrains Mono.
   ============================================================= */

:root {
  /* Color tokens */
  --paper: #FFF6EC;
  --paper-2: #FFEDDB;
  --white: #FFFFFF;
  --ink: #221405;
  --ink-soft: #6B573F;
  --line: #EBD9C3;
  --orange: #F4610C;
  --orange-deep: #C2440A;
  --orange-soft: #FFE3CE;
  --green: #0E7A4F;
  --green-soft: #DCF2E6;
  --gold: #FFD44D;

  /* Type */
  --font-display: "Bricolage Grotesque", "Arial Black", Impact, sans-serif;
  --font-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Shape + depth */
  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 14px 34px rgba(34, 20, 5, 0.10);
  --shadow-soft: 0 6px 18px rgba(34, 20, 5, 0.07);

  /* Layout */
  --wrap: 1140px;
  --gutter: clamp(1rem, 4vw, 2rem);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--orange-deep); text-decoration-thickness: 1.5px; text-underline-offset: 2px; }
a:hover { color: var(--orange); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.3rem, 5.4vw, 3.9rem); font-weight: 800; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); font-weight: 700; }
h3 { font-size: clamp(1.2rem, 2.2vw, 1.45rem); font-weight: 700; }

p { margin: 0 0 1.1em; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

.section { padding-block: clamp(3.2rem, 7vw, 5.5rem); }
.section-tight { padding-block: clamp(2.2rem, 5vw, 3.5rem); }
.section-alt { background: var(--white); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--ink); color: var(--paper); padding: 0.6em 1em; border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 4px; }

/* ---------- Eyebrows, chips, fine print ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.5em;
  font-family: var(--font-mono); font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--orange-deep);
  background: var(--orange-soft); border: 1px solid rgba(196, 72, 12, 0.25);
  padding: 0.4em 0.85em; border-radius: 999px; margin-bottom: 1.1rem;
}

.chips { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1.2rem 0 0.4rem; padding: 0; list-style: none; }
.chips li {
  display: inline-flex; align-items: center; gap: 0.45em;
  background: var(--white); border: 1px solid var(--line); border-radius: 999px;
  padding: 0.42em 0.95em; font-size: 0.9rem; font-weight: 600; color: var(--ink-soft);
}
.chips li::before { content: "✓"; color: var(--green); font-weight: 800; }

.fine-print { font-size: 0.83rem; color: var(--ink-soft); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  font-family: var(--font-body); font-weight: 700; font-size: 1rem;
  border-radius: 999px; padding: 0.78em 1.5em; cursor: pointer;
  text-decoration: none; border: 2px solid transparent;
  transition: transform 0.12s ease, background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.btn:active { transform: translateY(1px) scale(0.99); }

.btn-primary { background: var(--orange); color: #fff; box-shadow: 0 8px 20px rgba(244, 97, 12, 0.32); }
.btn-primary:hover { background: var(--orange-deep); color: #fff; }

.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }

.btn-copy {
  background: var(--ink); color: var(--paper); font-family: var(--font-mono);
  font-size: 0.92rem; padding: 0.7em 1.25em;
}
.btn-copy:hover { background: #3a2810; color: #fff; }
.btn-copy.is-copied { background: var(--green); color: #fff; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255, 246, 236, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow 0.2s ease;
}
.site-header.is-scrolled { box-shadow: var(--shadow-soft); }

.header-inner {
  display: flex; align-items: center; gap: 1.5rem;
  min-height: 74px;
}

.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand-mark {
  display: inline-grid; place-items: center; width: 42px; height: 42px;
  background: var(--orange); color: #fff; border-radius: 12px;
  font-family: var(--font-display); font-weight: 800; font-size: 1.35rem;
  box-shadow: 0 6px 14px rgba(244, 97, 12, 0.35);
}
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 1.28rem; letter-spacing: -0.01em; }
.brand-name em { font-style: normal; color: var(--orange); }
.brand .custom-logo { max-height: 46px; width: auto; }

.site-nav ul { display: flex; gap: 0.4rem; list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: inline-block; text-decoration: none; color: var(--ink);
  font-weight: 600; font-size: 0.97rem; padding: 0.55em 0.9em; border-radius: 999px;
}
.site-nav a:hover { background: var(--orange-soft); color: var(--orange-deep); }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px; justify-content: center;
  background: none; border: 0; padding: 0.6rem; cursor: pointer;
}
.nav-toggle span:not(.sr-only) { width: 24px; height: 3px; background: var(--ink); border-radius: 2px; transition: transform 0.2s ease, opacity 0.2s ease; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ---------- Ticker ---------- */
.ticker {
  background: var(--ink); color: var(--gold);
  overflow: hidden; white-space: nowrap;
  border-bottom: 1px solid #000;
}
.ticker-track {
  display: inline-flex; gap: 3rem; padding: 0.55rem 0;
  font-family: var(--font-mono); font-size: 0.82rem; font-weight: 700; letter-spacing: 0.06em;
  animation: ticker-scroll 28s linear infinite;
}
.ticker-track span { display: inline-flex; align-items: center; gap: 3rem; }
.ticker-track b { color: #fff; font-weight: 700; }
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- Hero ---------- */
.hero { padding-block: clamp(3rem, 7vw, 5.5rem) clamp(3rem, 6vw, 4.5rem); }
.hero-grid {
  display: grid; grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 5vw, 4rem); align-items: center;
}
.hero-sub { font-size: clamp(1.05rem, 1.8vw, 1.2rem); color: var(--ink-soft); max-width: 34em; }
.hero h1 strong { color: var(--orange); }

/* ---------- The Ticket (signature element) ---------- */
.ticket {
  position: relative;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.8rem 1.8rem 1.4rem;
  transform: rotate(-1.2deg);
}
.ticket-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.ticket-off {
  font-family: var(--font-display); font-weight: 800; color: var(--orange);
  font-size: clamp(3rem, 6.5vw, 4.4rem); line-height: 0.95; letter-spacing: -0.02em;
}
.ticket-off small { display: block; font-family: var(--font-mono); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; color: var(--ink-soft); text-transform: uppercase; margin-bottom: 0.4rem; }
.ticket-store { font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-soft); text-align: right; text-transform: uppercase; letter-spacing: 0.1em; }

.ticket-tear {
  position: relative; margin: 1.4rem -1.8rem;
  border-top: 2px dashed var(--line);
}
.ticket-tear::before, .ticket-tear::after {
  content: ""; position: absolute; top: -14px; width: 28px; height: 28px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 50%;
}
.ticket-tear::before { left: -15px; }
.ticket-tear::after { right: -15px; }

.ticket-code-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.ticket-code {
  font-family: var(--font-mono); font-weight: 700;
  font-size: clamp(1.5rem, 3.4vw, 2.1rem); letter-spacing: 0.06em;
  background: var(--paper); border: 2px dashed var(--orange);
  border-radius: var(--radius-sm); padding: 0.35em 0.7em; color: var(--ink);
}

.ticket-barcode {
  margin-top: 1.4rem; height: 40px; border-radius: 3px;
  background: repeating-linear-gradient(90deg,
    var(--ink) 0 2px, transparent 2px 5px,
    var(--ink) 5px 8px, transparent 8px 11px,
    var(--ink) 11px 12px, transparent 12px 17px);
  opacity: 0.85;
}
.ticket-barcode-num {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.35em;
  color: var(--ink-soft); text-align: center; margin-top: 0.4rem; text-transform: uppercase;
}

.ticket-stamp {
  position: absolute; top: -16px; right: -12px; transform: rotate(7deg);
  font-family: var(--font-mono); font-weight: 700; font-size: 0.78rem;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--green); border: 3px solid var(--green); border-radius: 10px;
  padding: 0.4em 0.75em; background: rgba(255, 255, 255, 0.85);
}

/* ---------- Coupon cards ---------- */
.coupon-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.1rem, 2.5vw, 1.8rem); margin-top: 2.2rem;
}
.coupon-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-soft);
  padding: 1.6rem 1.5rem 1.5rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.coupon-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

.coupon-tag {
  align-self: flex-start; font-family: var(--font-mono); font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  background: var(--gold); color: var(--ink); border-radius: 6px; padding: 0.35em 0.7em;
  margin-bottom: 0.9rem;
}
.coupon-card.is-featured .coupon-tag { background: var(--orange); color: #fff; }

.coupon-title { font-size: 1.3rem; margin-bottom: 0.35rem; }
.coupon-desc { color: var(--ink-soft); font-size: 0.95rem; flex-grow: 1; }

.coupon-code-box {
  display: flex; align-items: center; justify-content: space-between; gap: 0.7rem;
  border-top: 2px dashed var(--line); margin: 1.1rem -1.5rem 0; padding: 1.1rem 1.5rem 0;
  flex-wrap: wrap;
}
.coupon-code {
  font-family: var(--font-mono); font-weight: 700; font-size: 1.15rem; letter-spacing: 0.05em;
  background: var(--paper); border: 2px dashed var(--orange);
  border-radius: 8px; padding: 0.3em 0.6em;
}
.coupon-card .fine-print { margin-top: 0.8rem; margin-bottom: 0; }

/* ---------- Steps ---------- */
.steps { counter-reset: step; list-style: none; margin: 2rem 0 0; padding: 0; display: grid; gap: 1rem; max-width: 720px; }
.steps li {
  counter-increment: step; position: relative;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 1.05rem 1.2rem 1.05rem 4.2rem; box-shadow: var(--shadow-soft);
}
.steps li::before {
  content: counter(step);
  position: absolute; left: 1.1rem; top: 50%; transform: translateY(-50%);
  width: 2.1rem; height: 2.1rem; display: grid; place-items: center;
  background: var(--orange); color: #fff; border-radius: 50%;
  font-family: var(--font-display); font-weight: 800; font-size: 1.05rem;
}
.steps code {
  font-family: var(--font-mono); background: var(--paper-2); border: 1px solid var(--line);
  border-radius: 6px; padding: 0.1em 0.4em; font-size: 0.92em;
}

/* ---------- Codes table ---------- */
.codes-table-wrap { overflow-x: auto; margin-top: 1.8rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow-soft); }
table.codes-table { width: 100%; border-collapse: collapse; min-width: 560px; }
.codes-table th, .codes-table td { text-align: left; padding: 0.95rem 1.2rem; border-bottom: 1px solid var(--line); }
.codes-table th { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); background: var(--paper-2); }
.codes-table tr:last-child td { border-bottom: 0; }
.codes-table code { font-family: var(--font-mono); font-weight: 700; color: var(--orange-deep); }

/* ---------- Long-form content ---------- */
.prose { max-width: 760px; }
.prose h2 { margin-top: 2.4rem; }
.prose h3 { margin-top: 1.8rem; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: 0.45em; }
.prose blockquote { border-left: 4px solid var(--orange); margin: 1.4em 0; padding: 0.3em 0 0.3em 1.1em; color: var(--ink-soft); }

/* ---------- FAQ ---------- */
.faq-list { max-width: 780px; margin-top: 1.8rem; display: grid; gap: 0.8rem; }
.faq-item {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-soft);
}
.faq-item summary {
  cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  font-family: var(--font-display); font-weight: 700; font-size: 1.08rem;
  padding: 1.05rem 1.3rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; font-family: var(--font-mono); font-size: 1.4rem; color: var(--orange);
  transition: transform 0.2s ease; line-height: 1;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item .faq-answer { padding: 0 1.3rem 1.2rem; color: var(--ink-soft); }
.faq-item .faq-answer p:last-child { margin-bottom: 0; }

/* ---------- CTA band ---------- */
.cta-band {
  background: var(--ink); color: var(--paper);
  border-radius: var(--radius); padding: clamp(2rem, 5vw, 3.2rem);
  display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap;
}
.cta-band h2 { color: #fff; margin-bottom: 0.3em; }
.cta-band p { color: #CBB79E; margin: 0; max-width: 34em; }
.cta-band .btn-primary { flex-shrink: 0; }
.cta-band .btn-copy { background: var(--orange); color: #fff; flex-shrink: 0; }
.cta-band .btn-copy:hover { background: var(--orange-deep); }
.cta-band .btn-copy.is-copied { background: var(--green); }

/* ---------- Blog / archive cards ---------- */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.6rem; margin-top: 2rem; }
.post-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-soft); display: flex; flex-direction: column;
}
.post-card img { display: block; width: 100%; height: 190px; object-fit: cover; }
.post-card-body { padding: 1.3rem 1.4rem 1.5rem; display: flex; flex-direction: column; gap: 0.5rem; }
.post-card h2 { font-size: 1.25rem; margin: 0; }
.post-card h2 a { color: var(--ink); text-decoration: none; }
.post-card h2 a:hover { color: var(--orange-deep); }
.post-meta { font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); }

/* ---------- Single / page ---------- */
.page-hero { padding-block: clamp(2.6rem, 6vw, 4rem) 0.5rem; }
.entry-content { max-width: 760px; padding-bottom: clamp(3rem, 6vw, 4.5rem); }
.entry-content h2 { margin-top: 2.2rem; }
.entry-content img { border-radius: var(--radius-sm); }
.entry-content table { width: 100%; border-collapse: collapse; margin: 1.4em 0; }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: 0.7em 0.9em; text-align: left; }
.entry-content th { background: var(--paper-2); }

.inline-coupon {
  display: inline-flex; align-items: center; gap: 0.6em;
  background: var(--white); border: 2px dashed var(--orange); border-radius: 10px;
  padding: 0.35em 0.4em 0.35em 0.8em; margin: 0.15em 0;
}
.inline-coupon code { font-family: var(--font-mono); font-weight: 700; letter-spacing: 0.05em; }
.inline-coupon .btn-copy { padding: 0.4em 0.9em; font-size: 0.8rem; }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 2.5rem; }
.pagination .page-numbers {
  display: inline-grid; place-items: center; min-width: 2.6rem; height: 2.6rem; padding-inline: 0.6rem;
  background: var(--white); border: 1px solid var(--line); border-radius: 999px;
  text-decoration: none; color: var(--ink); font-weight: 600;
}
.pagination .page-numbers.current { background: var(--orange); border-color: var(--orange); color: #fff; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #D9C6AC; margin-top: clamp(3rem, 7vw, 5rem); }
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr;
  gap: clamp(1.8rem, 4vw, 3rem); padding-block: clamp(2.8rem, 6vw, 4rem) 2rem;
}
.footer-brand { font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; color: #fff; }
.footer-brand em { font-style: normal; color: var(--orange); }
.footer-col h3 { color: #fff; font-size: 1rem; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700; }
.footer-menu, .footer-col ul { list-style: none; margin: 0.8rem 0 0; padding: 0; display: grid; gap: 0.5rem; }
.site-footer a { color: #D9C6AC; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-note { font-size: 0.85rem; line-height: 1.7; color: #B49B7C; }
.footer-legal {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-block: 1.3rem; font-size: 0.82rem; color: #A08B6E;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}

/* ---------- 404 ---------- */
.error-ticket { max-width: 560px; margin: clamp(3rem, 8vw, 5rem) auto; text-align: center; }
.error-ticket .ticket { transform: rotate(1.5deg); }
.error-ticket .ticket-off { color: var(--ink-soft); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .ticket { transform: rotate(0deg); max-width: 620px; }
  .coupon-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .site-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    display: none; padding: 0.6rem var(--gutter) 1.1rem;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0.15rem; }
  .site-nav a { display: block; padding: 0.75em 0.9em; }
  .nav-toggle { display: flex; }
  .header-cta { display: none; }
  .coupon-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-legal { flex-direction: column; }
}

@media (max-width: 520px) {
  body { font-size: 1rem; }
  .ticket { padding: 1.4rem 1.3rem 1.2rem; }
  .ticket-tear { margin-inline: -1.3rem; }
  .coupon-code-box { margin-inline: -1.5rem; }
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ticker-track { animation: none; }
  .coupon-card, .btn { transition: none; }
  .coupon-card:hover { transform: none; }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .ticker, .site-footer, .btn { display: none !important; }
  body { background: #fff; }
}

/* ---------- Quick answer + table of contents (SEO helpers) ---------- */
.quick-answer {
  background: var(--white);
  border: 1.5px solid var(--line);
  border-left: 6px solid var(--orange);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.35rem;
  margin: 1.6rem 0 0;
  box-shadow: var(--shadow-soft);
}
.quick-answer h2 { font-size: 1.15rem; margin: 0 0 0.35rem; }
.quick-answer p { margin: 0; color: var(--ink-soft); }
.quick-answer p strong, .quick-answer p code { color: var(--ink); }

.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 1.1rem 0 0;
  padding: 0;
}
.toc a {
  display: inline-block;
  padding: 0.42rem 0.9rem;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.toc a:hover { border-color: var(--orange); color: var(--orange); }
