/* ============================================================
   THRIFTRUPEE — Base Styles
   Reset · Typography · Utilities
   ============================================================ */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--tr-body);
  background: var(--tr-cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { cursor: pointer; background: none; border: none; font: inherit; }
input, select, textarea { font: inherit; }
table { border-collapse: collapse; width: 100%; }

/* ── Layout containers ── */
.tr-container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--sp-5);
}
.tr-container-sm {
  width: 100%;
  max-width: var(--container-sm);
  margin: 0 auto;
  padding: 0 var(--sp-5);
}
@media (max-width: 768px) {
  .tr-container, .tr-container-sm { padding: 0 var(--sp-4); }
}

/* ── Section spacing ── */
.tr-section {
  padding: var(--sp-20) 0;
}
.tr-section--sm {
  padding: var(--sp-12) 0;
}
.tr-section--lg {
  padding: var(--sp-24) 0;
}
@media (max-width: 768px) {
  .tr-section      { padding: var(--sp-12) 0; }
  .tr-section--sm  { padding: var(--sp-8) 0; }
  .tr-section--lg  { padding: var(--sp-16) 0; }
}

/* ── Typography scale ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--tr-heading);
  line-height: 1.15;
  font-weight: 400;
  letter-spacing: -0.02em;
}
h1 { font-size: clamp(32px, 5vw, 56px); }
h2 { font-size: clamp(26px, 3.5vw, 40px); }
h3 { font-size: clamp(20px, 2.5vw, 28px); }
h4 { font-size: clamp(17px, 2vw, 22px); }
h5 { font-size: 18px; }
h6 { font-size: 16px; }

p { margin-bottom: var(--sp-4); }
p:last-child { margin-bottom: 0; }

strong { font-weight: 700; }
em { font-style: italic; }

/* ── Section header pattern ── */
.tr-section-label {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tr-green);
  background: var(--tr-pale);
  border: 1px solid rgba(34,165,84,0.2);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  margin-bottom: var(--sp-4);
}
.tr-section-label::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--tr-mint);
}
.tr-section-title {
  font-family: var(--font-display);
  color: var(--tr-heading);
  margin-bottom: var(--sp-4);
}
.tr-section-title em {
  color: var(--tr-green);
  font-style: italic;
}
.tr-section-sub {
  font-family: var(--font-body);
  font-size: 17px;
  color: var(--tr-muted);
  max-width: 600px;
  line-height: 1.7;
  margin-bottom: var(--sp-8);
}
.tr-section-header {
  margin-bottom: var(--sp-10);
}
.tr-section-header--center {
  text-align: center;
}
.tr-section-header--center .tr-section-sub {
  margin-left: auto;
  margin-right: auto;
}

/* ── Buttons ── */
.tr-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 14px;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  transition: all var(--dur) var(--ease);
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.tr-btn--primary {
  background: var(--tr-mint);
  color: var(--tr-ink);
}
.tr-btn--primary:hover {
  background: var(--tr-lime);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(52,212,122,0.35);
}
.tr-btn--outline {
  background: rgba(255,255,255,0.08);
  color: var(--tr-white);
  border: 1.5px solid rgba(255,255,255,0.2);
}
.tr-btn--outline:hover {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.4);
}
.tr-btn--ghost {
  background: transparent;
  color: var(--tr-green);
  border: 1.5px solid var(--tr-pale);
}
.tr-btn--ghost:hover {
  background: var(--tr-pale);
  border-color: rgba(34,165,84,0.25);
}
.tr-btn--dark {
  background: var(--tr-ink);
  color: var(--tr-white);
}
.tr-btn--dark:hover {
  background: var(--tr-forest);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.tr-btn--sm {
  font-size: 13px;
  padding: 8px 18px;
}
.tr-btn--lg {
  font-size: 16px;
  padding: 15px 32px;
}

/* ── Badges / tags ── */
.tr-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}
.tr-badge--green {
  background: var(--tr-pale);
  color: var(--tr-emerald);
  border: 1px solid rgba(34,165,84,0.18);
}
.tr-badge--gold {
  background: #fef9e8;
  color: #8a6d0a;
  border: 1px solid rgba(212,160,23,0.25);
}
.tr-badge--new {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid rgba(37,99,235,0.2);
}
.tr-badge--hot {
  background: #fff1f2;
  color: #be123c;
  border: 1px solid rgba(220,38,38,0.18);
}

/* ── Rating stars ── */
.tr-rating {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--tr-gold);
}
.tr-rating-num { color: var(--tr-body); }

/* ── Cards (base) ── */
.tr-card {
  background: var(--tr-white);
  border: 1px solid var(--tr-sand);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.tr-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

/* ── Dividers ── */
.tr-divider {
  width: 40px;
  height: 3px;
  background: var(--tr-mint);
  border-radius: 2px;
  margin: var(--sp-4) 0;
}

/* ── Utility classes ── */
.tr-text-center { text-align: center; }
.tr-text-muted  { color: var(--tr-muted); }
.tr-text-green  { color: var(--tr-green); }
.tr-text-white  { color: var(--tr-white); }
.tr-font-display { font-family: var(--font-display); }

.tr-bg-cream   { background: var(--tr-cream); }
.tr-bg-warm    { background: var(--tr-warm); }
.tr-bg-dark    { background: var(--tr-ink); }
.tr-bg-forest  { background: var(--tr-forest); }
.tr-bg-white   { background: var(--tr-white); }

.tr-mt-auto { margin-top: auto; }
.tr-mb-0    { margin-bottom: 0 !important; }
.tr-hidden  { display: none !important; }

/* ── Grid helpers ── */
.tr-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-6); }
.tr-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-6); }
.tr-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-6); }
@media (max-width: 900px) {
  .tr-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .tr-grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .tr-grid-4, .tr-grid-3, .tr-grid-2 { grid-template-columns: 1fr; }
}

/* ── Reveal animation (JS adds .is-visible) ── */
.tr-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
}
.tr-reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ── Screen reader only ── */
.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 ── */
.skip-link {
  position: absolute;
  top: -999px;
  left: var(--sp-4);
  background: var(--tr-ink);
  color: var(--tr-white);
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--radius);
  font-weight: 700;
  z-index: var(--z-modal);
}
.skip-link:focus { top: var(--sp-4); }
