/* ===== Home Page Styles ===== */

/* --- Header & Footer --- */
body.home-page header,
body.home-page footer {
    background-color: #3c486b;
    color: #e7ecf1;
}

body.home-page header h1 a {
    color: #e7ecf1;
    text-decoration: none;
}

body.home-page footer a {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.2s; 
}

body.home-page footer a:hover,
body.home-page footer a:focus {
    color: #f0f0f0;
    text-decoration: none;
    font-weight: 600;
}

header, footer {
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

aside.toc a {
    color: #485563ff;
    text-decoration: none;
    transition: color 0.2s, font-weight 0.2s;
}

aside.toc a:hover,
aside.toc a:focus {
    color: #3c486b;
    font-weight: 600;
}

header h1 {
    margin: 0;
    font-size: 24px;
}

/* --- Container Layout --- */
.container {
    display: flex;
    min-height: 80vh;
}

aside {
    width: 15%;
    background: #e0e6ee;
    padding: 20px;
    border-right: 1px solid #c3ccd7;
}

main {
    width: 85%;
    padding: 20px;
    background: #ffffff;
}

footer {
    text-align: center;
    font-size: 14px;
    color: #8893a0;
}

ul {
    padding-left: 20px;
}

ul li {
    margin-bottom: 10px;
}

/* --- Site Footer --- */
.site-footer {
    background-color: #3c486b;
    color: #ffffff;
    text-align: center;
    padding: 30px 20px;
    margin-top: 40px;
}

.site-footer .slogan {
    font-size: 16px;
    margin-bottom: 8px;
    color: #e4eaf0ff;
}

.site-footer a {
    color: #bcd2e8;
}

.site-footer a:hover {
    color: white;
}

/* --- Featured Banner --- */
.featured-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #dbe3ec;
    padding: 24px;
    border-radius: 16px;
    margin: 0 auto 50px auto;
    flex-wrap: wrap;
    gap: 16px;
    max-width: 1400px;
    width: 90%;
}

.featured-banner .featured-image img {
    width: 900px;
    max-width: 100%;
    height: 350px;
    object-fit: cover;
    object-position: center center;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.featured-banner .featured-text {
    max-width: 500px;
    flex: 1;
}

.featured-banner .featured-title {
    font-size: 2rem;
    margin-bottom: 12px;
}

.featured-banner .featured-title a {
    color: #3c486b;
    text-decoration: none;
}

.featured-banner .featured-author {
    font-weight: bold;
    color: #587ca1;
    margin-bottom: 16px;
}

.read-more a,
.featured-banner .btn {
    padding: 6px 12px;
    background-color: #003580;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    margin-top: 15px;
    display: inline-block;
}

.featured-banner .btn:hover {
    background-color: #0a50b1;
    color: #ffffff;
}

/* ===== Cards Section ===== */
.cards-section .grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* карточки растягиваются */
    gap: 20px;
    justify-content: center; /* центрирование карточек */
    width: 100%;
}

.cards-section .card {
    height: 420px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    background-color: #fff;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cards-section .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.cards-section .card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    margin-bottom: 10px;
    border-radius: 5px;
}

.cards-section .card h3 {
    margin: 10px 0 5px;
    font-size: 18px;
    color: #3c486b;
}

.cards-section .bio-meta {
    font-size: 12px;
    color: #667688;
    margin-bottom: 4px;
}

.cards-section .bio-excerpt {
    font-size: 14px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    overflow: hidden;
    margin-bottom: 16px;
}

.cards-section .read-more {
    text-align: right;
    margin-top: auto;
}

.cards-section .read-more a {
    display: inline-block;
    background-color: #1b3557;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    transition: background-color 0.3s, transform 0.2s;
}

.cards-section .read-more a:hover {
    background-color: #003580;
    transform: translateY(-2px);
    color: #fff;
}

/* ===== Category Page Wrapper (Main Cards Container) ===== */
body.home-page .category-page-wrapper {
    width: 90%;
    max-width: 1400px;
    margin: 0 auto 50px;
    padding: 0 20px;
    box-sizing: border-box;
}

/* ===== Featured Banner Hover Effect ===== */
body.home-page .featured-banner,
body.home-page .featured-banner .featured-image img,
body.home-page .featured-banner .featured-text {
    transition: all 0.3s ease;
}

body.home-page .featured-banner:hover {
    background-color: #cdd7e4;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

body.home-page .featured-banner:hover .featured-image img {
    transform: scale(1.03);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

body.home-page .featured-banner:hover .featured-text {
    transform: translateY(-5px);
}

/* ===== Pagination ===== */
.pagination-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 3rem;
  margin-bottom: 2rem;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.page-link {
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: #333;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  transition: all 0.3s ease;
  font-weight: 500;
}

.page-link:hover {
  background-color: #f8f9fa;
  border-color: #adb5bd;
  color: #495057;
}

.page-link.current {
  background-color: #007bff;
  border-color: #007bff;
  color: white;
  cursor: default;
}

.page-link.current:hover {
  background-color: #0056b3;
  border-color: #0056b3;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  html, body {
      overflow-x: hidden;
  }

  .pagination {
    gap: 0.25rem;
  }

  .page-link {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
  }

  .cards-section .grid {
      grid-template-columns: 1fr;
      padding: 0 10px;
      margin: 0 auto;
  }

  .cards-section .card {
      width: 100%;
      max-width: 100%;
      margin: 0 0 12px 0;
  }

  .cards-section img {
      max-width: 100%;
      height: auto;
      display: block;
  }
}
/* ===== Центрируем карточки на главной ===== */
body.home-page .cards-section .grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    width: 100%;
    max-width: 1400px;      /* как у баннера */
    margin: 0 auto;         /* центрируем сетку на странице */
    padding: 0 20px;        /* внутренние отступы */
    box-sizing: border-box;
}

body.home-page .cards-section .card {
    max-width: 320px;       /* ограничиваем карточку */
    margin: 0 auto;         /* центрируем карточку внутри колонки */
}
