/* ==========================================================================
   IT Pro Theme - GitHub-Clone Profile Layout
   ========================================================================== */

/* ---------- Reset & Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-fg-default);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-accent-fg);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* ---------- Layout ---------- */

.container {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: 2rem;
}

@media (max-width: 768px) {
  .container {
    padding-inline: 1.25rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding-inline: 1rem;
  }
}

.site-main {
  min-height: calc(100vh - 64px - 60px);
  padding-block: 2rem;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-canvas-overlay);
  border-bottom: 1px solid var(--color-border-default);
  padding-block: 0.75rem;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 40px;
}

.header-brand {
  flex-shrink: 0;
}

.header-brand .site-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-fg-default);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-brand .site-title:hover {
  color: var(--color-fg-muted);
  text-decoration: none;
}

.header-brand .custom-logo-link img {
  height: 32px;
  width: auto;
}

.header-search {
  flex: 1;
  max-width: 560px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  background: var(--color-canvas-default);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius);
  transition: border-color var(--transition-medium), box-shadow var(--transition-medium);
}

.header-search:focus-within {
  border-color: var(--color-accent-fg);
  box-shadow: 0 0 0 3px var(--color-accent-muted);
}

.header-search .material-symbols-rounded {
  font-size: 18px;
  color: var(--color-fg-muted);
}

.header-search form {
  flex: 1;
  display: flex;
}

.header-search input {
  flex: 1;
  background: none;
  border: none;
  color: var(--color-fg-default);
  font-size: var(--label-1);
  font-family: var(--font-body);
  outline: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.profile-sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-8);
  color: var(--color-fg-muted);
}

.profile-sidebar-toggle:hover {
  color: var(--color-fg-default);
  background: var(--color-canvas-subtle);
}

/* ---------- Profile Layout (Two-Column) ---------- */

.profile-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2rem;
  align-items: start;
}

/* ---------- Profile Sidebar ---------- */

.profile-sidebar {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.profile-name {
  font-size: var(--title-2);
  font-weight: var(--weight-semiBold);
  color: var(--on-background);
  line-height: 1.2;
}

.profile-username {
  font-size: var(--title-3);
  font-weight: var(--weight-regular);
  color: var(--on-surface);
  line-height: 1.3;
}

.profile-bio {
  font-size: var(--body);
  color: var(--on-surface-2);
  line-height: 1.5;
}

/* CTA Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: var(--label-1);
  font-weight: var(--weight-semiBold);
  font-family: var(--font-body);
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--transition-short), transform var(--transition-short);
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
  width: 100%;
}

.btn-primary:hover {
  background: var(--primary-hover);
  color: var(--white);
}

.btn-primary .material-symbols-rounded {
  font-size: 18px;
}

/* Profile Contact */
.profile-contact {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.profile-contact-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--label-1);
  color: var(--on-surface);
}

.profile-contact-item .material-symbols-rounded {
  font-size: 18px;
  color: var(--on-surface-variant);
  flex-shrink: 0;
}

.profile-contact-item a {
  color: var(--on-surface);
}

.profile-contact-item a:hover {
  color: var(--primary);
}

/* Sidebar About Link */
.sidebar-about {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.75rem;
  border: 1px solid var(--surface-variant-outline);
  border-radius: var(--radius-8);
  background: var(--surface);
  text-decoration: none;
  transition: border-color var(--transition-short);
}

.sidebar-about:hover {
  border-color: var(--surface-variant-outline-hover);
  text-decoration: none;
}

.sidebar-about__icon {
  font-size: 18px;
  color: var(--on-surface-variant);
  flex-shrink: 0;
  margin-top: 1px;
}

.sidebar-about__text {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}

.sidebar-about__label {
  font-size: var(--label-1);
  font-weight: var(--weight-semiBold);
  color: var(--primary);
}

.sidebar-about:hover .sidebar-about__label {
  text-decoration: underline;
}

.sidebar-about__desc {
  font-size: 11px;
  color: var(--on-surface-variant);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Sidebar Pinned Articles */
.sidebar-pinned {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-pinned__heading {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: var(--label-2);
  font-weight: var(--weight-semiBold);
  color: var(--on-surface-variant);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.sidebar-pinned__heading .material-symbols-rounded {
  font-size: 14px;
}

.sidebar-pinned__card {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--surface-variant-outline);
  border-radius: var(--radius-8);
  background: var(--surface);
  transition: border-color var(--transition-short);
  text-decoration: none;
}

.sidebar-pinned__card:hover {
  border-color: var(--surface-variant-outline-hover);
  text-decoration: none;
}

.sidebar-pinned__title {
  font-size: var(--label-2);
  font-weight: var(--weight-semiBold);
  color: var(--primary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sidebar-pinned__card:hover .sidebar-pinned__title {
  text-decoration: underline;
}

.sidebar-pinned__meta {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 11px;
  color: var(--on-surface-variant);
}

.sidebar-pinned__lang {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.sidebar-pinned__lang .lang-dot {
  width: 8px;
  height: 8px;
}

.sidebar-pinned__date::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--on-surface-variant);
  vertical-align: middle;
  margin-right: 0.375rem;
}

.profile-copyright {
  font-size: var(--label-2);
  color: var(--on-surface-variant);
  margin-top: 0.5rem;
}

/* ---------- Tab Navigation ---------- */

.tab-nav {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--color-border-default);
  margin-bottom: 1.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.tab-nav::-webkit-scrollbar {
  display: none;
}

.tab-nav-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.75rem 1rem;
  color: var(--color-fg-muted);
  font-size: var(--label-1);
  font-weight: var(--weight-medium);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: border-color var(--transition-medium), color var(--transition-short);
}

.tab-nav-item:hover {
  color: var(--color-fg-default);
  border-bottom-color: var(--color-border-default);
  text-decoration: none;
}

.tab-nav-item--active {
  color: var(--color-fg-default);
  font-weight: var(--weight-semiBold);
  border-bottom-color: #f78166;
}

.tab-nav-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 0.375rem;
  border-radius: 2em;
  background: var(--alpha-10);
  font-size: var(--label-2);
  font-weight: var(--weight-medium);
  color: var(--color-fg-default);
}

/* ---------- Archive Header ---------- */

.archive-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.archive-title {
  font-size: var(--title-3);
  font-weight: var(--weight-semiBold);
  color: var(--on-background);
}

.archive-count {
  font-size: var(--label-1);
  color: var(--on-surface);
}

.section-subtitle {
  font-size: var(--title-3);
  font-weight: var(--weight-semiBold);
  color: var(--on-background);
  margin-bottom: 1rem;
}

/* ---------- Repo Card List ---------- */

.repo-card-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ---------- Repo Card ---------- */

.repo-card {
  padding: 24px;
  border: 1px solid var(--surface-variant-outline);
  border-radius: var(--radius-12);
  background: var(--surface);
  transition: border-color var(--transition-medium);
}

.repo-card:hover {
  border-color: var(--surface-variant-outline-hover);
}

.repo-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.repo-card-name {
  font-size: var(--title-3);
  font-weight: var(--weight-semiBold);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.profile-main {
  min-width: 0;
}

.repo-card-name a {
  color: var(--primary);
}

.repo-card-name a:hover {
  text-decoration: underline;
}

.badge-outline {
  display: inline-block;
  padding: 0 7px;
  font-size: var(--label-2);
  font-weight: var(--weight-medium);
  line-height: 18px;
  white-space: nowrap;
  border: 1px solid var(--surface-variant-outline);
  border-radius: 2em;
  color: var(--on-surface);
  background: transparent;
}

.repo-card-description {
  font-size: var(--label-1);
  color: var(--on-surface-2);
  line-height: 1.5;
  margin-bottom: 1rem;
  overflow-wrap: anywhere;
}

.repo-card-footer {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  color: var(--on-surface-variant);
  font-size: var(--label-2);
}

.repo-card-lang {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.lang-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: var(--radius-circle);
  flex-shrink: 0;
}

.repo-card-stat {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.repo-card-stat .material-symbols-rounded {
  font-size: 16px;
}

/* ---------- No Results / 404 ---------- */

.no-results {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--on-surface);
}

.no-results h2 {
  font-size: var(--title-2);
  color: var(--on-background);
  margin-bottom: 0.5rem;
}

.error-404 {
  text-align: center;
  padding: 2rem 1rem;
  margin-bottom: 2rem;
}

.error-404 h1 {
  font-size: var(--title-2);
  color: var(--on-background);
  margin-bottom: 0.5rem;
}

.error-message {
  color: var(--on-surface);
  font-size: var(--label-1);
}

.ascii-art {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--on-surface-variant);
  margin-bottom: 1rem;
  text-align: left;
  display: inline-block;
}

/* ---------- Article Content (Prose) ---------- */

.prose {
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-fg-default);
  overflow-wrap: anywhere;
}

.prose h1, .prose h2, .prose h3, .prose h4 {
  font-weight: 600;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  padding-bottom: 0.3em;
}

.prose h2 {
  font-size: 1.5rem;
  border-bottom: 1px solid var(--color-border-default);
  border-left: 3px solid var(--color-accent-fg);
  padding-left: 0.6em;
}

.prose p {
  margin-bottom: 1rem;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 85%;
  background: rgba(110, 118, 129, 0.4);
  padding: 0.2em 0.4em;
  border-radius: var(--radius-8);
}

.prose pre {
  background: var(--color-canvas-subtle);
  padding: 1rem;
  border-radius: var(--radius-8);
  overflow: auto;
  margin-bottom: 1rem;
}

.prose ul,
.prose ol {
  padding-left: 1.5em;
  margin-bottom: 1rem;
}

.prose li {
  margin-bottom: 0.25em;
}

.prose blockquote {
  padding: 0 1rem;
  color: var(--color-fg-muted);
  border-left: 0.25rem solid var(--color-border-default);
  margin-bottom: 1rem;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.prose th,
.prose td {
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--color-border-default);
  text-align: left;
}

.prose th {
  background: var(--color-canvas-subtle);
  font-weight: var(--weight-semiBold);
}

.prose tbody tr:nth-child(even) {
  background: var(--color-canvas-subtle);
}

/* ---------- Badges ---------- */

.badge {
  display: inline-block;
  padding: 0 7px;
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: 2em;
}

.badge-green {
  color: var(--color-success-fg);
  border-color: var(--color-success-fg);
  background: transparent;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0 10px;
  font-size: var(--label-2);
  font-weight: var(--weight-medium);
  line-height: 22px;
  color: var(--on-surface);
  border: 1px solid var(--surface-variant-outline);
  border-radius: var(--radius-pill);
  background: transparent;
}

.badge-pill .material-symbols-rounded {
  font-size: 14px;
}

/* ---------- Article Header (Single Post) ---------- */

.article-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.article-title {
  font-size: var(--title-1);
  font-weight: var(--weight-bold);
  color: var(--on-background);
  line-height: 1.2;
  margin-bottom: 2rem;
  overflow-wrap: anywhere;
}

.article-content {
  min-width: 0;
}

.article-featured-image {
  margin-bottom: 1.5rem;
  border-radius: var(--radius-12);
  overflow: hidden;
  max-height: 420px;
}

.article-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Article Layout (Single Post) ---------- */

.article-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  align-items: start;
}

.toc-sidebar {
  position: sticky;
  top: 80px;
}

.toc[data-empty="true"] {
  display: none;
}

.toc-sidebar:has(.toc[data-empty="true"]) {
  display: none;
}

.article-layout:has(.toc[data-empty="true"]) {
  grid-template-columns: 1fr;
}

.toc {
  font-size: 0.8125rem;
  background: var(--surface);
  border: 1px solid var(--surface-variant-outline);
  border-radius: var(--radius-12);
  padding: 1rem;
}

.toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.toc-header h4 {
  font-size: var(--label-2);
  font-weight: var(--weight-semiBold);
  color: var(--on-surface);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.toc-toggle {
  color: var(--on-surface-variant);
  transition: color var(--transition-short);
}

.toc-toggle:hover {
  color: var(--on-background);
}

.toc-list {
  list-style: none;
  border-left: 2px solid var(--surface-variant-outline);
  padding-left: 0.75rem;
}

.toc-list li a {
  display: block;
  padding: 0.25rem 0;
  color: var(--on-surface-variant);
  transition: color var(--transition-short);
}

.toc-list li a:hover {
  color: var(--on-background);
  text-decoration: none;
}

.toc-list li a.active {
  color: var(--primary);
  text-decoration: none;
}

.toc-list li.toc-h3 {
  padding-left: 1rem;
}

.toc-list.collapsed {
  display: none;
}

/* ---------- Pagination ---------- */

.pagination {
  display: flex;
  justify-content: center;
  gap: 0.25rem;
  margin-top: 2rem;
}

.pagination a, .pagination span {
  padding: 0.375rem 0.75rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--color-accent-fg);
  font-size: 0.875rem;
}

.pagination a:hover {
  background: var(--color-canvas-subtle);
  border-color: var(--color-border-default);
  text-decoration: none;
}

.pagination .current {
  color: var(--color-fg-default);
  background: var(--color-accent-emphasis);
  border-color: var(--color-accent-emphasis);
}

/* ---------- Card (Related Posts on single.php) ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--surface-variant-outline);
  border-radius: var(--radius-12);
  overflow: hidden;
  transition: border-color var(--transition-medium);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.card:hover {
  border-color: var(--surface-variant-outline-hover);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.card-thumbnail {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.card-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--label-2);
}

.card-title {
  font-size: var(--label-1);
  font-weight: var(--weight-semiBold);
  line-height: 1.4;
}

.card-title a {
  color: var(--color-accent-fg);
  text-decoration: none;
}

.card-title a:hover {
  text-decoration: underline;
}

.card-excerpt {
  font-size: var(--label-2);
  color: var(--color-fg-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--label-2);
  color: var(--color-fg-muted);
  margin-top: auto;
  padding-top: 0.5rem;
}

.card-author {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.card-author img {
  border-radius: 50%;
}

.card-date {
  color: var(--color-fg-muted);
}

/* ---------- Footer ---------- */

.site-footer {
  padding-block: 2rem;
  border-top: 1px solid var(--color-border-default);
  margin-top: 4rem;
  color: var(--color-fg-muted);
  font-size: var(--label-2);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Theme Toggle ---------- */

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-8);
  color: var(--color-fg-muted);
  transition: color var(--transition-short), background-color var(--transition-short);
}

.theme-toggle:hover {
  color: var(--color-fg-default);
  background: var(--color-canvas-subtle);
}

[data-theme="dark"] .theme-toggle-dark { display: none; }
[data-theme="dark"] .theme-toggle-light { display: inline; }
[data-theme="light"] .theme-toggle-light { display: none; }
[data-theme="light"] .theme-toggle-dark { display: inline; }

/* ---------- Post Navigation (Single) ---------- */

.post-navigation {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border-default);
}

.post-nav-link {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  color: var(--color-fg-default);
}

.post-nav-link:hover {
  text-decoration: none;
}

.post-nav-link:hover .post-nav-title {
  color: var(--primary);
}

.post-nav-label {
  font-size: var(--label-2);
  color: var(--on-surface-variant);
}

.post-nav-title {
  font-size: var(--label-1);
  font-weight: var(--weight-medium);
  transition: color var(--transition-short);
}

.post-nav-next {
  text-align: right;
  margin-left: auto;
}

/* ---------- Related Posts ---------- */

.related-posts {
  margin-top: 3rem;
}

.section-title {
  font-size: var(--title-3);
  font-weight: var(--weight-semiBold);
  color: var(--on-background);
  margin-bottom: 1rem;
}

/* ---------- Misc Responsive Helpers ---------- */

.profile-contact-item a {
  word-break: break-all;
}

/* ---------- Responsive: Tablet (max-width: 1024px) ---------- */

@media (max-width: 1024px) {
  .profile-layout {
    grid-template-columns: 200px 1fr;
    gap: 1.5rem;
  }

  .article-layout {
    grid-template-columns: 1fr;
  }

  .toc-sidebar {
    position: relative;
    top: 0;
  }
}

/* ---------- Responsive: Small Tablet / Large Phone (max-width: 768px) ---------- */

@media (max-width: 768px) {
  /* Header */
  .header-inner { gap: 0.5rem; }

  .header-search {
    flex: 1;
    max-width: none;
  }

  /* Profile layout → single column */
  .profile-layout {
    grid-template-columns: 1fr;
  }

  /* Profile sidebar → mobile overlay */
  .profile-sidebar-toggle {
    display: flex;
  }

  .profile-sidebar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 200;
    background: var(--background);
    padding: 4rem 1.5rem 1.5rem;
    overflow-y: auto;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .profile-sidebar.open {
    display: flex;
  }

  .profile-sidebar .profile-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
  }

  .profile-contact {
    align-items: center;
  }

  /* Tab nav */
  .tab-nav {
    margin-inline: -1.25rem;
    padding-inline: 1.25rem;
  }

  .tab-nav-item {
    padding: 0.5rem 0.75rem;
    font-size: var(--label-2);
  }

  /* Repo cards */
  .repo-card {
    padding: 16px;
  }

  .repo-card-footer {
    gap: 0.75rem;
  }

  /* Article */
  .article-title {
    font-size: clamp(24px, 6vw, 36px);
  }

  .article-featured-image {
    margin-inline: -1.25rem;
    border-radius: 0;
    max-height: none;
  }

  .toc {
    padding: 0.75rem;
  }

  .toc-list {
    font-size: var(--label-2);
  }

  .prose pre {
    margin-inline: -0.5rem;
    border-radius: var(--radius);
    font-size: 13px;
  }

  .prose table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ---------- Responsive: Mobile Phone (max-width: 480px) ---------- */

@media (max-width: 480px) {
  /* Header brand: hide text on very small screens */
  .header-brand .site-title {
    font-size: 0;
  }

  .header-brand .site-title .site-icon,
  .header-brand .site-title img,
  .header-brand .custom-logo-link img {
    font-size: initial;
    display: block;
  }

  /* Search bar: collapse to centered icon, expand on focus */
  .header-search {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    max-width: 40px;
    overflow: hidden;
    padding: 0;
    gap: 0;
    justify-content: center;
    border-radius: var(--radius-8);
    transition: max-width var(--transition-medium), width var(--transition-medium), flex var(--transition-medium), padding var(--transition-medium), gap var(--transition-medium);
  }

  .header-search.is-open {
    flex: 1;
    width: auto;
    max-width: 100%;
    padding: 0.375rem 0.75rem;
    gap: 0.5rem;
  }

  .header-search .material-symbols-rounded {
    flex-shrink: 0;
  }

  .header-search form {
    display: none;
  }

  .header-search.is-open form {
    display: flex;
    flex: 1;
  }

  /* Repo cards */
  .repo-card { padding: 12px; }
  .repo-card-header { gap: 0.5rem; }
  .repo-card-footer { gap: 0.5rem; font-size: 11px; }

  /* Article meta pills */
  .article-meta { gap: 0.375rem; }
  .badge-pill { font-size: 11px; padding: 0 8px; line-height: 20px; }

  /* Post navigation */
  .post-navigation { flex-direction: column; }
  .post-nav-next { text-align: left; margin-left: 0; }

  /* Tab nav */
  .tab-nav {
    margin-inline: -1rem;
    padding-inline: 1rem;
  }

  /* Article */
  .article-featured-image {
    margin-inline: -1rem;
  }

  .prose pre {
    margin-inline: -0.75rem;
    padding: 0.75rem;
    font-size: 12px;
  }

  /* Footer */
  .site-footer { padding-block: 1.5rem; margin-top: 2rem; }

  /* Pagination */
  .pagination a, .pagination span { padding: 0.25rem 0.5rem; font-size: var(--label-2); }
}

/* ---------- About / README Page ---------- */

.about-readme {
  border: 1px solid var(--surface-variant-outline);
  border-radius: var(--radius-12);
  background: var(--surface);
  overflow: hidden;
}

.about-readme-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background: var(--surface-variant);
  border-bottom: 1px solid var(--surface-variant-outline);
  font-size: var(--label-1);
  font-weight: var(--weight-semiBold);
  color: var(--on-background);
}

.about-readme-header .material-symbols-rounded {
  font-size: 18px;
  color: var(--on-surface-variant);
}

.about-readme-filename {
  font-family: var(--font-mono);
  font-size: var(--label-1);
}

.about-readme-body {
  padding: 1.5rem;
}

.about-readme-body > :first-child {
  margin-top: 0;
}

.about-topics {
  margin-top: 1.5rem;
}

.about-topics-heading {
  font-size: var(--label-1);
  font-weight: var(--weight-semiBold);
  color: var(--on-background);
  margin-bottom: 0.75rem;
}

.about-topics-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.about-topic-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  font-size: var(--label-2);
  font-weight: var(--weight-medium);
  color: var(--on-surface);
  background: var(--surface);
  border: 1px solid var(--surface-variant-outline);
  border-radius: var(--radius-pill);
  transition: border-color var(--transition-short), background var(--transition-short);
}

.about-topic-badge:hover {
  border-color: var(--surface-variant-outline-hover);
  background: var(--surface-variant);
  text-decoration: none;
  color: var(--on-background);
}

.about-topic-badge .lang-dot {
  width: 10px;
  height: 10px;
}

.about-topic-count {
  color: var(--on-surface-variant);
  font-size: 11px;
}

/* ---------- Stack Page ---------- */

.stack-group {
  margin-top: 1.5rem;
}

.stack-group__heading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--title-3);
  font-weight: var(--weight-semiBold);
  color: var(--on-background);
  margin-bottom: 1rem;
}

.stack-group__heading .lang-dot {
  width: 12px;
  height: 12px;
}

.stack-group__count {
  font-size: var(--label-2);
  font-weight: var(--weight-medium);
  color: var(--on-surface-variant);
}


