/*
 * ═══════════════════════════════════════════════════
 *  HOMEPAGE CARDS — "Astro-Industrial Terminal"
 *  Bold panels with structural depth
 * ═══════════════════════════════════════════════════
 */

:root {
  --hp-bg-deep: rgba(6,12,24,0.88);
  --hp-bg-hover: rgba(4,9,20,0.96);
  --hp-accent: #00D4AA;
  --hp-accent-dim: rgba(0,212,170,0.05);
  --hp-accent-border: rgba(0,212,170,0.09);
  --hp-text-bright: rgba(232,240,250,0.92);
  --hp-text-mid: rgba(200,214,232,0.38);
  --hp-text-dim: rgba(200,214,232,0.20);
  --hp-gold: #E8983E;
  --hp-gold-dim: rgba(232,152,62,0.08);
  --hp-card-radius: 10px;
  --hp-cat-radius: 12px;
}

/* ─── Section ─── */
.hp-section {
  max-width: 1000px;
  margin: 3rem auto;
  padding: 0 1.5rem;
}
.hp-section + .hp-section {
  padding-top: 2.5rem;
  border-top: 1px solid rgba(58,123,213,0.05);
  margin-top: 3.5rem;
}

/* ─── Section heading ─── */
.hp-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1.35rem;
  flex-wrap: wrap;
  position: relative;
}
.hp-section-head::after {
  content: '';
  flex: 1;
  min-width: 40px;
  height: 1px;
  background: linear-gradient(90deg, rgba(58,123,213,0.18), transparent);
}
.hp-section-title {
  font-family: 'Inter', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: #E8F0FA;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.01em;
}
.hp-section-icon { font-size: 1.15rem; }
.hp-section-count {
  font-size: 0.68rem;
  color: rgba(200,214,232,0.25);
  background: rgba(58,123,213,0.04);
  padding: 2px 9px;
  border-radius: 10px;
  border: 1px solid rgba(58,123,213,0.06);
}

/* ═══════════════════════════════════════════════════
   NEW GUIDES — image-less accent-bar cards
   ═══════════════════════════════════════════════════ */

.hp-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
@media (max-width: 820px) {
  .hp-card-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
}
@media (max-width: 480px) {
  .hp-card-grid { grid-template-columns: 1fr; }
}

/* ── Card base ── */
.hp-card {
  display: flex;
  text-decoration: none;
  color: inherit;
  background: var(--hp-bg-deep);
  border: 1px solid rgba(58,123,213,0.07);
  border-radius: var(--hp-card-radius);
  overflow: hidden;
  transition: all 0.35s cubic-bezier(0.33,1,0.68,1);
  position: relative;
  box-shadow:
    0 2px 10px rgba(0,0,0,0.25),
    inset 0 1px 0 rgba(255,255,255,0.015);
}

/* Dark inner trim */
.hp-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 -2px 4px rgba(0,0,0,0.3);
  z-index: 2;
}

/* ── Accent bar ── */
.hp-card-bar {
  width: 4px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  background: #00D4AA;
  opacity: 0.45;
  transition: opacity 0.25s, width 0.2s;
}

.hp-card-bar::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent 5%, rgba(0,212,170,0.2) 50%, transparent 95%);
}

/* ── Content ── */
.hp-card-inner {
  flex: 1;
  padding: 16px 16px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  z-index: 1;
}

/* ── Meta line ── */
.hp-card-meta-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hp-card-cat {
  font-size: 0.6rem;
  font-weight: 600;
  color: rgba(0,212,170,0.55);
  text-transform: lowercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  background: var(--hp-accent-dim);
  border: 1px solid rgba(0,212,170,0.07);
  border-radius: 4px;
}

.hp-card-new {
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--hp-gold);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  background: var(--hp-gold-dim);
  padding: 1px 7px;
  border-radius: 3px;
  border: 1px solid rgba(232,152,62,0.15);
  animation: hp-glow 2.8s ease-in-out infinite;
}

@keyframes hp-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232,152,62,0); }
  50% { box-shadow: 0 0 8px 0 rgba(232,152,62,0.10); }
}

/* ── Title ── */
.hp-card-title {
  font-size: 0.9rem;
  font-weight: 650;
  color: rgba(232,240,250,0.92);
  margin: 0;
  line-height: 1.3;
  letter-spacing: 0.01em;
  transition: color 0.2s;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Description ── */
.hp-card-desc {
  font-size: 0.72rem;
  color: var(--hp-text-mid);
  margin: 0;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

/* ── Footer ── */
.hp-card-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 9px;
  margin-top: auto;
  border-top: 1px solid rgba(255,255,255,0.03);
}

.hp-card-date {
  font-size: 0.6rem;
  color: var(--hp-text-dim);
  letter-spacing: 0.03em;
}

.hp-card-read {
  margin-left: auto;
  font-size: 0.68rem;
  color: #00D4AA;
  font-weight: 500;
  opacity: 0.3;
  transform: translateX(-6px);
  transition: opacity 0.3s, transform 0.3s;
  letter-spacing: 0.03em;
}

/* ── Hover ── */
.hp-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0,212,170,0.10);
  background: var(--hp-bg-hover);
  box-shadow:
    0 12px 35px rgba(0,0,0,0.40),
    0 0 0 1px rgba(0,212,170,0.03);
}
.hp-card:hover .hp-card-bar {
  opacity: 1;
  width: 5px;
}
.hp-card:hover .hp-card-title {
  color: #fff;
}
.hp-card:hover .hp-card-read {
  opacity: 1;
  transform: translateX(0);
}

/* ═══════════════════════════════════════════════════
   ARTICLE PAGE LAYOUT — fixed L1 + flex row for L2, content, ad
   ═══════════════════════════════════════════════════ */

/* ── Container: stacked (hero above content-row) ── */
.page-wrap.page-wrap-article {
  display: block;
}

/* ── Hero: full width ── */
.hero-wrap {
  width: 100%;
}

/* ── L1 fixed sidebar (position:fixed inherited from style.css .sidebar) ── */
.page-wrap-article .sidebar-l1 {
  width: 220px;
}

/* ── Shift article content right by L1 width ── */
.page-wrap.page-wrap-article {
  padding-left: 220px;
}

/* ── Content row: flex row below hero ── */
.content-row {
  display: flex;
  align-items: flex-start;
  width: 100%;
}

/* ── L2: 180px fixed, sticky ── */
.sidebar-l2 {
  width: 180px;
  min-width: 180px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  left: auto;
  bottom: auto;
  overflow-y: auto;
  background: rgba(6,12,24,0.40);
  border-right: 1px solid rgba(58,123,213,0.06);
}

/* ── Ad column: 160px fixed, sticky ── */
.ad-col-right {
  width: 160px;
  min-width: 160px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  left: auto;
  bottom: auto;
  padding: 24px 8px;
  order: 4;
}
.ad-sticky-wrap {
  position: sticky;
  top: 24px;
}

/* ── Main content: flex-grow ── */
.page-wrap-article .main-area {
  flex: 1;
  min-width: 0;
  margin-left: 0;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .sidebar-l2,
  .ad-col-right { display: none; }
}
@media (max-width: 768px) {
  .sidebar-l1 { display: none; }
  .ad-col-right { display: none; }
  .content-body-fixed { padding: 1.5rem; }
  .hero-sub-page { padding: 1.5rem 1.2rem; min-height: 120px; }
}

/* ── L1 nav link styling ── */
.l1-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px 8px 16px;
  text-decoration: none;
  color: rgba(200,214,232,0.50);
  font-size: 0.78rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all 0.15s;
  border-radius: 0 6px 6px 0;
  margin: 1px 8px 1px 0;
}
.l1-link:hover {
  color: rgba(232,240,250,0.80);
  background: rgba(0,212,170,0.04);
  border-left-color: rgba(0,212,170,0.20);
}
.l1-link.active {
  color: #E8F0FA;
  background: rgba(0,212,170,0.06);
  border-left-color: #00D4AA;
}
.l1-name { flex: 1; }
.l1-count {
  font-size: 0.62rem;
  color: rgba(200,214,232,0.20);
  background: rgba(255,255,255,0.03);
  padding: 1px 6px;
  border-radius: 6px;
}
.l1-link.active .l1-count {
  color: rgba(0,212,170,0.50);
  background: rgba(0,212,170,0.06);
}

/* ── L2 nav link styling ── */
.sidebar-l2-inner {
  padding: 16px 4px 16px 0;
}
.l2-section-label {
  font-size: 0.6rem;
  font-weight: 700;
  color: rgba(200,214,232,0.22);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0 0 8px 14px;
}
.l2-link {
  display: block;
  padding: 5px 8px 5px 14px;
  text-decoration: none;
  color: rgba(200,214,232,0.30);
  font-size: 0.7rem;
  font-weight: 400;
  border-left: 2px solid transparent;
  transition: all 0.12s;
  border-radius: 0 4px 4px 0;
  margin-right: 4px;
}
.l2-link:hover {
  color: rgba(232,240,250,0.55);
  background: rgba(255,255,255,0.02);
  border-left-color: rgba(58,123,213,0.12);
}
.l2-link.active {
  color: #00D4AA;
  background: rgba(0,212,170,0.03);
  border-left-color: #00D4AA;
}

/* ── Hero sub-page (article pages) ── */
.hero-sub-page {
  position: relative;
  padding: 2.4rem 2rem 1.8rem;
  background-image: var(--sub-hero-bg);
  background-size: cover;
  background-position: center 40%;
  background-color: #0a1222;
  min-height: 150px;
  display: flex;
  align-items: flex-end;
}
.hero-sub-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(6,10,18,0.85) 0%, rgba(6,10,18,0.60) 50%, rgba(6,10,18,0.25) 100%);
  pointer-events: none;
}
.hero-sub-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
}
.hero-title-sub {
  font-size: 1.45rem;
  font-weight: 700;
  color: rgba(232,240,250,0.96);
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}
.hero-desc-sub {
  font-size: 0.85rem;
  color: rgba(200,214,232,0.50);
  margin: 0;
  line-height: 1.5;
}

/* ── Content body fixed variant ── */
.content-body-fixed {
  padding: 2rem 2.5rem 3rem;
  max-width: 900px;
}



/* ═══════════════════════════════════════════════════
   CATEGORY — image + bottom text panel
   ═══════════════════════════════════════════════════ */

.hp-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
@media (max-width: 640px) {
  .hp-cat-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
}
@media (max-width: 420px) {
  .hp-cat-grid { grid-template-columns: 1fr; }
}

/* ── Card ── */
.hp-cat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border-radius: var(--hp-cat-radius);
  overflow: hidden;
  min-height: 240px;
  transition: all 0.4s cubic-bezier(0.33,1,0.68,1);
  border: 1px solid rgba(58,123,213,0.07);
  box-shadow:
    0 2px 14px rgba(0,0,0,0.18);
}

/* Dark inner trim */
.hp-cat-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 -3px 6px rgba(0,0,0,0.25);
  z-index: 5;
}

/* ── Background image ── */
.hp-cat-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 30%;
  background-color: #0A1222;
  transition: transform 0.6s ease;
  z-index: 0;
}

/* ── Gradient overlay ── */
.hp-cat-frost {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    180deg,
    rgba(6,10,18,0.15) 0%,
    rgba(6,10,18,0.40) 30%,
    rgba(6,10,18,0.60) 50%,
    rgba(6,10,18,0.75) 65%,
    rgba(6,10,18,0.88) 80%,
    rgba(6,10,18,0.95) 100%
  );
}

/* ── Bottom text panel ── */
.hp-cat-body {
  position: relative;
  z-index: 4;
  margin-top: auto;
  padding: 1.15rem 1.3rem 1.05rem;
  background: linear-gradient(
    180deg,
    rgba(8,14,26,0.50) 0%,
    rgba(8,14,26,0.78) 20%,
    rgba(8,14,26,0.90) 55%,
    rgba(8,14,26,0.94) 100%
  );
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border-top: 1px solid rgba(58,123,213,0.05);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.hp-cat-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 3px;
}

.hp-cat-icon {
  font-size: 1.05rem;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.35);
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.03);
  flex-shrink: 0;
  transition: background 0.25s;
}

.hp-cat-name {
  font-family: 'Inter', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: rgba(232,240,250,0.95);
  margin: 0;
  letter-spacing: 0.01em;
}

.hp-cat-desc {
  font-size: 0.75rem;
  color: rgba(200,214,232,0.55);
  line-height: 1.45;
  margin: 0;
}

.hp-cat-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 7px;
}

.hp-cat-count {
  font-size: 0.62rem;
  color: rgba(200,214,232,0.30);
  background: rgba(0,0,0,0.25);
  padding: 2px 10px;
  border-radius: 8px;
}

.hp-cat-arrow {
  margin-left: auto;
  font-size: 0.72rem;
  color: #00D4AA;
  font-weight: 600;
  opacity: 0.5;
  transition: opacity 0.3s, transform 0.3s;
  letter-spacing: 0.02em;
}

/* ── Hover ── */
.hp-cat-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0,212,170,0.08);
  box-shadow:
    0 16px 44px rgba(0,0,0,0.35),
    0 0 0 1px rgba(0,212,170,0.03);
}
.hp-cat-card:hover .hp-cat-img {
  transform: scale(1.07);
}
.hp-cat-card:hover .hp-cat-arrow {
  opacity: 1;
  transform: translateX(6px);
}
.hp-cat-card:hover .hp-cat-icon {
  background: rgba(0,212,170,0.06);
}

/* ═══════════════════════════════════════════════════
   LINK ROW
   ═══════════════════════════════════════════════════ */

.hp-link-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
@media (max-width: 480px) {
  .hp-link-row { grid-template-columns: 1fr 1fr; }
}

.hp-link-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0.8rem 1rem;
  background: rgba(8,14,28,0.55);
  border: 1px solid rgba(58,123,213,0.06);
  border-radius: 8px;
  text-decoration: none;
  color: rgba(200,214,232,0.40);
  font-size: 0.8rem;
  transition: all 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.10);
}
.hp-link-card:hover {
  border-color: rgba(58,123,213,0.15);
  color: #E8F0FA;
  background: rgba(8,14,28,0.72);
  transform: translateY(-2px);
  box-shadow: 0 4px 18px rgba(0,0,0,0.22);
}
.hp-link-icon {
  font-size: 1rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}
