/* Post rank — head / tabs / rank badge / pager on post-static cards */

.post-rank-static .post-crumb__current {
  color: var(--post-muted);
}

.post-rank-panel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  align-self: stretch;
  gap: 18px;
}

.post-rank-tabs {
  display: flex;
  align-items: center;
  align-self: stretch;
  gap: 18px;
}

.post-rank-tab {
  appearance: none;
  border: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  padding: 12px 24px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--post-muted);
  font-size: 18px;
  line-height: 24px;
  font-weight: 400;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  box-sizing: border-box;
  text-decoration: none;
}

.post-rank-alert {
  padding: 12px 16px;
  border-radius: 8px;
  background: rgba(255, 80, 80, 0.12);
  color: #ff8a8a;
  font-size: 14px;
  line-height: 20px;
}

.post-rank-tab--active {
  background: rgba(255, 225, 32, 0.1);
  color: var(--post-accent, #ecd227);
}

/* Ranked cards: cover + text below (not channel overlay cards) */
.post-rank-static .post-card--ranked {
  aspect-ratio: auto;
  height: auto;
  padding-bottom: 0;
  overflow: visible;
  background: transparent;
  color: var(--post-text);
  border-radius: 0;
}

.post-rank-static .post-card--ranked .post-card__media {
  position: relative;
  inset: auto;
  border-radius: 20px;
}

.post-rank-static .post-card--ranked .post-card__body {
  position: static;
  z-index: auto;
}

.post-rank-static .post-card--ranked .post-card__meta {
  padding: 0;
  color: var(--post-muted);
  text-shadow: none;
}

.post-rank-static .post-card--ranked .post-card__title {
  padding: 0;
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: var(--post-text);
}

/* Rank badge */
.post-rank {
  position: absolute;
  z-index: 2;
  pointer-events: none;
}

.post-rank__num {
  font-weight: 400;
  text-align: center;
  line-height: 1;
}

/* Hot TOP badge — whole icon */
.post-rank__hot {
  position: absolute;
  z-index: 2;
  display: block;
  object-fit: contain;
  pointer-events: none;
}

/* ========== Visibility ========== */
@media (max-width: 768px) {
  .post-rank-only-pc {
    display: none !important;
  }
}

@media (min-width: 769px) {
  .post-rank-only-h5 {
    display: none !important;
  }
}

/* ========== H5 ========== */
@media (max-width: 768px) {
  .post-rank-static .post-view {
    padding: 12px 16px 24px;
  }

  .post-rank-static .post-inner {
    gap: 18px;
  }

  .post-rank-head {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    align-self: stretch;
    padding: 6px 12px;
    background: rgba(255, 225, 32, 0.1);
    border-radius: 6px;
  }

  .post-rank-static .post-crumb {
    font-size: 12px;
    line-height: 18px;
    color: var(--post-text);
  }

  .post-rank-static .post-crumb__current {
    color: var(--post-muted);
  }

  .post-rank-static .post-title {
    font-size: 14px;
    line-height: 20px;
    font-weight: 400;
  }

  .post-rank-tabs {
    gap: 6px;
  }

  .post-rank-tab {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    padding: 6px 12px;
    font-size: 12px;
    line-height: 18px;
  }

  /* H5: 2-col wrap (not waterfall) so rank rows stay aligned */
  .post-rank-static .post-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 7px;
    columns: unset;
  }

  .post-rank-static .post-card {
    width: calc((100% - 7px) / 2);
    margin: 0;
  }

  .post-rank-static .post-card--ranked {
    gap: 6px;
  }

  .post-rank-static .post-card--ranked .post-card__media {
    height: 0;
    padding-bottom: 49.404762%; /* 83 / 168 */
    border-radius: 9px;
  }

  .post-rank-static .post-card--ranked .post-card__body {
    gap: 2px;
  }

  .post-rank-static .post-card--ranked .post-card__title {
    order: 1;
    font-size: 12px;
    line-height: 18px;
    -webkit-line-clamp: 2;
  }

  .post-rank-static .post-card--ranked .post-card__meta {
    order: 2;
    font-size: 12px;
    line-height: 18px;
  }

  .post-rank__pc {
    display: none;
  }

  .post-rank__hot {
    top: 6px;
    left: 6px;
    width: 26px;
    height: 14px;
  }

  .post-rank {
    left: 0;
    bottom: 0;
    top: auto;
    right: auto;
    width: 25px;
    height: 20px;
    border-radius: 5px 0.83px 5px 0.83px;
    overflow: hidden;
  }

  .post-rank::before {
    content: "";
    position: absolute;
    inset: 0;
  }

  .post-rank--1::before {
    background: linear-gradient(225deg, #ffcd9a 0%, #e88a33 100%);
  }

  .post-rank--2::before {
    background: linear-gradient(225deg, #cce9ff 0%, #8da9bf 100%);
  }

  .post-rank--3::before {
    background: linear-gradient(225deg, #ffbfa4 0%, #d88867 100%);
  }

  .post-rank--4::before {
    background: linear-gradient(225deg, #878787 0%, #494949 100%);
  }

  .post-rank__num {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 15px;
    line-height: 20px;
    font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
  }
}

/* ========== PC ========== */
@media (min-width: 769px) {
  .post-rank-static .post-view {
    padding: 30px 200px 60px;
  }

  .post-rank-static .post-inner {
    gap: 30px;
  }

  .post-rank-head {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    align-self: stretch;
    padding: 24px 18px;
    background: rgba(255, 225, 32, 0.1);
    border-radius: 12px;
  }

  .post-rank-static .post-crumb {
    font-size: 18px;
    line-height: 24px;
    color: var(--post-text);
  }

  .post-rank-static .post-crumb__current {
    color: var(--post-muted);
  }

  .post-rank-static .post-title {
    font-size: 20px;
    line-height: 28px;
    font-weight: 400;
  }

  .post-rank-static .post-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }

  .post-rank-static .post-card--ranked {
    display: block;
    height: 0;
    padding-bottom: 49.2%; /* 369 / 750 */
    overflow: hidden;
    border-radius: 20px;
    background: var(--post-placeholder);
  }

  .post-rank-static .post-card--ranked .post-card__media {
    position: absolute;
    inset: 0;
    height: auto;
    padding-bottom: 0;
    border-radius: 20px;
  }

  .post-rank-static .post-card--ranked .post-card__body {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    gap: 12px;
    padding: 0;
    color: #fff;
  }

  .post-rank-static .post-card--ranked .post-card__meta {
    order: 0;
    padding: 0 24px;
    font-size: 16px;
    line-height: 22px;
    color: #fff;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.6);
  }

  .post-rank-static .post-card--ranked .post-card__title {
    order: 0;
    padding: 16px 24px;
    font-size: 18px;
    line-height: 24px;
    -webkit-line-clamp: 2;
    color: #fff;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }

  .post-rank__hot {
    top: 30px;
    left: 30px;
    width: 66px;
    height: 40px;
  }

  .post-rank {
    right: 30px;
    top: 30px;
    left: auto;
    bottom: auto;
    width: 44px;
    height: 52px;
  }

  .post-rank__pc {
    display: block;
    width: 44px;
    height: 52px;
    object-fit: contain;
  }

  .post-rank__num {
    position: absolute;
    left: 0;
    right: 0;
    top: 20px;
    color: #666;
    font-size: 18px;
    line-height: 20px;
    font-family: "Swis721 BlkCn BT", Impact, sans-serif;
  }

  .post-rank--1 .post-rank__num {
    color: #643f25;
  }

  .post-rank--2 .post-rank__num {
    color: #5d6c8c;
  }

  .post-rank--3 .post-rank__num {
    color: #be5e29;
  }

  .post-rank--4 .post-rank__num {
    color: #666;
  }

  /* ----- PC pager (same pattern as post-tag) ----- */
  .post-pager--pc {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 4px 0;
    align-self: center;
    overflow: hidden;
  }

  .post-pager__circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 999px;
    background: #3d3d3d;
    color: rgba(255, 255, 255, 0.55);
    font-size: 16px;
    line-height: 22px;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    overflow: hidden;
    box-sizing: border-box;
  }

  .post-pager__circle:disabled {
    opacity: 0.55;
    cursor: not-allowed;
  }

  .post-pager__circle--active {
    background: var(--post-accent, #ecd227);
    color: #3d3d3d;
    cursor: default;
  }

  .post-pager__circle img {
    display: block;
    width: 24px;
    height: 24px;
  }

  .post-pager__ellipsis {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 48px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 16px;
    line-height: 22px;
  }

  .post-pager__goto {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
  }

  .post-pager__goto-label {
    color: rgba(255, 255, 255, 0.55);
    font-size: 16px;
    line-height: 22px;
  }

  .post-pager__goto-input {
    width: 72px;
    height: 48px;
    border: 0;
    border-radius: 999px;
    background: #3d3d3d;
    color: #fff;
    font-size: 16px;
    line-height: 22px;
    text-align: center;
    font-family: inherit;
    box-sizing: border-box;
  }

  .post-pager__goto-btn {
    width: 96px;
    height: 48px;
    border: 0;
    border-radius: 999px;
    background: var(--post-accent, #ecd227);
    color: #3d3d3d;
    font-size: 16px;
    line-height: 22px;
    font-family: inherit;
    cursor: pointer;
  }
}

@media (min-width: 769px) and (max-width: 1600px) {
  .post-rank-static .post-view {
    padding-left: 48px;
    padding-right: 48px;
  }
}
