﻿/* Home, category and tag list styles. */
.home-shell {
  display: block;
  min-height: calc(100vh - 118px);
}

.home-content {
  width: min(100%, 1320px);
  padding: 34px 28px 72px;
  margin: 0 auto;
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: start;
}

.home-main {
  min-width: 0;
}

.home-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--blog-border);
}

.home-tab {
  appearance: none;
  padding: 10px 4px 11px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--blog-muted);
  font: inherit;
  font-weight: 650;
}

.home-tab:hover,
.home-tab.active {
  color: var(--blog-accent-strong);
  border-bottom-color: var(--blog-accent);
}

.home-tab-panel[hidden] {
  display: none;
}

.home-tab-panel.is-loading {
  opacity: 0.72;
}

.home-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.home-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--blog-border);
  border-radius: 8px;
  background: var(--blog-surface);
  box-shadow: 0 10px 28px var(--blog-shadow);
}

.home-card-media {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--blog-surface-soft);
}

.home-card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.home-card:hover .home-card-media img {
  transform: scale(1.03);
}

.home-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 16px 16px 18px;
}

.home-card-category {
  display: inline-block;
  color: var(--blog-accent-strong);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
}

.home-card-category:hover {
  color: var(--blog-accent);
}

.home-card-body h2 {
  margin: 0 0 8px;
  font-size: 1.2rem;
  line-height: 1.35;
}

.home-card-body h2 a {
  color: var(--blog-text);
  text-decoration: none;
}

.home-card-body h2 a:hover {
  color: var(--blog-accent-strong);
}

.home-card-summary {
  display: -webkit-box;
  min-height: 3.2em;
  margin: 0 0 12px;
  overflow: hidden;
  color: var(--blog-muted);
  line-height: 1.6;
  text-decoration: none;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.home-card-summary:hover {
  color: var(--blog-text);
}

.home-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 12px;
}

.home-card-date {
  color: var(--blog-muted);
  font-size: 0.9rem;
}

.home-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}

.home-card-tags a {
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--blog-active);
  color: var(--blog-accent-strong);
  font-size: 0.78rem;
  text-decoration: none;
}

.home-card-tags a:hover {
  color: var(--blog-accent);
}

.home-aside {
  display: grid;
  gap: 16px;
  min-width: 0;
  position: sticky;
  top: 82px;
  align-self: start;
}

.home-side-card {
  padding: 18px;
  border: 1px solid var(--blog-border);
  border-radius: 8px;
  box-shadow: 0 10px 28px var(--blog-shadow);
}

.home-side-card h2 {
  margin: 6px 0 10px;
  font-size: 1.15rem;
}

.home-side-card p {
  margin: 0;
  color: var(--blog-muted);
  line-height: 1.7;
}

.home-profile-card {
  text-align: center;
}

.home-profile-card h1 {
  font-size: 1.5rem;
}

.profile-avatar {
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  margin: 2px auto 14px;
  overflow: hidden;
  border: 1px solid var(--blog-border);
  border-radius: 8px;
  background: var(--blog-surface-soft);
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--blog-accent-strong);
  font-size: 2.6rem;
  font-weight: 800;
}

.home-profile-card h2 {
  margin-bottom: 6px;
}

.profile-description {
  color: var(--blog-text);
  font-size: 0.95rem;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0 14px;
}

.profile-stats div {
  min-width: 0;
}

.profile-stats dt,
.profile-stats dd {
  margin: 0;
}

.profile-stats dt {
  color: var(--blog-muted);
  font-size: 0.82rem;
}

.profile-stats dd {
  margin-top: 4px;
  color: var(--blog-heading);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.1;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

.profile-link {
  --profile-link-color: #0e7490;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 3px;
  border: 0;
  background: transparent;
  color: var(--profile-link-color);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.profile-link:hover {
  color: var(--profile-link-color);
  filter: saturate(1.15);
  transform: translateY(-1px);
}

.profile-link-image {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  object-fit: cover;
}

.profile-link-icon {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  overflow: hidden;
  font-size: 0.88rem;
  text-align: center;
}

.profile-link-tone-1 {
  --profile-link-color: #c2410c;
}

.profile-link-tone-2 {
  --profile-link-color: #7e22ce;
}

.profile-link-tone-3 {
  --profile-link-color: #1d4ed8;
}

.profile-link-tone-4 {
  --profile-link-color: #be185d;
}

.profile-link-tone-5 {
  --profile-link-color: #15803d;
}

.profile-link-tone-6 {
  --profile-link-color: #b91c1c;
}

.home-ad-link {
  display: inline-flex;
  align-items: center;
  margin-top: 12px;
  color: var(--blog-accent-strong);
  font-weight: 700;
  text-decoration: none;
}

.home-ad-link:hover {
  color: var(--blog-accent);
}

.home-ad-content {
  margin-top: 10px;
  color: var(--blog-muted);
  line-height: 1.7;
}

.home-ad-content > :last-child {
  margin-bottom: 0;
}

.home-ad-content p {
  margin: 0 0 10px;
}

.home-ad-content h1,
.home-ad-content h2,
.home-ad-content h3,
.home-ad-content h4 {
  margin: 10px 0 8px;
  color: var(--blog-heading);
  font-size: 1.05rem;
  line-height: 1.35;
}

.home-ad-content img {
  display: block;
  width: 100%;
  max-height: 180px;
  margin: 10px 0;
  border-radius: 8px;
  object-fit: cover;
}

.home-ad-content a {
  color: var(--blog-accent-strong);
  font-weight: 700;
  text-decoration: none;
}

.side-eyebrow {
  color: var(--blog-accent-strong);
  font-size: 0.82rem;
  font-weight: 700;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: center;
}

.home-side-card .tag-cloud {
  margin-top: 14px;
}

.tag-empty {
  padding: 5px 9px;
  border-radius: 999px;
  background: #eefbf4;
  color: var(--blog-accent-strong);
  font-size: 0.88rem;
  text-decoration: none;
}

.tag-cloud-item {
  --tag-bg: #eefbf4;
  --tag-border: rgba(22, 135, 91, 0.16);
  --tag-color: var(--blog-accent-strong);
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid var(--tag-border);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--tag-bg), color-mix(in srgb, var(--tag-bg) 72%, #ffffff));
  color: var(--tag-color);
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.07);
}

.tag-size-1 {
  font-size: 0.82rem;
}

.tag-size-2 {
  font-size: 0.92rem;
}

.tag-size-3 {
  font-size: 1.02rem;
}

.tag-size-4 {
  font-size: 1.14rem;
}

.tag-size-5 {
  font-size: 1.26rem;
}

.tag-tone-1 {
  --tag-bg: #dcfce7;
  --tag-border: rgba(22, 163, 74, 0.2);
  --tag-color: #15803d;
}

.tag-tone-2 {
  --tag-bg: #dbeafe;
  --tag-border: rgba(37, 99, 235, 0.2);
  --tag-color: #1d4ed8;
}

.tag-tone-3 {
  --tag-bg: #fef3c7;
  --tag-border: rgba(217, 119, 6, 0.22);
  --tag-color: #b45309;
}

.tag-tone-4 {
  --tag-bg: #fce7f3;
  --tag-border: rgba(219, 39, 119, 0.18);
  --tag-color: #be185d;
}

.tag-tone-5 {
  --tag-bg: #e0f2fe;
  --tag-border: rgba(2, 132, 199, 0.2);
  --tag-color: #0369a1;
}

.tag-tone-6 {
  --tag-bg: #ede9fe;
  --tag-border: rgba(124, 58, 237, 0.18);
  --tag-color: #6d28d9;
}

.tag-cloud-item:hover {
  color: var(--tag-color);
  filter: saturate(1.16);
  transform: translateY(-1px);
}

.home-empty {
  padding: 24px;
  border: 1px dashed var(--blog-border);
  border-radius: 8px;
  color: var(--blog-muted);
  text-align: center;
}

.category-hero {
  margin-bottom: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--blog-border);
}

.category-hero span {
  color: var(--blog-accent-strong);
  font-size: 0.9rem;
  font-weight: 700;
}

.category-hero h1 {
  margin: 8px 0 10px;
  color: var(--blog-heading);
  font-size: 2rem;
}

.category-hero p {
  max-width: 720px;
  margin: 0;
  color: var(--blog-muted);
  line-height: 1.7;
}


@media (max-width: 1180px) {
  .home-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .home-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-aside {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    position: static;
  }
}

@media (max-width: 820px) {
  .home-content {
    padding: 26px 18px 56px;
  }

  .home-grid,
  .home-card-grid,
  .home-aside {
    display: grid;
    grid-template-columns: 1fr;
  }

  .home-main,
  .home-aside {
    grid-column: auto;
  }
}
