/*
Theme Name: StudentQuest Theme
Theme URI: https://studentquest.net
Author: StudentQuest
Description: Premium lightweight SEO-optimized theme for academic marketplace blog with Customizer button controls and structured star-rating schema.
Version: 4.0
License: GPL2
Text Domain: studentquest
*/

/* ── VARIABLES ── */
:root {
  --sq-navy:   #0b1d3a;
  --sq-cobalt: #1a52c8;
  --sq-sky:    #3b82f6;
  --sq-gold:   #f5a623;
  --sq-cream:  #faf7f2;
  --sq-white:  #ffffff;
  --sq-muted:  #64748b;
  --sq-border: #e2e8f0;
  --sq-radius: 10px;
  --sq-shadow: 0 4px 24px rgba(11,29,58,.10);
  --sq-shadow-lg: 0 12px 48px rgba(11,29,58,.16);
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'DM Sans', sans-serif;
  --transition: .25s cubic-bezier(.4,0,.2,1);

  /* Customizer-driven button tokens (defaults match Customizer defaults) */
  --btn-primary-bg:      #f5a623;
  --btn-primary-color:   #0b1d3a;
  --btn-primary-radius:  50px;
  --btn-secondary-bg:    transparent;
  --btn-secondary-color: #ffffff;
  --btn-secondary-border:#ffffff;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--sq-cream);
  color: var(--sq-navy);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container {
  width: 90%;
  max-width: 1120px;
  margin: 0 auto;
}

/* ── GLOBAL BUTTON ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .78rem 1.8rem;
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  text-decoration: none;
  border-radius: var(--btn-primary-radius);
}

.btn-primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-color);
}

.btn-primary:hover {
  opacity: .88;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
}

.btn-outline {
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-color);
  border: 1.5px solid var(--btn-secondary-border);
}

.btn-outline:hover {
  background: rgba(255,255,255,.1);
}

/* ── NAV ── */
nav.site-nav {
  background: var(--sq-navy);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(11,29,58,.25);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.site-logo {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 900;
  color: var(--sq-white);
  letter-spacing: -.5px;
}

.site-logo span { color: var(--sq-gold); }

.nav-links { display: flex; gap: 2rem; list-style: none; }

.nav-links a {
  color: rgba(255,255,255,.75);
  font-size: .9rem;
  font-weight: 500;
  transition: color var(--transition);
}

.nav-links a:hover { color: var(--sq-white); }

.nav-cta {
  background: var(--btn-primary-bg) !important;
  color: var(--btn-primary-color) !important;
  padding: .45rem 1.1rem !important;
  border-radius: var(--btn-primary-radius) !important;
  font-weight: 600 !important;
}

/* ── HERO ── */
.hero {
  background: linear-gradient(135deg, var(--sq-navy) 0%, #1a3461 60%, #1e4080 100%);
  color: var(--sq-white);
  padding: 100px 0 90px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 80% 50%, rgba(26,82,200,.35) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 10% 80%, rgba(245,166,35,.12) 0%, transparent 60%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 4rem;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: rgba(245,166,35,.18);
  border: 1px solid rgba(245,166,35,.4);
  color: var(--sq-gold);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .35rem .9rem;
  border-radius: 50px;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 4.5vw, 3.6rem);
  font-weight: 900;
  line-height: 1.13;
  margin-bottom: 1.4rem;
  letter-spacing: -.02em;
}

.hero h1 em { font-style: normal; color: var(--sq-gold); }

.hero p {
  font-size: 1.05rem;
  color: rgba(255,255,255,.78);
  max-width: 500px;
  margin-bottom: 2.4rem;
  line-height: 1.75;
}

.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ── STAR RATING WIDGET ── */
.rating-widget {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 50px;
  padding: .55rem 1.1rem;
  margin-bottom: 2rem;
}

.rating-stars {
  display: flex;
  gap: 2px;
}

.rating-stars .star {
  color: var(--sq-gold);
  font-size: 1.1rem;
  line-height: 1;
}

.rating-stars .star.half { position: relative; }

.rating-text {
  font-size: .85rem;
  color: rgba(255,255,255,.85);
  font-weight: 500;
}

.rating-text strong { color: var(--sq-white); }

/* hero card */
.hero-card {
  background: rgba(255,255,255,.07);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 20px;
  padding: 2rem;
  animation: float 5s ease-in-out infinite;
}

@keyframes float {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

.hero-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--sq-white);
  margin-bottom: 1.2rem;
}

.hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.stat {
  background: rgba(255,255,255,.07);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
}

.stat-num {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--sq-gold);
  display: block;
}

.stat-label {
  font-size: .75rem;
  color: rgba(255,255,255,.65);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: .2rem;
}

/* ── TRUST BAR ── */
.trust-bar {
  background: var(--sq-white);
  border-bottom: 1px solid var(--sq-border);
  padding: 1.2rem 0;
}

.trust-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  flex-wrap: wrap;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: .85rem;
  font-weight: 500;
  color: var(--sq-muted);
}

.trust-icon {
  width: 20px; height: 20px;
  background: var(--sq-cobalt);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.trust-icon svg { width: 11px; height: 11px; fill: #fff; }

/* ── SECTIONS ── */
.section-header { text-align: center; margin-bottom: 3.5rem; }

.section-label {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--sq-cobalt);
  margin-bottom: .8rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 900;
  color: var(--sq-navy);
  line-height: 1.2;
  letter-spacing: -.02em;
}

.section-sub {
  color: var(--sq-muted);
  margin-top: .8rem;
  font-size: .95rem;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

/* ── SERVICES ── */
.services { padding: 90px 0; }

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.service-card {
  background: var(--sq-white);
  border: 1px solid var(--sq-border);
  border-radius: 16px;
  padding: 2rem;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--sq-cobalt), var(--sq-sky));
  opacity: 0;
  transition: opacity var(--transition);
}

.service-card:hover { transform: translateY(-4px); box-shadow: var(--sq-shadow-lg); border-color: transparent; }
.service-card:hover::before { opacity: 1; }

.service-icon {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, #e8f0fe, #c7d9fd);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.2rem;
  font-size: 1.5rem;
}

.service-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--sq-navy);
  margin-bottom: .6rem;
}

.service-card p { font-size: .88rem; color: var(--sq-muted); line-height: 1.65; margin-bottom: 1.2rem; }

.service-link {
  font-size: .83rem;
  font-weight: 600;
  color: var(--sq-cobalt);
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  transition: gap var(--transition);
}

.service-card:hover .service-link { gap: .6rem; }

/* ── HOW IT WORKS ── */
.how { background: var(--sq-white); padding: 90px 0; }

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  margin-top: 3.5rem;
  position: relative;
}

.steps::before {
  content: '';
  position: absolute;
  top: 28px;
  left: calc(12.5% + 28px);
  right: calc(12.5% + 28px);
  height: 2px;
  background: linear-gradient(90deg, var(--sq-cobalt), var(--sq-sky));
  opacity: .25;
}

.step { text-align: center; }

.step-num {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--sq-cobalt), var(--sq-sky));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--sq-white);
  margin: 0 auto 1.2rem;
  box-shadow: 0 4px 16px rgba(26,82,200,.35);
}

.step h4 { font-weight: 700; color: var(--sq-navy); margin-bottom: .5rem; font-size: .98rem; }
.step p { font-size: .83rem; color: var(--sq-muted); line-height: 1.6; }

/* ── ARTICLES ── */
.articles { padding: 90px 0; }

.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
  margin-top: 3rem;
}

.article-card {
  background: var(--sq-white);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--sq-border);
  transition: all var(--transition);
}

.article-card:hover { transform: translateY(-4px); box-shadow: var(--sq-shadow-lg); border-color: transparent; }

.article-thumb {
  height: 180px;
  background: linear-gradient(135deg, #e8f0fe 0%, #c7d9fd 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.article-body { padding: 1.4rem; }

.article-tag {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--sq-cobalt);
  background: #e8f0fe;
  padding: .25rem .65rem;
  border-radius: 50px;
  margin-bottom: .9rem;
}

.article-card h3 {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--sq-navy);
  line-height: 1.4;
  margin-bottom: .65rem;
  transition: color var(--transition);
}

.article-card:hover h3 { color: var(--sq-cobalt); }
.article-card p { font-size: .84rem; color: var(--sq-muted); line-height: 1.65; }

.article-meta {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--sq-border);
  font-size: .78rem;
  color: var(--sq-muted);
}

/* ── REVIEWS SECTION ── */
.reviews { padding: 90px 0; background: var(--sq-cream); }

.reviews-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 3rem;
}

.review-card {
  background: var(--sq-white);
  border: 1px solid var(--sq-border);
  border-radius: 16px;
  padding: 1.8rem;
  transition: all var(--transition);
}

.review-card:hover { transform: translateY(-3px); box-shadow: var(--sq-shadow-lg); }

.review-stars { display: flex; gap: 2px; margin-bottom: 1rem; }
.review-stars .star { color: var(--sq-gold); font-size: 1rem; }

.review-card p {
  font-size: .9rem;
  color: var(--sq-muted);
  line-height: 1.7;
  margin-bottom: 1.2rem;
  font-style: italic;
}

.reviewer {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.reviewer-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sq-cobalt), var(--sq-sky));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: .9rem;
  flex-shrink: 0;
}

.reviewer-name { font-weight: 600; font-size: .88rem; color: var(--sq-navy); }
.reviewer-meta { font-size: .75rem; color: var(--sq-muted); }

/* aggregate rating bar */
.aggregate-rating {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  background: var(--sq-white);
  border: 1px solid var(--sq-border);
  border-radius: 16px;
  padding: 2rem 2.5rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.agg-score { text-align: center; }

.agg-number {
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 900;
  color: var(--sq-navy);
  line-height: 1;
}

.agg-stars { display: flex; gap: 3px; justify-content: center; margin: .4rem 0; }
.agg-stars .star { color: var(--sq-gold); font-size: 1.3rem; }
.agg-count { font-size: .82rem; color: var(--sq-muted); }

.agg-bars { flex: 1; min-width: 200px; }

.bar-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .45rem;
}

.bar-label { font-size: .8rem; color: var(--sq-muted); white-space: nowrap; width: 36px; text-align: right; }

.bar-track {
  flex: 1;
  height: 8px;
  background: #e8f0fe;
  border-radius: 50px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--sq-cobalt), var(--sq-sky));
  border-radius: 50px;
}

.bar-pct { font-size: .78rem; color: var(--sq-muted); width: 32px; }

/* ── CTA BANNER ── */
.cta-banner {
  background: linear-gradient(135deg, var(--sq-navy) 0%, #1e4080 100%);
  padding: 80px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 100% at 50% 0%, rgba(26,82,200,.5), transparent 70%);
}

.cta-banner-inner { position: relative; z-index: 1; }

.cta-banner h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: 900;
  color: var(--sq-white);
  margin-bottom: 1rem;
  letter-spacing: -.02em;
}

.cta-banner p { color: rgba(255,255,255,.72); max-width: 480px; margin: 0 auto 2.2rem; font-size: .95rem; }

/* ── SIDEBAR ── */
aside.widget-area { padding: 2rem 0; }

.widget { margin-bottom: 2rem; }

.widget h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--sq-navy);
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--sq-cobalt);
}

.widget ul { list-style: none; }

.widget li { margin-bottom: .5rem; }

.widget a {
  font-size: .88rem;
  color: var(--sq-muted);
  transition: color var(--transition);
  display: flex;
  align-items: center;
  gap: .4rem;
}

.widget a::before { content: '→'; color: var(--sq-cobalt); font-size: .75rem; }
.widget a:hover { color: var(--sq-cobalt); }

/* ── FOOTER ── */
footer.site-footer {
  background: var(--sq-navy);
  color: rgba(255,255,255,.65);
  padding: 60px 0 30px;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.footer-brand .site-logo { font-size: 1.4rem; margin-bottom: 1rem; display: block; }
.footer-brand p { font-size: .85rem; line-height: 1.7; max-width: 240px; }

.footer-col h4 {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--sq-white);
  margin-bottom: 1.2rem;
}

.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: .6rem; }

.footer-col a {
  font-size: .85rem;
  color: rgba(255,255,255,.55);
  transition: color var(--transition);
}

.footer-col a:hover { color: var(--sq-white); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.8rem;
  font-size: .8rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { color: rgba(255,255,255,.45); transition: color var(--transition); }
.footer-links a:hover { color: rgba(255,255,255,.9); }

/* footer rating badge */
.footer-rating {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50px;
  padding: .4rem 1rem;
  font-size: .78rem;
  color: rgba(255,255,255,.7);
  margin-top: .8rem;
}

.footer-rating .star { color: var(--sq-gold); }

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-text > * { animation: fadeUp .65s ease both; }
.hero-text > *:nth-child(1) { animation-delay: .05s; }
.hero-text > *:nth-child(2) { animation-delay: .15s; }
.hero-text > *:nth-child(3) { animation-delay: .25s; }
.hero-text > *:nth-child(4) { animation-delay: .35s; }
.hero-text > *:nth-child(5) { animation-delay: .45s; }
.hero-card { animation: fadeUp .65s .5s ease both; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-card { display: none; }
  .services-grid, .articles-grid, .reviews-grid { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .steps::before { display: none; }
  .footer-top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .nav-links { display: none; }
  .services-grid, .articles-grid, .reviews-grid, .steps { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; }
  .trust-inner { gap: 1.5rem; }
  .aggregate-rating { flex-direction: column; gap: 1.5rem; }
}
