/* ============================================
   TOMICH.CO — Clean Affiliate Review Site
   Wirecutter-inspired, minimal, fast
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --color-bg: #ffffff;
  --color-surface: #f8f9fa;
  --color-border: #e5e7eb;
  --color-text: #1a1a2e;
  --color-text-secondary: #6b7280;
  --color-accent: #2563eb;
  --color-accent-hover: #1d4ed8;
  --color-badge: #059669;
  --color-badge-text: #ffffff;
  --color-ad-bg: #f3f4f6;
  --color-ad-border: #d1d5db;
  --color-card-shadow: rgba(0,0,0,0.06);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Georgia', 'Times New Roman', serif;
  --max-content: 780px;
  --max-page: 1280px;
  --sidebar-w: 200px;
  --gap: 2rem;
}

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

a { color: var(--color-accent); text-decoration: none; }
a:hover { color: var(--color-accent-hover); text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

/* --- Layout: 3-column with ad sidebars --- */
.page-wrapper {
  max-width: var(--max-page);
  margin: 0 auto;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr var(--sidebar-w);
  gap: var(--gap);
  padding: 0 1rem;
}

.sidebar-ad {
  position: sticky;
  top: 5rem;
  align-self: start;
  height: fit-content;
}

.ad-slot {
  background: var(--color-ad-bg);
  border: 1px dashed var(--color-ad-border);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 0.75rem;
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  margin-bottom: 1.5rem;
}

.ad-slot span { display: block; margin-top: 0.25rem; font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.05em; }

.main-content {
  max-width: var(--max-content);
  width: 100%;
  margin: 0 auto;
}

/* --- Header / Nav --- */
.site-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 1rem;
}

.site-logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.03em;
}

.site-logo em { font-style: normal; color: var(--color-accent); }

.site-nav { display: flex; gap: 1.5rem; align-items: center; }
.site-nav a {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.15s;
}
.site-nav a:hover, .site-nav a.active { color: var(--color-text); text-decoration: none; }

/* --- Hero --- */
.hero {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem 2rem;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.hero p {
  font-size: 1.15rem;
  color: var(--color-text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* --- Category Cards (homepage) --- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin: 2rem 0 3rem;
}

.category-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 2rem;
  transition: box-shadow 0.2s, transform 0.15s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.category-card:hover {
  box-shadow: 0 4px 20px var(--color-card-shadow);
  transform: translateY(-2px);
  text-decoration: none;
}

.category-card .card-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.category-card h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.4rem; }
.category-card p { font-size: 0.9rem; color: var(--color-text-secondary); line-height: 1.5; }

/* --- Product Cards --- */
.product-list { display: flex; flex-direction: column; gap: 2rem; margin: 2rem 0; }

.product-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.75rem;
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 1.5rem;
  align-items: start;
  transition: box-shadow 0.2s;
}

.product-card:hover { box-shadow: 0 2px 16px var(--color-card-shadow); }

.product-image {
  background: var(--color-surface);
  border-radius: 8px;
  width: 160px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  font-size: 0.8rem;
  overflow: hidden;
}

.product-image img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }

.product-info h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 0.25rem; }

.product-badge {
  display: inline-block;
  background: var(--color-badge);
  color: var(--color-badge-text);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2em 0.6em;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.product-info .price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-accent);
  margin: 0.25rem 0 0.5rem;
}

.product-info .review { font-size: 0.92rem; color: var(--color-text-secondary); line-height: 1.6; }

.product-info .cta {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.6rem 1.4rem;
  background: var(--color-accent);
  color: #fff;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.15s;
}

.product-info .cta:hover { background: var(--color-accent-hover); text-decoration: none; }

/* --- Page header for category pages --- */
.page-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.page-header h1 { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 0.4rem; }
.page-header p { font-size: 1rem; color: var(--color-text-secondary); }
.page-header .byline { font-size: 0.85rem; color: var(--color-text-secondary); margin-top: 0.5rem; }

/* --- In-content ad banner --- */
.ad-banner {
  background: var(--color-ad-bg);
  border: 1px dashed var(--color-ad-border);
  border-radius: 8px;
  padding: 1.25rem;
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 0.75rem;
  margin: 2rem 0;
}

/* --- Affiliate Disclosure --- */
.disclosure {
  background: var(--color-surface);
  border-left: 3px solid var(--color-accent);
  padding: 0.75rem 1rem;
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  border-radius: 0 6px 6px 0;
  margin-bottom: 2rem;
  line-height: 1.5;
}

/* --- Footer --- */
.site-footer {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem 0;
  border-top: 1px solid var(--color-border);
  margin-top: 2rem;
  font-size: 0.82rem;
  color: var(--color-text-secondary);
}

.site-footer a { color: var(--color-text-secondary); }
.site-footer a:hover { color: var(--color-text); }

.footer-links { display: flex; justify-content: center; gap: 1.5rem; margin-bottom: 0.5rem; }

/* --- Responsive --- */
@media (max-width: 1024px) {
  .page-wrapper {
    grid-template-columns: 1fr;
  }
  .sidebar-ad { display: none; }
  .hero { padding: 2rem 1rem 1.5rem; }
  .hero h1 { font-size: 2rem; }
}

@media (max-width: 640px) {
  .category-grid { grid-template-columns: 1fr; }
  .product-card { grid-template-columns: 1fr; }
  .product-image { width: 100%; height: 200px; }
  .site-header { flex-direction: column; gap: 0.75rem; }
  .site-nav { gap: 1rem; }
  .hero h1 { font-size: 1.6rem; }
  .hero p { font-size: 1rem; }
}

/* --- Utility --- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.mb-2 { margin-bottom: 2rem; }
