/* Shared navigation switcher between the tutorial blog and Picked resources. */
body[data-static-mode="true"] #guest-actions,
body[data-static-mode="true"] #manage-trigger,
body[data-static-mode="true"] #account-trigger,
body[data-static-mode="true"] #add-resource,
body[data-static-mode="true"] #management-banner {
  display: none !important;
}

.site-switch {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-wrap: wrap;
}

.site-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-block-size: 2.25rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid #ffffffd9;
  border-radius: 0.65rem;
  background: linear-gradient(130deg, #ffffffa6, #ffffff57);
  box-shadow: inset 0 1px 0 #ffffffd9, 0 2px 7px #67779506;
  color: #526574;
  font-size: 0.78rem;
  line-height: 1.4;
  transition: background 0.16s, border-color 0.16s, color 0.16s;
}

.site-nav-link:hover {
  background: #ffffffd4;
  color: #304451;
}

.site-nav-link[aria-current="page"] {
  background: linear-gradient(135deg, #ffeeded9, #f6d8cba6);
  border-color: #e9b59c;
  color: #934a31;
  font-weight: 650;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.28em;
}

/* Blog index layout & tutorial cards */
.blog-hero h1 {
  font-size: clamp(1.75rem, 1.35rem + 1.8vw, 2.65rem);
  text-wrap: balance;
  white-space: normal;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.5rem 1.25rem;
  border: 1px solid var(--glass-edge);
  border-radius: 1.375rem;
  background: linear-gradient(135deg, #ffffffb0, #ffffff5c 52%, #ffffff8c);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  backdrop-filter: blur(18px) saturate(145%);
  box-shadow: var(--glass-shadow);
  min-width: 0;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

@media (hover: hover) and (pointer: fine) {
  .post-card:hover {
    transform: translateY(-4px);
    border-color: #fff;
    box-shadow: inset 0 1px 0 #fff, inset 0 -1px 0 #ffffffb3, 0 15px 35px #5267821a, 0 4px 10px #7186a30a;
  }
}

.post-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
  font-size: 0.78rem;
  color: #5f707f;
}

.post-category-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 0.5rem;
  border: 1px solid #ffffffcf;
  background: #f5fbf7ab;
  color: #426658;
  font-weight: 600;
}

.post-card-title {
  margin: 0 0 0.65rem;
  font-size: clamp(1.125rem, 1.02rem + 0.45vw, 1.35rem);
  line-height: 1.45;
  color: #2c3e4b;
  text-wrap: balance;
}

.post-card-title a {
  text-decoration: none;
}

.post-card-title a:hover {
  color: #b65337;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.post-card-summary {
  margin: 0 0 1.1rem;
  font-size: 0.9rem;
  line-height: 1.7;
  color: #506370;
  overflow-wrap: break-word;
  text-wrap: pretty;
}

.post-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: auto;
  margin-bottom: 1rem;
}

.post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.9rem;
  border-top: 1px solid #ffffffa6;
  font-size: 0.82rem;
}

.post-read-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-block-size: 2rem;
  padding: 0.25rem 0.5rem;
  margin-inline-start: auto;
  color: #9e4a30;
  font-weight: 600;
  border-radius: 0.45rem;
}

.post-read-link:hover {
  background: #ffffff96;
}

.post-resource-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-block-size: 2rem;
  padding: 0.25rem 0.65rem;
  border-radius: 0.5rem;
  background: #ffffff80;
  border: 1px solid #ffffffc9;
  color: #46695e;
  font-size: 0.78rem;
}

.post-resource-pill:hover {
  background: #ffffffd6;
}

/* Breadcrumbs (WCAG + CSS generated decorative separator) */
.post-breadcrumb {
  margin: 1.75rem 0 1.25rem;
}

.post-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.85rem;
  color: #5d6e7b;
}

.post-breadcrumb > ol > li + li::before {
  content: "/" / "";
  margin-inline-end: 0.45rem;
  color: #8b99a5;
}

.post-breadcrumb a {
  display: inline-block;
  padding: 0.2rem 0.35rem;
  border-radius: 0.4rem;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 0.22em;
}

.post-breadcrumb a:hover,
.post-breadcrumb a:focus-visible {
  text-decoration-color: currentColor;
  background: #ffffff80;
}

.post-breadcrumb a[aria-current="page"] {
  color: #2f414e;
  font-weight: 650;
  text-decoration: underline;
  text-decoration-color: #d8634385;
}

/* Article reading layout */
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16rem;
  gap: 2rem;
  align-items: start;
  padding-bottom: 2.5rem;
}

.article-panel {
  min-width: 0;
  padding: clamp(1.4rem, 1rem + 1.8vw, 2.6rem);
  border: 1px solid var(--glass-edge);
  border-radius: 1.5rem;
  background: linear-gradient(135deg, #ffffffc4, #ffffff87 55%, #ffffffad);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  box-shadow: var(--glass-shadow);
}

.post-header {
  padding-bottom: 1.5rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid #ffffffc4;
}

.post-header h1 {
  margin: 0.65rem 0 0.9rem;
  font-size: clamp(1.65rem, 1.25rem + 1.6vw, 2.35rem);
  line-height: 1.35;
  color: #243542;
  white-space: normal;
  text-wrap: balance;
}

.post-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.1rem;
  font-size: 0.85rem;
  color: #5b6d7c;
}

.post-header-summary {
  margin: 1rem 0 0;
  font-size: 1rem;
  line-height: 1.7;
  color: #495d6c;
  max-width: 65ch;
  text-wrap: pretty;
}

.post-header-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.1rem;
}

.post-tag-link {
  display: inline-flex;
  align-items: center;
  min-block-size: 2rem;
  padding: 0.25rem 0.7rem;
  border: 1px solid #ffffffc9;
  border-radius: 0.55rem;
  background: #ffffff8a;
  color: #4b6863;
  font-size: 0.82rem;
}

.post-tag-link:hover {
  background: #fff;
  color: #2f5449;
}

/* Mobile collapsible TOC */
.mobile-toc {
  display: none;
  margin-bottom: 1.5rem;
  border: 1px solid #ffffffcf;
  border-radius: 0.95rem;
  background: #ffffff75;
  padding: 0.75rem 1rem;
}

.mobile-toc summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.92rem;
  color: #364b58;
}

.toc-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.toc-list a {
  display: block;
  padding: 0.3rem 0.55rem;
  border-radius: 0.45rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #536775;
  border-inline-start: 2px solid transparent;
}

.toc-list a:hover {
  background: #ffffff96;
  color: #2a3e4b;
}

.toc-list a[aria-current="location"] {
  background: #ffffffb8;
  border-inline-start-color: var(--accent);
  color: #9e4a30;
  font-weight: 600;
}

.toc-item-level-3 a {
  padding-inline-start: 1.15rem;
  font-size: 0.81rem;
}

.toc-item-level-4 a,
.toc-item-level-5 a,
.toc-item-level-6 a {
  padding-inline-start: 1.75rem;
  font-size: 0.79rem;
}

.toc-sidebar {
  position: sticky;
  top: 1.5rem;
  max-block-size: calc(100dvh - 3rem);
  overflow-y: auto;
  padding: 1.2rem 1.1rem;
  border: 1px solid var(--glass-edge);
  border-radius: 1.15rem;
  background: linear-gradient(145deg, #ffffffa6, #ffffff61);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  box-shadow: var(--glass-shadow);
}

.toc-title {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #425664;
}

/* Long-form prose typography */
.post-prose {
  max-width: 65ch;
  font-size: 1rem;
  line-height: 1.75;
  color: #2d3b45;
  overflow-wrap: break-word;
}

.post-prose > :first-child {
  margin-top: 0;
}

.post-prose h2,
.post-prose h3,
.post-prose h4 {
  position: relative;
  margin: 2rem 0 0.85rem;
  line-height: 1.38;
  color: #23333f;
  scroll-margin-top: 1.5rem;
  text-wrap: balance;
}

.post-prose h2 {
  font-size: clamp(1.3rem, 1.15rem + 0.65vw, 1.6rem);
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #d7e0e5;
}

.post-prose h3 {
  font-size: clamp(1.1rem, 1.02rem + 0.35vw, 1.28rem);
}

.heading-anchor {
  margin-inline-end: 0.45rem;
  color: #9baab5;
  font-weight: 500;
  text-decoration: none;
}

.heading-anchor:hover {
  color: var(--accent);
}

.post-prose p,
.post-prose blockquote,
.post-prose li {
  text-wrap: pretty;
}

.post-prose p {
  margin: 0 0 1.1rem;
}

.post-prose ul,
.post-prose ol {
  margin: 0 0 1.2rem;
  padding-inline-start: 1.45rem;
}

.post-prose li + li {
  margin-top: 0.45rem;
}

.post-prose a:not(.heading-anchor) {
  color: #9d482d;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1.5px;
}

.post-prose a:not(.heading-anchor):hover {
  color: #77321c;
}

.post-prose code {
  font-family: ui-monospace, "Cascadia Code", "Fira Code", Consolas, monospace;
  font-size: 0.88em;
  padding: 0.12em 0.38em;
  border-radius: 0.35rem;
  background: #e9eff3;
  color: #304554;
}

.code-block {
  margin: 1.25rem 0 1.5rem;
  border: 1px solid #d7e2e8;
  border-radius: 0.95rem;
  background: #f5f9fc;
  overflow: hidden;
}

.code-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.9rem;
  border-bottom: 1px solid #e1e9ee;
  background: #ebf2f6;
  font-size: 0.78rem;
  color: #556a78;
}

.copy-code {
  min-block-size: 1.85rem;
  padding: 0.2rem 0.65rem;
  border: 1px solid #cddae2;
  border-radius: 0.45rem;
  background: #fff;
  color: #3e5564;
  font-size: 0.75rem;
}

.copy-code:hover {
  background: #f0f5f8;
}

.code-block pre {
  margin: 0;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  line-height: 1.6;
  font-size: 0.88rem;
}

.code-block pre code {
  padding: 0;
  background: transparent;
  font-size: inherit;
}

.post-prose blockquote {
  margin: 1.2rem 0;
  padding: 0.75rem 1rem;
  border-inline-start: 3px solid #d88f72;
  border-radius: 0 0.75rem 0.75rem 0;
  background: #ffffff80;
  color: #465966;
}

.post-prose blockquote > :last-child {
  margin-bottom: 0;
}

.callout {
  margin: 1.25rem 0;
  padding: 0.95rem 1.1rem;
  border-radius: 0.85rem;
  border: 1px solid #d5e2e8;
  border-inline-start-width: 4px;
  background: #f4f9fc;
}

.callout-title {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.callout > :last-child {
  margin-bottom: 0;
}

.callout-note { border-inline-start-color: #5b82ad; background: #eff5fb; }
.callout-note .callout-title { color: #365c85; }
.callout-tip { border-inline-start-color: #5f8c6c; background: #eef7f0; }
.callout-tip .callout-title { color: #386346; }
.callout-important { border-inline-start-color: #826ab0; background: #f4f0fa; }
.callout-important .callout-title { color: #564085; }
.callout-warning { border-inline-start-color: #c27b3c; background: #fdf5eb; }
.callout-warning .callout-title { color: #8c511d; }
.callout-caution { border-inline-start-color: #c25546; background: #fdf0ee; }
.callout-caution .callout-title { color: #8c3226; }

.table-wrap {
  margin: 1.25rem 0;
  overflow-x: auto;
  border: 1px solid #d9e3e8;
  border-radius: 0.85rem;
  background: #ffffffb3;
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table-wrap th,
.table-wrap td {
  padding: 0.65rem 0.9rem;
  text-align: start;
  border-bottom: 1px solid #e5edf1;
}

.table-wrap th {
  background: #edf3f7;
  font-weight: 650;
  color: #324654;
}

.table-wrap tbody tr:last-child td {
  border-bottom: 0;
}

.post-prose img {
  max-width: 100%;
  height: auto;
  border-radius: 0.85rem;
}

.post-prose hr {
  border: 0;
  border-top: 1px solid #d5e0e6;
  margin: 2rem 0;
}

/* Linked Picked resources section inside tutorial */
.linked-resources {
  margin-top: 2.25rem;
  padding-top: 1.75rem;
  border-top: 1px solid #d7e1e7;
}

.linked-resources-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.linked-resources-head h2 {
  margin: 0;
  font-size: 1.15rem;
  color: #293c49;
}

.linked-resources-all {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-block-size: 2.25rem;
  padding: 0.4rem 0.85rem;
  border-radius: 0.65rem;
  border: 1px solid #e4baa7;
  background: #fff3ec;
  color: #93492f;
  font-size: 0.85rem;
  font-weight: 600;
}

.linked-resources-all:hover {
  background: #ffe6d8;
}

.linked-resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.9rem;
}

.linked-resource-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 1rem 1.05rem;
  border: 1px solid #ffffffde;
  border-radius: 1rem;
  background: #ffffff96;
  box-shadow: 0 4px 14px #5b6d820c;
}

.linked-resource-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.76rem;
  color: #5c6f7e;
}

.linked-resource-card h3 {
  margin: 0;
  font-size: 1rem;
  color: #2b3d49;
}

.linked-resource-card p {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.6;
  color: #526674;
}

.linked-resource-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.55rem;
  font-size: 0.8rem;
}

.linked-resource-links a {
  color: #3f6d63;
  font-weight: 600;
}

.linked-resource-links a:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* Previous / Next post navigation */
.post-pagination {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #d7e1e7;
}

.post-page-link {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.9rem 1rem;
  border: 1px solid #ffffffd9;
  border-radius: 0.95rem;
  background: #ffffff80;
}

.post-page-link:hover {
  background: #ffffffcf;
}

.post-page-link span {
  font-size: 0.76rem;
  color: #637483;
}

.post-page-link strong {
  font-size: 0.92rem;
  color: #2b3e4c;
  text-wrap: balance;
}

.post-page-link.next {
  text-align: end;
  grid-column: 2;
}

.not-found-panel {
  max-width: 38rem;
  margin: 3rem auto;
  padding: 2.25rem;
  text-align: center;
  border: 1px solid var(--glass-edge);
  border-radius: 1.5rem;
  background: var(--glass-surface);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  backdrop-filter: blur(18px) saturate(145%);
  box-shadow: var(--glass-shadow);
}

.not-found-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

@media (max-width: 1120px) {
  .article-layout {
    grid-template-columns: 1fr;
  }
  .toc-sidebar {
    display: none;
  }
  .mobile-toc {
    display: block;
  }
}

@media (max-width: 820px) {
  .post-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 650px) {
  .post-pagination {
    grid-template-columns: 1fr;
  }
  .post-page-link.next {
    grid-column: auto;
    text-align: start;
  }
  .article-panel {
    border-radius: 1.15rem;
    padding: 1.25rem;
  }
  .site-nav-link {
    font-size: 0.75rem;
    padding: 0.38rem 0.72rem;
  }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .post-card,
  .article-panel,
  .toc-sidebar,
  .not-found-panel {
    background: #f7f9fc;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .post-card,
  .article-panel,
  .toc-sidebar,
  .not-found-panel {
    background: #f7f9fc;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (forced-colors: active) {
  .site-nav-link[aria-current="page"],
  .post-breadcrumb a[aria-current="page"],
  .toc-list a[aria-current="location"] {
    border: 2px solid Highlight;
    text-decoration: underline;
  }
  .post-card,
  .article-panel,
  .toc-sidebar,
  .not-found-panel {
    background: Canvas;
    border-color: CanvasText;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
