/* Blog index: layout, hero, search, grid, cards, pagination */

/* Sticky footer: no blank space below footer regardless of content length */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.blog-main {
  flex: 1;
  scroll-margin-top: var(--header-height, 5rem);
  padding-top: 0;
}

/* ---- Hero (title + tagline only) ---- */
.blog-hero-section {
  width: 100%;
  padding: calc(var(--header-height, 5rem) + 2rem) 2rem 1.75rem;
  text-align: center;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.blog-hero-inner {
  max-width: 42rem;
  margin: 0 auto;
}

.blog-hero-section h1 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  color: #051a61;
  margin: 0 0 0.75rem;
  line-height: 1.2;
}

.blog-hero-tagline {
  font-size: 1.125rem;
  color: #4a4a4a;
  line-height: 1.5;
  margin: 0;
}

/* ---- Search (above grid, not in hero) ---- */
.blog-search {
  margin: 0 0 1.5rem;
  text-align: left;
}

.blog-search-label {
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.blog-search-wrap {
  position: relative;
  width: 100%;
}

.blog-search-icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.125rem;
  height: 1.125rem;
  color: #666;
  opacity: 0.85;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.blog-search-icon svg {
  width: 100%;
  height: 100%;
}

.blog-search-input {
  width: 100%;
  padding: 0.625rem 1rem 0.625rem 2.5rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: #1a1a1a;
  background: #f8f9fc;
  border: 1px solid rgba(8, 44, 153, 0.12);
  border-radius: 10px;
  min-height: 2.75rem;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.blog-search-input::placeholder {
  color: #888;
}

.blog-search-input:hover {
  border-color: rgba(8, 44, 153, 0.25);
}

.blog-search-wrap:hover .blog-search-icon,
.blog-search-wrap:focus-within .blog-search-icon {
  color: #082c99;
  opacity: 1;
}

.blog-search-input:focus {
  outline: none;
  border-color: #082c99;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(8, 44, 153, 0.12);
}

.blog-search-no-results {
  text-align: center;
  color: #666;
  font-size: 1rem;
  margin: 0 0 1.5rem;
  padding: 1rem;
}

/* ---- Grid section ---- */
.blog-grid-section {
  padding: 2rem 0 3rem;
  background: #fff;
}

.blog-grid-container {
  max-width: 75rem;
  margin: 0 auto;
  padding: 0 2rem;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.75rem;
}

/* ---- Cards ---- */
.blog-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
  border: 1px solid rgba(8, 44, 153, 0.1);
  cursor: pointer;
  text-decoration: none;
  display: block;
}

.blog-card:hover {
  box-shadow: 0 12px 28px rgba(8, 44, 153, 0.12);
  border-color: rgba(8, 44, 153, 0.2);
  transform: translateY(-2px);
}

.blog-card-image {
  position: relative;
  height: 200px;
  background-size: cover;
  background-position: center;
}

.blog-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 50%, rgba(0, 0, 0, 0.08));
}

.blog-card-body {
  padding: 1.375rem;
}

.blog-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  gap: 0.5rem;
}

.blog-card-date {
  font-size: 0.8125rem;
  color: #666;
  font-weight: 500;
}

.blog-card-category {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #082c99;
  font-weight: 600;
  background: rgba(8, 44, 153, 0.08);
  padding: 0.25rem 0.625rem;
  border-radius: 6px;
}

.blog-card-title {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.125rem;
  font-weight: 600;
  color: #051a61;
  line-height: 1.35;
  margin: 0 0 0.5rem;
}

.blog-card-excerpt {
  font-size: 0.9375rem;
  color: #4a4a4a;
  line-height: 1.55;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 4.2em;
}

.blog-card-footer {
  padding-top: 1rem;
  margin-top: 0.75rem;
  border-top: 1px solid #eee;
}

.blog-read-more {
  font-size: 0.875rem;
  color: #082c99;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  transition: gap 0.2s ease;
}

.blog-card:hover .blog-read-more {
  gap: 0.5rem;
}

/* ---- Pagination ---- */
.blog-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.375rem;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(8, 44, 153, 0.1);
}

.blog-pagination a,
.blog-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #051a61;
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}

.blog-pagination a:hover {
  background: rgba(8, 44, 153, 0.08);
  color: #082c99;
}

.blog-pagination span.blog-pagination-current {
  background: #082c99;
  color: #fff;
}

.blog-pagination span.blog-pagination-ellipsis {
  color: #888;
  pointer-events: none;
}

/* ---- Responsive ---- */
@media (max-width: 62rem) {
  .blog-hero-section {
    padding: calc(var(--header-height, 5rem) + 1.5rem) 1.5rem 2rem;
  }
  .blog-hero-section h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
  }
  .blog-hero-tagline {
    font-size: 1rem;
  }
  .blog-grid-container {
    padding: 0 1.5rem;
  }
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
  .blog-card {
    border-radius: 10px;
  }
  .blog-card-image {
    height: 180px;
  }
  .blog-card-body {
    padding: 1.25rem;
  }
  .blog-card-title {
    font-size: 1.0625rem;
  }
  .blog-card-excerpt {
    font-size: 0.875rem;
  }
}

@media (max-width: 40rem) {
  .blog-hero-section {
    padding: calc(var(--header-height, 5rem) + 1.25rem) 1rem 1.75rem;
  }
  .blog-hero-section h1 {
    font-size: clamp(1.5rem, 5vw, 2rem);
  }
  .blog-hero-tagline {
    font-size: 0.9375rem;
  }
  .blog-search-input {
    min-height: 2.75rem;
    padding: 0.625rem 1rem 0.625rem 2.5rem;
  }
  .blog-grid-section {
    padding: 1.5rem 0 2.5rem;
  }
  .blog-grid-container {
    padding: 0 1rem;
  }
  .blog-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .blog-card {
    border-radius: 10px;
  }
  .blog-card-image {
    height: 160px;
  }
  .blog-card-body {
    padding: 1rem;
  }
  .blog-card-title {
    font-size: 1rem;
  }
  .blog-card-excerpt {
    font-size: 0.875rem;
    min-height: 3.9em;
  }
  .blog-card-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.375rem;
  }
  .blog-card-category {
    font-size: 0.625rem;
  }
  .blog-card-date {
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .blog-hero-inner {
    max-width: 100%;
  }
  .blog-grid-container {
    padding: 0 0.75rem;
  }
  .blog-grid {
    gap: 1rem;
  }
}
