/*
 * archive-post.css
 * Styles for the Blog Post Archive page (archive-post.php).
 * Requires style.css to be loaded first.
 */

/* ──────────────────────────────────────────
   ARCHIVE HERO
────────────────────────────────────────── */
.blog-hero {
  position: relative;
  overflow: hidden;
  padding: 64px 0 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.blog-hero-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 100% at 90% 50%, rgba(232,255,71,.06) 0%, transparent 65%),
    radial-gradient(ellipse 35% 70% at 5%  60%, rgba(41,214,181,.05) 0%, transparent 60%);
  pointer-events: none;
}

.blog-hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.02) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  pointer-events: none;
}

.blog-hero .container {
  position: relative;
  z-index: 2;
}

/* ── Hero breadcrumb ── */
.blog-hero .breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.blog-hero .breadcrumb a { transition: color .2s; }
.blog-hero .breadcrumb a:hover { color: var(--accent); }
.blog-hero .breadcrumb-sep { opacity: .35; }

/* ── Hero content row ── */
.blog-hero-content {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

.blog-hero-left { flex: 1; min-width: 280px; }

.blog-hero-eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent3);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.blog-hero-eyebrow::before {
  content: '';
  width: 24px;
  height: 2px;
  background: var(--accent3);
  flex-shrink: 0;
}

.blog-hero h1 {
  font-family: var(--ff-head);
  font-size: clamp(2.4rem, 5vw, 4rem);
  letter-spacing: .04em;
  line-height: 1;
  margin-bottom: 14px;
}

.blog-hero-desc {
  font-size: 14px;
  color: var(--muted);
  max-width: 520px;
  line-height: 1.75;
}

/* ── Hero stats ── */
.blog-hero-stats {
  display: flex;
  gap: 16px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.blog-stat {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 22px;
  text-align: center;
  min-width: 90px;
}

.blog-stat-val {
  font-family: var(--ff-head);
  font-size: 1.9rem;
  color: var(--accent);
  letter-spacing: .04em;
  line-height: 1;
}

.blog-stat-lbl {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 5px;
}

/* ──────────────────────────────────────────
   CATEGORY FILTER TABS
────────────────────────────────────────── */
.blog-cat-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  white-space: nowrap;
  position: sticky;
  top: 66px;   /* matches header height */
  z-index: 50;
}
.blog-cat-bar::-webkit-scrollbar { height: 3px; }

.blog-cat-inner {
  display: flex;
  align-items: stretch;
}

.blog-cat-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 14px 22px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
  text-decoration: none;
  flex-shrink: 0;
  cursor: pointer;
}
.blog-cat-tab:hover { color: var(--text); }
.blog-cat-tab.active { color: var(--accent3); border-bottom-color: var(--accent3); }

.blog-cat-count {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--surface2);
  color: var(--muted);
}
.blog-cat-tab.active .blog-cat-count {
  background: rgba(41,214,181,.15);
  color: var(--accent3);
}

/* ──────────────────────────────────────────
   MAIN ARCHIVE LAYOUT
────────────────────────────────────────── */
.blog-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
  padding: 52px 0 80px;
  align-items: start;
}

/* ──────────────────────────────────────────
   TOOLBAR (search + sort)
────────────────────────────────────────── */
.blog-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.blog-result-count {
  font-size: 13px;
  color: var(--muted);
  flex: 1;
  min-width: 0;
}
.blog-result-count strong { color: var(--text); }

.blog-search-wrap {
  position: relative;
  flex: 1;
  max-width: 300px;
}

.blog-search-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  stroke: var(--muted);
  fill: none;
  stroke-width: 2;
  pointer-events: none;
}

.blog-search-input {
  width: 100%;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 9px;
  padding: 9px 14px 9px 36px;
  font-family: var(--ff-body);
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border-color .2s;
}
.blog-search-input:focus { border-color: var(--accent3); }
.blog-search-input::placeholder { color: var(--muted); }

.blog-sort-select {
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 9px;
  padding: 9px 14px;
  font-family: var(--ff-body);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  outline: none;
  cursor: pointer;
  transition: border-color .2s, color .2s;
  appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a8099' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.blog-sort-select:focus { border-color: var(--accent3); color: var(--text); }

/* ──────────────────────────────────────────
   FEATURED POST (first post, large card)
────────────────────────────────────────── */
.post-featured {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 28px;
  transition: border-color .3s, transform .3s, box-shadow .3s;
  text-decoration: none;
  color: inherit;
}
.post-featured:hover {
  border-color: rgba(232,255,71,.2);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.post-featured-thumb {
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, #1d2133 0%, #111520 100%);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.post-featured-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.post-featured:hover .post-featured-thumb img { transform: scale(1.04); }
.post-featured-thumb svg {
  width: 80px;
  height: 80px;
  stroke: rgba(255,255,255,.1);
  fill: none;
  stroke-width: .6;
}
.post-featured-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background: var(--accent);
  color: #000;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 99px;
}

.post-featured-body {
  padding: 36px 36px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}

.post-featured-cat {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent3);
  background: rgba(41,214,181,.1);
  padding: 4px 12px;
  border-radius: 99px;
  border: 1px solid rgba(41,214,181,.2);
  align-self: flex-start;
}

.post-featured-title {
  font-family: var(--ff-head);
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  letter-spacing: .03em;
  line-height: 1.1;
  transition: color .2s;
}
.post-featured:hover .post-featured-title { color: var(--accent); }

.post-featured-excerpt {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.8;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-featured-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.post-featured-author {
  display: flex;
  align-items: center;
  gap: 9px;
}

.post-featured-ava {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent3), #0a7f6e);
  display: grid;
  place-items: center;
  font-family: var(--ff-head);
  font-size: .85rem;
  color: #000;
  flex-shrink: 0;
  overflow: hidden;
}
.post-featured-ava img { width: 100%; height: 100%; object-fit: cover; }
.post-featured-author-name { font-size: 12px; font-weight: 800; }

.post-featured-date {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
}
.post-featured-date svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2; }

.post-featured-read {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--muted);
}
.post-featured-read svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ──────────────────────────────────────────
   POST GRID
────────────────────────────────────────── */
.post-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

/* ── Standard post card ── */
.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .3s, box-shadow .3s, border-color .3s;
  text-decoration: none;
  color: inherit;
}
.post-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
  border-color: rgba(232,255,71,.15);
}

.post-card-thumb {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #1d2133 0%, #111520 100%);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.post-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.post-card:hover .post-card-thumb img { transform: scale(1.05); }
.post-card-thumb svg {
  width: 52px;
  height: 52px;
  stroke: rgba(255,255,255,.12);
  fill: none;
  stroke-width: .8;
}

.post-card-cat {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  background: rgba(41,214,181,.2);
  color: var(--accent3);
  padding: 3px 10px;
  border-radius: 99px;
  backdrop-filter: blur(8px);
}

.post-card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--muted);
}
.post-card-meta svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2; flex-shrink: 0; }
.post-card-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--border); }

.post-card-title {
  font-weight: 800;
  font-size: 15px;
  line-height: 1.4;
  color: var(--text);
  transition: color .2s;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card:hover .post-card-title { color: var(--accent); }

.post-card-excerpt {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.post-card-author {
  display: flex;
  align-items: center;
  gap: 8px;
}

.post-card-ava {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent3), #0a7f6e);
  display: grid;
  place-items: center;
  font-family: var(--ff-head);
  font-size: .7rem;
  color: #000;
  flex-shrink: 0;
  overflow: hidden;
}
.post-card-ava img { width: 100%; height: 100%; object-fit: cover; }
.post-card-author-name { font-size: 11px; font-weight: 700; color: var(--muted); }

.post-card-read-more {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent3);
  letter-spacing: .06em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: gap .2s;
}
.post-card:hover .post-card-read-more { gap: 8px; }
.post-card-read-more svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2.5; }

/* ── List-view variant (toggled by JS) ── */
.post-grid.view-list { grid-template-columns: 1fr; }
.post-grid.view-list .post-card {
  flex-direction: row;
}
.post-grid.view-list .post-card-thumb {
  aspect-ratio: 4/3;
  width: 220px;
  flex-shrink: 0;
}
.post-grid.view-list .post-card-body { padding: 22px 24px; }

/* ──────────────────────────────────────────
   EMPTY STATE
────────────────────────────────────────── */
.blog-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px;
  gap: 16px;
}
.blog-empty svg { opacity: .15; }
.blog-empty h3 {
  font-family: var(--ff-head);
  font-size: 1.6rem;
  letter-spacing: .04em;
  color: var(--text);
}
.blog-empty p { font-size: 14px; color: var(--muted); max-width: 380px; line-height: 1.7; }

/* ──────────────────────────────────────────
   PAGINATION
────────────────────────────────────────── */
.blog-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 44px;
  flex-wrap: wrap;
}

.blog-page-btn {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  transition: all .2s;
}
.blog-page-btn:hover { border-color: var(--accent3); color: var(--accent3); }
.blog-page-btn.active { background: var(--accent3); color: #000; border-color: var(--accent3); font-weight: 800; }
.blog-page-btn.disabled { opacity: .3; pointer-events: none; }
.blog-page-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.5; }

/* ──────────────────────────────────────────
   SIDEBAR
────────────────────────────────────────── */
.blog-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 118px; /* header + cat-bar */
}

.blog-sidebar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.blog-sidebar-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.blog-sidebar-head svg { width: 14px; height: 14px; stroke: var(--accent3); fill: none; stroke-width: 2; }

.blog-sidebar-body { padding: 16px 18px; }

/* ── Category list in sidebar ── */
.sidebar-cat-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-cat-item a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  transition: all .2s;
  text-decoration: none;
}
.sidebar-cat-item a:hover { color: var(--text); background: var(--surface2); }
.sidebar-cat-item.active a { color: var(--accent3); background: rgba(41,214,181,.06); font-weight: 800; }

.sidebar-cat-count {
  font-size: 10px;
  font-weight: 800;
  background: var(--surface2);
  padding: 2px 8px;
  border-radius: 99px;
  color: var(--muted);
}
.sidebar-cat-item.active .sidebar-cat-count {
  background: rgba(41,214,181,.15);
  color: var(--accent3);
}

/* ── Popular posts in sidebar ── */
.sidebar-post-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  align-items: flex-start;
}
.sidebar-post-item:last-child { border-bottom: none; padding-bottom: 0; }
.sidebar-post-item:hover .sidebar-post-title { color: var(--accent3); }

.sidebar-post-thumb {
  width: 60px;
  height: 48px;
  border-radius: 8px;
  background: linear-gradient(135deg, #1d2133, #111520);
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
}
.sidebar-post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-post-thumb svg { width: 20px; height: 20px; stroke: rgba(255,255,255,.15); fill: none; }

.sidebar-post-title {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--text);
  transition: color .2s;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sidebar-post-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

/* ── Tag cloud in sidebar ── */
.sidebar-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.sidebar-tag {
  font-size: 11px;
  font-weight: 700;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 5px 12px;
  border-radius: 7px;
  text-decoration: none;
  transition: all .2s;
}
.sidebar-tag:hover { border-color: var(--accent3); color: var(--accent3); background: rgba(41,214,181,.06); }

/* ── Newsletter in sidebar ── */
.sidebar-newsletter-input {
  width: 100%;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-family: var(--ff-body);
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border-color .2s;
  margin-bottom: 10px;
}
.sidebar-newsletter-input:focus { border-color: var(--accent3); }
.sidebar-newsletter-input::placeholder { color: var(--muted); }

/* ──────────────────────────────────────────
   VIEW TOGGLE
────────────────────────────────────────── */
.blog-view-toggle {
  display: flex;
  gap: 6px;
}

.blog-view-btn {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all .2s;
}
.blog-view-btn svg { width: 14px; height: 14px; stroke: var(--muted); fill: none; stroke-width: 1.8; }
.blog-view-btn.active { background: rgba(41,214,181,.1); border-color: var(--accent3); }
.blog-view-btn.active svg { stroke: var(--accent3); }

/* ──────────────────────────────────────────
   RESPONSIVE
────────────────────────────────────────── */
@media (max-width: 1024px) {
  .blog-layout { grid-template-columns: 1fr; }
  .blog-sidebar {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .post-featured { grid-template-columns: 1fr; }
  .post-featured-thumb { aspect-ratio: 21/9; }
}

@media (max-width: 768px) {
  .blog-hero-stats { display: none; }
  .blog-layout { padding: 36px 0 60px; }
  .post-grid { grid-template-columns: 1fr; }
  .post-grid.view-list .post-card { flex-direction: column; }
  .post-grid.view-list .post-card-thumb { width: 100%; aspect-ratio: 16/9; }
  .blog-sidebar { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .blog-hero h1 { font-size: 2.2rem; }
  .blog-toolbar { gap: 8px; }
  .blog-search-wrap { max-width: 100%; }
}
