/* Clean "Timeline/Syllabus" Design for Learning Paths */

/* Reset container styles */
.learning-grid .group-block {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  margin-top: 64px;
  position: relative;
}
.learning-grid .group-block:first-of-type {
  margin-top: 16px;
}
.learning-grid .group-block::before {
  display: none;
}

/* Section Headings (H2) */
.learning-grid .group-block > .group-header h2 {
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  color: var(--text);
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  border: 0; /* Remove underline */
  padding: 0;
}
.learning-grid .group-block > .group-header p.lead {
  margin-top: 0;
  margin-bottom: 32px;
  font-size: 1.1rem;
  max-width: 65ch;
  color: var(--text-dim);
}

/* Timeline "Rail" Container */
.learning-grid .group-block-section {
  padding-left: 16px; /* Outer gutter */
}

/* DETAILS / MODULE Styles */
.learning-grid details {
  margin-top: 32px;
  border: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  position: relative;
  padding-left: 36px; /* Space for rail + icon + gap */
}
/* The vertical timeline line */
.learning-grid details::before {
  content: '';
  position: absolute;
  left: 11px; /* Indented rail */
  top: 12px; /* Start slightly below the top to align with icon center */
  bottom: -32px; /* Connect to next item */
  width: 2px;
  background: var(--border);
}
.learning-grid details:last-child::before {
  bottom: 12px; /* Stop at the last icon center */
}
.learning-grid .group-block details:first-of-type {
  margin-top: 0;
}
.learning-grid .group-block details:first-of-type::before {
  top: 12px; /* Ensure it starts at the icon */
}

/* SUMMARY / HEADER Styles */
.learning-grid details summary {
  padding-left: 0; /* Reset inner padding, rely on details padding */
  font-weight: 700;
  font-size: 1.25rem; /* H3 size */
  color: var(--text);
  background: transparent;
  list-style: none;
  display: flex;
  align-items: flex-start; /* Align icon with first line of text */
  gap: 12px;
  cursor: pointer;
  transition: color 0.2s ease;
  position: relative;
  line-height: 1.5; /* Explicit line height for calculation */
}
.learning-grid details summary:hover {
  background: transparent;
  color: var(--accent-600);
}
/* Re-purposing ::before for timeline indicator (Circular Button Node) */
.learning-grid details summary::before {
  content: '▼';
  /* Flexbox for centering the icon inside the circle */
  display: flex;
  align-items: center;
  justify-content: center;
  
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border); /* Visible border to look like a node */
  background: var(--bg);
  
  font-size: 0.7em; /* Small, crisp icon */
  color: var(--text-dim);
  
  transition: all 0.2s ease;
  transform-origin: center;
  position: absolute;
  
  /* 
     Centering math:
     Rail center is at 12px (11px left + 1px half-width).
     Details padding-left is 36px.
     Icon center needs to be at 12px absolute (which is -24px relative to content start).
     Icon width is 24px (+4px border total? No, border-box usually). 
     Assuming standard sizing, Left edge = -24px (center) - 12px (half width) = -36px.
  */
  left: -37px; 
  top: 10px; /* Adjusted for better optical vertical centering with text */
  
  z-index: 2; /* Ensure above line */
  box-sizing: content-box;
  padding: 0; /* Reset padding */
  line-height: 1;
}

/* Open State */
.learning-grid details[open] summary::before {
  content: '▲';
  transform: rotate(0deg);
  border-color: var(--accent-600);
  background: var(--accent-600);
  color: #fff; /* White icon on accent bg */
  box-shadow: 0 0 0 4px var(--bg); /* Halo effect to separate from line */
}

/* Hover State (Summary) */
.learning-grid details summary:hover::before {
  border-color: var(--accent-600);
  color: var(--accent-600);
}
/* Hover State (when already open, keep it filled but maybe darken?) */
.learning-grid details[open] summary:hover::before {
  color: #fff;
  background: var(--accent-500);
  border-color: var(--accent-500);
}

/* Add a subtle hover indication to the text as well */
.learning-grid details summary:hover {
  color: var(--accent-600);
}
.learning-grid details summary {
  align-items: center; /* Ensure vertical centering of content */
}

/* Remove the separate custom "Bullet" (::after) */
.learning-grid details summary::after {
  display: none;
}

/* Adjust padding-left for details to position the entire summary block */
.learning-grid details {
  padding-left: 36px; /* Original indent for the timeline line */
}

/* Description inside details */
.learning-grid .details-desc {
  margin: 12px 0 24px;
  color: var(--text-dim);
  font-size: 1rem;
  line-height: 1.6;
  background: transparent;
  padding: 0;
  font-style: normal;
}

/* Resource List - Clean List Style */
.learning-grid .group-block details ul.resource-list,
.learning-grid .group-block section ul.resource-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0 32px;
  padding: 0;
}
.learning-grid .group-block details ul.resource-list li,
.learning-grid .group-block section ul.resource-list li {
  border: 0;
  border-radius: 6px;
  padding: 12px 16px;
  background: var(--bg-alt); /* Very subtle tint */
  box-shadow: none;
  display: flex;
  gap: 16px;
  align-items: center;
  transition: background 0.2s ease;
}
.learning-grid .group-block details ul.resource-list li:hover,
.learning-grid .group-block section ul.resource-list li:hover {
  background: var(--accent-soft);
  border-color: transparent;
  transform: none;
  box-shadow: none;
}
.learning-grid .group-block details ul.resource-list li:first-child,
.learning-grid .group-block section ul.resource-list li:first-child {
  border-top: 0;
}

/* Typography for List Items */
.learning-grid .group-block details ul.resource-list li .title,
.learning-grid .group-block section ul.resource-list li .title {
  margin: 0;
  font-weight: 600;
  font-size: 1rem;
}
.learning-grid .group-block details ul.resource-list li .title a,
.learning-grid .group-block section ul.resource-list li .title a {
  color: var(--text);
  text-decoration: none;
}
.learning-grid .group-block details ul.resource-list li:hover .title a {
  color: var(--accent-600);
}
.learning-grid .group-block details ul.resource-list li .meta,
.learning-grid .group-block section ul.resource-list li .meta {
  margin-top: 2px;
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* Type Pills (Optional: keep small or remove for pure minimalism) */
.learning-grid .kind {
  font-size: 0.75rem;
  padding: 2px 8px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
}

