/* How-to Guide individual page styles */

/* ── Two-column layout ── */
.htg-layout {
  display: flex;
  gap: 56px;
  align-items: flex-start;
}

.htg-main {
  flex: 1;
  min-width: 0;
}

.htg-aside {
  display: none;
}

@media (min-width: 1024px) {
  .htg-aside {
    display: block;
    width: 220px;
    flex-shrink: 0;
  }

  .htg-aside-inner {
    position: sticky;
    top: 32px;
  }
}

/* ── Back arrow (rotated) ── */
.htg-back-arrow {
  display: inline-block;
  transform: rotate(180deg);
}

/* ── Page title ── */
.htg-page-title {
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: #111827;
}

.dark .htg-page-title {
  color: #f9fafb;
}

/* ── Step count strip ── */
.htg-step-strip {
  display: flex;
  align-items: center;
  gap: 12px;
}

.htg-step-dots {
  display: flex;
  gap: 4px;
}

.htg-step-dot {
  width: 8px;
  height: 2px;
  background: #e5e7eb;
  border-radius: 1px;
}

.dark .htg-step-dot {
  background: #374151;
}

/* ── Newspaper-style body text ── */
.htg-newsprint {
  font-size: 0.825rem;
  line-height: 1.55;
  color: #4b5563;
  letter-spacing: 0.005em;
}

.dark .htg-newsprint {
  color: #9ca3af;
}

.htg-newsprint p { margin-bottom: 0.6rem; }
.htg-newsprint p:last-child { margin-bottom: 0; }

.htg-newsprint ul,
.htg-newsprint ol {
  margin-left: 1.1rem;
  margin-bottom: 0.6rem;
}

.htg-newsprint li { margin-bottom: 0.2rem; }

.htg-newsprint strong {
  color: #111827;
  font-weight: 600;
}

.dark .htg-newsprint strong {
  color: #f9fafb;
}

.htg-newsprint a {
  color: #15803d;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.dark .htg-newsprint a {
  color: #4ade80;
}

/* ── Generic collapsible (intro, outro) ── */
.htg-collapse {
  border-top: 1px solid #e5e7eb;
}

.dark .htg-collapse {
  border-top-color: #374151;
}

.htg-collapse-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  cursor: pointer;
  list-style: none;
  user-select: none;
  font-size: 0.72rem;
  font-family: ui-monospace, 'JetBrains Mono', monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7280;
}

.dark .htg-collapse-summary {
  color: #9ca3af;
}

.htg-collapse-summary::-webkit-details-marker { display: none; }

.htg-collapse-icon {
  font-family: ui-monospace, monospace;
  font-size: 1rem;
  color: #16a34a;
  transition: transform 0.25s ease;
  line-height: 1;
}

.htg-collapse[open] > .htg-collapse-summary .htg-collapse-icon {
  transform: rotate(45deg);
}

.htg-collapse-body {
  padding-bottom: 16px;
}

/* ── Steps list ── */
.htg-steps-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* ── Individual step ── */
.htg-step {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 0 16px;
  border-top: 1px solid #e5e7eb;
}

.dark .htg-step {
  border-top-color: #374151;
}

.htg-step:last-child {
  border-bottom: 1px solid #e5e7eb;
}

.dark .htg-step:last-child {
  border-bottom-color: #374151;
}

.htg-step-number {
  padding-top: 14px;
}

/* ── Collapsible step details ── */
.htg-step-details {
  min-width: 0;
}

.htg-step-summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 12px 0;
  cursor: pointer;
  list-style: none;
  user-select: none;
  font-size: 1.05rem;
  font-weight: 600;
  color: #111827;
  line-height: 1.3;
}

.dark .htg-step-summary {
  color: #f9fafb;
}

.htg-step-summary::-webkit-details-marker { display: none; }

.htg-step-details[open] > .htg-step-summary .htg-collapse-icon {
  transform: rotate(45deg);
}

/* step content sits below the summary */
.htg-step-content {
  padding-bottom: 16px;
}

/* ── Tip callout ── */
.htg-tip {
  margin-top: 10px;
  margin-bottom: 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  background: #f0fdf4;
  border-left: 2px solid #16a34a;
  border-radius: 0 3px 3px 0;
}

.dark .htg-tip {
  background: rgba(22, 163, 74, 0.08);
  border-left-color: #4ade80;
}

.htg-tip-icon {
  font-family: ui-monospace, monospace;
  font-size: 0.7rem;
  color: #16a34a;
  padding-top: 1px;
  flex-shrink: 0;
  user-select: none;
}

.dark .htg-tip-icon { color: #4ade80; }

.htg-tip-text {
  font-size: 0.8rem;
  color: #15803d;
  line-height: 1.5;
  margin: 0;
}

.dark .htg-tip-text { color: #86efac; }

/* ── Outro / Key takeaways ── */
.htg-outro-inner {
  background: #111827;
  border-radius: 4px;
  padding: 0 28px 4px;
}

@media (min-width: 768px) {
  .htg-outro-inner {
    padding: 0 36px 4px;
  }
}

.htg-outro-collapse {
  border-top: none;
}

.htg-outro-summary {
  color: #6b7280;
  padding: 18px 0 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.htg-outro-icon {
  color: #4ade80;
}

.htg-outro-collapse[open] > .htg-outro-summary .htg-outro-icon {
  transform: rotate(45deg);
}

.htg-outro-body {
  color: #d1d5db;
  padding-bottom: 20px;
}

.dark .htg-outro-body {
  color: #d1d5db;
}

.htg-outro-body li::marker { color: #4ade80; }
.htg-outro-body strong { color: #f9fafb; font-weight: 600; }
.htg-outro-body a { color: #4ade80; }

/* ── Sticky aside — step navigation ── */
.htg-aside-collapse {
  border-top: 1px solid #e5e7eb;
}

.dark .htg-aside-collapse {
  border-top-color: #374151;
}

.htg-aside-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0 10px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.htg-aside-summary::-webkit-details-marker { display: none; }

.htg-aside-icon {
  color: #16a34a;
  font-size: 0.9rem;
  transition: transform 0.25s ease;
}

.htg-aside-collapse[open] > .htg-aside-summary .htg-aside-icon {
  transform: rotate(45deg);
}

.htg-aside-nav {
  padding-bottom: 12px;
}

.htg-aside-nav ol {
  list-style: none;
  padding: 0;
  margin: 0;
}

.htg-aside-link {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 6px 0;
  text-decoration: none;
  border-bottom: 1px solid #f3f4f6;
  transition: color 0.2s ease;
}

.dark .htg-aside-link {
  border-bottom-color: #1f2937;
}

.htg-aside-link:hover .htg-aside-title {
  color: #16a34a;
}

.dark .htg-aside-link:hover .htg-aside-title {
  color: #4ade80;
}

.htg-aside-num {
  font-family: ui-monospace, 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  color: #16a34a;
  flex-shrink: 0;
  padding-top: 1px;
}

.htg-aside-title {
  font-size: 0.75rem;
  line-height: 1.4;
  color: #6b7280;
  transition: color 0.2s ease;
}

.dark .htg-aside-title {
  color: #9ca3af;
}

/* ── PDF download button ── */
.htg-pdf-btn {
  font-family: ui-monospace, 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 7px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 3px;
  color: #6b7280;
  background: transparent;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.htg-pdf-btn:hover {
  background: #111827;
  color: #f9fafb;
  border-color: #111827;
}

.dark .htg-pdf-btn {
  border-color: #374151;
  color: #9ca3af;
}

.dark .htg-pdf-btn:hover {
  background: #f9fafb;
  color: #111827;
  border-color: #f9fafb;
}

/* ── Category pills ── */
.htg-cat-pill {
  font-family: ui-monospace, 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 3px;
  display: inline-block;
}

.htg-cat-pill[data-cat="Tax & HMRC"]  { background: rgba(22,163,74,0.1); color: #15803d; }
.htg-cat-pill[data-cat="Bookkeeping"] { background: rgba(37,99,235,0.1); color: #1d4ed8; }
.htg-cat-pill[data-cat="Software"]    { background: rgba(124,58,237,0.1); color: #6d28d9; }
.htg-cat-pill[data-cat="Year End"]    { background: rgba(217,119,6,0.1); color: #b45309; }
.htg-cat-pill[data-cat="Payroll"]     { background: rgba(6,182,212,0.1); color: #0e7490; }

.dark .htg-cat-pill[data-cat="Tax & HMRC"]  { background: rgba(22,163,74,0.15); color: #4ade80; }
.dark .htg-cat-pill[data-cat="Bookkeeping"] { background: rgba(37,99,235,0.15); color: #93c5fd; }
.dark .htg-cat-pill[data-cat="Software"]    { background: rgba(124,58,237,0.15); color: #c4b5fd; }
.dark .htg-cat-pill[data-cat="Year End"]    { background: rgba(217,119,6,0.15); color: #fcd34d; }
.dark .htg-cat-pill[data-cat="Payroll"]     { background: rgba(6,182,212,0.15); color: #67e8f9; }

/* ── Difficulty badges ── */
.htg-diff {
  font-family: ui-monospace, 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 3px;
}

.htg-diff--beginner     { background: rgba(22,163,74,0.08); color: #16a34a; }
.htg-diff--intermediate { background: rgba(217,119,6,0.08); color: #d97706; }
.htg-diff--advanced     { background: rgba(220,38,38,0.08); color: #dc2626; }

.dark .htg-diff--beginner     { background: rgba(22,163,74,0.12); color: #4ade80; }
.dark .htg-diff--intermediate { background: rgba(217,119,6,0.12); color: #fbbf24; }
.dark .htg-diff--advanced     { background: rgba(220,38,38,0.12); color: #f87171; }
