/* =============================================================
   Blog — Public Styles
   Shares CSS variables from Styles.css (loaded first)
   ============================================================= */

/* ── Blog Hero ──────────────────────────────────────────────────────── */
.blog-hero {
  background: var(--charcoal-blue);
  color: #fff;
  padding: 5rem 2rem 4rem;
  text-align: center;
}

.blog-hero-inner {
  max-width: 700px;
  margin: 0 auto;
}

.blog-hero-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--tuscan-sun);
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.blog-hero-heading {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 1.2rem;
  color: #ffffff;
}

.blog-hero-sub {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.75);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ── Blog Listing ───────────────────────────────────────────────────── */
.blog-list-section {
  padding: 4rem 2rem 6rem;
}

.blog-list-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

/* ── Post Card ──────────────────────────────────────────────────────── */
.post-card {
  background: var(--background-white);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.post-card-image {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: var(--background-light);
}

.post-card-image-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--charcoal-blue), var(--verdigris));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: rgba(255,255,255,0.35);
}

.post-card-body {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.post-card-date {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--accent-color);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.post-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
}

.post-card-excerpt {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-footer {
  padding: 0 1rem 1rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.post-card-read-more {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-color);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* ── Skeleton / Loading ─────────────────────────────────────────────── */
.blog-loading {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  width: 100%;
}

@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}

.blog-skeleton {
  height: 260px;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--border-color) 25%, var(--background-light) 50%, var(--border-color) 75%);
  background-size: 1200px 100%;
  animation: shimmer 1.5s infinite;
}

/* ── Empty state ────────────────────────────────────────────────────── */
.posts-empty {
  text-align: center;
  padding: 5rem 2rem;
  color: var(--text-secondary);
  font-size: 1rem;
}

/* ── Individual Post Page ───────────────────────────────────────────── */
.post-back-bar {
  background: var(--background-white);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 2rem;
}

.post-back-inner {
  max-width: 780px;
  margin: 0 auto;
}

.post-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-color);
  text-decoration: none;
  transition: var(--transition);
}
.post-back-link:hover { color: var(--text-primary); }

.post-article {
  max-width: 780px;
  margin: 0 auto;
  padding: 3rem 2rem 6rem;
}

.post-header { margin-bottom: 2rem; }

.post-header-tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent-color);
  margin-bottom: 0.8rem;
  display: block;
}

.post-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.post-meta {
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.post-meta-sep { color: var(--border-color); }

.post-cover {
  width: 100%;
  border-radius: 12px;
  margin-bottom: 2.5rem;
  aspect-ratio: 16/9;
  object-fit: cover;
  box-shadow: var(--shadow-md);
}

.post-body {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-primary);
}

.post-body p {
  margin-bottom: 1.4rem;
}

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

/* ── Post skeleton ──────────────────────────────────────────────────── */
.post-loading {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.post-skeleton {
  border-radius: 8px;
  background: linear-gradient(90deg, var(--border-color) 25%, var(--background-light) 50%, var(--border-color) 75%);
  background-size: 1200px 100%;
  animation: shimmer 1.5s infinite;
}

.post-skeleton--title  { height: 3.5rem; width: 70%; }
.post-skeleton--meta   { height: 1rem; width: 40%; }
.post-skeleton--image  { height: 400px; }
.post-skeleton--body   { height: 1rem; }
.post-skeleton--short  { width: 55%; }

/* ── Post error ─────────────────────────────────────────────────────── */
.post-error {
  text-align: center;
  padding: 5rem 2rem;
  max-width: 500px;
  margin: 0 auto;
  color: var(--text-secondary);
}

/* ── Nav active state ───────────────────────────────────────────────── */
.nav-link--active {
  color: var(--tuscan-sun) !important;
  background: rgba(233,196,106,0.1) !important;
}

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .blog-hero { padding: 3.5rem 1.5rem 3rem; }
  .blog-list-section { padding: 2.5rem 1.25rem 4rem; }
  .post-article { padding: 2rem 1.25rem 4rem; }
  .posts-grid { grid-template-columns: 1fr; gap: 1.25rem; }
  .blog-loading { grid-template-columns: 1fr; }
}

/* ══ Comments Section ═══════════════════════════════════════════════════════ */
.comments-section {
  background: var(--background-light);
  border-top: 1px solid var(--border-color);
  padding: 3rem 2rem 5rem;
}

.comments-inner {
  max-width: 780px;
  margin: 0 auto;
}

.comments-heading {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 2rem;
}

.comments-count {
  font-weight: 500;
  color: var(--text-secondary);
}

/* ── Comment thread ─────────────────────────────────────────────────── */
.comments-empty {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.comment {
  display: flex;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.comment--reply {
  margin-top: 0.85rem;
  margin-bottom: 0;
}

.comment-replies {
  margin-top: 0.75rem;
  padding-left: 1.5rem;
  border-left: 2px solid var(--border-color);
}

.comment-avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  margin-top: 2px;
}

.comment-avatar--sm {
  width: 28px;
  height: 28px;
  font-size: 0.75rem;
}

.comment-content {
  flex: 1;
  min-width: 0;
}

.comment-meta {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.3rem;
  flex-wrap: wrap;
}

.comment-author {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
}

.comment-date {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.comment-body {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-primary);
  margin: 0 0 0.4rem;
  word-break: break-word;
}

.comment-reply-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-color);
  letter-spacing: 0.3px;
  transition: var(--transition);
}
.comment-reply-btn:hover { color: var(--text-primary); }

/* ── Comment forms ──────────────────────────────────────────────────── */
.comment-form-wrap {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.comment-form-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.1rem;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.comment-form--reply {
  margin-top: 0.85rem;
  padding: 1rem;
  background: var(--background-white);
  border: 1px solid var(--border-color);
  border-radius: 10px;
}

.reply-context {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0 0 0.6rem;
}

.comment-form-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.comment-form input,
.comment-form textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border-color);
  border-radius: 7px;
  background: var(--background-white);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: inherit;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.comment-form input:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: var(--accent-color);
}

.comment-form input::placeholder,
.comment-form textarea::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}

.comment-form textarea {
  resize: vertical;
  min-height: 90px;
}

.comment-form-footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.comment-form-error {
  font-size: 0.8rem;
  color: #c0392b;
  flex: 1;
}

.comment-submit-btn {
  padding: 0.55rem 1.3rem;
  background: var(--charcoal-blue);
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
  white-space: nowrap;
}
.comment-submit-btn:hover { background: var(--accent-color); }
.comment-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.comment-cancel-btn {
  padding: 0.55rem 1rem;
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 7px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}
.comment-cancel-btn:hover { border-color: var(--text-secondary); color: var(--text-primary); }

/* ── Responsive comments ────────────────────────────────────────────── */
@media (max-width: 640px) {
  .comments-section { padding: 2rem 1.25rem 3.5rem; }
  .comment-form-fields { grid-template-columns: 1fr; }
  .comment-replies { padding-left: 0.85rem; }
}
