/*
 * RedteaGO Blog Index —— 2026 官网重构设计稿（Figma node 2014:18048）的 1:1 实现。
 *
 * 数值都是画板（1440 宽、内容区 1200）里的真实尺寸；窄屏退回流式布局。
 * 全部选择器挂在 .rtg-blog 下，避免和 spicepress / Elementor 互相污染。
 */

/* 破框：短代码常被塞进主题/Elementor 的定宽容器，整块拉回视口宽度再自己排版。
 * body 上的 overflow-x 是为了吞掉 100vw 与滚动条宽度的那几个像素差。 */
body.rtg-blog-page {
  overflow-x: hidden;
}

.rtg-blog {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);

  --rtg-ink: #21201e;
  --rtg-ink-80: rgba(33, 32, 30, 0.8);
  --rtg-ink-50: rgba(33, 32, 30, 0.5);
  --rtg-ink-40: rgba(33, 32, 30, 0.4);
  --rtg-ink-10: rgba(33, 32, 30, 0.1);
  --rtg-card-shadow: 0 4px 24px 0 rgba(33, 32, 30, 0.1);

  font-family: Montserrat, Inter, system-ui, -apple-system, sans-serif;
  color: var(--rtg-ink);
  background: #fff;
  text-align: left;
}

.rtg-blog *,
.rtg-blog *::before,
.rtg-blog *::after {
  box-sizing: border-box;
}

/* 宿主主题（spicepress 用 #id 选择器）会把链接/表单控件改回自己的样子，
 * 这几条必须硬压，否则 CTA 文字被染成 ink、搜索框变成 45px 白底带边框。 */
.rtg-blog a,
.rtg-blog a:hover,
.rtg-blog a:focus,
.rtg-blog a:visited {
  text-decoration: none !important;
  color: inherit;
  box-shadow: none !important;
  border: 0;
}

.rtg-blog input,
.rtg-blog button {
  font-family: inherit;
  letter-spacing: normal;
  text-transform: none;
  min-height: 0;
}

.rtg-blog img {
  display: block;
  max-width: 100%;
  height: auto;
}

.rtg-blog p,
.rtg-blog h1,
.rtg-blog h2,
.rtg-blog h3 {
  margin: 0;
  padding: 0;
}

.rtg-blog .rtg-wrap {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 120px;
}

.rtg-blog .rtg-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ----------------------------------------------------------------- nav */

/* 这页自带设计稿那条导航，主题自己的 header 要藏掉，否则两条叠着。
 * spicepress 线上是 header.header-overlapped > nav.navbar-custom，本地干净装是裸的 nav.navbar-custom。 */
body.rtg-blog-has-nav header.header-overlapped,
body.rtg-blog-has-nav .navbar-custom {
  display: none !important;
}

.rtg-blog .rtg-nav {
  position: absolute;
  top: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  width: min(1214px, calc(100% - 40px));
  height: 52px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.4);
}

.rtg-blog .rtg-nav--static {
  position: relative;
  top: 0;
  margin: 26px auto 0;
  transform: none;
}

.rtg-blog .rtg-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 100%;
  padding: 0 20px;
  font-family: Poppins, Montserrat, system-ui, sans-serif;
}

.rtg-blog .rtg-nav__logo {
  display: block;
  flex: none;
  line-height: 0;
}

.rtg-blog .rtg-nav__logo img {
  width: 130px;
  height: 18px;
}

.rtg-blog .rtg-nav__menu {
  display: flex;
  align-items: center;
  gap: 43px;
}

.rtg-blog .rtg-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 14px;
  line-height: 21px;
  font-weight: 400;
  color: rgba(33, 32, 30, 0.6) !important;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s ease;
}

.rtg-blog .rtg-nav__link:hover,
.rtg-blog .rtg-nav__link:focus {
  color: var(--rtg-ink) !important;
}

.rtg-blog .rtg-nav__caret {
  width: 20px;
  height: 20px;
  flex: none;
  transform: rotate(90deg);
}

.rtg-blog .rtg-nav__group {
  position: relative;
}

/* Resource 下拉：纯 CSS，hover / 键盘聚焦都能开 */
.rtg-blog .rtg-nav__panel {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 180px;
  padding: 12px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px 0 rgba(33, 32, 30, 0.12);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
}

.rtg-blog .rtg-nav__group:hover .rtg-nav__panel,
.rtg-blog .rtg-nav__group:focus-within .rtg-nav__panel {
  opacity: 1;
  visibility: visible;
}

.rtg-blog .rtg-nav__panel a {
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 21px;
  color: rgba(33, 32, 30, 0.6) !important;
  white-space: nowrap;
}

.rtg-blog .rtg-nav__panel a:hover {
  background: rgba(33, 32, 30, 0.05);
  color: var(--rtg-ink) !important;
}

.rtg-blog .rtg-nav__side {
  display: flex;
  align-items: center;
  gap: 14px;
}

.rtg-blog .rtg-nav__meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  line-height: 22px;
  font-weight: 400;
  color: var(--rtg-ink-80);
  white-space: nowrap;
}

.rtg-blog .rtg-nav__globe {
  width: 20px;
  height: 20px;
  flex: none;
}

.rtg-blog .rtg-nav__divider {
  width: 1px;
  height: 18px;
  flex: none;
  background: var(--rtg-ink-40);
}

.rtg-blog .rtg-nav__search {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 15px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  line-height: 22px;
  color: rgba(33, 32, 30, 0.6) !important;
  white-space: nowrap;
  transition: background-color 0.2s ease;
}

.rtg-blog .rtg-nav__search:hover {
  background: rgba(255, 255, 255, 0.8);
}

/* 21px 图标框里放 15.8px 字形，和设计稿一致 */
.rtg-blog .rtg-nav__search-icon {
  width: 15.8px;
  height: 15.79px;
  flex: none;
  margin: 0 2.6px;
}

.rtg-blog .rtg-nav__login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 32px;
  flex: none;
  border-radius: 100px;
  background: #000;
  font-size: 14px;
  line-height: normal;
  font-weight: 500;
  color: #fff !important;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.rtg-blog .rtg-nav__login:hover {
  opacity: 0.85;
}

/* ---------------------------------------------------------------- hero */

.rtg-blog__hero {
  position: relative;
  width: 100%;
  height: 367px;
  background: linear-gradient(180deg, #a7c4ff 0%, #e9f0ff 61.058%, rgba(233, 240, 255, 0) 100%);
}

.rtg-blog .rtg-hero__title {
  position: absolute;
  top: 146px;
  left: 50%;
  transform: translateX(-50%);
  width: 516px;
  margin: 0;
  font-size: 62px;
  line-height: 82px;
  font-weight: 700;
  letter-spacing: 1.24px;
  text-align: center;
  color: var(--rtg-ink);
}

.rtg-blog .rtg-search {
  position: absolute;
  top: 288px;
  left: 50%;
  transform: translateX(-50%);
  display: block;
  width: 620px;
  height: 64px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 3px 10px 0 rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.rtg-blog .rtg-search__input {
  position: absolute;
  top: 0;
  left: 24px;
  width: 528px;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  outline: 0;
  background: transparent !important;
  box-shadow: none !important;
  font-family: inherit;
  font-size: 16px !important;
  line-height: 24px;
  font-weight: 500;
  color: var(--rtg-ink);
}

.rtg-blog .rtg-search__input::placeholder {
  color: var(--rtg-ink-40);
  opacity: 1;
}

.rtg-blog .rtg-search__btn {
  position: absolute;
  top: 8px;
  left: 564px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 24px;
  /* 主题/Elementor 会把 button 底色改成品牌蓝，硬压回 ink */
  background: var(--rtg-ink) !important;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.rtg-blog .rtg-search__btn:hover,
.rtg-blog .rtg-search__btn:focus {
  background: #000 !important;
}

.rtg-blog .rtg-search__btn svg {
  display: block;
  width: 22.57px;
  height: 22.55px;
}

/* ----------------------------------------------------------- featured */

.rtg-blog__featured {
  padding: 80px 0;
  background: #fff;
}

.rtg-blog .rtg-featured {
  position: relative;
  height: 400px;
  border-radius: 36px;
  overflow: hidden;
}

/* 卡片外形（含缺口与 1px 内描边）就是设计稿导出的那张 SVG */
.rtg-blog .rtg-featured__shape {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.rtg-blog .rtg-featured__body {
  position: relative;
  display: flex;
  height: 100%;
}

/* border-box 下 padding 算在宽里，所以基宽是 50(左内距) + 596(文本列) */
.rtg-blog .rtg-featured__text {
  flex: 0 0 646px;
  width: 646px;
  padding: 60px 0 0 50px;
}

.rtg-blog .rtg-featured__title {
  height: 68px;
  overflow: hidden;
  font-size: 24px;
  line-height: 36px;
  font-weight: 700;
  color: var(--rtg-ink) !important;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.rtg-blog .rtg-featured__excerpt {
  height: 72px;
  margin-top: 20px;
  overflow: hidden;
  font-size: 14px;
  line-height: 24px;
  font-weight: 500;
  color: var(--rtg-ink);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.rtg-blog .rtg-featured__meta {
  margin-top: 2px;
  font-size: 13px;
  line-height: 24px;
  font-weight: 400;
  color: var(--rtg-ink-40);
}

.rtg-blog .rtg-featured__cta {
  margin-top: 56px;
}

.rtg-blog .rtg-featured__media {
  flex: 0 0 404px;
  width: 404px;
  height: 300px;
  margin: 50px 50px 0 100px;
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(180deg, #ddd 0%, #777 100%);
}

.rtg-blog .rtg-featured__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ------------------------------------------------------------ buttons */

.rtg-blog .rtg-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 14px 30px;
  border-radius: 100px;
  background: var(--rtg-ink);
  color: #fff !important;
  font-family: inherit;
  font-size: 16px;
  line-height: 20px;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 0.2s ease;
}

.rtg-blog .rtg-pill:hover,
.rtg-blog .rtg-pill:focus {
  background: #000;
  color: #fff !important;
}

.rtg-blog .rtg-pill--lg {
  font-size: 20px;
}

.rtg-blog .rtg-pill--lg svg {
  display: block;
  width: 24px;
  height: 26px;
  flex: none;
}

/* -------------------------------------------------------------- lists */

.rtg-blog__list {
  padding: 100px 0;
  background: #fff;
}

.rtg-blog .rtg-heading {
  font-size: 48px;
  line-height: 55px;
  font-weight: 700;
  color: var(--rtg-ink);
}

.rtg-blog .rtg-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 50px 60px;
  margin-top: 30px;
}

.rtg-blog .rtg-card {
  position: relative;
  display: block;
  border-radius: 24px;
  overflow: hidden;
  background: #fff;
  /* !important 是为了压过链接重置里的 box-shadow:none —— 卡片本身就是个 <a> */
  box-shadow: var(--rtg-card-shadow) !important;
}

.rtg-blog .rtg-card__media {
  height: 207px;
  overflow: hidden;
  background: #a1a1a1;
}

.rtg-blog .rtg-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.rtg-blog .rtg-card:hover .rtg-card__media img {
  transform: scale(1.05);
}

.rtg-blog .rtg-card__body {
  position: relative;
  background: #fff;
  /* 设计稿里正文块自带一道向上的投影，压在图片下沿 */
  box-shadow: 0 -10px 15px 0 rgba(0, 0, 0, 0.25);
}

.rtg-blog .rtg-card__title {
  padding: 20px 20px 0;
  overflow: hidden;
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
  color: var(--rtg-ink-80);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

.rtg-blog .rtg-card__meta {
  position: absolute;
  left: 20px;
  bottom: 17px;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 400;
  color: var(--rtg-ink-50);
}

.rtg-blog .rtg-card--recent .rtg-card__body {
  height: 144px;
}

.rtg-blog .rtg-card--recent .rtg-card__title {
  -webkit-line-clamp: 3;
  max-height: 92px;
}

.rtg-blog .rtg-card--more .rtg-card__body {
  height: 119px;
}

.rtg-blog .rtg-card--more .rtg-card__title {
  -webkit-line-clamp: 2;
  max-height: 68px;
}

.rtg-blog .rtg-list__cta {
  display: flex;
  justify-content: center;
  margin-top: 60px;
}

.rtg-blog .rtg-list__more-heading {
  margin-top: 100px;
}

/* --------------------------------------------------------- pagination */

.rtg-blog .rtg-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 80px;
}

.rtg-blog .rtg-pagination__item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 35px;
  height: 35px;
  border-radius: 17.5px;
  font-family: Poppins, Montserrat, system-ui, sans-serif;
  font-size: 20px;
  line-height: normal;
  font-weight: 300;
  color: var(--rtg-ink) !important;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.rtg-blog .rtg-pagination__item:hover {
  background: var(--rtg-ink-10);
  color: var(--rtg-ink);
}

.rtg-blog .rtg-pagination__item.is-current {
  background: var(--rtg-ink);
  color: #fff !important;
}

.rtg-blog .rtg-pagination__dots {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  width: 35px;
  height: 35px;
  padding-bottom: 10px;
}

.rtg-blog .rtg-pagination__dots span {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--rtg-ink);
}

.rtg-blog .rtg-pagination__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex: none;
}

.rtg-blog .rtg-pagination__arrow svg {
  display: block;
  width: 11.9833px;
  height: 6.327px;
}

.rtg-blog .rtg-pagination__arrow--prev svg {
  transform: rotate(90deg);
}

.rtg-blog .rtg-pagination__arrow--next svg {
  transform: rotate(-90deg);
}

.rtg-blog .rtg-pagination__arrow.is-disabled {
  opacity: 0.3;
  pointer-events: none;
}

/* -------------------------------------------------------- responsive */

@media (max-width: 1279px) {
  .rtg-blog .rtg-wrap {
    padding: 0 40px;
  }

  /* 导航一行放不下 1214 了，先收菜单间距 */
  .rtg-blog .rtg-nav__menu {
    gap: 24px;
  }
}

/* 再窄就按「先丢次要入口」的顺序退：搜索胶囊 → 菜单/语言/货币，最后只留 logo + Login */
@media (max-width: 1120px) {
  .rtg-blog .rtg-nav__search {
    display: none;
  }
}

@media (max-width: 980px) {
  .rtg-blog .rtg-nav__menu,
  .rtg-blog .rtg-nav__meta,
  .rtg-blog .rtg-nav__divider {
    display: none;
  }

  .rtg-blog .rtg-nav__inner {
    justify-content: space-between;
  }
}

@media (max-width: 1279px) {

  .rtg-blog .rtg-featured {
    height: auto;
    border: 1px solid var(--rtg-ink-10);
    border-radius: 36px;
    background: linear-gradient(90deg, #fff 0%, #f9fcfe 100%);
  }

  /* 缺口卡外形只在画板宽度下精确，窄屏改用普通圆角卡 */
  .rtg-blog .rtg-featured__shape {
    display: none;
  }

  .rtg-blog .rtg-featured__body {
    flex-direction: row-reverse;
    align-items: flex-start;
    gap: 40px;
    padding: 40px;
  }

  .rtg-blog .rtg-featured__text {
    flex: 1 1 auto;
    width: auto;
    padding: 0;
  }

  /* 窄屏文本会多折一行，固定高度会切掉字底 */
  .rtg-blog .rtg-featured__title,
  .rtg-blog .rtg-featured__excerpt {
    height: auto;
  }

  .rtg-blog .rtg-featured__media {
    flex: 0 0 340px;
    width: 340px;
    height: 252px;
    margin: 0;
  }
}

@media (max-width: 900px) {
  .rtg-blog__hero {
    height: 300px;
  }

  .rtg-blog .rtg-hero__title {
    top: 100px;
    width: min(90%, 516px);
    font-size: 46px;
    line-height: 60px;
  }

  .rtg-blog .rtg-search {
    top: 210px;
    width: min(92%, 620px);
  }

  .rtg-blog .rtg-search__input {
    width: calc(100% - 96px);
  }

  .rtg-blog .rtg-search__btn {
    left: auto;
    right: 8px;
  }

  .rtg-blog .rtg-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 40px;
  }

  /* 堆叠时让配图在上，和下面的卡片列表一致 */
  .rtg-blog .rtg-featured__body {
    flex-direction: column-reverse;
    justify-content: flex-end;
  }

  .rtg-blog .rtg-featured__media {
    flex: 0 0 auto;
    width: 100%;
    height: 240px;
  }
}

@media (max-width: 640px) {
  .rtg-blog .rtg-wrap {
    padding: 0 20px;
  }

  .rtg-blog__hero {
    height: 260px;
  }

  /* 导航收成 logo + Login 后仍占 26..78，标题要让开 */
  .rtg-blog .rtg-hero__title {
    top: 100px;
    font-size: 34px;
    line-height: 44px;
    letter-spacing: 0.68px;
  }

  .rtg-blog .rtg-search {
    top: 168px;
    height: 56px;
  }

  .rtg-blog .rtg-search__btn {
    top: 6px;
    width: 44px;
    height: 44px;
  }

  .rtg-blog__featured {
    padding: 40px 0;
  }

  .rtg-blog__list {
    padding: 40px 0 60px;
  }

  .rtg-blog .rtg-featured__body {
    padding: 24px;
    gap: 24px;
  }

  .rtg-blog .rtg-featured__title {
    height: auto;
    font-size: 20px;
    line-height: 30px;
    -webkit-line-clamp: 3;
  }

  .rtg-blog .rtg-heading {
    font-size: 32px;
    line-height: 40px;
  }

  .rtg-blog .rtg-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }

  .rtg-blog .rtg-list__more-heading {
    margin-top: 60px;
  }

  .rtg-blog .rtg-pagination {
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 48px;
  }
}
