/* ==========================================================================
   ImOmI 静态站 · 补充样式
   原站主题 Autumn-Pro 6.1 的样式在 style-6.1.css 里（保持原样未改），
   这里只补三类东西：
   1) 原主题靠 JavaScript 生成、我们用原生实现的部分（首页轮播、搜索层、移动端抽屉）
   2) 原主题里由 WordPress 输出、我们改成静态后的新结构（评论列表、归档页、上下篇）
   3) 少量像素级修补
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 首页大图轮播（原站是 owl-carousel，这里用 scroll-snap 原生滚动）
   -------------------------------------------------------------------------- */
.autumn_module_slider_center {
  background: #f4f4f4;
  padding: 30px 0 10px;
}

.imomi-hero {
  align-items: flex-start;
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 10px;
}
.imomi-hero::-webkit-scrollbar { display: none; }

.imomi-hero-slide {
  position: relative;
  flex: 0 0 46%;
  height: 340px;
  scroll-snap-align: center;
  border-radius: 4px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-color: #1a1a1a;
  color: #fff;
}
.imomi-hero-slide:before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, .72), rgba(0, 0, 0, .18) 60%, transparent);
}
.imomi-hero-slide .entry-wrapper {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 28px;
  z-index: 2;
}
.imomi-hero-slide .entry-category a {
  display: inline-block;
  margin: 0 6px 8px 0;
  padding: 2px 10px;
  font-size: 12px;
  line-height: 20px;
  color: #fff;
  background: var(--accent-color);
  border-radius: 20px;
}
.imomi-hero-slide .entry-title {
  font-size: 22px;
  line-height: 1.45;
  font-weight: 700;
  margin: 0 0 10px;
}
.imomi-hero-slide .entry-title a { color: #fff; }
.imomi-hero-slide .entry-excerpt {
  font-size: 13px;
  line-height: 1.8;
  color: rgba(255, 255, 255, .82);
  margin-bottom: 12px;
  max-height: 3.6em;
  overflow: hidden;
}
.imomi-hero-slide .entry-footer a {
  font-size: 12px;
  color: rgba(255, 255, 255, .75);
}

.imomi-hero-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 6px 0 12px;
}
.imomi-hero-dots button {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #c9c9c9;
  cursor: pointer;
  transition: background .2s, transform .2s;
}
.imomi-hero-dots button.is-active { background: #f0151f; transform: scale(1.25); }

@media (max-width: 991px) {
  .imomi-hero-slide { flex: 0 0 82%; min-height: 280px; }
  .imomi-hero-slide .entry-wrapper { padding: 20px; }
  .imomi-hero-slide .entry-title { font-size: 18px; }
}

/* --------------------------------------------------------------------------
   2. 搜索层（原站是主题 JS 生成的弹窗）
   -------------------------------------------------------------------------- */
.search-box {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  background: rgba(20, 20, 20, .88);
}
.search-box.is-open { display: flex; }
.search-box-inner {
  position: relative;
  width: min(680px, 92vw);
  background: #fff;
  border-radius: 6px;
  padding: 26px 26px 12px;
}
.search-box .search-form { position: relative; }
.search-box input[type="search"] {
  width: 100%;
  height: 46px;
  padding: 0 44px 0 14px;
  font-size: 15px;
  border: 1px solid #e6e6e6;
  border-radius: 4px;
  outline: none;
}
.search-box input[type="search"]:focus { border-color: #f0151f; }
.search-box .search-form i {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
}
.search-results {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  max-height: 52vh;
  overflow-y: auto;
}
.search-results li a {
  display: block;
  padding: 10px 6px;
  border-bottom: 1px solid #f2f2f2;
  font-size: 14px;
  color: #333;
}
.search-results li a:hover { color: #f0151f; }
.search-results li span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: #aaa;
}
.search-close {
  position: absolute;
  top: -42px;
  right: 0;
  color: #fff;
  font-size: 24px;
}

/* --------------------------------------------------------------------------
   3. 移动端抽屉菜单
   -------------------------------------------------------------------------- */
.mobile-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 78vw;
  max-width: 320px;
  z-index: 9998;
  padding: 24px 20px;
  background: #fff;
  box-shadow: 4px 0 20px rgba(0, 0, 0, .12);
  overflow-y: auto;
  transform: translateX(-102%);
  transition: transform .28s ease;
}
.mobile-drawer.is-open { transform: translateX(0); }
.mobile-drawer ul { list-style: none; margin: 0; padding: 0; }
.mobile-drawer > ul > li { border-bottom: 1px solid #f2f2f2; }
.mobile-drawer a {
  display: block;
  padding: 12px 2px;
  font-size: 15px;
  color: #333;
}
.mobile-drawer ul ul a { padding-left: 16px; font-size: 14px; color: #666; }
body.drawer-open { overflow: hidden; }

@media (min-width: 992px) {
  .mobile-drawer { display: none; }
}

/* --------------------------------------------------------------------------
   4. 评论（原站评论由 WordPress 输出，这里是自己渲染的历史存档）
   -------------------------------------------------------------------------- */
.comments-area {
  margin: 40px 0 20px;
  padding: 30px;
  background: #fff;
  border-radius: 4px;
}
.comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.comment-list .comment {
  padding: 16px 0;
  border-top: 1px solid #f2f2f2;
}
.comment-meta {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
}
.comment-author { font-weight: 700; color: #1a1a1a; }
.comment-date { font-size: 12px; color: #aaa; }
.comment-content {
  font-size: 14px;
  line-height: 1.9;
  color: #444;
  word-break: break-word;
}
.comment-content p { margin: 0 0 .6em; }
.comment-closed {
  margin-top: 18px;
  font-size: 12px;
  color: #aaa;
}

/* --------------------------------------------------------------------------
   5. 文章页零件：标签、上下篇
   -------------------------------------------------------------------------- */
.entry-tags {
  margin: 26px 0 0;
  padding: 0 30px 26px;
}
.entry-tags a {
  display: inline-block;
  margin: 4px 6px 4px 0;
  padding: 3px 12px;
  font-size: 12px;
  color: #666;
  border: 1px solid #e6e6e6;
  border-radius: 20px;
}
.entry-tags a:hover { color: #f0151f; border-color: #f0151f; }

.post-navigation {
  display: flex;
  gap: 16px;
  margin: 0 0 10px;
}
.post-navigation > div {
  flex: 1 1 0;
  padding: 18px 20px;
  background: #fff;
  border-radius: 4px;
}
.post-navigation > div span {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: #aaa;
}
.post-navigation .nav-next { text-align: right; }
.post-navigation a { font-size: 14px; color: #333; }
.post-navigation a:hover { color: #f0151f; }

/* --------------------------------------------------------------------------
   6. 分类 / 标签 / 归档列表页
   -------------------------------------------------------------------------- */
.term-bar {
  padding: 26px 30px;
  margin-bottom: 20px;
  background: #fff;
  border-radius: 4px;
}
.term-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
}
.term-count { font-size: 13px; color: #aaa; }

.term-list { background: #fff; border-radius: 4px; padding: 10px 26px; }
.term-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f2f2f2;
}
.term-row:last-child { border-bottom: 0; }
.term-row a { color: #333; }
.term-row a:hover { color: #f0151f; }

.archive-list { background: #fff; border-radius: 4px; padding: 12px 26px 26px; }
.archive-year h4 {
  margin: 22px 0 8px;
  font-size: 18px;
  color: #f0151f;
  font-weight: 700;
}
.archive-year ul { list-style: none; margin: 0; padding: 0; }
.archive-year li {
  display: flex;
  gap: 14px;
  padding: 7px 0;
  border-bottom: 1px dashed #f0f0f0;
}
.archive-date { color: #aaa; font-size: 13px; font-variant-numeric: tabular-nums; }
.archive-year a { color: #333; }
.archive-year a:hover { color: #f0151f; }

.notfound { background: #fff; border-radius: 4px; padding: 80px 30px; text-align: center; }
.notfound h1 { font-size: 72px; margin: 0 0 10px; color: #f0151f; }

/* --------------------------------------------------------------------------
   7. 修补：正文图片、TOC 开关、分享反馈
   -------------------------------------------------------------------------- */
.entry-content img { max-width: 100%; height: auto; }
.entry-content figure { margin: 0 0 1.4em; }
.entry-content figcaption { font-size: 13px; color: #999; text-align: center; }

#toc.is-collapsed ul { display: none; }
#toc .toc-controller { cursor: pointer; }

.share-tip {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%) translateY(10px);
  padding: 10px 18px;
  font-size: 13px;
  color: #fff;
  background: rgba(20, 20, 20, .88);
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 10000;
}
.share-tip.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }

.section-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 25px;
  position: relative;
  line-height: 1;
}
.section-title span {
  border-bottom: 2px solid #f0151f;
  display: inline-block;
  padding-bottom: 8px;
}

/* 原站是在 WordPress 自定义器里把 --accent-color 改成了珊瑚色 #f16b6f（archive.org 的原 HTML 里有这行内联样式），
   主题自带的是青绿 #519f97，这里还原回去。 */
:root { --accent-color: #f16b6f; }
.section-title span { border-bottom-color: var(--accent-color); }

/* ---------- 移动端修正 ---------- */
img, iframe, video { max-width: 100%; }
.entry-title, .entry-excerpt, .comment-content { overflow-wrap: anywhere; }

@media (max-width: 991px) {
  .col-lg-9, .col-lg-3 { flex: 0 0 100%; max-width: 100%; }
  .widget-area { margin-top: 30px; }
}

@media (max-width: 767px) {
  .posts-wrapper .grid-item { flex: 0 0 100%; max-width: 100%; }
  .imomi-hero-slide { flex: 0 0 88%; }
  .imomi-hero { padding: 0 10px; }
  .entry-header .entry-title { font-size: 22px; }
  .site-header .container { padding-left: 10px; padding-right: 10px; }
}
