/**
 * 遊説スケジュール SNS画像生成 - スタイルシート
 * ベースCSSと動的スタイル変数
 */

/* Google Fonts - M PLUS Rounded 1c */
@import url('https://fonts.googleapis.com/css2?family=M+PLUS+Rounded+1c:wght@400;500;700;800&display=swap');

/* コンテナスタイル */
.yuzei-sns-generator-container {
    max-width: 1480px;
    margin: 0 auto;
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.yuzei-sns-generator-container h1 {
    font-size: 32px;
    margin-bottom: 10px;
    color: #333;
}

.yuzei-sns-generator-container .description {
    color: #666;
    margin-bottom: 30px;
}

.yuzei-sns-generator-container .description-note {
    font-size: 14px;
    color: #999;
    margin-top: 10px;
    font-style: italic;
}

.yuzei-sns-generator-container .form-group {
    margin-bottom: 20px;
}

.yuzei-sns-generator-container label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.yuzei-sns-generator-container select {
    width: 100%;
    max-width: 500px;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.yuzei-sns-generator-container button {
    padding: 12px 24px;
    font-size: 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.yuzei-sns-generator-container .button-primary {
    background: #2271b1;
    color: white;
}

.yuzei-sns-generator-container .button-primary:hover:not(:disabled) {
    background: #135e96;
}

.yuzei-sns-generator-container .button-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.yuzei-sns-generator-container .button-secondary {
    background: #646970;
    color: white;
}

.yuzei-sns-generator-container .button-secondary:hover:not(:disabled) {
    background: #50575e;
}

.yuzei-sns-generator-container .button-secondary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* プレビューコントロール */
.yuzei-sns-generator-container .yuzei-preview-controls {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.yuzei-sns-generator-container .yuzei-preview-label {
    font-size: 14px;
    color: #666;
}

.yuzei-sns-generator-container .yuzei-scale-btn {
    padding: 6px 14px;
    font-size: 13px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.yuzei-sns-generator-container .yuzei-scale-btn:hover {
    border-color: #c94058;
    color: #c94058;
}

.yuzei-sns-generator-container .yuzei-scale-btn.active {
    background: #c94058;
    border-color: #c94058;
    color: white;
}

.yuzei-sns-generator-container .yuzei-preview-container {
    margin-top: 40px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.yuzei-sns-generator-container .yuzei-sns-card-container {
    display: inline-block;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: auto;
    max-width: 100%;
}

/* プレビューサイズ切り替え用クラス */
.yuzei-sns-generator-container .yuzei-sns-card-container.scale-50 #yuzei-sns-card {
    transform: scale(0.5);
    transform-origin: top left;
}

.yuzei-sns-generator-container .yuzei-sns-card-container.scale-50 {
    width: 680px;
    height: 680px;
    overflow: visible;
}

/* SNSカードスタイル */
#yuzei-sns-card {
    width: 1280px;
    height: 1280px;
    background-image: url('../images/sns-bg-2026-circle.png');
    /* 変更 */
    background-size: cover;
    background-position: center;
    color: #333333;
    font-family: "M PLUS Rounded 1c", "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    padding: 30px;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* 全幅ヘッダー（アイキャッチ） */
#yuzei-sns-card .yuzei-sns-top-header {
    position: relative;
    width: 100%;
    margin-bottom: var(--header-margin-bottom, 20px);
    border-bottom: 4px solid #c94058;
    display: block;
    min-height: 180px;
}

/* バッジ（ヘッダー左） */
/* バッジ（ヘッダー左） */
#yuzei-sns-card .yuzei-sns-header-badge {
    position: absolute;
    left: 40px;
    top: 45%;
    /* 50%より少し上げて視覚的なバランスを調整 */
    transform: translateY(-50%);
    width: 155px;
    height: 155px;
    background: #1a2c5b;
    /* ダークネイビー */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    /* box-shadow削除 */
}

#yuzei-sns-card .yuzei-sns-badge-text {
    color: white;
    font-size: 26px;
    /* 30px -> 26px に縮小 */
    font-weight: 800;
    text-align: center;
    line-height: 1.2;
    transform: rotate(-5deg);
    /* ちょっと傾けて勢いを出す */
}

/* 候補者写真：右端に絶対配置 */
#yuzei-sns-card .yuzei-sns-header-left {
    position: absolute;
    right: 0;
    bottom: 0px;
    /* 赤いラインに接地 */
    z-index: 10;
}

#yuzei-sns-card .yuzei-sns-header-left .yuzei-sns-candidate {
    width: 280px;
    height: auto;
    object-fit: contain;
    display: block;
}

/* タイトルエリア：中央固定 */
#yuzei-sns-card .yuzei-sns-header-right {
    width: 100%;
    height: 100%;
    /* 親要素の高さに合わせる */
    min-height: 180px;
    /* 親と同じ高さ確保 */
    padding: 0 200px;
    /* パディングを緩和して改行を防ぐ */
    box-sizing: border-box;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#yuzei-sns-card .yuzei-sns-top-header .yuzei-sns-title {
    font-size: 54px;
    font-weight: 800;
    color: #c94058;
    line-height: 1.2;
}

#yuzei-sns-card .yuzei-sns-top-header .yuzei-sns-date {
    font-size: 42px;
    font-weight: 700;
    margin-top: 0;
    /* マージン削除 */
    color: #333;
}

/* 2カラムレイアウト */
#yuzei-sns-card .yuzei-sns-layout {
    display: flex;
    width: 100%;
    flex: 1;
    gap: 30px;
}

/* 左サイドバー */
#yuzei-sns-card .yuzei-sns-sidebar {
    width: 320px;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* アイキャッチフレームラッパー（中央配置用） */
#yuzei-sns-card .yuzei-sns-eyecatch-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

/* サイドバー下部コンテンツ */
#yuzei-sns-card .yuzei-sns-sidebar-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    flex-shrink: 0;
}

/* アイキャッチフレーム */
#yuzei-sns-card .yuzei-sns-eyecatch-frame {
    width: 100%;
    max-width: 320px;
    aspect-ratio: 1 / 1;
    border: 10px solid #ffffff;
    border-radius: 0;
    background: transparent;
    margin: 0;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

#yuzei-sns-card .yuzei-sns-eyecatch {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    position: absolute;
    top: 0;
    left: 0;
}

/* 右メインエリア */
#yuzei-sns-card .yuzei-sns-main {
    flex: 1;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* （サイドバー内ヘッダーは全幅ヘッダーに移動済み） */

/* 候補者写真（サイドバー上部） */
#yuzei-sns-card .yuzei-sns-candidate-header {
    display: flex;
    justify-content: center;
    padding: 5px 0;
    flex-shrink: 0;
}

#yuzei-sns-card .yuzei-sns-candidate-header .yuzei-sns-candidate {
    max-width: 120px;
    max-height: 120px;
    object-fit: contain;
}

/* 候補者写真エリア（旧・未使用） */
#yuzei-sns-card .yuzei-sns-candidate-wrap {
    display: none;
}

#yuzei-sns-card .yuzei-sns-candidate {
    max-width: 160px;
    max-height: 200px;
    object-fit: contain;
}

/* フッター（左サイドバー内） */
#yuzei-sns-card .yuzei-sns-footer {
    padding-top: 10px;
    text-align: center;
    flex-shrink: 0;
}

#yuzei-sns-card .yuzei-sns-qr {
    width: 100px;
    height: auto;
    margin-bottom: 10px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

#yuzei-sns-card .yuzei-sns-url {
    font-size: 18px;
    font-weight: 500;
    color: #c64949;
    letter-spacing: 0.02em;
}

#yuzei-sns-card .yuzei-sns-table {
    display: table;
    table-layout: fixed;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 var(--row-spacing, 15px);
}

#yuzei-sns-card .yuzei-sns-row {
    display: table-row;
    height: auto;
}

/* 市町村がある行（カテゴリー行）- 背景設定はセルへ移動 */
#yuzei-sns-card .yuzei-sns-row-city .yuzei-sns-info {
    background: rgba(255, 255, 255, 0.95);

}

/* 市町村がない行（詳細行）- 背景設定はセルへ移動 */
#yuzei-sns-card .yuzei-sns-row-detail .yuzei-sns-info {
    background: rgba(255, 255, 255, 0.75);

}

/* 詳細行（ロケーションのみ） - 個別パディング変数を適用 */
#yuzei-sns-card .yuzei-sns-row-detail .yuzei-sns-time,
#yuzei-sns-card .yuzei-sns-row-detail .yuzei-sns-info {
    padding-top: var(--location-padding, 4px);
    padding-bottom: var(--location-padding, 4px);
}

#yuzei-sns-card .yuzei-sns-time {
    font-size: var(--time-font-size, 24px);
    font-weight: 700;
    padding: var(--row-padding, 6px) 10px;
    width: var(--time-width, 210px);
    min-width: var(--time-width, 210px);
    max-width: var(--time-width, 210px);
    white-space: nowrap;
    background: rgba(200, 64, 88, 0.9);
    color: #ffffff;
    border-radius: 8px 0 0 8px;
    text-align: center;
    vertical-align: middle;
    display: table-cell;
    box-sizing: border-box;

}

/* 詳細行（ロケーションのみ）の時刻背景色を薄くしてメリハリをつける */
#yuzei-sns-card .yuzei-sns-row-detail .yuzei-sns-time {
    background: rgba(200, 64, 88, 0.75);
}

#yuzei-sns-card .yuzei-sns-info {
    font-size: var(--info-font-size, 24px);
    font-weight: 500;
    padding: var(--row-padding, 6px) 30px var(--row-padding, 6px) 15px;
    border-radius: 0 50px 50px 0;
    vertical-align: middle;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
    line-height: 1.6;
    width: auto;
}

/* シティ行（通常行） - 個別パディング変数を適用 */
#yuzei-sns-card .yuzei-sns-row-city .yuzei-sns-info {
    padding-top: var(--city-padding, 6px);
    padding-bottom: var(--city-padding, 6px);
    min-height: calc(var(--row-padding, 6px) * 2 + var(--info-font-size, 18px) * 1.6);
    display: table-cell;
    overflow: visible;
    white-space: normal;
    text-overflow: clip;
    box-sizing: border-box;
}

#yuzei-sns-card .yuzei-sns-city {
    font-weight: 700;
    margin-right: 0;
    padding-left: 20px;
    display: inline;
    white-space: nowrap;
    vertical-align: baseline;
}

#yuzei-sns-card .yuzei-sns-location {
    display: inline;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
    vertical-align: baseline;
    font-weight: 500;
    padding-left: 50px;
}

#yuzei-sns-card .yuzei-sns-aza {
    display: inline;
    font-weight: 500;
    padding-left: 20px;
    /* シティとの間隔 */
    vertical-align: baseline;
}

/* 区分タグ（ふれあい、マイク納め式等） */
#yuzei-sns-card .yuzei-sns-type {
    display: inline-block;
    background: rgba(200, 64, 88, 0.15);
    color: #c94058;
    font-size: 15px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 10px;
    /* テキストとの最小間隔 */
    vertical-align: middle;
    flex-shrink: 0;
    /* 縮小させない */
    margin-right: 5px;
}

/* 内部レイアウト用ラッパー */
#yuzei-sns-card .yuzei-sns-info-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* 両端揃え（テキストは左、バッジは右） */
    width: 100%;
}

#yuzei-sns-card .yuzei-sns-text-group {
    display: block;
    word-wrap: break-word;
    /* 長いテキストの折り返し */
    min-width: 0;
    /* Flexbox内での縮小を許可 */
}

/* 重要なお知らせ（左サイドバー内） */
#yuzei-sns-card .yuzei-sns-notice {
    background: rgba(200, 64, 88, 0.9);
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    padding: 8px 12px;
    text-align: center;
    margin-bottom: 10px;
    border-radius: 6px;
    line-height: 1.4;
}

/* （フッタースタイルは上の.yuzei-sns-sidebarセクションで定義済み） */

/* ローディング */
.yuzei-sns-generator-container #loading {
    display: none;
    margin: 20px 0;
    padding: 20px;
    background: #e7f3ff;
    border-left: 4px solid #2271b1;
    border-radius: 4px;
}

.yuzei-sns-generator-container .button-group {
    margin-top: 20px;
}