/* Articles page styles */
:root {
  --articles-max-width: 1280px;
  --articles-sidebar-width: 260px;
  --articles-right-width: 280px;
  --articles-gap: 24px;
  --articles-card-radius: 18px;
  --articles-card-border: rgba(148, 163, 184, 0.18);
  --articles-muted: rgba(148, 163, 184, 0.78);
  --articles-accent: #38bdf8;
  --articles-accent-hover: #0ea5e9;
}

body.articles-page {
  min-height: 100vh;
  background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.18), transparent 42%),
              radial-gradient(circle at top right, rgba(129, 140, 248, 0.18), transparent 55%),
              var(--bg-color);
}

.articles-header {
  position: sticky;
  top: 0;
  z-index: 180;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 16px clamp(16px, 5vw, 32px);
  background: color-mix(in srgb, var(--header-bg) 94%, transparent 6%);
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  backdrop-filter: blur(18px);
}

.articles-header__left {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.articles-logo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.12);
  color: inherit;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: background 0.2s ease;
}

.articles-logo:hover,
.articles-logo:focus-visible {
  background: rgba(56, 189, 248, 0.24);
  outline: none;
}

.articles-logo__mark {
  font-weight: 800;
}

.articles-tabs {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.articles-tab {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(148, 163, 184, 0.08);
  color: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.articles-tab:hover,
.articles-tab:focus-visible {
  background: rgba(56, 189, 248, 0.18);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
  outline: none;
}

.articles-tab.is-active {
  background: rgba(56, 189, 248, 0.22);
  color: #0ea5e9;
  border-color: rgba(56, 189, 248, 0.5);
}

.articles-header__center {
  min-width: 0;
}

.articles-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: color-mix(in srgb, var(--card-bg) 92%, transparent 8%);
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 8px 12px;
  border-radius: 999px;
}

.articles-search input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: inherit;
  font: inherit;
}

.articles-search button {
  border: none;
  background: linear-gradient(135deg, var(--articles-accent), var(--articles-accent-hover));
  color: #0f172a;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.articles-search button:hover,
.articles-search button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(14, 165, 233, 0.35);
  outline: none;
}

.articles-header__right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.articles-circle-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(148, 163, 184, 0.12);
  color: inherit;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s ease, transform 0.2s ease;
}

.articles-circle-btn:hover,
.articles-circle-btn:focus-visible {
  background: rgba(56, 189, 248, 0.2);
  transform: translateY(-1px);
  outline: none;
}

.articles-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(56, 189, 248, 0.32);
  display: inline-flex;
}

.articles-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.articles-layout {
  width: min(var(--articles-max-width), 100% - 32px);
  margin: 32px auto 80px;
  display: grid;
  grid-template-columns: var(--articles-sidebar-width) minmax(0, 1fr) var(--articles-right-width);
  gap: var(--articles-gap);
  align-items: start;
}

.articles-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.articles-panel {
  background: color-mix(in srgb, var(--card-bg) 90%, transparent 10%);
  border: 1px solid var(--articles-card-border);
  border-radius: 20px;
  padding: 18px 20px;
  box-shadow: 0 22px 42px rgba(15, 23, 42, 0.18);
}

.articles-panel h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.articles-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.articles-field {
  display: block;
  font-size: 0.85rem;
  color: var(--articles-muted);
  margin-bottom: 6px;
}

.articles-select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.08);
  color: inherit;
}

.articles-tag-filter {
  display: flex;
  gap: 8px;
  align-items: center;
}

.articles-link-btn {
  background: none;
  border: none;
  color: var(--articles-accent);
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
}

.articles-link-btn:hover,
.articles-link-btn:focus-visible {
  color: var(--articles-accent-hover);
  text-decoration: underline;
  outline: none;
}

.articles-tag-cloud {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.articles-tag-chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.12);
  color: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  border: none;
}

.articles-tag-chip.is-active {
  background: rgba(56, 189, 248, 0.3);
  color: #0ea5e9;
}

.articles-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.articles-list {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.articles-collection {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.articles-collection--feed {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.articles-collection--grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.articles-collection--grid > .articles-card {
  height: 100%;
}

.articles-empty {
  text-align: center;
  padding: 40px 20px;
  border-radius: 20px;
  border: 1px dashed rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.12);
  color: var(--articles-muted);
}

.articles-load-more {
  align-self: center;
  padding: 12px 26px;
  border-radius: 999px;
  border: none;
  font-weight: 700;
  color: #0f172a;
  background: linear-gradient(135deg, var(--articles-accent), var(--articles-accent-hover));
  cursor: pointer;
  box-shadow: 0 18px 36px rgba(14, 165, 233, 0.32);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.articles-load-more:hover,
.articles-load-more:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 24px 48px rgba(14, 165, 233, 0.45);
  outline: none;
}

.articles-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 20px;
  padding: 22px;
  border-radius: var(--articles-card-radius);
  background: color-mix(in srgb, var(--card-bg) 94%, transparent 6%);
  border: 1px solid var(--articles-card-border);
  box-shadow: 0 32px 60px rgba(15, 23, 42, 0.28);
}

.articles-card--feed {
  width: 100%;
}

.articles-card--grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
}

.articles-vote {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.1);
}

.articles-card--grid .articles-vote {
  order: 2;
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
  padding: 0;
  background: transparent;
}

.articles-vote button {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: inherit;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.articles-vote button:hover,
.articles-vote button:focus-visible {
  background: rgba(56, 189, 248, 0.18);
  outline: none;
}

.articles-vote button.is-active {
  color: var(--articles-accent);
}

.articles-score {
  font-weight: 700;
  font-size: 1rem;
}

.articles-card--grid .articles-score {
  font-size: 1rem;
}

.articles-card__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  gap: 18px;
  align-items: stretch;
}

.articles-card--grid .articles-card__body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.articles-card__content {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.articles-card__title {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.3;
  color: inherit;
  text-decoration: none;
}

.articles-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--articles-muted);
}

.articles-meta-link {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}

.articles-meta-link:hover,
.articles-meta-link:focus-visible {
  color: var(--articles-accent);
  text-decoration: underline;
  outline: none;
}

.articles-card__summary {
  font-size: 1rem;
  color: color-mix(in srgb, var(--text-color) 92%, white 8%);
  line-height: 1.6;
}

.articles-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.articles-tag {
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.16);
  color: inherit;
}

.articles-card__cover {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  min-height: 160px;
  background: rgba(15, 23, 42, 0.18);
  aspect-ratio: 16 / 9;
}

.articles-card--grid .articles-card__cover {
  order: -1;
  width: 100%;
  height: auto;
  min-height: 0;
}

.articles-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.articles-card--grid .articles-card__cover img {
  border-radius: 16px;
}

.articles-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

.articles-card--grid .articles-card__actions {
  justify-content: space-between;
}

.articles-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(148, 163, 184, 0.08);
  font-size: 0.85rem;
  font-weight: 600;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
}

.articles-action:hover,
.articles-action:focus-visible {
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  outline: none;
}

.articles-panel__empty {
  font-size: 0.9rem;
  color: var(--articles-muted);
  margin-top: 12px;
}

.articles-reading-list,
.articles-top-tags,
.articles-recommendations {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.articles-reading-item,
.articles-recommendation {
  display: flex;
  gap: 12px;
  align-items: center;
}

.articles-reading-item img,
.articles-recommendation img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  background: rgba(15, 23, 42, 0.18);
}

.articles-reading-item a,
.articles-recommendation a {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}

.articles-top-tag {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9rem;
}

.articles-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-bottom: 16px;
}

.articles-write-btn {
  position: fixed;
  bottom: 28px;
  right: clamp(16px, 4vw, 32px);
  padding: 14px 28px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  color: #0f172a;
  font-size: 1rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 24px 48px rgba(99, 102, 241, 0.45);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.articles-write-btn:hover,
.articles-write-btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 30px 60px rgba(99, 102, 241, 0.55);
  outline: none;
}

.articles-write-btn--inline {
  position: static;
  right: auto;
  bottom: auto;
  box-shadow: 0 18px 36px rgba(99, 102, 241, 0.32);
}

.articles-write-btn--inline:hover,
.articles-write-btn--inline:focus-visible {
  box-shadow: 0 24px 48px rgba(99, 102, 241, 0.45);
}

.articles-toolbar .articles-write-btn--inline {
  margin-left: auto;
}

.articles-card--skeleton {
  position: relative;
  overflow: hidden;
}

.skeleton-block {
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.08) 25%, rgba(148, 163, 184, 0.16) 50%, rgba(148, 163, 184, 0.08) 75%);
  background-size: 200% 100%;
  animation: articles-skeleton 1.4s ease-in-out infinite;
}

.skeleton-block--button {
  width: 36px;
  height: 36px;
}

.skeleton-block--text {
  width: 20px;
  height: 18px;
}

.skeleton-block--title {
  height: 26px;
  width: 70%;
}

.skeleton-block--meta {
  height: 16px;
  width: 50%;
}

.skeleton-block--summary {
  height: 14px;
  width: 100%;
}

.skeleton-block--cover {
  position: absolute;
  inset: 0;
}

.articles-notice {
  margin-top: 12px;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid rgba(248, 113, 113, 0.32);
  background: rgba(248, 113, 113, 0.1);
  color: #fca5a5;
  font-size: 0.95rem;
}

@media (max-width: 1240px) {
  .articles-layout {
    grid-template-columns: var(--articles-sidebar-width) minmax(0, 1fr);
  }
  .articles-sidebar--right {
    display: none;
  }
  .articles-card__body {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 980px) {
  .articles-header {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }
  .articles-header__left {
    justify-content: space-between;
  }
  .articles-tabs {
    order: 3;
    width: 100%;
    padding-top: 12px;
  }
  .articles-header__center {
    order: 2;
  }
  .articles-header__right {
    order: 1;
    justify-content: flex-end;
  }
  .articles-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .articles-sidebar--left {
    order: 2;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .articles-panel {
    flex: 1 1 240px;
  }
}

@media (max-width: 680px) {
  .articles-card {
    grid-template-columns: minmax(0, 1fr);
  }
  .articles-vote {
    flex-direction: row;
    justify-content: flex-start;
    padding: 8px 12px;
  }
  .articles-card__body {
    grid-template-columns: minmax(0, 1fr);
  }
  .articles-write-btn {
    width: calc(100% - 32px);
    left: 16px;
    right: 16px;
    justify-content: center;
  }
}

@keyframes articles-skeleton {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}
