/* ============================================================
   BuzzReicpe — Single Resource Page (single-product)
   Apple Education Page Style | Text-first resource detail
   Complete standalone stylesheet
   ============================================================ */

/* ---- 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);
  --rcp-accent: #0071e3;
  --rcp-bg: #f5f5f7;
  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; color: transparent; font-size: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ---- Layout ---- */
.content-wrap { max-width: 1200px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }

/* ============================================================
   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-top: 12px;
  padding-bottom: 12px;
  padding-left: 28px;
  padding-right: 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-sm { padding-top: 8px; padding-bottom: 8px; padding-left: 20px; padding-right: 20px; font-size: 13px; }

.btn-subscribe {
  width: 44px;
  height: 44px;
  padding-top: 0;
  padding-right: 0;
  padding-bottom: 0;
  padding-left: 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); }

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 28px;
  padding-bottom: 12px;
  font-size: 14px;
  color: var(--text-muted);
  flex-wrap: wrap;
  opacity: 0;
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color .2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb a:active { transform: scale(.97); }

.breadcrumb-sep {
  display: flex;
  align-items: center;
  color: #d2d2d7;
  font-size: 10px;
}

.breadcrumb-current {
  color: var(--text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 300px;
}

/* ============================================================
   RESOURCE MAIN
   ============================================================ */
.resource-main {
  padding-top: 8px;
  padding-bottom: 100px;
}

/* ============================================================
   TWO-COLUMN RESOURCE LAYOUT
   ============================================================ */
.resource-layout {
  display: flex;
  gap: 64px;
  align-items: flex-start;
  padding-top: 24px;
  padding-bottom: 64px;
}

/* ============================================================
   RESOURCE INFO (Left Column)
   ============================================================ */
.resource-info {
  flex: 1;
  min-width: 0;
}

/* Tags */
.resource-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  opacity: 0;
}

.resource-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-top: 6px;
  padding-bottom: 6px;
  padding-left: 16px;
  padding-right: 16px;
  border-radius: 980px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
}

.tag-brand {
  background: rgba(var(--accent-rgb), .08);
  color: var(--accent);
}

.tag-category {
  background: var(--light-bg);
  color: var(--text-muted);
}

/* Name */
.resource-name {
  font-family: 'Playfair Display', serif;
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -.03em;
  color: var(--text);
  margin-bottom: 16px;
  opacity: 0;
}

/* Tagline */
.resource-tagline {
  font-size: clamp(16px, 1.5vw, 19px);
  color: var(--text-muted);
  line-height: 1.55;
  max-width: 540px;
  margin-bottom: 28px;
  opacity: 0;
}

/* Price Row */
.resource-price-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 32px;
  opacity: 0;
}

.price-current {
  font-family: 'Playfair Display', serif;
  font-size: clamp(32px, 3.5vw, 42px);
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -.02em;
}

.price-original {
  font-size: 20px;
  color: var(--text-muted);
  text-decoration: line-through;
  font-weight: 400;
}
.price-original:empty { display: none; }

/* CTA Button */
.btn-resource-cta {
  font-size: 17px;
  padding-top: 16px;
  padding-bottom: 16px;
  padding-left: 40px;
  padding-right: 40px;
  gap: 10px;
  opacity: 0;
}
.btn-resource-cta i { font-size: 15px; }

/* ============================================================
   GRADIENT VISUAL CARD (Right Column)
   ============================================================ */
.resource-visual {
  width: 460px;
  flex-shrink: 0;
}

.visual-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  height: 460px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: transform .3s var(--ease-out), box-shadow .3s var(--ease-out);
  will-change: transform;
}

.visual-card-glow {
  position: absolute;
  top: -30%;
  left: -20%;
  width: 140%;
  height: 140%;
  background: radial-gradient(ellipse at 40% 40%, rgba(255,255,255,.2), transparent 60%);
  pointer-events: none;
}

.visual-card-shine {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(255,255,255,.1) 0%, transparent 50%, rgba(0,0,0,.08) 100%);
  pointer-events: none;
}

.visual-card-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding-top: 40px;
  padding-right: 40px;
  padding-bottom: 40px;
  padding-left: 40px;
}

.visual-card-icon {
  font-size: 72px;
  color: rgba(255,255,255,.95);
  margin-bottom: 20px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.1));
}

.visual-card-label {
  display: block;
  font-size: 20px;
  font-weight: 600;
  color: rgba(255,255,255,.9);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.visual-card-badge {
  display: inline-flex;
  align-items: center;
  padding-top: 6px;
  padding-bottom: 6px;
  padding-left: 18px;
  padding-right: 18px;
  border-radius: 980px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,.95);
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  letter-spacing: .04em;
}

/* ============================================================
   ACCORDION
   ============================================================ */
.resource-accordion {
  border-top: 1px solid var(--border);
  margin-bottom: 80px;
}

.accordion-item {
  border-bottom: 1px solid var(--border);
}

.accordion-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding-top: 22px;
  padding-bottom: 22px;
  background: none;
  border: none;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: color .2s ease;
  gap: 12px;
  font-family: inherit;
}
.accordion-trigger:hover { color: var(--accent); }
.accordion-trigger:active { transform: scale(.995); }

.accordion-trigger-icon {
  color: var(--accent);
  font-size: 15px;
  width: 22px;
  text-align: center;
  margin-right: 4px;
}

.accordion-icon {
  font-size: 14px;
  color: var(--text-muted);
  transition: transform .3s var(--ease-out);
  flex-shrink: 0;
}

.accordion-item.is-active .accordion-icon {
  transform: rotate(180deg);
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.35s var(--ease-out), opacity 0.25s var(--ease-out);
}

.accordion-item.is-active .accordion-body {
  /* Default open state — JS overrides with px values for smooth transitions */
  max-height: 2000px;
  opacity: 1;
}

.accordion-body-inner {
  padding-bottom: 28px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-muted);
}

.accordion-body-inner p {
  margin-bottom: 14px;
}

.accordion-body-inner p:last-child {
  margin-bottom: 0;
}

.accordion-body-inner strong {
  color: var(--text);
  font-weight: 600;
}

.accordion-body-inner a {
  color: var(--accent);
  text-decoration: underline;
  transition: opacity .2s ease;
}
.accordion-body-inner a:hover { opacity: .8; }

.accordion-body-inner ul,
.accordion-body-inner ol {
  margin: 12px 0;
  padding-left: 24px;
}

.accordion-body-inner li {
  margin-bottom: 8px;
}

/* Safety net: prevent h2 in description content from breaking accordion layout */
.accordion-body-inner h2 {
  font-size: 15px;
  margin: 16px 0 6px;
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 700;
  line-height: 1.4;
}

/* Spec Grid inside accordion */
.spec-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.spec-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  gap: 16px;
}

.spec-item:last-child {
  border-bottom: none;
}

.spec-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  flex-shrink: 0;
}

.spec-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-align: right;
}

/* ============================================================
   RELATED RESOURCES
   ============================================================ */
.related-resources {
  padding-top: 0;
  padding-bottom: 80px;
}

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

.related-grid {
  display: grid;
  gap: 24px;
}

/* Same style as product cards on products page */
.related-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  text-decoration: none;
  min-height: 280px;
  display: flex;
  align-items: flex-end;
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out);
  opacity: 0;
  transform: translateY(24px);
  animation: card-fade-in .5s var(--ease-out) forwards;
}
.related-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}
.related-card:active { transform: scale(.97); }

@keyframes card-fade-in {
  to { opacity: 1; transform: translateY(0); }
}

.related-card:nth-child(1) { animation-delay: 0ms; }
.related-card:nth-child(2) { animation-delay: 60ms; }
.related-card:nth-child(3) { animation-delay: 120ms; }

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

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

.related-card-body {
  position: relative;
  z-index: 2;
  padding-top: 28px;
  padding-right: 28px;
  padding-bottom: 28px;
  padding-left: 28px;
  width: 100%;
}

.related-card-cat {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,.8);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 8px;
  background: rgba(255,255,255,.15);
  padding-top: 4px;
  padding-bottom: 4px;
  padding-left: 12px;
  padding-right: 12px;
  border-radius: 980px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.related-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
  line-height: 1.25;
  letter-spacing: -.01em;
}

.related-card-excerpt {
  font-size: 13px;
  color: rgba(255,255,255,.8);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 95%;
}

.related-card-price {
  display: inline-block;
  margin-top: 12px;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  font-family: 'Playfair Display', serif;
}

/* ============================================================
   COMMENT THREADS
   ============================================================ */
.comment-threads-section {
  padding-top: 40px;
  padding-bottom: 40px;
}

/* ============================================================
   FOOTER — 4-column, matches homepage
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  padding-top: 64px;
  padding-bottom: 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-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-top: 11px;
  padding-bottom: 11px;
  padding-left: 16px;
  padding-right: 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-top: 20px;
  padding-bottom: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

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

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .breadcrumb,
  .resource-name,
  .resource-tagline,
  .resource-price-row,
  .btn-resource-cta,
  .resource-tags,
  .visual-card,
  .related-card {
    opacity: 1;
    transform: translateY(0);
    animation: none;
  }

  .related-card { animation: none; }
  .related-card:nth-child(1),
  .related-card:nth-child(2),
  .related-card:nth-child(3) { animation-delay: 0ms; }

  .accordion-body {
    transition: none;
  }

  .accordion-item.is-active .accordion-icon {
    transform: none;
  }

  .visual-card { transform: none !important; }

  .breadcrumb a:active,
  .btn-primary:active,
  .btn-search:active,
  .btn-resource-cta:active,
  .main-nav a:active,
  .accordion-trigger:active,
  .related-card:active,
  .footer-social a:active,
  .footer-col a:active { transform: none; }

  .related-card:hover { transform: none; }
  .related-card:hover .related-card-bg { transform: none; }
}

/* ============================================================
   RESPONSIVE — 960px (Tablet)
   ============================================================ */
@media (max-width: 960px) {
  .resource-layout {
    flex-direction: column;
    gap: 48px;
  }

  .resource-visual {
    width: 100%;
    order: -1;
  }

  .visual-card {
    height: 360px;
  }

  .resource-info {
    width: 100%;
  }

  .resource-name {
    font-size: clamp(28px, 5vw, 40px);
  }

  .price-current {
    font-size: clamp(28px, 4vw, 36px);
  }

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

  .breadcrumb { padding-top: 20px; font-size: 13px; }

  .resource-main { padding-bottom: 80px; }
  .resource-accordion { margin-bottom: 60px; }
  .related-resources { padding-bottom: 60px; }

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

/* ============================================================
   RESPONSIVE — 600px (Mobile)
   ============================================================ */
@media (max-width: 600px) {
  .resource-layout {
    gap: 36px;
    padding-top: 16px;
    padding-bottom: 48px;
  }

  .resource-visual {
    width: 100%;
  }

  .visual-card {
    height: 280px;
  }

  .visual-card-icon {
    font-size: 52px;
    margin-bottom: 14px;
  }

  .visual-card-label {
    font-size: 16px;
  }

  .resource-tags {
    margin-bottom: 16px;
  }

  .resource-tag {
    font-size: 12px;
    padding-top: 5px;
    padding-bottom: 5px;
    padding-left: 14px;
    padding-right: 14px;
  }

  .resource-name {
    font-size: clamp(26px, 7vw, 34px);
    margin-bottom: 12px;
  }

  .resource-tagline {
    font-size: 15px;
    margin-bottom: 22px;
  }

  .resource-price-row {
    margin-bottom: 26px;
    flex-wrap: wrap;
  }

  .price-current {
    font-size: clamp(28px, 6vw, 34px);
  }

  .price-original {
    font-size: 17px;
  }

  .btn-resource-cta {
    font-size: 16px;
    padding-top: 14px;
    padding-bottom: 14px;
    padding-left: 36px;
    padding-right: 36px;
    width: 100%;
    justify-content: center;
  }

  .breadcrumb {
    padding-top: 16px;
    font-size: 12px;
    gap: 8px;
  }
  .breadcrumb-current {
    max-width: 160px;
  }

  .cols-3 { grid-template-columns: 1fr; }

  .accordion-trigger {
    font-size: 15px;
    padding-top: 18px;
    padding-bottom: 18px;
  }

  .accordion-body-inner {
    font-size: 14px;
  }

  .spec-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .spec-value {
    text-align: left;
  }

  .resource-main {
    padding-bottom: 60px;
    padding-top: 4px;
  }

  .resource-accordion {
    margin-bottom: 48px;
  }

  .related-resources {
    padding-bottom: 48px;
  }

  .related-card {
    min-height: 240px;
  }
  .related-card-body {
    padding-top: 24px;
    padding-right: 24px;
    padding-bottom: 24px;
    padding-left: 24px;
  }
  .related-card-title {
    font-size: 18px;
  }

  .section-subtitle {
    margin-bottom: 32px;
  }

  .comment-threads-section {
    padding-top: 24px;
    padding-bottom: 24px;
  }

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

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