/**
 * rihobeer.com モバイル最適化CSS
 * Version: 3.0
 * Description: プロフェッショナルなモバイルファーストデザイン
 * Created: 2025-07-16
 */

/* ===================================
   基本リセットとボックスサイジング
   =================================== */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* ===================================
   ビューポート設定（重要）
   =================================== */
@viewport {
    width: device-width;
    initial-scale: 1;
}

/* ===================================
   モバイルファースト基本スタイル
   =================================== */
html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    line-height: 1.6;
    color: #333;
    background-color: #fafafa;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===================================
   コンテナの最適化
   =================================== */
.container,
.wrap,
.content-wrap,
#container,
.site-container {
    width: 100%;
    max-width: 100%;
    padding: 0 15px;
    margin: 0 auto;
    overflow-x: hidden;
}

/* デスクトップでの最大幅制限 */
@media (min-width: 1200px) {
    .container,
    .wrap,
    .content-wrap {
        max-width: 1200px;
        padding: 0 20px;
    }
}

/* ===================================
   メインコンテンツエリアの最適化
   =================================== */
#content,
.content,
.main,
main,
.entry-content {
    width: 100%;
    padding: 15px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ===================================
   サイドバーのモバイル対応
   =================================== */
#sidebar,
.sidebar,
aside {
    width: 100%;
    padding: 15px;
    margin-top: 30px;
}

/* デスクトップでの2カラムレイアウト */
@media (min-width: 768px) {
    .content-sidebar-wrap,
    .content-area {
        display: flex;
        gap: 30px;
    }
    
    #content,
    .content,
    .main {
        flex: 1;
        max-width: calc(100% - 320px);
    }
    
    #sidebar,
    .sidebar {
        flex: 0 0 300px;
        margin-top: 0;
    }
}

/* ===================================
   ナビゲーションメニューの最適化
   =================================== */
.menu-toggle,
.mobile-menu-toggle {
    display: block;
    background: #333;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    width: 100%;
    text-align: left;
    position: relative;
    z-index: 1001;
}

@media (min-width: 768px) {
    .menu-toggle,
    .mobile-menu-toggle {
        display: none;
    }
}

/* モバイルメニュー */
.navi,
.global-nav,
.main-navigation,
#navi,
.menu {
    display: none;
    width: 100%;
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1000;
}

.navi.active,
.menu.active,
.menu-open .navi,
.menu-open .menu {
    display: block;
}

@media (min-width: 768px) {
    .navi,
    .global-nav,
    .main-navigation,
    #navi,
    .menu {
        display: block !important;
    }
}

/* メニューアイテム */
.navi ul,
.menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.navi li,
.menu li {
    border-bottom: 1px solid #eee;
}

.navi a,
.menu a {
    display: block;
    padding: 15px 20px;
    color: #333;
    text-decoration: none;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.navi a:active,
.menu a:active {
    background-color: #f0f0f0;
}

/* ===================================
   画像とメディアの最適化
   =================================== */
img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

iframe,
embed,
object,
video {
    max-width: 100%;
    height: auto;
}

/* アスペクト比を保持した動画コンテナ */
.video-container,
.embed-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    margin: 20px 0;
}

.video-container iframe,
.embed-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ===================================
   テーブルの最適化
   =================================== */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 14px;
}

@media (max-width: 767px) {
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }
}

/* ===================================
   フォームの最適化
   =================================== */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="password"],
input[type="search"],
textarea,
select {
    width: 100%;
    padding: 12px 15px;
    font-size: 16px; /* iOS自動ズーム防止 */
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 15px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* ボタンの最適化 */
button,
input[type="submit"],
input[type="button"],
.button,
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    background-color: #f39c12;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 44px; /* タッチターゲット最小サイズ */
    min-width: 44px;
}

button:active,
.button:active {
    transform: scale(0.98);
}

/* ===================================
   広告エリアの修正
   =================================== */
.ad-area,
.ad-space,
.advertisement,
.sponsor-area,
[class*="ad-"],
[id*="ad-"] {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    text-align: center;
    margin: 20px 0;
}

/* 広告内の要素を中央寄せ */
.ad-area > *,
.ad-space > *,
.advertisement > * {
    max-width: 100%;
    margin: 0 auto;
}

/* HopLink広告の特別対応 */
.hoplink-container,
.hoplink-ad-container {
    width: 100% !important;
    padding: 15px !important;
    box-sizing: border-box !important;
}

.hoplink-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 15px !important;
}

@media (min-width: 480px) {
    .hoplink-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (min-width: 768px) {
    .hoplink-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (min-width: 992px) {
    .hoplink-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

/* ===================================
   タイポグラフィの最適化
   =================================== */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.3;
    margin: 20px 0 15px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

h1 { font-size: 28px; }
h2 { font-size: 24px; }
h3 { font-size: 20px; }
h4 { font-size: 18px; }
h5 { font-size: 16px; }
h6 { font-size: 14px; }

p {
    margin: 0 0 15px;
    line-height: 1.8;
}

/* リンクのタッチエリア拡大 */
a {
    color: #f39c12;
    text-decoration: none;
    min-height: 44px;
    min-width: 44px;
    display: inline-block;
    line-height: 1.5;
}

/* ===================================
   フッターの最適化
   =================================== */
footer,
.footer,
#footer {
    width: 100%;
    padding: 30px 15px;
    background: #333;
    color: white;
    text-align: center;
}

footer a,
.footer a {
    color: #f39c12;
    padding: 10px;
}

/* ===================================
   モバイル専用のユーティリティクラス
   =================================== */
/* スクロール可能なコンテナ */
.scrollable {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* 余白調整 */
.mobile-padding {
    padding: 15px;
}

/* テキストの読みやすさ */
.readable {
    font-size: 16px;
    line-height: 1.8;
    color: #333;
}

/* ===================================
   パフォーマンス最適化
   =================================== */
/* 画像の遅延読み込み */
img[loading="lazy"] {
    background: #f0f0f0;
}

/* スムーズスクロール */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* ===================================
   プリント用スタイル
   =================================== */
@media print {
    .no-print,
    .ad-area,
    .advertisement,
    nav,
    .navigation,
    .menu-toggle {
        display: none !important;
    }
}

/* ===================================
   特定の問題の修正
   =================================== */
/* Cocoonテーマ特有の修正 */
.cocoon-body {
    overflow-x: hidden;
}

.content-in {
    max-width: 100%;
    overflow-x: hidden;
}

/* アフィリエイトリンクの修正 */
.affiliate-link,
.product-link {
    display: inline-block;
    padding: 10px 20px;
    margin: 5px;
    background: #f39c12;
    color: white;
    border-radius: 4px;
    text-align: center;
    min-width: 150px;
}

/* ===================================
   ダークモード対応（オプション）
   =================================== */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #e0e0e0;
    }
    
    .content,
    .container {
        background-color: #2a2a2a;
    }
    
    a {
        color: #ffa726;
    }
}/**
 * rihobeer.com モバイル最適化修正CSS
 * Version: 3.1
 * Description: 左右余白を除去し、色合いは維持
 * Created: 2025-07-16
 */

/* ===================================
   余白の完全除去
   =================================== */
html, body {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    overflow-x: hidden !important;
}

/* Cocoonテーマ特有の余白除去 */
.wrap,
#container,
.container,
.content,
.content-wrap,
.content-in,
.main,
#main,
.site-container,
.page-container,
.entry-content,
.cocoon-body {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box !important;
}

/* コンテンツ内部のパディング調整 */
.article,
.entry,
.post,
.page,
.single {
    padding: 15px !important;
    margin: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* ヘッダーの余白除去 */
#header,
.header,
.site-header,
header {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.header-in,
.header-container {
    width: 100% !important;
    padding: 10px 15px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

/* フッターの余白除去 */
#footer,
.footer,
.site-footer,
footer {
    width: 100% !important;
    margin: 0 !important;
    padding: 20px 15px !important;
    box-sizing: border-box !important;
}

/* サイドバーの余白調整 */
#sidebar,
.sidebar,
aside {
    width: 100% !important;
    padding: 15px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

/* ===================================
   広告エリアの全幅対応
   =================================== */
.ad-area,
.ad-space,
.advertisement,
.sponsor-area,
.hoplink-container,
.hoplink-ad-container,
[class*="ad-"],
[id*="ad-"] {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 15px !important;
    box-sizing: border-box !important;
}

/* 広告グリッドの修正 */
.hoplink-grid {
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* ===================================
   ナビゲーションの全幅対応
   =================================== */
.navi,
.global-nav,
.main-navigation,
#navi,
.menu {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.navi-in,
.menu-container {
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* ===================================
   記事一覧の余白調整
   =================================== */
.list,
.entry-card-wrap,
.post-list,
.archive {
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

.entry-card {
    margin: 10px 15px !important;
    width: calc(100% - 30px) !important;
}

/* ===================================
   画像の全幅対応
   =================================== */
.eye-catch,
.eye-catch-wrap,
.post-thumbnail,
.featured-image {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.eye-catch img,
.post-thumbnail img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
}

/* ===================================
   テーブルとプレの横スクロール対応
   =================================== */
.entry-content table,
.entry-content pre {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    display: block !important;
}

/* ===================================
   ボタンとフォームの調整
   =================================== */
.btn,
.button,
button,
input[type="submit"],
input[type="button"] {
    width: 100% !important;
    max-width: 300px !important;
    margin: 10px auto !important;
    display: block !important;
}

/* ===================================
   モバイル専用の調整
   =================================== */
@media (max-width: 834px) {
    /* iPadも含めたモバイル対応 */
    body {
        font-size: 16px !important;
    }
    
    /* パディングの最小化 */
    .entry-content,
    .article-body {
        padding: 10px !important;
    }
    
    /* 見出しのサイズ調整 */
    h1 { font-size: 24px !important; }
    h2 { font-size: 20px !important; }
    h3 { font-size: 18px !important; }
    
    /* リストの余白調整 */
    ul, ol {
        padding-left: 20px !important;
    }
}

/* ===================================
   重要: Cocoonテーマの上書き
   =================================== */
/* Cocoonのデフォルト余白を無効化 */
.page-body {
    margin: 0 !important;
    padding: 0 !important;
}

#container {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Cocoonのmax-width制限を解除 */
@media (min-width: 835px) {
    .wrap {
        max-width: 100% !important;
    }
}

/* ===================================
   スクロールバーの非表示（iOS対応）
   =================================== */
::-webkit-scrollbar {
    display: none;
}

html {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ===================================
   ビューポート固定（重要）
   =================================== */
@supports (-webkit-touch-callout: none) {
    /* iOS Safari対応 */
    body {
        position: fixed;
        width: 100%;
        height: 100vh;
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ===================================
   追加の最適化
   =================================== */
/* 不要な余白を生む要素の修正 */
.alignfull {
    width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
}

/* ソーシャルボタンの調整 */
.sns-share,
.sns-follow {
    padding: 10px !important;
    margin: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* パンくずリストの調整 */
.breadcrumb {
    padding: 10px 15px !important;
    margin: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
}

/* モバイルメニューボタンの位置修正 */
.menu-toggle,
.mobile-menu-toggle {
    position: fixed !important;
    top: 10px !important;
    right: 10px !important;
    z-index: 9999 !important;
    width: auto !important;
    padding: 10px 15px !important;
}