/* ============================================================
   BuzzReicpe Blog — Apple Education Page Style
   Complete standalone stylesheet for blog listing page
   ============================================================ */

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

: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;
}

body { overflow-x: hidden; }

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 { padding-top: 100px; padding-bottom: 100px; }

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

/* ============================================================
   HEADER — Frosted glass (matching homepage)
   ============================================================ */
.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); }

/* ============================================================
   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;
}

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 24px;
  max-width: 1200px;
  margin: 0 auto;
  font-size: 13px;
  color: var(--text-muted);
}
.breadcrumb a {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  text-decoration: none;
  transition: color .2s ease;
}
.breadcrumb a:hover { color: var(--text); }
.breadcrumb a:active { transform: scale(.97); }
.breadcrumb a i { font-size: 12px; }

.breadcrumb-sep {
  font-size: 10px;
  color: #aeaeb2;
}

.breadcrumb-current {
  color: var(--text);
  font-weight: 500;
}

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

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

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

.blog-hero-content {
  position: relative;
  z-index: 2;
}

.blog-hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(38px, 5vw, 56px);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -.02em;
  margin-bottom: 14px;
  color: var(--text);
}

.blog-hero-subtitle {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.55;
}

/* ============================================================
   BLOG CONTENT SECTION
   ============================================================ */
.blog-content {
  padding-top: 48px;
}

/* ============================================================
   CATEGORY PILLS
   ============================================================ */
.category-pills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 36px;
}

.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 22px;
  border: 1px solid var(--border);
  border-radius: 980px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg);
  transition: all .2s ease, transform 160ms var(--ease-out);
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
}
.cat-pill i { font-size: 12px; }
.cat-pill:hover {
  background: var(--light-bg);
  color: var(--text);
  border-color: var(--text-muted);
}
.cat-pill:active { transform: scale(.97); }
.cat-pill.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.cat-pill.active:hover {
  background: var(--accent-hover);
}

/* ============================================================
   TOOLBAR
   ============================================================ */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 48px;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.toolbar-count {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}
.toolbar-count i { font-size: 13px; color: #aeaeb2; }

.toolbar-sort {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sort-label {
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
}

.sort-select {
  padding: 6px 32px 6px 12px;
  border: 1px solid var(--border);
  border-radius: 980px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  color: var(--text);
  background: var(--bg);
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236e6e73' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.sort-select:hover { border-color: #aeaeb2; }
.sort-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .12);
}

/* ============================================================
   FEATURED POST
   ============================================================ */
.featured-post {
  margin-bottom: 56px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg);
  transition: transform .3s var(--ease-out), box-shadow .3s var(--ease-out);
}
.featured-post:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.featured-post:active { transform: scale(.98); }

.featured-post a {
  display: grid;
  grid-template-columns: 1fr 1fr;
  color: inherit;
  text-decoration: none;
}

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

.featured-post-img-gradient {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
}

.featured-post-body {
  padding: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

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

.featured-post-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 14px;
  color: var(--text);
  transition: color .25s ease;
}
.featured-post:hover .featured-post-title { color: var(--accent); }

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

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

.meta-dot {
  color: #d2d2d7;
  font-size: 14px;
}

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

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

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

.post-card-img {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
  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-img-gradient {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.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;
  line-height: 1.3;
  margin: 6px 0 8px;
  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;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.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; }

/* ============================================================
   SSR SAMPLE HIDING
   ============================================================ */
/* Hide sample cards when real cards exist in the grid */
.post-grid:has(.post-card:not(.ssr-sample)) .ssr-sample { display: none; }

/* Markers for JS-based sample hiding (frontmatter-only elements) */
.ssr-sample-only { display: block; }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 56px 0 0;
}

.page-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s ease, transform 160ms var(--ease-out);
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
}
.page-btn i { font-size: 12px; }
.page-btn:hover {
  background: var(--light-bg);
  border-color: #aeaeb2;
}
.page-btn:active { transform: scale(.92); }
.page-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.page-btn.active:hover {
  background: var(--accent-hover);
}
.page-btn.disabled {
  opacity: .3;
  pointer-events: none;
  cursor: default;
}

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

.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-col-brand p { max-width: 300px; }

.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 {
  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 {
  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);
}

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

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: translateY(0); }
  .blog-hero-title, .blog-hero-subtitle { opacity: 1; transform: translateY(0); }
  .post-card:hover { transform: none; }
  .featured-post:hover { transform: none; }
  .post-card:hover .post-card-img img { transform: none; }
  .featured-post:hover .featured-post-img img { transform: none; }
  .post-card:active, .featured-post:active,
  .page-btn:active, .cat-pill: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) {
  .featured-post a { grid-template-columns: 1fr; }
  .featured-post-body { padding: 28px; }
  .featured-post-img { aspect-ratio: 16/9; }

  .cols-3 { grid-template-columns: repeat(2, 1fr); }
  .post-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; }

  .blog-hero { padding: 60px 0 0; }
  .blog-content { padding-top: 36px; }
  .section { padding-top: 80px; padding-bottom: 80px; }
}

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

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

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

  .blog-hero { padding: 48px 0 0; }
  .blog-content { padding-top: 28px; }
  .section { padding-top: 60px; padding-bottom: 60px; }

  .breadcrumb { padding: 14px 24px; font-size: 12px; }

  .featured-post-body { padding: 24px; }
  .post-card-body { padding: 18px; }

  .category-pills { gap: 8px; margin-bottom: 28px; }
  .cat-pill { padding: 6px 16px; font-size: 12px; }

  .toolbar { margin-bottom: 32px; }

  .pagination { padding: 40px 0 0; gap: 6px; }
  .page-btn { width: 36px; height: 36px; font-size: 13px; }
}
