/* ==========================================================================
   index.css — 首页专属样式
   --------------------------------------------------------------------------
   板块：焦点图轮播 / 新闻动态 / 通知公告 / 廉政教育·法规制度
   依赖：base.css（公共组件 .panel/.home-title/.date-block/.link-section/
          .back-top 已提升至其中）、header.css、footer.css
   ========================================================================== */

/* 白卡片（.panel）与栏目题头（.home-title）为公共组件，已提升至 base.css */

/* ------------------------------ 一、新闻区 ------------------------------- */
.news-section {
  display: grid;
  grid-template-columns: 560px 1fr;
  gap: 24px;
  padding-top: 32px;
  padding-bottom: 44px;
}

.news-panel {
  display: flex;
  flex-direction: column;
}

/* 焦点图轮播 */
.focus-carousel {
  position: relative;
  min-width: 0;                      /* grid 项：抑制内容最小宽度 */
  margin-left: 0;                    /* 抵消 .swiper-container 的 margin:auto——
                                        auto 外边距会禁用 grid 拉伸，使容器收缩为 slide 总宽 */
  margin-right: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  /* 不设 align-self：随网格行拉伸，与新闻动态面板保持等高 */
}

.carousel-track {
  height: 100%;                      /* 填满拉伸后的轮播高度，与新闻动态面板等高 */
}

/* Swiper 配置了 slideClass: 'slide'，swiper.min.css 的 .swiper-slide 布局规则
   不会命中，这里补齐横向排列必需的属性 */
.carousel-track .slide {
  flex-shrink: 0;
  width: 100%;
  height: 100%;
  position: relative;
}

.slide a {
  display: block;
  width: 100%;
  height: 100%;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 图底部标题条 */
.slide-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 30px 90px 12px 14px;    /* 右侧为圆点指示器留位 */
  background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, .72));
  color: #fff;
  font-size: 15px;
  line-height: 1.5;
}

/* 左右箭头：默认淡显，悬停轮播区时加强 */
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 6;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .32);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: .55;
  transition: opacity .25s ease, background-color .25s ease;
}

.carousel-arrow:hover {
  background: var(--red-700);
  opacity: 1;
}

.carousel-arrow:focus-visible { opacity: 1; }

.carousel-arrow--prev { left: 12px; }
.carousel-arrow--next { right: 12px; }

.focus-carousel:hover .carousel-arrow { opacity: 1; }

/* 圆点指示器 */
.carousel-dots {
  position: absolute;
  right: 14px;
  bottom: 12px;
  z-index: 6;
  display: flex;
  gap: 6px;
}

/* 圆点指示器：由 Swiper 生成 .swiper-pagination-bullet，样式对齐原 button 版本 */
.carousel-dots .swiper-pagination-bullet {
  width: 9px;
  height: 9px;
  margin: 0;                         /* 间距由 .carousel-dots 的 gap 控制 */
  opacity: 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, .55);
  transition: width .25s ease, background-color .25s ease;
}

.carousel-dots .swiper-pagination-bullet-active {
  width: 20px;
  border-radius: 5px;
  background: var(--gold);
}

/* 要闻头条 */
.news-headline {
  padding: 14px 16px;
  border-bottom: 1px dashed var(--line);
}

.news-headline__title a {
  display: block;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.55;
  color: var(--red-700);
}

.news-headline__title a:hover {
  color: var(--red-800);
}

.news-headline__excerpt {
  margin-top: 6px;
  font-size: 13px;
  color: var(--ink-500);
  line-height: 1.7;
}

.news-headline:hover .news-headline__excerpt {
  color: var(--red-700);
}

/* 新闻列表 */
.news-list {
  padding: 2px 16px 12px;
  flex: 1;
}

.news-list li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
}

.news-list li:last-child {
  border-bottom: none;
}

.news-list a {
  position: relative;
  flex: 1;
  min-width: 0;                     /* 允许 ellipsis 生效 */
  padding-left: 12px;
  font-size: 14px;
  color: var(--ink-700);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.news-list a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 5px;
  height: 5px;
  margin-top: -3px;
  border-radius: 50%;
  background: var(--red-700);
}

.news-list li:hover a,
.news-list li:hover time {
  color: var(--red-700);
}

.news-list time {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--ink-400);
  transition: color .2s ease;
}

/* ------------------------ 二、公告 / 廉政教育 / 法规制度 -------------------------- */
.notice-section {
  padding-bottom: 48px;
}

.notice-section .container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* 通知公告 */
.notice-list {
  padding: 4px 16px 14px;
}

.notice-item {
  padding: 14px 0;
}

.notice-item + .notice-item {
  border-top: 1px dashed var(--line);
}

.notice-item__link {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* 日期方块（.date-block）为公共组件，已提升至 base.css；条目链接挂 .link-block 即可联动 */

.notice-item__body {
  flex: 1;
  min-width: 0;
}

.notice-item__title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink-900);
  transition: color .2s ease;
}

.notice-item__link:hover .notice-item__title {
  color: var(--red-700);
}

/* 友情链接区（.link-section）与回到顶部按钮（.back-top）为公共组件，已提升至 base.css */

/* -------------------------------- 响应式 -------------------------------- */
@media (max-width: 992px) {
  /* 新闻区：轮播与新闻面板上下单列排布 */
  .news-section {
    grid-template-columns: 1fr;
  }

  .focus-carousel {
    height: auto;                    /* 独占一行时无参照高度，恢复固定比例 */
    aspect-ratio: 16 / 7;
  }

  /* 公告区：三栏改单栏 */
  .notice-section .container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .news-section {
    grid-template-columns: 1fr;
    padding-top: 24px;
    padding-bottom: 28px;
  }

  .focus-carousel {
    aspect-ratio: 4 / 3;
  }

  .notice-section {
    padding-bottom: 36px;
  }
}

@media (max-width: 480px) {
  .home-title h3 {
    font-size: 17px;
    letter-spacing: 1px;
  }

  .news-headline__title a {
    font-size: 16px;
  }
}

/* ==========================================================================
   导航下方横幅轮播（Swiper 4）— index.html .banner-section
   ========================================================================== */
.banner-swiper .swiper-slide img {
  display: block;
  width: 100%;
  height: 514px;
}

/* Swiper 默认圆点为黑色半透明、激活态为蓝色，与红色主题不符；
   改为白色圆点 + 金色激活态，与新闻区焦点图轮播的指示器样式一致 */
.banner-swiper .swiper-pagination-bullet {
  opacity: 1;
  background: rgba(255, 255, 255, .55);
}

.banner-swiper .swiper-pagination-bullet-active {
  background: var(--gold);
}

/* Swiper 默认箭头为蓝色 SVG，统一改为白色 */
.banner-swiper .swiper-button-prev,
.banner-swiper .swiper-button-next {
  filter: brightness(0) invert(1);
}

@media (max-width: 480px) {
  /* 小屏下横幅较矮，隐藏左右箭头，仅保留圆点指示器 */
  .banner-swiper .swiper-button-prev,
  .banner-swiper .swiper-button-next {
    display: none;
  }
}