/* pages/guides.css — guides landing page + individual guide page styles */

/* ═══════════════════════════════════
   A. GUIDES LANDING PAGE
   ═══════════════════════════════════ */

/* Hero */
.guides-hero {
  text-align: center;
  padding-top: var(--space-4);
  padding-bottom: var(--space-2);
}

.guides-hero h1 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 var(--space-3);
}

.guides-hero__subtitle {
  max-width: 52ch;
  margin: 0 auto var(--space-2);
  font-size: 1rem;
  color: var(--text-2);
  line-height: 1.55;
}

.guides-hero__count {
  font-size: 0.9rem;
  color: var(--text-3);
  text-align: center;
  margin: 0 auto;
}

/* Guide cards — 2-column grid */
.guides-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-5);
  max-width: 960px;
  margin: 0 auto var(--space-8);
}

/* Guide card */
.guide-card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: var(--space-5);
  transition: border-color 0.15s ease;
  cursor: pointer;
}

.guide-card:hover {
  border-color: var(--accent);
}

/* Make the title link cover the entire card for full-card click */
.guide-card h2 a::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* Lift interactive elements above the overlay */
.guide-card-tool,
.guide-card-link {
  position: relative;
  z-index: 1;
}

/* Category badges — reuse blog pattern */
.guide-category-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 8px;
  border-radius: 6px;
  margin-bottom: var(--space-2);
}

/* mechanical + ventilation: same as blog "guides" category */
.guide-category--mechanical {
  background: #2a4a3f;
  color: #7bc88f;
}

.guide-category--ventilation {
  background: #2a4a3f;
  color: #7bc88f;
}

/* electrical: same as blog "industry" category */
.guide-category--electrical {
  background: #4a3a2a;
  color: #d4a853;
}

/* standards: same as blog "reference" category */
.guide-category--standards {
  background: #3a2a4a;
  color: #a08bd4;
}

.guide-card h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 var(--space-2);
  line-height: 1.3;
}

.guide-card h2 a {
  text-decoration: none;
  color: inherit;
}

.guide-card h2 a:hover {
  color: var(--accent);
}

.guide-card-summary {
  font-size: 0.95rem;
  color: var(--text-2);
  line-height: 1.6;
  margin: 0 0 var(--space-3);
}

.guide-card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 0.8rem;
  color: var(--text-3);
  margin: 0 0 var(--space-3);
}

.guide-card-meta svg {
  display: inline-block;
  vertical-align: middle;
  width: 14px;
  height: 14px;
  margin-right: 3px;
  flex-shrink: 0;
  color: var(--accent);
}

.guide-card-meta span {
  display: inline-flex;
  align-items: center;
}

/* Tags */
.guide-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: var(--space-3);
}

.guide-tag {
  font-size: 10px;
  padding: 2px 8px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text-3);
}

/* Related tools row within card */
.guide-card-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  font-size: 0.8rem;
}

.guide-card-tools-label {
  color: var(--text-3);
  font-size: 0.78rem;
}

.guide-card-tool {
  display: inline-block;
  font-size: 0.78rem;
  padding: 3px 10px;
  background: var(--bg-section);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--accent);
  text-decoration: none;
  transition: border-color 0.15s;
}

.guide-card-tool:hover {
  border-color: var(--accent);
  color: var(--accent-hover);
}

/* Read guide link */
.guide-card-link {
  display: inline-block;
  font-size: 0.9rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.guide-card-link:hover {
  text-decoration: underline;
  color: var(--accent-hover);
}

/* Empty state */
.guides-empty {
  text-align: center;
  padding: var(--space-8);
  color: var(--text-2);
}


/* ═══════════════════════════════════
   B. INDIVIDUAL GUIDE PAGE
   ═══════════════════════════════════ */

/* Page wrapper */
.guide-page {
  padding-top: var(--space-4);
}

.guide-page .measure {
  max-width: 68ch;
}

/* Breadcrumb */
.guide-breadcrumb {
  font-size: 0.85rem;
  color: var(--text-3);
  margin-bottom: var(--space-5);
}

.guide-breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}

.guide-breadcrumb a:hover {
  text-decoration: underline;
}

.guide-breadcrumb .separator {
  margin: 0 0.35em;
}

/* Guide header */
.guide-header {
  margin-bottom: var(--space-6);
}

.guide-header h1 {
  margin-bottom: var(--space-3);
}

.guide-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--text-3);
  margin-bottom: var(--space-3);
}

.guide-read-time,
.guide-date {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.guide-meta svg {
  display: inline-block;
  vertical-align: middle;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--accent);
}

.guide-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.guide-tags .guide-tag {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--accent);
  text-transform: capitalize;
}

/* Table of Contents */
.guide-toc {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-6);
}

.guide-toc h2 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-1);
  margin: 0 0 var(--space-3);
  cursor: pointer;
}

.guide-toc h2 svg {
  display: inline-block;
  vertical-align: middle;
  width: 14px;
  height: 14px;
  margin-left: 6px;
  transition: transform 0.2s;
  color: var(--text-3);
}

.guide-toc.is-collapsed h2 svg {
  transform: rotate(-90deg);
}

.guide-toc ol {
  margin: 0;
  padding-left: 1.4em;
  list-style: decimal;
}

.guide-toc li {
  margin-bottom: var(--space-2);
  max-width: none;
}

.guide-toc li:last-child {
  margin-bottom: 0;
}

.guide-toc a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
}

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

/* Guide content body */
.guide-content {
  max-width: 700px;
}

.guide-content p {
  line-height: 1.75;
  color: var(--text-2);
  margin-bottom: 1.25em;
  max-width: none;
}

.guide-content h2 {
  color: var(--accent);
  font-size: 1.25rem;
  margin-top: 2em;
  margin-bottom: 0.75em;
}

.guide-content h3 {
  color: var(--text-1);
  font-size: 1.05rem;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

.guide-content ul,
.guide-content ol {
  color: var(--text-2);
  line-height: 1.75;
  margin-bottom: 1.25em;
  padding-left: 1.5em;
}

.guide-content li {
  margin-bottom: 0.4em;
  max-width: none;
}

.guide-content a {
  color: var(--accent);
}

.guide-content strong {
  color: var(--text-1);
}

/* Tables in guide content */
.guide-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.9rem;
}

.guide-content th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  background: var(--bg-surface);
  color: var(--text-1);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--border-subtle);
}

.guide-content td {
  padding: 0.6rem 0.75rem;
  color: var(--text-2);
  border-bottom: 1px solid var(--border-subtle);
  line-height: 1.5;
}

.guide-content tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.015);
}

/* Responsive table wrapper */
.guide-content .table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5em 0;
}

.guide-content .table-wrap table {
  margin: 0;
  min-width: 500px;
}

/* Callout / highlight box */
.guide-content .callout {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin: 1.5em 0;
}

.guide-content .callout p {
  margin-bottom: 0;
  color: var(--text-1);
}

/* Also support .highlight-box class like blog posts */
.guide-content .highlight-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin: 1.5em 0;
}

.guide-content .highlight-box p {
  margin-bottom: 0;
  color: var(--text-1);
}

/* Code / formula blocks */
.guide-content code {
  background: var(--bg-surface);
  padding: 0.15em 0.5em;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace;
  color: var(--accent);
}

.guide-content pre {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 1.5em 0;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.6;
}

.guide-content pre code {
  background: transparent;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
  color: var(--text-2);
}

/* Formula display */
.guide-content .formula {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.75rem 1.25rem;
  margin: 1.5em 0;
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace;
  font-size: 0.95rem;
  color: var(--text-1);
  text-align: center;
}

/* Blockquote */
.guide-content blockquote {
  background: var(--bg-surface);
  border-left: 3px solid var(--accent);
  margin: 1.5em 0;
  padding: 0.75rem 1.25rem;
  border-radius: 0 6px 6px 0;
}

.guide-content blockquote p {
  color: var(--text-2);
  margin-bottom: 0;
  font-style: italic;
}

/* ═══════════════════════════════════
   C. GUIDE PAGE SIDEBAR SECTIONS
   ═══════════════════════════════════ */

/* Related tools CTA */
.guide-tools {
  margin-top: var(--space-7);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border-subtle);
}

.guide-tools h2 {
  font-size: 1rem;
  margin-bottom: var(--space-3);
  color: var(--text-1);
}

.guide-tools-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.guide-tool-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  flex: 1 1 220px;
  min-width: 0;
  padding: var(--space-3);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  text-decoration: none;
  transition: border-color 0.15s;
}

.guide-tool-card:hover {
  border-color: var(--accent);
}

.guide-tool-card__name {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent);
  margin-bottom: 2px;
}

.guide-tool-card__desc {
  display: block;
  font-size: 0.8rem;
  color: var(--text-3);
  line-height: 1.4;
}

/* Related guides */
.guide-related {
  margin-top: var(--space-6);
}

.guide-related h2 {
  font-size: 1rem;
  margin-bottom: var(--space-3);
  color: var(--text-1);
}

.guide-related-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.guide-related-card {
  flex: 1 1 220px;
  min-width: 0;
  padding: var(--space-3);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  transition: border-color 0.15s;
}

.guide-related-card:hover {
  border-color: var(--accent);
}

.guide-related-card a {
  text-decoration: none;
  color: inherit;
}

.guide-related-card__title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--text-1);
}

.guide-related-card:hover .guide-related-card__title {
  color: var(--accent);
}

.guide-related-card__summary {
  font-size: 0.8rem;
  color: var(--text-3);
  line-height: 1.4;
  margin: 0;
}

/* Related posts */
.guide-posts {
  margin-top: var(--space-6);
}

.guide-posts h2 {
  font-size: 1rem;
  margin-bottom: var(--space-3);
  color: var(--text-1);
}

.guide-posts-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.guide-post-card {
  flex: 1 1 200px;
  min-width: 0;
  padding: var(--space-3);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  transition: border-color 0.15s;
}

.guide-post-card:hover {
  border-color: var(--accent);
}

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

.guide-post-card__title {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-1);
}

.guide-post-card:hover .guide-post-card__title {
  color: var(--accent);
}

/* Bottom CTA banner */
.guide-bottom-cta {
  margin-top: var(--space-6);
  padding: var(--space-5);
  background: var(--bg-section);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  text-align: center;
}

.guide-bottom-cta p {
  margin: 0 0 var(--space-4);
  font-size: 1rem;
  color: var(--text-1);
}

.guide-bottom-cta .btn {
  margin: 0 4px;
}

/* Guide navigation (previous / all / next) */
.guide-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
}

.guide-nav a {
  font-size: 0.9rem;
  color: var(--accent);
  text-decoration: none;
}

.guide-nav a:hover {
  text-decoration: underline;
}

.guide-nav__center {
  color: var(--text-3);
  font-size: 0.9rem;
}

.guide-nav__center a {
  color: var(--accent);
}


/* ═══════════════════════════════════
   D. GUIDES LANDING — SECTION LAYOUT
   ═══════════════════════════════════ */

.guides-section {
  margin-bottom: 60px;
}

.guides-section-header {
  max-width: 960px;
  margin: 0 auto var(--space-5);
  text-align: left;
}

.guides-section-header h2 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-1);
  margin: 0 0 var(--space-2);
}

.guides-section-header p {
  color: var(--text-2);
  margin: 0 0 var(--space-2);
  font-size: 0.9rem;
  line-height: 1.5;
}

.guides-section-header .guides-section-note {
  color: var(--text-3);
  font-size: 0.85rem;
  font-style: italic;
}


/* ═══════════════════════════════════
   E. COURSE-STYLE TUTORIAL LIST
   ═══════════════════════════════════ */

/* Vertical course list */
.course-list {
  max-width: 700px;
  margin: 0 auto;
  position: relative;
  padding-left: 56px;
}

/* Vertical timeline connector */
.course-list::before {
  content: '';
  position: absolute;
  top: 20px;
  bottom: 20px;
  left: 23px;
  width: 2px;
  background: var(--border-subtle);
}

/* Single course item */
.course-item {
  position: relative;
  padding-bottom: var(--space-5);
}

.course-item:last-child {
  padding-bottom: 0;
}

/* Step number circle on the timeline */
.course-item__number {
  position: absolute;
  left: -56px;
  top: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 2px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-3);
  z-index: 1;
  transition: border-color 0.15s, color 0.15s;
}

.course-item:hover .course-item__number {
  border-color: var(--accent);
  color: var(--accent);
}

/* Card body */
.course-item__body {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.15s;
}

.course-item:hover .course-item__body {
  border-color: var(--accent);
}

/* Thumbnail / video preview */
.course-item__thumb {
  position: relative;
  padding-bottom: 50%;
  background: var(--bg-section);
  overflow: hidden;
}

.course-item__thumb img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.course-item__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--accent);
  opacity: 0.35;
  z-index: 1;
  transition: opacity 0.15s;
}

.course-item:hover .course-item__play {
  opacity: 0.6;
}

/* Text content below thumbnail */
.course-item__text {
  padding: var(--space-4);
}

.course-item__title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-1);
  margin: 0 0 6px;
  line-height: 1.3;
}

.course-item__summary {
  font-size: 0.9rem;
  color: var(--text-2);
  line-height: 1.55;
  margin: 0 0 10px;
}

.course-item__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--text-3);
}

.course-item__duration {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.course-item__meta svg {
  width: 14px;
  height: 14px;
  color: var(--accent);
  flex-shrink: 0;
}

.course-item__badge {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--text-3);
  background: var(--bg-page);
  border: 1px solid var(--border-subtle);
}

/* Coming-soon items muted */
.course-item--coming-soon .course-item__body {
  opacity: 0.85;
}


/* ═══════════════════════════════════
   F. RESPONSIVE
   ═══════════════════════════════════ */

@media (max-width: 768px) {
  .guides-list {
    grid-template-columns: 1fr;
  }

  .course-list {
    padding-left: 44px;
  }

  .course-list::before {
    left: 17px;
  }

  .course-item__number {
    width: 36px;
    height: 36px;
    font-size: 0.8rem;
    left: -44px;
  }
}

@media (max-width: 600px) {
  .guide-card {
    padding: var(--space-4);
  }

  .guide-header h1 {
    font-size: 1.5rem;
  }

  .guide-content {
    max-width: 100%;
  }

  .guide-content h2 {
    font-size: 1.15rem;
  }

  .guide-tools-grid {
    flex-direction: column;
  }

  .guide-related-grid {
    flex-direction: column;
  }

  .guide-posts-grid {
    flex-direction: column;
  }

  /* TOC: start collapsed on mobile via JS */
  .guide-toc ol {
    padding-left: 1.2em;
  }
}

/* Cross-page CTA */
.guides-cta {
  padding: var(--space-4);
  background: var(--bg-section);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  text-align: center;
}

.guides-cta p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-2);
}

.guides-cta a {
  color: var(--accent);
  text-decoration: none;
}

.guides-cta a:hover {
  text-decoration: underline;
  color: var(--accent-hover);
}
