/* =============================================================================
   guides.css — Sleek Academia Guides Hub & Article Styles
   Harmonizes Neumorphic/Liquid Glass style with modern card grids, topic chips,
   answer box callout, and mid/end CTA cards.
   ============================================================================= */

/* Screen reader only utility */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* =============================================================================
   Minimal Guides Hub Styles (Linear / Vercel Minimalist Aesthetic)
   ============================================================================= */

.sa-guides-main {
  padding: 3rem 1.25rem 6rem;
  min-height: 80vh;
}

.sa-guides-container {
  max-width: 820px;
  margin: 0 auto;
  width: 100%;
}

/* Header & Controls */
.sa-guides-header {
  margin-bottom: 3rem;
}

.sa-guides-title {
  font-size: clamp(2.1rem, 4vw, 2.85rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.15;
  color: var(--navy, #0f172a);
  margin: 0 0 2rem 0;
}

.sa-guides-controls {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .sa-guides-controls {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
  }
}

.sa-guides-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sa-guides-chip {
  appearance: none;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  color: var(--slate-text, #475569);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 1rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.sa-guides-chip:hover {
  background: #f8fafc;
  color: var(--navy, #0f172a);
  border-color: #cbd5e1;
}

.sa-guides-chip.is-active,
.sa-guides-chip[aria-pressed="true"] {
  background: var(--navy, #0f172a);
  color: #ffffff;
  border-color: var(--navy, #0f172a);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
}

/* Search */
.sa-guides-search-wrap {
  position: relative;
  width: 100%;
  max-width: 19rem;
}

.sa-guides-search-icon {
  position: absolute;
  left: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  color: var(--slate-light, #94a3b8);
  pointer-events: none;
}

.sa-guides-search-input {
  width: 100%;
  padding: 0.5rem 2.2rem 0.5rem 2.4rem;
  font-size: 0.88rem;
  color: var(--navy, #0f172a);
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 9999px;
  outline: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sa-guides-search-input:focus {
  border-color: var(--blue, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.sa-guides-search-clear {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--slate-light, #94a3b8);
  cursor: pointer;
  padding: 0.2rem;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sa-guides-search-clear:hover {
  color: var(--navy, #0f172a);
}

/* --- Topic Sections --- */
.sa-topic-section {
  margin-bottom: 3.5rem;
  scroll-margin-top: 5rem;
}

.sa-topic-header {
  margin-bottom: 1.25rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid #e2e8f0;
}

.sa-topic-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--navy, #0f172a);
  margin: 0;
  letter-spacing: -0.02em;
}

/* --- Minimal Guides Feed & Cards --- */
.sa-guides-feed,
.sa-guides-list {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.sa-guide-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 14px;
  padding: 1.6rem 1.85rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
  transition: border-color 0.18s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
  cursor: pointer;
  text-decoration: none;
}

.sa-guide-card:hover {
  border-color: #cbd5e1;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -8px rgba(15, 23, 42, 0.08);
}

.sa-guide-card.is-pillar {
  border-left: 3px solid var(--blue, #2563eb);
}

.sa-card-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  font-size: 0.76rem;
  margin-bottom: 0.65rem;
}

.sa-card-topic {
  font-weight: 700;
  color: var(--blue, #2563eb);
  background: #eff6ff;
  padding: 3px 8px;
  border-radius: 5px;
  letter-spacing: 0.02em;
}

.sa-card-pillar {
  font-weight: 700;
  color: var(--navy, #0f172a);
  background: #f1f5f9;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sa-card-meta {
  color: var(--slate-light, #94a3b8);
  font-weight: 500;
}

.sa-card-title,
.sa-guide-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--navy, #0f172a);
  margin: 0 0 0.5rem 0;
  letter-spacing: -0.015em;
}

.sa-card-title a,
.sa-guide-card h3 a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

.sa-guide-card:hover .sa-card-title a,
.sa-guide-card:hover h3 a {
  color: var(--blue, #2563eb);
}

.sa-card-promise,
.sa-guide-card-promise {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--slate-text, #475569);
  margin: 0 0 1rem 0;
}

.sa-card-footer {
  display: flex;
  align-items: center;
  margin-top: auto;
}

.sa-card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--blue, #2563eb);
  text-decoration: none;
  transition: gap 0.2s ease;
}

.sa-guide-card:hover .sa-card-link {
  gap: 0.55rem;
}

.sa-card-arrow {
  transition: transform 0.2s ease;
}

.sa-guide-card:hover .sa-card-arrow {
  transform: translateX(3px);
}

.sa-guide-empty {
  padding: 1.25rem 1.5rem;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  color: var(--slate-text, #475569);
  font-size: 0.88rem;
}

.sa-guide-empty a {
  color: var(--blue, #2563eb);
  font-weight: 600;
  text-decoration: none;
}

/* Fallback card footer for article related cards */
.sa-guide-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(241, 245, 249, 0.9);
  padding-top: 0.9rem;
  margin-top: 1rem;
  font-size: 0.8rem;
}

.sa-guide-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 800;
  color: var(--magenta, #db2777);
  text-decoration: none;
  transition: gap 0.2s ease;
}

.sa-guide-date {
  color: var(--slate-light, #94a3b8);
  font-size: 0.75rem;
  font-weight: 500;
}

/* =============================================================================
   Article Template Styles
   ============================================================================= */

/* Breadcrumb */
.sa-guide-breadcrumb {
  margin: 0 0 1.5rem;
  font-size: 0.84rem;
  color: var(--slate-light, #94a3b8);
}

.sa-guide-breadcrumb ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.sa-guide-breadcrumb li a {
  color: var(--blue, #2563eb);
  text-decoration: none;
  font-weight: 600;
}

.sa-guide-breadcrumb-sep {
  color: var(--slate-light, #cbd5e1);
}

/* Header & Meta */
.sa-guide-header {
  margin-bottom: 2rem;
}

.sa-guide-topic-badge {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue, #2563eb);
  margin-bottom: 0.6rem;
}

.sa-guide-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.84rem;
  color: var(--slate-light, #64748b);
  margin-top: 0.75rem;
}

.sa-guide-meta-divider {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--slate-light, #94a3b8);
}

/* 3. Answer Box */
.sa-guide-answer-box {
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.95) 0%, rgba(240, 249, 255, 0.9) 100%);
  border: 1.5px solid rgba(191, 219, 254, 0.8);
  border-left: 5px solid var(--blue, #2563eb);
  border-radius: 1rem;
  padding: 1.4rem 1.6rem;
  margin: 2rem 0;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.06);
}

.sa-guide-answer-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue, #2563eb);
  margin-bottom: 0.5rem;
}

.sa-guide-answer-text {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--navy, #0f172a);
  margin: 0;
  font-weight: 500;
}

/* 4. Table of Contents */
.sa-guide-toc {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 1rem;
  padding: 1.25rem 1.6rem;
  margin: 2rem 0 2.5rem;
}

.sa-guide-toc-title {
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--navy, #0f172a);
  margin: 0 0 0.75rem;
}

.sa-guide-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sa-guide-toc-list li a {
  color: var(--blue, #2563eb);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
}

.sa-guide-toc-list li a:hover {
  text-decoration: underline;
}

/* 6. Mid-article CTA Card */
.sa-guide-mid-cta {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
  border: 1.5px solid rgba(226, 232, 240, 0.95);
  border-radius: 1.25rem;
  padding: 1.75rem;
  margin: 3rem 0;
  box-shadow: 0 10px 25px -8px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .sa-guide-mid-cta {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 2rem 2.25rem;
  }
}

.sa-guide-mid-cta-kicker {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--blue, #2563eb);
  display: block;
  margin-bottom: 0.35rem;
}

.sa-guide-mid-cta-text h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--navy, #0f172a);
  margin: 0 0 0.35rem;
}

.sa-guide-mid-cta-text p {
  font-size: 0.9rem;
  color: var(--slate-text, #475569);
  margin: 0;
  max-width: 32rem;
}

/* 7. FAQ Block */
.sa-guide-faq-section {
  margin: 3.5rem 0 2.5rem;
}

.sa-guide-faq-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--navy, #0f172a);
  margin: 0 0 1.25rem;
}

.sa-guide-faq-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sa-guide-faq-item {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
}

.sa-guide-faq-q {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--navy, #0f172a);
  margin: 0 0 0.5rem;
}

.sa-guide-faq-a {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--slate-text, #475569);
  margin: 0;
}

/* Related Guides */
.sa-guide-related-section {
  margin-top: 3.5rem;
}

.sa-guide-related-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--navy, #0f172a);
  margin: 0 0 1.25rem;
}

.sa-guide-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 1rem;
}

.sa-guide-related-card {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 1rem;
  padding: 1.2rem;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.sa-guide-related-card:hover {
  transform: translateY(-2px);
  border-color: var(--blue, #2563eb);
}

.sa-guide-related-card h4 {
  font-size: 0.98rem;
  font-weight: 750;
  color: var(--navy, #0f172a);
  margin: 0 0 0.4rem;
}

.sa-guide-related-card span {
  font-size: 0.75rem;
  color: var(--blue, #2563eb);
  font-weight: 700;
}

/* --- Blurred Background on Guides Hub and Article Pages --- */
body:has(.sa-guides-main) .fixed-desk-bg,
body:has(.sa-guide-main) .fixed-desk-bg,
.sa-guides-page .fixed-desk-bg {
  filter: blur(14px) brightness(0.95);
  transform: scale(1.05);
  transition: filter 0.3s ease;
}

/* --- Card Click Opening Animation & Modern View Transitions --- */
@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }

  ::view-transition-old(root) {
    animation: 0.22s ease-out both vt-fade-out;
  }

  ::view-transition-new(root) {
    animation: 0.28s cubic-bezier(0.16, 1, 0.3, 1) both vt-page-in;
  }

  @keyframes vt-fade-out {
    to { opacity: 0; transform: scale(0.985); }
  }

  @keyframes vt-page-in {
    from { opacity: 0; transform: translateY(10px) scale(0.99); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }

  .sa-guide-card.is-opening {
    z-index: 100;
    transform: scale(1.03) translateY(-4px);
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.28), 0 0 0 2px var(--blue, #2563eb);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
  }

  body.is-transitioning .sa-guide-card:not(.is-opening) {
    opacity: 0.5;
    transform: scale(0.98);
    transition: opacity 0.22s ease, transform 0.22s ease;
  }

  body.is-transitioning .sa-guides-hero,
  body.is-transitioning .sa-blog-eyebrow,
  body.is-transitioning .sa-blog-intro,
  body.is-transitioning .sa-guides-controls {
    opacity: 0.6;
    transition: opacity 0.22s ease;
  }
}
