/* ==========================================================================
   BLOG SPECIFIC STYLES - datacentertraining.us
   Apple Liquid Glass design system — see /css/tokens.css for tokens.
   ========================================================================== */

.blog-page {
  background: var(--bg);
  min-height: 100vh;
}

.blog-container {
  width: 100%;
  max-width: var(--max-grid);
  margin: 0 auto;
  padding: 40px var(--pad-x, 22px) 80px;
}

/* Post pages use a narrower reading column than the listing grid */
.blog-container-read {
  max-width: 860px;
}

/* ============ HERO SECTION ============ */
.blog-hero {
  margin-bottom: 36px;
}

.blog-hero .eyebrow {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-link);
  margin-bottom: 12px;
}

.blog-hero h1 {
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -0.03em;
  line-height: 1.12;
  color: var(--text);
  margin: 0 0 12px;
}

.blog-hero p {
  color: var(--text-2);
  margin: 0;
  font-size: 16px;
  max-width: 640px;
  line-height: 1.65;
}

/* ============ CONTROLS BAR ============ */
.controls-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.search-input {
  flex: 1 1 260px;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-sheet, 16px);
  height: 44px;
  padding: 0 16px;
  box-shadow: var(--sh-card);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sort-select {
  flex: 0 0 auto;
  font-family: inherit;
  font-weight: 550;
  font-size: 13.5px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-sheet, 16px);
  height: 44px;
  padding: 0 16px;
  cursor: pointer;
  box-shadow: var(--sh-card);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-input:focus,
.sort-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-tint);
}

/* ============ POST CARDS ============ */
#posts-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  align-items: stretch;
}

#posts-list .empty-state {
  grid-column: 1 / -1;
}

.post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--sh-card);
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transition: transform 0.2s var(--ease-out-quart, ease), box-shadow 0.2s var(--ease-out-quart, ease);
}

.post-card-thumb {
  width: 100%;
  height: 250px;
  flex-shrink: 0;
  object-fit: cover;
  display: block;
}

.post-card-thumb--empty {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 32px;
  height: 32px;
  border-radius: var(--r-chip, 8px);
  background: rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
}

.post-card-thumb--empty svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.post-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 22px 26px 26px;
}

.post-card:hover {
  text-decoration: none;
  color: inherit;
  transform: translateY(-3px);
  box-shadow: var(--sh-lift);
}

.post-card .post-date {
  font-size: 11.5px;
  font-weight: 650;
  color: var(--accent-link);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.post-card h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.35;
  transition: color 0.15s ease;
}

.post-card:hover h2 {
  color: var(--accent-link);
}

@media (max-width: 768px) {
  #posts-list {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* ============ PAGINATION ============ */
.pagination {
  display: flex;
  justify-content: center;
  margin-top: 44px;
}

.pagination-list {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 4px;
  background: rgba(0,0,0,0.05);
  border-radius: var(--r-pill);
}

.pagination-list button {
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border: none;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text-body);
  font-weight: 550;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.pagination-list button:hover:not(:disabled):not(.active) {
  color: var(--text);
  background: rgba(0,0,0,0.06);
}

.pagination-list button.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 650;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.pagination-list button:disabled {
  color: var(--text-4);
  opacity: 0.6;
  cursor: not-allowed;
}

.pagination-list button.pagination-arrow svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pagination-ellipsis {
  min-width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-4);
  font-weight: 550;
  font-size: 13px;
}

.empty-state {
  color: var(--text-2);
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--sh-card);
  padding: 48px 24px;
  text-align: center;
}

.empty-state code {
  background: rgba(0,0,0,0.05);
  padding: 2px 6px;
  border-radius: var(--r-chip, 6px);
}

/* ============ POST DETAIL PAGE ============ */
.back-link {
  display: inline-flex;
  text-decoration: none;
  align-items: center;
  gap: 6px;
  margin-bottom: 22px;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-2);
  transition: color 0.15s ease;
}

.back-link:hover {
  color: var(--accent-link);
}

.post-header .post-date {
  font-size: 12px;
  font-weight: 650;
  color: var(--accent-link);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.post-header h1 {
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  margin: 8px 0 26px;
  font-size: clamp(28px, 3.5vw, 40px);
  line-height: 1.15;
}

.post-featured-image {
  margin: 0 0 32px;
}

.post-featured-image img {
  display: block;
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  border-radius: var(--r-card);
}

.post-content {
  background: var(--surface);
  border-radius: var(--r-panel);
  box-shadow: var(--sh-panel);
  padding: clamp(28px, 4vw, 48px);
}

.post-content p {
  margin: 0 0 20px;
  line-height: 1.85;
  font-size: 16px;
  color: var(--text-body);
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--r-thumb);
  margin: 24px 0;
}

.post-content h1,
.post-content h2,
.post-content h3 {
  color: var(--text);
  font-weight: 650;
  letter-spacing: -0.01em;
  margin-top: 36px;
  margin-bottom: 16px;
  line-height: 1.3;
}

.post-content h2 {
  font-size: 24px;
}

.post-content h3 {
  font-size: 19px;
}

.post-content h1:first-child,
.post-content h2:first-child,
.post-content h3:first-child {
  margin-top: 0;
}

.post-content ul,
.post-content ol {
  margin: 0 0 20px;
  padding-left: 24px;
}

.post-content ul {
  list-style: disc;
}

.post-content ol {
  list-style: decimal;
}

.post-content li {
  margin-bottom: 8px;
  line-height: 1.7;
  color: var(--text-body);
}

.post-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 24px 0;
}

.post-content table td,
.post-content table th {
  border-bottom: 1px solid var(--hairline);
  padding: 12px 16px;
}

.post-content blockquote {
  border-left: 3px solid var(--accent);
  margin: 24px 0;
  padding: 8px 24px;
  background: var(--accent-tint);
  border-radius: 0 var(--r-chip, 8px) var(--r-chip, 8px) 0;
  color: var(--text-body);
}

.post-content blockquote p:last-child {
  margin-bottom: 0;
}

.post-content .post-divider {
  border: none;
  height: 1px;
  margin: 40px 0;
  background: linear-gradient(to right, transparent, var(--faint) 20%, var(--faint) 80%, transparent);
}

.post-content .post-spacer {
  height: 28px;
}

.post-content .post-caption {
  font-size: 14px;
  font-style: italic;
  color: var(--text-3);
  margin: -8px 0 20px;
}

.post-content a {
  color: var(--accent-link);
}

.post-content .sources-list {
  list-style: none;
  padding-left: 0;
  margin-top: 16px;
}

.post-content .sources-list li {
  border-left: 3px solid var(--accent);
  padding: 6px 0 6px 16px;
  margin-bottom: 10px;
  list-style-type: none;
}

.post-content .sources-list a {
  font-weight: 600;
  color: var(--accent-link);
  text-decoration: underline;
}

.post-content .sources-list a:hover {
  color: var(--accent);
}

@media (max-width: 640px) {
  .blog-container {
    padding: 28px 16px 60px;
  }

  .post-content {
    padding: 26px 20px;
  }

  .post-card-thumb {
    height: 200px;
  }

  .post-card-body {
    padding: 18px 18px 22px;
  }
}
