.trim {
    position: relative;
    overflow: hidden;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    margin-left: auto;
    margin-right: auto;
}

.trim img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    -webkit-transform: translate(-50%, -50%);
    -ms-transform: translate(-50%, -50%);
    height: 100%;
}

@media (max-width: 767px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
        width: 100%;
    }
}

.channel-card-col {
    margin-bottom: 20px;
}

.channel-card {
    display: block;
    text-align: center;
    padding: 15px 10px;
    border-radius: 8px;
    transition: box-shadow .15s ease, transform .15s ease;
}

.channel-card:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.channel-card-title {
    margin: 10px 0 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-card {
    display: flex;
    gap: 20px;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.video-card-thumb {
    flex: 0 0 200px;
}

.video-card-thumb img {
    width: 100%;
    /* height:auto が無いと、CLS対策で付けた width/height 属性の height="90" が
       そのまま高さとして使われ、幅だけ伸びて画像が横に潰れる（本番で発生）。
       width だけをCSSで指定する場合は height:auto を必ず添えること */
    height: auto;
    border-radius: 6px;
    display: block;
}

.video-card-body {
    flex: 1 1 auto;
    min-width: 0;
}

.video-card-title {
    margin: 0 0 8px;
    font-size: 16px;
    line-height: 1.4;
}

.video-card-title a {
    color: #222;
}

.video-card-date {
    color: #888;
    font-size: 13px;
    margin-bottom: 8px;
}

.video-card-stats {
    font-size: 13px;
    color: #555;
    margin-bottom: 6px;
}

.video-card-channel {
    font-size: 13px;
    margin: 0;
}

@media (max-width: 575px) {
    .video-card {
        flex-direction: column;
        gap: 10px;
    }
    .video-card-thumb {
        flex: none;
        width: 100%;
    }
}

.frame-wrapper__video {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%;
    overflow: hidden;
    margin-bottom: 50px;
}

.frame-wrapper__video iframe {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}
/* ページャ (viewer/parts.html の pager マクロ) */
.viewer-pager {
    margin-top: 30px;
}

.viewer-pager .shop-pagination {
    list-style: none;
    margin: 0;
    padding: 10px 0;
    /* ページ数が多くても横にはみ出さず折り返す */
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3px;
}

.viewer-pager .shop-pagination > li {
    margin-right: 0;
}

.viewer-pager .shop-pagination > li > a,
.viewer-pager .shop-pagination > li > span {
    border: 1px solid #eee;
    color: #999999;
    display: block;
    font-size: 13px;
    height: 30px;
    line-height: 28px;
    min-width: 30px;
    padding: 0 4px;
    text-align: center;
}

.viewer-pager .shop-pagination > li.disabled > span {
    color: #ddd;
    background: #fafafa;
}

.viewer-pager .shop-pagination > li.active > a {
    border-color: #ff7f00;
    color: #ff7f00;
}

.video-list-empty {
    color: #666;
    margin-bottom: 15px;
}

/* 見出し階層是正で <h3> から <p> に置き換えたリード文。見た目は従来のh3相当を維持する */
.section-lead {
    font-size: 1.17em;
    font-weight: bold;
    margin: 1em 0;
}

/* パンくずリスト(viewer/parts.html の breadcrumb マクロ) */
.viewer-breadcrumb {
    margin-bottom: 15px;
}

.viewer-breadcrumb .breadcrumb {
    margin-bottom: 0;
    padding: 8px 12px;
    font-size: 13px;
}

/* チャンネルバナー(channel/show.html)。画像が読み込みエラーになるとブラウザはimgを非置換要素扱いに戻し、
   width:100%/aspect-ratioが効かなくなってCLSが起きる。display:blockを明示することでエラー時も
   ブロックボックスとしてwidth/aspect-ratioを確実に適用させる */
.blog-details-photo > img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    object-fit: cover;
}

/* 動画詳細のクリック・トゥ・プレイ(video/show.html)。.frame-wrapper__videoはposition:relativeで
   アスペクト比(padding-bottom:56.25%)を確保済みなので、facadeはそこに重ねるだけでCLSは発生しない */
.video-facade {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    padding: 0;
    cursor: pointer;
    background-color: #000;
    background-size: cover;
    background-position: center;
}

.video-facade-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 68px;
    height: 48px;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
}

.video-facade-play::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 54%;
    transform: translate(-50%, -50%);
    border-style: solid;
    border-width: 12px 0 12px 20px;
    border-color: transparent transparent transparent #fff;
}

/* 並び替え(?sort=)UI(ranking/new/recommend共通. viewer/channel/ranking,new,video/recommendのindex.htmlで使用. #39) */
.viewer-sort-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
    margin: 0 0 15px;
    font-size: 13px;
}

.viewer-sort-list li {
    padding: 4px 10px;
    border: 1px solid #ddd;
    border-radius: 999px;
}

.viewer-sort-list li.active {
    background: #333;
    color: #fff;
    border-color: #333;
}

.viewer-sort-list a {
    color: inherit;
    text-decoration: none;
}

/* ランキング(/channel/ranking)の順位バッジ(#39) */
.channel-ranking-rank {
    margin: 0 0 4px;
    font-weight: 700;
    font-size: 13px;
    color: #e0402a;
}

/* タグ一覧・トップのTAGセクションの動画件数バッジ(/tag, /. #41) */
.tag-video-count {
    font-size: 11px;
    color: #999;
}

/* 動画詳細のチャンネル情報ブロック(video/show.html)。共有マクロchannel_cardとは別実装(#42) */
.video-channel-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.video-channel-info-icon img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
}

.video-channel-info-title {
    font-weight: bold;
    margin-bottom: 4px;
}

.video-channel-info-subscribers {
    color: #777;
    font-size: 13px;
    margin-bottom: 8px;
}

/* 動画詳細のYouTube導線・シェアボタン(video/show.html)。外部JSを使わず素のリンクのみで実装する(#42) */
.video-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* 動画詳細の統計値(video/show.html) */
.video-stats-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 20px;
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.video-stats-label {
    color: #777;
    font-size: 12px;
    margin-right: 4px;
}

.video-stats-note {
    color: #999;
    font-size: 12px;
    margin-top: 8px;
    margin-bottom: 0;
}

/* 動画詳細の説明文(video/show.html)。長文は<details>でJS無しに折りたたむ(#42) */
.video-description-details > summary {
    cursor: pointer;
    font-weight: bold;
}

.video-description-body {
    margin-top: 10px;
    line-height: 1.7;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.video-description-empty {
    color: #999;
}
