/* ============================================================
   BuzzReicpe — Apple Education Page Style
   Design tokens, animations, and responsive layout
   ============================================================ */

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

:root {
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-rgb: 0, 113, 227;
  --bg: #ffffff;
  --light-bg: #f5f5f7;
  --text: #1d1d1f;
  --text-muted: #6e6e73;
  --border: rgba(0,0,0,.08);
  --radius: 16px;
  --radius-sm: 12px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.04);
  --shadow-md: 0 4px 20px rgba(0,0,0,.06);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.08);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ---- Layout ---- */
.content-wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.section,
.categories,
.featured-posts,
.testimonials { padding-top: 100px; padding-bottom: 100px; }

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(28px, 3.5vw, 42px);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -.02em;
  text-align: center;
  margin-bottom: 12px;
  color: var(--text);
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 18px;
  text-align: center;
  max-width: 560px;
  margin: 0 auto 52px;
  line-height: 1.5;
}

.cols-3 { grid-template-columns: repeat(3, 1fr); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 980px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  padding: 12px 28px;
  transition: background .2s ease, transform 160ms var(--ease-out), box-shadow .2s ease;
  font-family: inherit;
  white-space: nowrap;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { transform: scale(.97); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
  border-radius: 980px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  padding: 12px 28px;
  transition: background .2s ease, transform 160ms var(--ease-out);
  font-family: inherit;
  white-space: nowrap;
}
.btn-secondary:hover { background: rgba(var(--accent-rgb), .06); }
.btn-secondary:active { transform: scale(.97); }

.btn-sm { padding: 8px 20px; font-size: 13px; }
.btn-lg { padding: 16px 40px; font-size: 17px; }

.btn-subscribe {
  width: 44px;
  height: 44px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ============================================================
   HEADER — Frosted glass
   ============================================================ */
.site-header {
  position: relative;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
}

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

.logo {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo i { color: var(--accent); font-size: 20px; }

.main-nav { display: flex; align-items: center; gap: 32px; }
.main-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color .2s ease;
  position: relative;
}
.main-nav a:hover { color: var(--text); }
.main-nav a:active { transform: scale(.97); }
.main-nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform .2s var(--ease-out);
}
.main-nav a:hover::after { transform: scaleX(1); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-search {
  width: 38px;
  height: 38px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s ease, color .2s ease, transform 160ms var(--ease-out);
}
.btn-search:hover { background: var(--light-bg); color: var(--text); }
.btn-search:active { transform: scale(.92); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  padding: 140px 0 120px;
  text-align: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #f5f5f7 0%, #ffffff 100%);
  z-index: 0;
}

.hero-glow {
  position: absolute;
  top: -20%;
  left: 50%;
  width: 800px;
  height: 600px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse 50% 50% at center, rgba(0,113,227,.08), transparent 70%);
  z-index: 1;
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 2;
}

.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(38px, 6vw, 68px);
  font-weight: 900;
  line-height: 1.06;
  letter-spacing: -.03em;
  max-width: 820px;
  margin: 0 auto 20px;
  color: var(--text);
}

.hero-subtitle {
  font-size: clamp(17px, 2vw, 21px);
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto 40px;
  line-height: 1.55;
}

.hero-cta {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================================
   CATEGORY CARDS
   ============================================================ */
.cat-grid {
  display: grid;
  gap: 20px;
}

.cat-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  text-decoration: none;
  min-height: 240px;
  display: flex;
  align-items: flex-end;
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out);
}
.cat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0,0,0,.12);
}
.cat-card:active { transform: scale(.97); }

.cat-card-bg {
  position: absolute;
  inset: 0;
  transition: transform .8s var(--ease-out);
}
.cat-card:hover .cat-card-bg { transform: scale(1.06); }

.cat-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 25%, rgba(0,0,0,.6));
  z-index: 1;
}

.cat-card-body {
  position: relative;
  z-index: 2;
  padding: 32px;
  width: 100%;
}
.cat-card-body h3 {
  color: #fff;
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.2;
}
.cat-card-body p {
  color: rgba(255,255,255,.85);
  font-size: 14px;
  line-height: 1.5;
  max-width: 280px;
}

/* ============================================================
   POST CARDS
   ============================================================ */
.post-grid {
  display: grid;
  gap: 28px;
}

.post-card {
  background: var(--bg);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out);
  border: 1px solid var(--border);
}
.post-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}
.post-card:active { transform: scale(.98); }

.post-card a { text-decoration: none; color: inherit; display: block; }

.post-card-img {
  width: 100%;
  aspect-ratio: 16/10;
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, #0071e3, #5ac8fa);
}
.post-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  color: transparent;
  font-size: 0;
  position: relative;
  z-index: 1;
  transition: transform .6s var(--ease-out);
}
.post-card:hover .post-card-img img { transform: scale(1.05); }

.post-card-body { padding: 22px; }

.post-card-cat {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 6px;
}

.post-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 700;
  margin: 6px 0 8px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-excerpt {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 14px;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #aeaeb2;
}
.post-card-meta i { margin-right: 3px; font-size: 11px; }

.meta-dot { color: #d2d2d7; }

/* ============================================================
   STATS BAR
   ============================================================ */
.stats {
  background: var(--light-bg);
  text-align: center;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  max-width: 800px;
  margin: 0 auto;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.stat-number {
  font-family: 'Playfair Display', serif;
  font-size: clamp(40px, 5vw, 56px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.03em;
  color: var(--text);
}

.stat-label {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
}

/* ============================================================
   TESTIMONIALS
   ============================================================ */
.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.testimonial-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  display: flex;
  flex-direction: column;
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out);
}
.testimonial-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.testimonial-card:active { transform: scale(.98); }

.quote-icon {
  color: var(--accent);
  font-size: 22px;
  margin-bottom: 18px;
  opacity: .5;
}

.testimonial-text {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-muted);
  flex: 1;
  margin-bottom: 24px;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.testimonial-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: .02em;
}

.testimonial-info strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.testimonial-info span {
  font-size: 12px;
  color: var(--text-muted);
}

/* ============================================================
   CTA SECTION
   ============================================================ */
.cta {
  text-align: center;
  background: var(--light-bg);
}

.cta-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -.02em;
  margin-bottom: 14px;
  color: var(--text);
}

.cta-subtitle {
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1.5;
  margin-bottom: 36px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 64px 0 0;
  background: var(--light-bg);
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 48px;
}

.footer-col h3 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 18px;
  color: var(--text);
}

.footer-col p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 8px;
}

.footer-col a {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  display: block;
  margin-bottom: 10px;
  line-height: 1.5;
  transition: color .2s ease;
}
.footer-col a:hover { color: var(--text); }
.footer-col a:active { transform: scale(.97); }

/* Footer brand column */
.footer-col-brand p { max-width: 300px; }

/* Social icons */
.footer-social {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}
.footer-social a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 15px;
  transition: background .2s ease, color .2s ease, transform 160ms var(--ease-out);
  margin-bottom: 0;
}
.footer-social a:hover { background: var(--accent); color: #fff; }
.footer-social a:active { transform: scale(.92); }

/* Newsletter form */
.newsletter-form {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.newsletter-form input {
  flex: 1;
  min-width: 0;
  padding: 11px 16px;
  border: 1px solid var(--border);
  border-radius: 980px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.newsletter-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .12);
}
.newsletter-form input::placeholder { color: #aeaeb2; }

/* Footer bottom */
.footer-bottom {
  margin-top: 48px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ============================================================
   ANIMATIONS — Scroll reveals
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
}

/* ============================================================
   SSR SAMPLE HIDING
   ============================================================ */
.cat-grid:has(.cat-card:not(.ssr-sample)) .cat-card.ssr-sample,
.post-grid:has(.post-card:not(.ssr-sample)) .post-card.ssr-sample {
  display: none;
}

/* ============================================================
   HOVER: Touch devices
   ============================================================ */
@media (hover: hover) and (pointer: fine) {
  .cat-card:hover { transform: translateY(-4px); }
  .post-card:hover { transform: translateY(-6px); }
  .testimonial-card:hover { transform: translateY(-4px); }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: translateY(0); }
  .hero-title, .hero-subtitle, .hero-cta { opacity: 1; transform: translateY(0); }
  .post-card:hover { transform: none; }
  .cat-card:hover { transform: none; }
  .testimonial-card:hover { transform: none; }
  .cat-card:hover .cat-card-bg { transform: none; }
  .post-card:hover .post-card-img img { transform: none; }
  .cat-card:active, .post-card:active, .testimonial-card:active,
  .btn-primary:active, .btn-secondary:active, .btn-search:active,
  .main-nav a:active,
  .footer-social a:active, .footer-col a:active { transform: none; }
}

/* ============================================================
   RESPONSIVE - 960px (Tablet)
   ============================================================ */
@media (max-width: 960px) {
  .cols-3 { grid-template-columns: repeat(2, 1fr); }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .testimonial-grid { grid-template-columns: repeat(2, 1fr); }

  .footer-inner { grid-template-columns: 1fr 1fr; gap: 36px; }
  .footer-col-brand { grid-column: 1 / -1; }

  .main-nav { display: none; }

  .hero { padding: 100px 0 80px; }
  .section { padding-top: 80px; padding-bottom: 80px; }

  .section-subtitle { margin-bottom: 40px; font-size: 17px; }
}

/* ============================================================
   RESPONSIVE - 600px (Mobile)
   ============================================================ */
@media (max-width: 600px) {
  .cols-3 { grid-template-columns: 1fr; }
  .cat-grid { grid-template-columns: 1fr; }
  .post-grid { grid-template-columns: 1fr; }
  .testimonial-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; gap: 32px; }

  .footer-inner { grid-template-columns: 1fr; gap: 32px; }

  .hero { padding: 80px 0 60px; }
  .section { padding-top: 60px; padding-bottom: 60px; }
  .section-subtitle { margin-bottom: 32px; }

  .hero-cta { flex-direction: column; align-items: center; }
  .hero-cta .btn-lg { width: 100%; max-width: 320px; }

  .header-inner { height: 50px; }
  .logo { font-size: 19px; }

  .cat-card { min-height: 200px; }
  .cat-card-body { padding: 24px; }
}
