/* ===========================================================
   TAG Affiliate Directory — Global Stylesheet
   =========================================================== */

:root {
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-accent: #f59e0b;
  --color-dark: #0f172a;
  --color-slate: #334155;
  --color-muted: #64748b;
  --color-light: #f8fafc;
  --color-border: #e2e8f0;
  --color-white: #ffffff;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --maxw: 1140px;
  --font: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--color-slate);
  line-height: 1.65;
  background: var(--color-white);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--color-primary); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--color-primary-dark); }

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

h1, h2, h3, h4 { color: var(--color-dark); line-height: 1.25; font-weight: 700; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

.section { padding: 72px 0; }
.section--light { background: var(--color-light); }

.section-head { text-align: center; max-width: 720px; margin: 0 auto 48px; }
.section-head h2 { font-size: 2rem; margin-bottom: 14px; }
.section-head p { color: var(--color-muted); font-size: 1.05rem; }

.eyebrow {
  display: inline-block;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 12px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all .2s ease;
}
.btn--primary { background: var(--color-primary); color: #fff; }
.btn--primary:hover { background: var(--color-primary-dark); color: #fff; transform: translateY(-1px); }
.btn--ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.btn--ghost:hover { background: rgba(255,255,255,.12); color: #fff; }
.btn--outline { background: transparent; color: var(--color-primary); border-color: var(--color-primary); }
.btn--outline:hover { background: var(--color-primary); color: #fff; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; color: var(--color-dark); }
.brand:hover { color: var(--color-dark); }
.brand-logo { width: 38px; height: 38px; display: block; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 9px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .95rem;
}
.nav-links { display: flex; align-items: center; gap: 28px; list-style: none; }
.nav-links a { color: var(--color-slate); font-weight: 500; font-size: .96rem; }
.nav-links a:hover, .nav-links a.active { color: var(--color-primary); }
.nav-toggle { display: none; background: none; border: 0; font-size: 1.6rem; cursor: pointer; color: var(--color-dark); }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 60%, #2563eb 100%);
  color: #fff; padding: 90px 0; text-align: center;
}
.hero h1 { color: #fff; font-size: 2.9rem; margin-bottom: 18px; }
.hero p { font-size: 1.2rem; color: rgba(255,255,255,.85); max-width: 680px; margin: 0 auto 32px; }
.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 40px; justify-content: center; margin-top: 56px; flex-wrap: wrap; }
.hero-stats .stat strong { display: block; font-size: 2rem; color: #fff; }
.hero-stats .stat span { color: rgba(255,255,255,.7); font-size: .9rem; }

/* ---------- Page banner (interior pages) ---------- */
.page-banner {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  color: #fff; padding: 64px 0; text-align: center;
}
.page-banner h1 { color: #fff; font-size: 2.4rem; margin-bottom: 10px; }
.page-banner p { color: rgba(255,255,255,.8); max-width: 640px; margin: 0 auto; }

/* ---------- Grid cards ---------- */
.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: #fff; border: 1px solid var(--color-border);
  border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.card .icon {
  width: 50px; height: 50px; border-radius: 12px; display: grid; place-items: center;
  font-size: 1.5rem; margin-bottom: 16px;
  background: #eff6ff; color: var(--color-primary);
}
.card h3 { font-size: 1.2rem; margin-bottom: 10px; }
.card p { color: var(--color-muted); font-size: .96rem; }

/* ---------- Category chips ---------- */
.category-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
.category-card {
  background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius);
  padding: 24px; text-align: center; transition: all .2s ease;
}
.category-card:hover { border-color: var(--color-primary); box-shadow: var(--shadow-md); transform: translateY(-3px); }
.category-card .emoji { font-size: 2rem; }
.category-card h3 { font-size: 1.05rem; margin: 12px 0 6px; }
.category-card span { color: var(--color-muted); font-size: .85rem; }

/* ---------- Directory listings ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 40px; }
.filter-bar button {
  border: 1px solid var(--color-border); background: #fff; color: var(--color-slate);
  padding: 9px 18px; border-radius: 999px; cursor: pointer; font-size: .9rem; font-weight: 500;
  transition: all .2s ease;
}
.filter-bar button:hover { border-color: var(--color-primary); color: var(--color-primary); }
.filter-bar button.active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }

.listing {
  background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease;
}
.listing:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.listing-top { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.listing-logo {
  width: 52px; height: 52px; border-radius: 12px; flex: 0 0 auto;
  display: grid; place-items: center; font-weight: 800; color: #fff; font-size: 1.2rem;
}
.listing-top h3 { font-size: 1.15rem; }
.listing .tag {
  display: inline-block; font-size: .72rem; font-weight: 600; padding: 3px 10px;
  border-radius: 999px; background: #eff6ff; color: var(--color-primary); margin-top: 4px;
}
.listing p { color: var(--color-muted); font-size: .92rem; flex-grow: 1; }
.listing-meta { display: flex; gap: 18px; margin: 16px 0; padding-top: 14px; border-top: 1px solid var(--color-border); }
.listing-meta div span { display: block; font-size: .72rem; color: var(--color-muted); text-transform: uppercase; letter-spacing: .04em; }
.listing-meta div strong { font-size: .98rem; color: var(--color-dark); }

/* ---------- Steps ---------- */
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(3,1fr); gap: 28px; }
.step { position: relative; padding-left: 0; text-align: center; }
.step .num {
  width: 48px; height: 48px; border-radius: 50%; background: var(--color-primary); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 1.2rem; margin: 0 auto 16px;
}
.step h3 { font-size: 1.1rem; margin-bottom: 8px; }
.step p { color: var(--color-muted); font-size: .94rem; }

/* ---------- CTA band ---------- */
.cta-band {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: #fff; text-align: center; padding: 64px 0; border-radius: var(--radius);
}
.cta-band h2 { color: #fff; font-size: 1.9rem; margin-bottom: 14px; }
.cta-band p { color: rgba(255,255,255,.85); margin-bottom: 28px; max-width: 560px; margin-left: auto; margin-right: auto; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 48px; align-items: start; }
.info-item { display: flex; gap: 16px; margin-bottom: 26px; }
.info-item .ic {
  width: 46px; height: 46px; border-radius: 10px; background: #eff6ff; color: var(--color-primary);
  display: grid; place-items: center; font-size: 1.3rem; flex: 0 0 auto;
}
.info-item h4 { font-size: 1rem; margin-bottom: 2px; }
.info-item p, .info-item a { color: var(--color-muted); font-size: .95rem; }

.form-card { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow-md); }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; color: var(--color-dark); }
.field input, .field textarea, .field select {
  width: 100%; padding: 12px 14px; border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  font-family: inherit; font-size: .95rem; color: var(--color-slate); transition: border-color .2s ease;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.field textarea { resize: vertical; min-height: 130px; }
.form-note { font-size: .82rem; color: var(--color-muted); margin-top: 12px; }

/* ---------- Legal / prose ---------- */
.prose { max-width: 820px; margin: 0 auto; }
.prose h2 { font-size: 1.5rem; margin: 40px 0 14px; }
.prose h3 { font-size: 1.15rem; margin: 28px 0 10px; }
.prose p { margin-bottom: 16px; color: var(--color-slate); }
.prose ul { margin: 0 0 16px 22px; }
.prose li { margin-bottom: 8px; }
.prose .updated { color: var(--color-muted); font-size: .9rem; margin-bottom: 28px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--color-dark); color: #cbd5e1; padding: 56px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.site-footer .brand { color: #fff; margin-bottom: 14px; }
.site-footer p { color: #94a3b8; font-size: .92rem; max-width: 320px; }
.footer-col h4 { color: #fff; font-size: .95rem; margin-bottom: 16px; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { color: #94a3b8; font-size: .92rem; }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #1e293b; padding-top: 24px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.footer-bottom p { color: #64748b; font-size: .85rem; }

/* ---------- Ad banner ---------- */
.ad-strip { background: var(--color-light); border-bottom: 1px solid var(--color-border); padding: 22px 0; }
.ad-strip .container { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ad-label { font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--color-muted); }
.ad-banner {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  width: 100%; max-width: 760px; padding: 18px 28px; text-align: center;
  border-radius: var(--radius); color: #fff; font-weight: 700; font-size: 1.15rem;
  background: linear-gradient(135deg, #7c3aed, #db2777 60%, #f59e0b);
  box-shadow: var(--shadow-md); transition: transform .2s ease, box-shadow .2s ease;
}
.ad-banner:hover { color: #fff; transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.ad-banner .ad-emoji { font-size: 1.6rem; }
.ad-banner .ad-cta { font-size: .8rem; font-weight: 700; background: rgba(255,255,255,.22); padding: 6px 14px; border-radius: 999px; white-space: nowrap; }
@media (max-width: 640px) {
  .ad-banner { flex-direction: column; gap: 10px; font-size: 1.02rem; padding: 18px 20px; }
}

/* ---------- Breadcrumb ---------- */
.breadcrumb { background: var(--color-light); border-bottom: 1px solid var(--color-border); padding: 14px 0; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; font-size: .88rem; color: var(--color-muted); }
.breadcrumb li::after { content: "/"; margin-left: 8px; color: var(--color-border); }
.breadcrumb li:last-child::after { content: ""; }
.breadcrumb a { color: var(--color-muted); }
.breadcrumb a:hover { color: var(--color-primary); }
.breadcrumb li:last-child { color: var(--color-slate); font-weight: 600; }

/* ---------- Dropdown nav ---------- */
.has-dropdown { position: relative; }
.dropdown {
  position: absolute; top: 130%; left: 50%; transform: translateX(-50%);
  background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 10px; min-width: 230px; list-style: none;
  opacity: 0; visibility: hidden; transition: all .18s ease; z-index: 60;
}
.dropdown li { margin: 0; padding: 0; border: 0; }
.dropdown a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm); font-size: .9rem; color: var(--color-slate); }
.dropdown a:hover { background: var(--color-light); color: var(--color-primary); }
.has-dropdown:hover .dropdown { opacity: 1; visibility: visible; top: 110%; }

/* ---------- Category hub grid ---------- */
.cat-hub { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.cat-hub-card {
  background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius);
  padding: 28px; transition: all .2s ease; display: block;
}
.cat-hub-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--color-primary); }
.cat-hub-card .emoji { font-size: 2.2rem; }
.cat-hub-card h3 { font-size: 1.2rem; margin: 12px 0 8px; }
.cat-hub-card p { color: var(--color-muted); font-size: .92rem; margin-bottom: 12px; }
.cat-hub-card .count { display: inline-block; font-size: .78rem; font-weight: 600; color: var(--color-primary); background: #eff6ff; padding: 4px 12px; border-radius: 999px; }

/* ---------- Program detail ---------- */
.detail-grid { display: grid; grid-template-columns: 1fr 320px; gap: 40px; align-items: start; }
.detail-head { display: flex; align-items: center; gap: 18px; margin-bottom: 24px; }
.detail-logo { width: 72px; height: 72px; border-radius: 16px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 1.6rem; flex: 0 0 auto; }
.detail-head h1 { font-size: 1.9rem; }
.spec-card { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-sm); position: sticky; top: 90px; }
.spec-list { list-style: none; margin-bottom: 20px; }
.spec-list li { display: flex; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--color-border); font-size: .92rem; }
.spec-list li:last-child { border-bottom: 0; }
.spec-list span { color: var(--color-muted); }
.spec-list strong { color: var(--color-dark); text-align: right; }
.feature-list { list-style: none; }
.feature-list li { padding-left: 28px; position: relative; margin-bottom: 12px; color: var(--color-slate); }
.feature-list li::before { content: "\2713"; position: absolute; left: 0; top: 0; color: #16a34a; font-weight: 800; }

/* ---------- Networks table ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--color-border); border-radius: var(--radius); }
table.net-table { width: 100%; border-collapse: collapse; min-width: 640px; background: #fff; }
.net-table th, .net-table td { text-align: left; padding: 16px 18px; border-bottom: 1px solid var(--color-border); font-size: .92rem; }
.net-table th { background: var(--color-light); color: var(--color-dark); font-weight: 700; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
.net-table tr:last-child td { border-bottom: 0; }
.net-table tr:hover td { background: #fafcff; }

/* ---------- Blog ---------- */
.post-card { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); transition: all .2s ease; display: flex; flex-direction: column; }
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.post-thumb { height: 120px; background: linear-gradient(135deg, var(--color-primary), var(--color-accent)); display: grid; place-items: center; font-size: 2.4rem; }
.post-body { padding: 24px; display: flex; flex-direction: column; flex-grow: 1; }
.post-body .meta { font-size: .8rem; color: var(--color-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .04em; }
.post-body h3 { font-size: 1.12rem; margin-bottom: 8px; }
.post-body p { color: var(--color-muted); font-size: .92rem; flex-grow: 1; }
.post-body a.read { margin-top: 14px; font-weight: 600; font-size: .9rem; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid-3, .grid-4, .category-grid, .steps, .cat-hub { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .spec-card { position: static; }
}
@media (max-width: 640px) {
  .nav-links {
    display: none; position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; background: #fff; border-bottom: 1px solid var(--color-border);
    padding: 12px 20px; gap: 6px; box-shadow: var(--shadow-md);
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; padding: 8px 0; border-bottom: 1px solid var(--color-light); }
  .nav-toggle { display: block; }
  .hero h1 { font-size: 2.1rem; }
  .hero p { font-size: 1.05rem; }
  .grid-3, .grid-4, .grid-2, .category-grid, .steps, .cat-hub { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .section { padding: 52px 0; }
  .has-dropdown .dropdown { position: static; transform: none; opacity: 1; visibility: visible; box-shadow: none; border: 0; padding: 0 0 0 14px; min-width: 0; }
}
