/* ============================================================
   TopRatedWebDevs.com — Main Stylesheet
   ============================================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:    #1a56db;
  --primary-dk: #1340b0;
  --accent:     #ff6b2b;
  --bg:         #f8f9fb;
  --surface:    #ffffff;
  --border:     #e2e5ed;
  --text:       #1a1f36;
  --muted:      #6b7280;
  --star:       #f59e0b;
  --radius:     8px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08);
  --shadow-md:  0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.12);
  --max-w:      1200px;
  --font:       'Inter', system-ui, -apple-system, sans-serif;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ---------- Layout ---------- */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 64px 0; }
.section--alt { background: var(--surface); }

/* ---------- Header / Nav ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 64px;
}

.logo {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary);
  white-space: nowrap;
  letter-spacing: -0.5px;
}
.logo span { color: var(--accent); }

.main-nav {
  display: flex;
  gap: 4px;
  flex: 1;
}

.main-nav a {
  font-size: .875rem;
  font-weight: 500;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 6px;
  transition: background .15s, color .15s;
  white-space: nowrap;
}

.main-nav a:hover,
.main-nav a.active {
  background: #eff3ff;
  color: var(--primary);
  text-decoration: none;
}

.header-cta {
  margin-left: auto;
  background: var(--primary);
  color: #fff !important;
  padding: 8px 20px;
  border-radius: 6px;
  font-size: .875rem;
  font-weight: 600;
  transition: background .15s;
  white-space: nowrap;
}
.header-cta:hover { background: var(--primary-dk); text-decoration: none !important; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, #1340b0 0%, #1a56db 50%, #2563eb 100%);
  color: #fff;
  padding: 80px 0 72px;
  text-align: center;
}

.hero__eyebrow {
  display: inline-block;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 100px;
  padding: 4px 16px;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 16px;
}

.hero p {
  font-size: 1.125rem;
  opacity: .88;
  max-width: 600px;
  margin: 0 auto 36px;
}

/* Search bar */
.search-bar {
  display: flex;
  max-width: 640px;
  margin: 0 auto 24px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 24px rgba(0,0,0,.2);
  overflow: hidden;
}

.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  padding: 14px 20px;
  font-size: 1rem;
  color: var(--text);
  font-family: var(--font);
}

.search-bar button {
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  padding: 14px 28px;
  font-size: .95rem;
  font-weight: 700;
  font-family: var(--font);
  transition: background .15s;
  white-space: nowrap;
}
.search-bar button:hover { background: #e55a1e; }

.hero-stats {
  display: flex;
  gap: 40px;
  justify-content: center;
  opacity: .9;
  flex-wrap: wrap;
}

.hero-stat strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
}

.hero-stat span {
  font-size: .8rem;
  opacity: .8;
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* ---------- Section Headings ---------- */
.section-heading {
  text-align: center;
  margin-bottom: 48px;
}

.section-heading h2 {
  font-size: clamp(1.5rem, 3vw, 2.125rem);
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 10px;
}

.section-heading p {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 560px;
  margin: 0 auto;
}

/* ---------- Company Cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.company-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: box-shadow .2s, transform .2s;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.company-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.card-logo {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: linear-gradient(135deg, #eff3ff, #dbeafe);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.card-title { font-size: 1rem; font-weight: 700; }
.card-meta { font-size: .8rem; color: var(--muted); }

.card-rating {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .875rem;
}

.stars { color: var(--star); letter-spacing: 1px; font-size: .95rem; }
.rating-num { font-weight: 700; }
.review-count { color: var(--muted); font-size: .8rem; }

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  background: #eff3ff;
  color: var(--primary);
  border-radius: 100px;
  padding: 3px 10px;
  font-size: .75rem;
  font-weight: 500;
}

.card-desc {
  font-size: .875rem;
  color: var(--muted);
  flex: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: .8rem;
  color: var(--muted);
}

.card-cta {
  font-size: .8rem;
  font-weight: 600;
  color: var(--primary);
}

.badge-top {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fefce8;
  border: 1px solid #fde68a;
  color: #92400e;
  border-radius: 100px;
  padding: 2px 8px;
  font-size: .72rem;
  font-weight: 700;
}

/* ---------- Category Cards ---------- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.category-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  transition: box-shadow .2s, border-color .2s;
  display: block;
  color: var(--text);
}

.category-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
  text-decoration: none;
}

.category-icon {
  font-size: 2rem;
  margin-bottom: 10px;
  display: block;
}

.category-card h3 {
  font-size: .95rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.category-card p {
  font-size: .8rem;
  color: var(--muted);
}

/* ---------- City Links ---------- */
.city-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.city-link {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}

.city-link:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
  color: var(--primary);
  text-decoration: none;
}

.city-link .icon { font-size: 1.1rem; }

/* ---------- How It Works ---------- */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
}

.step {
  text-align: center;
  padding: 24px;
}

.step-num {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 1.25rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.step h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 8px; }
.step p { font-size: .875rem; color: var(--muted); }

/* ---------- CTA Banner ---------- */
.cta-banner {
  background: linear-gradient(135deg, var(--accent) 0%, #e55a1e 100%);
  color: #fff;
  text-align: center;
  padding: 64px 24px;
}

.cta-banner h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  margin-bottom: 12px;
}

.cta-banner p {
  opacity: .9;
  font-size: 1.05rem;
  margin-bottom: 28px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 7px;
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
  transition: background .15s, transform .1s;
}

.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-white { background: #fff; color: var(--accent); }
.btn-white:hover { background: #fff; color: var(--accent); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dk); }

/* ---------- Footer ---------- */
.site-footer {
  background: #111827;
  color: #9ca3af;
  padding: 56px 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand .logo { margin-bottom: 12px; }
.footer-brand p { font-size: .875rem; line-height: 1.7; max-width: 260px; }

.footer-col h4 {
  color: #fff;
  font-size: .9rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.footer-col ul li { margin-bottom: 8px; }
.footer-col ul li a {
  font-size: .875rem;
  color: #9ca3af;
  transition: color .15s;
}
.footer-col ul li a:hover { color: #fff; text-decoration: none; }

.footer-bottom {
  border-top: 1px solid #1f2937;
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .8rem;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-bottom a { color: #6b7280; }
.footer-bottom a:hover { color: #fff; text-decoration: none; }

/* ---------- Listing Page Specific ---------- */
.listing-hero {
  background: linear-gradient(135deg, #1340b0 0%, #1a56db 100%);
  color: #fff;
  padding: 48px 0;
}

.listing-hero h1 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -.5px;
  margin-bottom: 8px;
}

.listing-hero p {
  opacity: .85;
  font-size: 1.05rem;
  max-width: 580px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .8rem;
  opacity: .75;
  margin-bottom: 16px;
}

.breadcrumb a { color: #fff; }
.breadcrumb span { opacity: .5; }

.listing-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 32px;
  align-items: start;
  padding: 40px 0;
}

.sidebar {
  position: sticky;
  top: 80px;
}

.filter-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.filter-card h3 {
  font-size: .9rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text);
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  cursor: pointer;
  font-size: .875rem;
}

.filter-option input { accent-color: var(--primary); }

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.results-count {
  font-size: .95rem;
  font-weight: 600;
}

.results-count span { color: var(--muted); font-weight: 400; }

.sort-select {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 12px;
  font-size: .875rem;
  color: var(--text);
  background: var(--surface);
  font-family: var(--font);
  cursor: pointer;
}

.listing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: start;
  transition: box-shadow .2s;
}

.listing-card:hover { box-shadow: var(--shadow-md); }

.listing-logo {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  background: linear-gradient(135deg, #eff3ff, #dbeafe);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.listing-info h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; }
.listing-info .listing-meta { font-size: .8rem; color: var(--muted); margin-bottom: 8px; }
.listing-desc { font-size: .875rem; color: var(--muted); margin-bottom: 10px; }

.listing-aside {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .listing-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .listing-card { grid-template-columns: auto 1fr; }
  .listing-aside { align-items: flex-start; text-align: left; }
}

@media (max-width: 640px) {
  .main-nav { display: none; }
  .hero { padding: 56px 0 48px; }
  .hero-stats { gap: 24px; }
  .footer-grid { grid-template-columns: 1fr; }
  .section { padding: 48px 0; }
  .listing-card { grid-template-columns: 1fr; }
}
