/*
Theme Name: Amenotiero Magazine
Theme URI: https://amenotiero.icu/
Author: Amenotiero
Author URI: https://amenotiero.icu/
Description: あめのちエロ 専用カスタムテーマ
Version: 1.0
Text Domain: amenotiero
*/
:root {
  --bg: #0f0f15;
  --bg2: #1a1a25;
  --accent: #7c5cfc;
  --accent2: #9b7fff;
  --pink: #ff4d8a;
}
body { font-family: 'Noto Sans JP', sans-serif; }

/* ===== Theme BASE CSS ===== */
/* breakpoints: SP(<600) SM(600-767) TB(768-1023) PC(1024-1279) WD(1280+) */

* { margin: 0; padding: 0; box-sizing: border-box; }

/* SP横スクロール防止 — html/bodyレベルで封じ込め */
html { overflow-x: hidden; }
body {
    background: var(--bg, #0f0f15);
    color: var(--text, #f0f0f5);
    font-size: 15px;
    line-height: 1.75;
    font-family: 'Noto Sans JP', 'Yu Gothic UI', 'Hiragino Sans', sans-serif;
    overflow-x: hidden; /* 728pxバナー等のはみ出し防止 */
}
@media (min-width: 1024px) {
    body { font-size: 16px; line-height: 1.7; }
}

a { color: var(--accent2, #9b7fff); text-decoration: none; }
a:hover { text-decoration: underline; }
/* メディア要素はSP/PCで必ず親幅に収める */
img, iframe, video, embed, object { max-width: 100%; height: auto; }
img { display: block; }

/* ヘッダー（最小化: ロゴ + PCヘッダー広告のみ、空白なし） */
.sa-header {
    background: var(--bg2, #161620);
    border-bottom: 1px solid var(--border, #2a2a3d);
    padding: 4px 0;
    line-height: 1;
}
.sa-header .inner {
    max-width: 1160px; margin: 0 auto; padding: 0 16px;
    display: flex; align-items: center; min-height: 0;
}
.site-title { font-size: 18px; font-weight: 700; color: var(--accent2, #9b7fff); line-height: 1.3; }
.site-title a { color: inherit; }

/* ヘッダーバナー: PCのみ表示（728x90）/ SP広告は撤去 */
.sa-banner-pc { display: none; text-align: center; padding: 4px 0 0; background: var(--bg, #0d0d12); margin: 0; }
.sa-banner-sp { display: none; } /* SP広告撤去済み */
@media (min-width: 768px) {
    .sa-banner-pc { display: block; }
}

/* ナビ撤去: グローバルナビはエロタレスト送客動線に不要のため非表示 */
.site-nav { display: none; }

/* メインレイアウト共通（パターンCSSで上書き） */
.sa-content {
    max-width: 1160px; margin: 0 auto; padding: 20px 16px;
    display: grid; grid-template-columns: 1fr 280px; gap: 24px;
}
@media (max-width: 1023px) {
    .sa-content { grid-template-columns: 1fr; }
}

/* 記事グリッド — デフォルト2列 */
.sa-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
/* SP: 1列 */
@media (max-width: 599px) {
    .sa-grid { grid-template-columns: 1fr; gap: 12px; }
}
/* TB/SM: 2列 */
@media (min-width: 600px) and (max-width: 1023px) {
    .sa-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
}

/* 記事カード */
.sa-card {
    background: var(--bg2, #161620);
    border: 1px solid var(--border, #2a2a3d);
    border-radius: 8px; overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.sa-card:hover {
    border-color: var(--accent, #e8305a);
    box-shadow: 0 4px 16px rgba(0,0,0,0.35);
}
.sa-card .thumb {
    width: 100%; padding-top: 56.25%;
    background: var(--bg3, #1e1e2e); position: relative; overflow: hidden;
}
.sa-card .thumb img {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.3s ease;
}
.sa-card:hover .thumb img { transform: scale(1.05); }
.sa-card .thumb .duration {
    position: absolute; bottom: 5px; right: 5px;
    background: rgba(0,0,0,0.8); color: #fff; font-size: 11px;
    padding: 1px 6px; border-radius: 3px;
}
.sa-card .info { padding: 10px; }
.sa-card .info h2 {
    font-size: 13px; font-weight: 500; line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; margin-bottom: 5px;
}
@media (min-width: 1024px) {
    .sa-card .info h2 { font-size: 14px; }
}
.sa-card .info h2 a { color: var(--text, #f0f0f5); }
.sa-card .info h2 a:hover { color: var(--accent2, #ff5577); text-decoration: none; }
.sa-card .tags { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
.sa-card .tags a {
    font-size: 10px; padding: 1px 5px; border-radius: 3px;
    background: var(--bg3, #1e1e2e); color: var(--text2, #8888aa);
}
.sa-card .meta {
    font-size: 11px; color: var(--text2, #8888aa); margin-top: 5px;
    display: flex; gap: 8px; flex-wrap: wrap;
}

/* ページタイトル */
.page-title { margin-bottom: 18px; }
.page-title h1 {
    font-size: 18px; font-weight: 700; line-height: 1.4;
}
@media (min-width: 1024px) {
    .page-title h1 { font-size: 22px; }
}

/* サイドバー */
.sa-sidebar { display: flex; flex-direction: column; gap: 16px; }
.sa-widget {
    background: var(--bg2, #161620);
    border: 1px solid var(--border, #2a2a3d);
    border-radius: 8px; padding: 14px;
    overflow: hidden; /* 広告はみ出し防止 */
    max-width: 100%; /* 親幅を超えない */
    box-sizing: border-box;
}
/* WordPressウィジェット内の広告コンテナも強制収納 */
.widget_text, .textwidget, .custom-html-widget {
    max-width: 100%; overflow: hidden; box-sizing: border-box;
}
.sa-widget-title {
    font-size: 14px; font-weight: 700; margin-bottom: 10px;
    padding-bottom: 8px; border-bottom: 2px solid var(--accent, #e8305a);
    color: var(--accent2, #ff5577);
}
/* PC/SP共通: サイドバー広告ラッパー */
.sa-ad-wrap { max-width: 280px; overflow: hidden; }
/* SP時: サイドバーがメインカラム下に移動→幅制限を解除して100%に */
@media (max-width: 1023px) {
    .sa-ad-wrap { max-width: 100%; }
}

/* 個別記事 */
.single-content {
    background: var(--bg2, #161620);
    border: 1px solid var(--border, #2a2a3d);
    border-radius: 8px; padding: 22px;
    min-width: 0;
}
.sa-title {
    font-size: 18px; font-weight: 700; margin-bottom: 14px; line-height: 1.5;
}
@media (min-width: 1024px) {
    .sa-title { font-size: 22px; }
}
.sa-meta { font-size: 12px; color: var(--text2, #8888aa); margin-bottom: 14px; }
.sa-entry {
    line-height: 1.8; font-size: 15px;
}
@media (min-width: 1024px) {
    .sa-entry { font-size: 16px; }
}
.sa-entry img { max-width: 100%; height: auto; border-radius: 4px; margin: 8px 0; }
.sa-entry a { color: var(--accent2, #ff5577); }
.sa-entry p { margin-bottom: 12px; }

/* 動画ボタン */
.video-link { text-align: center; margin: 20px 0; }
.video-link a {
    display: inline-block; padding: 14px 40px;
    background: var(--pink, #ff2d6b); color: #fff;
    border-radius: 8px; font-weight: 700; font-size: 18px;
    transition: opacity 0.2s;
}
.video-link a:hover { opacity: 0.85; text-decoration: none; color: #fff; }

/* KOK広告 */
.kok-ads { margin: 22px 0; }
.article-bottom-parts { margin-top: 20px; }

/* ページネーション */
.pagination { margin-top: 24px; display: flex; justify-content: center; gap: 5px; flex-wrap: wrap; }
.pagination a, .pagination span {
    display: inline-block; padding: 7px 13px;
    background: var(--bg2, #161620);
    border: 1px solid var(--border, #2a2a3d);
    border-radius: 4px; font-size: 13px;
    color: var(--text2, #8888aa);
}
.pagination .current {
    background: var(--accent, #e8305a); color: #fff;
    border-color: var(--accent, #e8305a);
}

/* フッター */
.sa-footer {
    background: var(--bg2, #161620);
    border-top: 1px solid var(--border, #2a2a3d);
    padding: 20px 0; margin-top: 0;
}
.sa-footer .inner {
    max-width: 1160px; margin: 0 auto; padding: 0 16px;
}
.footer-bottom {
    display: flex; gap: 16px; align-items: center;
    font-size: 11px; color: var(--text2, #8888aa); flex-wrap: wrap;
}
.footer-bottom a { color: var(--text2, #8888aa); }

/* フッター上 エロタレスト大型パーツブロック */
.footer-eroterest-block {
    background: var(--bg2, #161620);
    border-top: 1px solid var(--border, #2a2a3d);
    padding: 20px 0; margin-top: 16px;
}

/* エロタレスト セクションタイトル共通スタイル */
.eroterest-section-title {
    font-size: 15px; font-weight: 700; margin-bottom: 10px;
    padding: 8px 0; border-bottom: 2px solid var(--accent, #e8305a);
    color: var(--accent2, #ff5577);
}

/* 記事下パーツブロック */
.article-bottom-parts, .article-popular-parts {
    margin-top: 24px;
}

/* 一覧ページ エロタレストブロック */
.index-eroterest-block {
    margin-top: 24px; margin-bottom: 8px;
}

/* エロタレスト全部見るボタン */
.btn-eroterest-all {
    display: inline-block; padding: 14px 40px;
    background: var(--accent, #e8305a); color: #fff !important;
    border-radius: 8px; font-weight: 700; font-size: 16px;
    text-decoration: none !important;
    transition: opacity 0.2s;
}
.btn-eroterest-all:hover { opacity: 0.85; text-decoration: none !important; }

/* SP時ナビ調整 */
@media (max-width: 599px) {
    .sa-header .inner { padding: 0 12px; }
    .sa-content { padding: 14px 12px; }
    /* SP: コンテンツ全体のはみ出し防止 */
    .sa-content, .sa-main, .sa-sidebar { overflow-x: hidden; }
    /* SP: WPウィジェット内固定幅広告をクリップ */
    .widget_text iframe, .textwidget iframe, .custom-html-widget iframe {
        max-width: 100% !important;
    }
    .btn-eroterest-all { padding: 12px 28px; font-size: 15px; }
}
/* 動画サムネ・リンクの強制中央寄せ (画像が左に寄る対策) */
.video-thumbnail, .video-link, .video-fallback { text-align: center !important; }
.video-thumbnail a, .video-link a, .video-fallback a { display: inline-block; }
.video-thumbnail img { display: block; margin: 0 auto; max-width: 100%; height: auto; border-radius: 4px; }



/* ===== fullwide パターン固有CSS ===== */
/* サイドバー非表示・全幅 */
.sa-content { grid-template-columns: 1fr; max-width: 1400px; }
.sa-sidebar { display: none; }

/* PC: 4列 */
@media (min-width: 1024px) {
    .sa-grid { grid-template-columns: repeat(4, 1fr); gap: 12px; }
}
/* タブレット: 2列 */
@media (min-width: 600px) and (max-width: 1023px) {
    .sa-grid { grid-template-columns: 1fr 1fr; }
}
/* SP: 1列 */
@media (max-width: 599px) {
    .sa-grid { grid-template-columns: 1fr; }
}
.sa-card { border-radius: 6px; }
.sa-card .info h2 { font-size: 12px; }
@media (min-width: 1024px) { .sa-card .info h2 { font-size: 13px; } }

