@charset "UTF-8";

/* =========================================
   Base Setting & Color Palette
   ========================================= */
:root {
    --navy-color: #1c305c;    /* 【濃紺】強調・メインカラー */
    --text-color: #111111;    /* 【黒】基本テキスト */
    --gray-dark: #666666;     /* 【濃グレー】補足文字・枠線 */
    --gray-light: #f4f7f6;    /* 【薄グレー】背景色 */
    --white-color: #ffffff;   /* 【白】カード背景 */
    --red-color: #d30000;     /* 【赤】強調色 */
    
    --border-radius: 8px;
    --box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

body {
    font-family: "M PLUS 2", "Noto Sans JP", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
    color: var(--text-color);
    background-color: var(--gray-light);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

a {
    text-decoration: none;
    transition: opacity 0.3s;
    color: var(--text-color);
}
a:hover {
    opacity: 0.7;
}

img {
    max-width: 100%;
    height: auto;
    vertical-align: bottom;
}

/* 共通コンテナ */
.content-wrapper {
    max-width: 960px;
    width: 92%;
    margin: 0 auto;
    padding: 40px 0;
}

/* =========================================
   Header & Navigation
   ========================================= */
.site-header {
    background-color: var(--white-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    background: var(--navy-color);
    color: var(--white-color);
    text-align: center;
    padding: 20px 10px;
}

.election-title {
    font-size: 1.8rem;
    font-weight: 900;
    margin: 0;
}

.election-date {
    font-size: 1rem;
    margin-top: 5px;
    font-weight: 700;
}

/* =========================================
   Navigation (Button Style)
   ========================================= */
#senkyo_nav {
    background-color: var(--white-color);
    border-bottom: 1px solid #eee;
    padding: 15px 0;
}

#senkyo_nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
    padding: 0 10px;
    margin: 0;
    gap: 10px;
}

#senkyo_nav li {
    flex: 1;
    max-width: 240px;
}

#senkyo_nav a {
    display: block;
    text-align: center;
    padding: 12px 5px;
    background-color: #f2efe4; /* 薄いベージュ */
    color: var(--navy-color);
    border-radius: 50px;
    font-weight: bold;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    border-bottom: none; 
}

#senkyo_nav a:hover {
    background-color: #e6dfcc;
    transform: translateY(-2px);
    opacity: 1;
}

#senkyo_nav a.active {
    background-color: var(--navy-color);
    color: var(--white-color);
}

@media screen and (max-width: 600px) {
    #senkyo_nav a {
        font-size: 0.8rem;
        padding: 10px 0;
    }
}

/* =========================================
   kaihyou Section (当日用)
   ========================================= */
.kaihyou-section {
    background-color: #e6e6e6;
    color: var(--white-color);
    padding: 20px 0;
    text-align: center;
}

.section-title-kaihyou {
    font-size: 1.5rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color:#1c305c;
}

.allcontents {
  width: 960px;
  height: 1080px;
  border: none;
}

@media screen and (max-width: 769px) {
  .allcontents {
    width: 100%;
    height: 1000px;
  }
}

/* =========================================
   District Map Image (選挙区画像)
   ========================================= */
.district-map-wrapper {
    margin-top: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.district-map {
    width: 100%;
    max-width: 560px;
    height: auto;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-radius: 4px;
}


/* =========================================
   Video Grid (Multiple Videos)
   ========================================= */
.video-grid {
    display: grid;
    /* PCでは2列 */
    grid-template-columns: repeat(2, 1fr); 
    gap: 20px;
    margin-bottom: 40px;
}

/* スマホでは1列にする */
@media screen and (max-width: 768px) {
    .video-grid {
        grid-template-columns: 1fr;
    }
}


/* =========================================
   Live Section & Single Wrapper
   ========================================= */
.live-section {
    background-color: #000;
    color: var(--white-color);
    padding: 20px 0;
    text-align: center;
}

.section-title-live {
    font-size: 1.5rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.badge-live {
    background-color: var(--red-color);
    color: var(--white-color);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    animation: blink 2s infinite;
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* 1つだけ中央に表示する外枠 */
.live-single-wrapper {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
    margin-bottom: 40px;
}

/* YouTube Container */
.youtube-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

@supports not (aspect-ratio: 16 / 9) {
    .youtube-container {
        padding-bottom: 56.25%;
        height: 0;
    }
    .youtube-container iframe {
        position: absolute;
        top: 0;
        left: 0;
    }
}

.youtube-container iframe {
    width: 100%;
    height: 100%;
}

/* =========================================
   Cards & Content Common
   ========================================= */
.white-card {
    background: var(--white-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 30px;
    margin-bottom: 30px;
}

.card-title, .section-heading {
    text-align: center;
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 30px;
    color: var(--navy-color);
    position: relative;
    padding-bottom: 15px;
}

.card-title::after, .section-heading::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background-color: var(--navy-color);
    margin: 10px auto 0;
    border-radius: 2px;
}

.section-lead {
    text-align: center;
    font-size: 0.9rem;
    color: var(--gray-dark);
    margin-bottom: 20px;
}

/* =========================================
   Buttons
   ========================================= */
.btn-area {
    text-align: center;
    margin-top: 20px;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    font-weight: bold;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent; 
}

/* メインボタン */
.btn-primary {
    background-color: var(--navy-color);
    color: var(--white-color);
    border-color: var(--navy-color);
}
.btn-primary:hover {
    background-color: var(--white-color);
    color: var(--navy-color);
}
.btn-primary i {
    color: var(--white-color) !important;
}
.btn-primary:hover i {
    color: var(--navy-color) !important;
}

/* サブボタン */
.btn-outline {
    background-color: var(--white-color);
    border: 2px solid var(--navy-color);
    color: var(--navy-color);
}
.btn-outline:hover {
    background-color: var(--navy-color);
    color: var(--white-color);
}
.btn-outline:hover i {
    color: var(--white-color) !important;
}

.btn-large { font-size: 1.2rem; padding: 15px 40px; }
.btn-sm { font-size: 0.9rem; padding: 10px 20px; }


/* =========================================
   Candidate Section & Grid
   ========================================= */
#kouhosya {
    width: 100%;            
    background-color: var(--white-color);
    margin-top: 40px;       
    margin-bottom: 40px;    
    padding: 60px 0;        
    box-shadow: 0 0 20px rgba(0,0,0,0.05); 
}
#kouhosya .content-wrapper { padding-top: 0; padding-bottom: 0; }

.district-title {
    border-left-color: var(--navy-color) !important;
    color: var(--text-color);
}

.candidate-grid {
    display: grid;
    gap: 20px;
    align-items: start;
}

.candidate-card {
    background: var(--white-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    border: 1px solid #eee;
}

.candidate-header {
    display: flex;
    padding: 20px;
    align-items: flex-start;
}

/* PC */
@media screen and (min-width: 768px) {
    .candidate-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .candidate-header {
        flex-direction: row;
        align-items: flex-start;
        text-align: left;
    }
    .candidate-photo {
        margin: 0 20px 0 0;
        width: 120px;
    }
    .candidate-name {
        margin-top: 0;
        font-size: 1.25rem;
    }
}

/* Mobile (候補者表示) - 写真左・テキスト右に変更 */
@media screen and (max-width: 767px) {
    .candidate-grid {
        grid-template-columns: 1fr;
    }
    .candidate-header {
        flex-direction: row;      /* 横並び（写真左・テキスト右） */
        align-items: flex-start;  /* 上揃え */
        text-align: left;         /* 左揃え */
        padding: 15px;            /* スマホ用に少し余白調整 */
    }
    .candidate-photo {
        margin: 0 15px 0 0;       /* 写真の右側に余白 */
        width: 90px;              /* スマホで見やすいサイズ（テキスト幅を確保するため少し縮小） */
        margin-bottom: 0;         /* 下の余白削除 */
    }
    .candidate-info {
        flex: 1;                  /* 残りのスペースをテキストが使う */
    }
    .candidate-name {
        font-size: 1.15rem;
        justify-content: flex-start;
    }
}

.candidate-photo {
    width: 120px;
    height: auto;
    border-radius: 4px;
    margin: 0 20px 0 0;
    flex-shrink: 0;
    border: 1px solid #eee;
    background: #fff;
    align-self: flex-start;
}
.candidate-photo img {
    width: 100%;
    height: auto;
    display: block;
}

.candidate-info { flex-grow: 1; }
.candidate-meta { margin-bottom: 5px; }

/* Tags */
.tag {
    display: inline-block;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--white-color);
    margin-right: 5px;
    font-weight: bold;
}
.tag-new { background-color: #e6dfcc; color: var(--navy-color); }
.tag-incumbent { background-color: #a89476; color: var(--white-color); }
.tag-party { background-color: var(--navy-color); }

.candidate-name { font-size: 1.3rem; margin: 5px 0; line-height: 1.3; font-weight: bold; }
.candidate-age { font-size: 1rem; margin: 5px 0; line-height: 1.3; font-weight: bold; padding-left:10px; }
.candidate-wins { font-size: 0.85rem; color: var(--gray-dark); margin: 0; }

/* Accordion */
.accordion-wrapper { border-top: 1px solid #eee; }
.titles {
    display: block;
    background-color: #fafafa;
    color: var(--navy-color);
    padding: 12px 20px;
    font-weight: bold;
    cursor: pointer;
    position: relative;
    transition: background 0.3s;
}
.titles:hover { background-color: #f0f0f0; }
.titles::after {
    content: '\f078';
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: var(--gray-dark);
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.3s;
    font-size: 0.9rem;
}
.titles.close::after { transform: translateY(-50%) rotate(180deg); }
.boxs { display: none; padding: 20px; background-color: var(--white-color); }
.qa-item { margin-bottom: 15px; border-bottom: 1px dotted #ccc; padding-bottom: 15px; }
.qa-item:last-child { border-bottom: none; }
.qa-question { font-size: 0.95rem; color: var(--navy-color); margin: 0 0 5px; font-weight: bold; }
.qa-answer { font-size: 0.9rem; margin: 0; }

/* =========================================
   Tab Styles / Icons / Info List
   ========================================= */
.tab-menu {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    border-bottom: 2px solid var(--navy-color);
}
.tab-item {
    flex: 1;
    text-align: center;
    padding: 12px 5px;
    cursor: pointer;
    background-color: #f4f7f6;
    color: var(--gray-dark);
    font-weight: bold;
    border-radius: 5px 5px 0 0;
    margin-right: 2px;
    transition: 0.3s;
    font-size: 0.95rem;
}
.tab-item:last-child { margin-right: 0; }
.tab-item.active { background-color: var(--navy-color); color: var(--white-color); }
.tab-item:hover:not(.active) { background-color: #e0e0e0; }
.tab-container { min-height: 120px; font-size: 0.9rem; }
.tab-panel { display: none; animation: fadeIn 0.4s ease; padding: 20px 15px; }
.tab-panel.active { display: block; }

.schedule-list { list-style: none; padding: 0; margin: 0; }
.schedule-list li { padding: 8px 0; border-bottom: 1px dotted #eee; }
.schedule-list li:last-child { border-bottom: none; }
.schedule-date { font-weight: bold; display: inline-block; min-width: 120px; color: var(--text-color); font-size: 0.85rem; }

.highlight { color: var(--navy-color); font-weight: bold; }
.text-red { color: var(--navy-color) !important; font-weight: bold; }
.fa-brands, .fa-solid, .fa-regular { color: var(--navy-color) !important; }

/* =========================================
   Message Grid
   ========================================= */
.message-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}
.message-card {
    background: var(--white-color);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.message-meta {
    font-size: 0.8rem;
    color: var(--gray-dark);
    margin-bottom: 8px;
    font-weight: bold;
}
.message-body { font-size: 0.95rem; margin: 0; }

/* =========================================
   Page Top Button
   ========================================= */
#page-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: none;
    margin: 0;
}
#page-top a {
    display: block;
    text-decoration: none;
    color: var(--navy-color);
    font-size: 3rem;
    opacity: 0.7;
    transition: opacity 0.3s;
}
#page-top a:hover { opacity: 1.0; cursor: pointer; }
#page-top img { width: 60px; height: auto; }

/* =========================================
   District Buttons (開票速報切り替え)
   ========================================= */
.senkyoku_box {
    margin-bottom: 30px; 
}
.district-nav-grid {
    display: grid;
    gap: 15px;
    width: 100%;
}
.district-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: var(--navy-color);
    color: var(--white-color);
    border: none;
    border-radius: var(--border-radius);
    padding: 15px 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 4px 0 #122143;
}
.district-btn:hover {
    background-color: #2b447a;
    transform: translateY(2px);
    box-shadow: 0 2px 0 #122143;
}
.district-main { font-size: 1.2rem; font-weight: 900; }

@media screen and (min-width: 768px) {
    .district-nav-grid { grid-template-columns: repeat(4, 1fr); }
}

/* =========================================
   Others / Mobile Adjustments (Final)
   ========================================= */
@media screen and (max-width: 767px) {
    /* 開票速報ボタン */
    .district-nav-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .district-main { font-size: 1.1rem; }
    .district-btn { padding: 12px 5px; }
}

@media screen and (max-width: 600px) {
    .content-wrapper { padding: 20px 0; }
    .election-title { font-size: 1.4rem;}
    .info-row { display: block; }
    .info-row dt { width: 100%; margin-bottom: 5px; }
    .info-row dd { width: 100%; padding-left: 10px; }
    
    .tab-item { font-size: 0.8rem; padding: 10px 2px; }
    .tab-item i { display: block; font-size: 1.2rem; margin-bottom: 4px; }
    .schedule-date { display: block; margin-bottom: 3px; }
    .btn-area a.btn { width: 100%; margin-bottom: 5px; }
}