:root {
  --home-accent: #425aef;
  --home-accent-soft: rgba(66, 90, 239, .10);
  --home-card-border: rgba(66, 90, 239, .12);
  --home-card-shadow: 0 18px 50px rgba(37, 52, 102, .08);
  --home-muted: #77819a;
}

[data-theme='dark'] {
  --home-accent: #79a7ff;
  --home-accent-soft: rgba(121, 167, 255, .13);
  --home-card-border: rgba(255, 255, 255, .09);
  --home-card-shadow: 0 18px 50px rgba(0, 0, 0, .24);
  --home-muted: #a1a8bd;
}

#page-header.full_page {
  height: 72vh;
  min-height: 540px;
  max-height: 820px;
}

#page-header.full_page:before {
  background: linear-gradient(180deg, rgba(9, 14, 35, .28), rgba(9, 14, 35, .72));
}

#page-header.full_page #nav {
  background: rgba(13, 20, 44, .18);
  border-bottom: 1px solid rgba(255, 255, 255, .14);
  backdrop-filter: blur(14px);
}

#site-info {
  text-align: left;
  left: 50%;
  max-width: 1180px;
  transform: translateX(-50%);
}

#site-info #site-title,
#site-info #site-subtitle,
#site-info #site_social_icons {
  text-align: left;
}

#site-info #site-title {
  font-size: clamp(2.5rem, 6vw, 5rem);
  letter-spacing: -.04em;
}

#site-info #site-subtitle {
  font-size: clamp(1rem, 2vw, 1.35rem);
  opacity: .9;
}

#content-inner.layout {
  max-width: 1400px;
  padding-top: 28px;
}

#home_top {
  width: 100%;
  margin: 0 0 18px;
}

.home-dashboard {
  display: grid;
  grid-template-columns: minmax(235px, .8fr) minmax(0, 2.2fr);
  gap: 18px;
}

.home-panel {
  background: var(--card-bg);
  border: 1px solid var(--home-card-border);
  border-radius: 20px;
  box-shadow: var(--home-card-shadow);
}

.home-profile-panel {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 280px;
}

.home-profile-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.home-profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  object-fit: cover;
  border: 3px solid var(--home-accent-soft);
}

.home-profile-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.home-label {
  color: var(--home-accent);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.home-profile-name {
  color: var(--text-highlight-color);
  font-size: 1.15rem;
  margin-top: 3px;
}

.home-profile-site {
  color: var(--home-muted);
  font-size: .82rem;
  margin-top: 2px;
}

.home-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 25px 0 20px;
}

.home-stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 8px;
  border-radius: 12px;
  background: var(--home-accent-soft);
  text-align: center;
}

.home-stat strong {
  color: var(--text-highlight-color);
  font-size: 1.2rem;
}

.home-stat span {
  color: var(--home-muted);
  font-size: .68rem;
}

.home-profile-actions {
  display: flex;
  gap: 10px;
}

.home-profile-action,
.home-panel-link {
  color: var(--home-accent);
  font-size: .82rem;
  font-weight: 700;
}

.home-profile-action:hover,
.home-panel-link:hover {
  color: var(--text-highlight-color);
}

.home-featured-panel,
.home-topics-panel {
  padding: 24px;
}

.home-panel-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.home-panel-heading h2 {
  color: var(--text-highlight-color);
  font-size: 1.45rem;
  margin: 5px 0 0;
}

.home-panel-link {
  white-space: nowrap;
}

.home-featured-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr;
  gap: 12px;
}

.home-featured-card {
  display: flex;
  min-height: 204px;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--home-card-border);
  border-radius: 15px;
  background: var(--global-bg);
  transition: transform .25s ease, box-shadow .25s ease;
}

.home-featured-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(37, 52, 102, .12);
}

.home-featured-card.is-featured {
  grid-row: span 2;
}

.home-featured-cover {
  height: 108px;
  overflow: hidden;
  background: var(--home-accent-soft);
}

.home-featured-card.is-featured .home-featured-cover {
  height: 160px;
}

.home-featured-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}

.home-featured-card:hover .home-featured-cover img {
  transform: scale(1.05);
}

.home-featured-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 12px 14px 14px;
}

.home-featured-category {
  color: var(--home-accent);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.home-featured-title {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 6px;
  color: var(--text-highlight-color);
  font-size: .96rem;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.home-featured-content time {
  margin-top: auto;
  padding-top: 10px;
  color: var(--home-muted);
  font-size: .7rem;
}

.home-topics-panel {
  margin-top: 18px;
}

.home-topic-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.home-topic-card {
  display: flex;
  min-height: 124px;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  border-radius: 15px;
  color: var(--text-highlight-color);
  background: linear-gradient(140deg, var(--home-accent-soft), transparent 75%);
  border: 1px solid var(--home-card-border);
  transition: transform .25s ease, background .25s ease;
}

.home-topic-card:hover {
  color: var(--text-highlight-color);
  transform: translateY(-3px);
  background: var(--home-accent-soft);
}

.home-topic-card i {
  color: var(--home-accent);
  font-size: 1.2rem;
}

.home-topic-card span {
  margin-top: 12px;
  font-weight: 800;
}

.home-topic-card small {
  color: var(--home-muted);
  font-size: .72rem;
  line-height: 1.4;
}

#category-bar {
  align-items: center;
  border: 1px solid var(--home-card-border);
  box-shadow: 0 10px 28px rgba(37, 52, 102, .05);
}

.category-bar-label {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  padding: 0 12px 0 8px;
  color: var(--home-accent);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.category-bar-label i {
  font-size: .9rem;
}

.category-bar-item a {
  font-size: .82rem;
}

#recent-posts .recent-post-item {
  border: 1px solid var(--home-card-border);
  box-shadow: var(--home-card-shadow);
  border-radius: 18px;
}

#recent-posts .recent-post-item:hover {
  box-shadow: 0 18px 38px rgba(37, 52, 102, .12);
}

#aside-content .card-widget {
  border: 1px solid var(--home-card-border);
  box-shadow: var(--home-card-shadow);
  border-radius: 18px;
}

@media screen and (max-width: 900px) {
  .home-dashboard {
    grid-template-columns: 1fr;
  }

  .home-profile-panel {
    min-height: 0;
  }

  .home-topic-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 768px) {
  #page-header.full_page {
    height: 68vh;
    min-height: 480px;
  }

  #site-info {
    left: 0;
    padding: 0 24px;
    transform: none;
  }

  #site-info #site-title,
  #site-info #site-subtitle,
  #site-info #site_social_icons {
    text-align: center;
  }

  #home_top {
    margin-bottom: 12px;
  }

  .home-profile-panel,
  .home-featured-panel,
  .home-topics-panel {
    padding: 18px;
    border-radius: 16px;
  }

  .home-featured-grid {
    grid-template-columns: 1fr 1fr;
  }

  .home-featured-card.is-featured {
    grid-column: span 2;
    grid-row: auto;
  }

  .home-featured-card.is-featured .home-featured-cover {
    height: 138px;
  }

  .home-topic-grid {
    gap: 8px;
  }

  .home-topic-card {
    min-height: 112px;
    padding: 13px;
  }
}

/* Homepage article portal: the home page is intentionally full-width. */
#recent-posts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

#recent-posts #home_top,
#recent-posts #category-bar,
#recent-posts #pagination {
  grid-column: 1 / -1;
}

#recent-posts .recent-post-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  height: auto;
  min-height: 0;
  margin-top: 0 !important;
}

#recent-posts .recent-post-item .post_cover,
#recent-posts .recent-post-item .post_cover.right,
#recent-posts .recent-post-item .post_cover.left {
  order: 0;
  width: 100%;
  height: 230px;
}

#recent-posts .recent-post-item .recent-post-info,
#recent-posts .recent-post-item .recent-post-info.no-cover {
  width: 100%;
  padding: 20px 24px 24px;
}

#home_top {
  margin-bottom: 0;
}

.home-featured-portal {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(290px, .75fr);
  min-height: 430px;
  overflow: hidden;
}

.home-featured-main,
.home-featured-hero {
  min-width: 0;
}

.home-featured-hero {
  position: relative;
  display: block;
  min-height: 430px;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(135deg, #425aef, #7c4dff);
}

.home-featured-hero:hover {
  color: #fff;
}

.home-featured-hero-media,
.home-featured-hero-media img,
.home-featured-hero-media div {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.home-featured-hero-media img {
  object-fit: cover;
  transition: transform .6s ease;
}

.home-featured-hero:hover .home-featured-hero-media img {
  transform: scale(1.04);
}

.home-featured-hero-media:after {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 11, 30, .02) 20%, rgba(6, 11, 30, .82) 100%);
  content: '';
}

.home-featured-hero-overlay {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  padding: 34px;
}

.home-featured-hero-overlay .home-label {
  color: rgba(255, 255, 255, .82);
}

.home-featured-hero-overlay strong {
  max-width: 780px;
  margin-top: 8px;
  color: #fff;
  font-size: clamp(1.7rem, 3vw, 3rem);
  line-height: 1.16;
}

.home-featured-hero-meta {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  color: rgba(255, 255, 255, .82);
  font-size: .8rem;
}

.home-featured-side {
  display: flex;
  flex-direction: column;
  padding: 20px;
  background: var(--global-bg);
}

.home-side-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--home-card-border);
}

.home-featured-list-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 72px;
  padding: 11px 0;
  border-bottom: 1px solid var(--home-card-border);
}

.home-featured-list-item:last-child {
  border-bottom: 0;
}

.home-featured-list-thumb {
  width: 52px;
  height: 52px;
  overflow: hidden;
  border-radius: 13px;
  background: var(--home-accent-soft);
}

.home-featured-list-thumb img,
.home-featured-list-thumb div {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-featured-list-thumb.is-empty {
  display: grid;
  place-items: center;
  color: var(--home-accent);
  font-size: 1.15rem;
  font-weight: 800;
}

.home-featured-list-content {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.home-featured-list-content strong {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-highlight-color);
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.home-featured-list-content span {
  overflow: hidden;
  color: var(--home-accent);
  font-size: .72rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media screen and (max-width: 900px) {
  #recent-posts {
    grid-template-columns: 1fr;
  }

  .home-featured-portal {
    grid-template-columns: 1fr;
  }

  .home-featured-hero {
    min-height: 360px;
  }
}

@media screen and (max-width: 768px) {
  #recent-posts {
    gap: 12px;
  }

  #recent-posts .recent-post-item .post_cover,
  #recent-posts .recent-post-item .post_cover.right,
  #recent-posts .recent-post-item .post_cover.left {
    height: 205px;
  }

  #recent-posts .recent-post-item .recent-post-info,
  #recent-posts .recent-post-item .recent-post-info.no-cover {
    padding: 18px 18px 22px;
  }

  .home-featured-hero {
    min-height: 300px;
  }

  .home-featured-hero-overlay {
    padding: 22px;
  }

  .home-featured-hero-overlay strong {
    font-size: 1.5rem;
  }
}
