/* 基本のリセットとフォント設定 */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    color: #333;
}

/* -------------------------------------- */
/* ヘッダーのスタイル */
/* -------------------------------------- */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 80px;
  background-color: #2c3e50;
  color: white;
  display: flex;
  align-items: center;
  padding: 0 20px;
  z-index: 1000;
  transition: top 0.3s ease; /* スムーズに隠すためのアニメーション */
  z-index: 1000;
}

.site-title {
  font-size: 1.5em;
  margin-left: 20px;
}

.menu-icon {
  font-size: 1.8em;
  cursor: pointer;
  z-index: 1001; /* ヘッダーより前面に */
  position: relative; /* 必要に応じて */
}

#side-menu {
  position: fixed;
  top: 80px;
  left: -250px;
  width: 250px;
  height: 100%;
  background-color: #34495e;
  color: white;
  transition: left 0.3s ease;
  z-index: 999;
}

#side-menu ul {
  list-style: none;
  padding: 20px;
}

#side-menu li {
  margin: 20px 0;
}

#side-menu a {
  color: white;
  text-decoration: none;
  font-size: 1.2em;
}

/* 検索フィルターのli項目 */
.search-filter {
  padding: 20px;
  font-size: 1.2em;
  color: white;
}

.search-filter label {
  display: block;
  margin-bottom: 0.5em;
  font-size: 1.2em;
  color: white;
}

.search-form {
  display: flex;
  flex-direction: column;     /* ← 横並びから縦並びに変更 */
  gap: 0.5em;                  /* 上下の間隔を確保 */
  align-items: stretch;       /* 幅を揃える（必要に応じて） */
}

.search-form input {
  flex: 1;
  padding: 0.33m 0.5em;
  border: none;
  border-radius: 4px;
  background-color: #fff;
  color: #333;
  font-size: 0.9em;
}

.search-form button {
  padding: 0.2em 0.5em;
  background-color: #7f8c8d;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 0.8em;
  cursor: not-allowed;
  width: 25%;
}

.site-header {
    background-color: #0056b3; /* 青色 */
    color: white;
    padding: 10px 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 修正: promptly を削除 */
    position: relative;
    margin-top: 80px; /* ヘッダーの高さ + 少し余裕 */
}

.header-container {
    display: flex;
    justify-content: space-between; 
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

/* サイトロゴ/タイトル */
.site-logo a {
    color: white;
    text-decoration: none;
    font-size: 1.5em;
    font-weight: bold;
}

/* ハンバーガーメニューボタン（スマホでのみ表示） */
.menu-toggle {
    margin-left: auto;              /* 右端に押し出す */
    display: block; 
    background: none;
    border: none;
    color: white;
    font-size: 1.8em;
    cursor: pointer;
    padding: 5px;
}

/* ナビゲーションメニュー（ulタグ） - スマホでの初期状態 */
#menu-links {
    list-style: none;
    margin: 0;
    padding: 0;
    text-align: center;
    
    display: none; 
    flex-direction: column; 
    position: absolute;
    top: 60px;
    right: 0; 
    left: auto;
    width: 200px; 
    background-color: #0056b3;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* クリック時にメニューを展開する設定 (JavaScriptでこのクラスが付与される) */
#menu-links.is-open {
    display: flex; 
}

#menu-links li {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

#menu-links li:first-child {
    border-top: none;
}

#menu-links a {
    display: block;
    padding: 10px 15px;
    color: white;
    text-decoration: none;
    font-size: 1.1em;
    transition: background-color 0.3s;
}

#menu-links a:hover {
    background-color: #003d7a;
}

/* -------------------------------------- */
/* メインコンテンツのスタイル */
/* -------------------------------------- */

main {
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 20px 10px; 
    min-height: 80vh; 
}

.summary-area {
    display: flex; 
    flex-wrap: wrap; 
    gap: 20px; 
    margin-bottom: 30px; 
}

.summary-card {
    flex: 1 1 45%; 
    min-width: 300px; 
    padding: 15px;
    border: 2px solid #ccc; 
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.runko-summary {
    background-color: #ffffff; 
    border-color: #007bff;
}

.saigai-summary {
    background-color: #ffffff; 
    border-color: #dc3545;
}


/* -------------------------------------- */
/* 運行状態表示エリアのスタイル */
/* -------------------------------------- */

#runko-status {
    position: relative; 
    min-height: 80px; 
    padding-top: 10px; 
    padding-bottom: 25px; 
    margin-top: 5px;
    overflow: hidden; 
}

.status-item {
    display: flex; 
    flex-direction: column; 
    justify-content: space-between; 
    position: absolute; 
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100% - 25px); 
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none;
}

.status-content {
    display: flex;
    align-items: center;
    flex-grow: 1; 
}

.status-item.current-status {
    opacity: 1; 
    pointer-events: auto;
}

.status-icon {
    width: 60px; 
    height: 60px; 
    margin-right: 10px;
}

.status-text {
    font-size: 2em; 
    font-weight: bold;
    margin: 0;
    color: #333; 
    flex-shrink: 1; 
}

.detail-link {
    display: block; 
    text-align: right;
    margin-top: 5px; 
    font-size: 0.9em;
    color: #0056b3;
    text-decoration: underline;
    transition: color 0.2s;
    flex-shrink: 0; 
    padding-bottom: 5px; 
}

.detail-link:hover {
    color: #003d7a;
}

#status-normal .status-text {
    color: #28a745; 
}
#status-delay .status-text {
    color: #ffc107; 
}
#status-stop .status-text {
    color: #dc3545; 
}

/* -------------------------------------- */
/* 災害状態表示エリアのスタイル */
/* -------------------------------------- */

#saigai-status {
    position: relative; 
    min-height: 80px; 
    padding-top: 10px; 
    padding-bottom: 25px; 
    margin-top: 5px;
    overflow: hidden; 
}

.saigai-item {
    display: flex; 
    flex-direction: column; 
    justify-content: space-between;
    position: absolute; 
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100% - 25px); 
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none;
}

.saigai-content {
    display: flex;
    align-items: center;
    flex-grow: 1; 
}

.saigai-item.current-saigai {
    opacity: 1; 
    pointer-events: auto;
}

.saigai-icon {
    width: 60px; 
    height: 60px; 
    margin-right: 10px;
}

.saigai-text {
    font-size: 2em; 
    font-weight: bold;
    margin: 0;
    color: #333; 
    flex-shrink: 1; 
}

#saigai-normal .saigai-text {
    color: #28a745; 
}
#saigai-warning .saigai-text {
    color: #ffc107; 
}
.saigai-emergency .saigai-text {
    color: #dc3545; 
    font-weight: 900; 
}


/* メインコンテンツ内の各セクションのスタイル */
#runko, #saigai, #news, #help {
    margin: 20px 0; 
    padding: 10px;
}

#runko, #news {
    background-color: #f0f0f0; 
}

#saigai, #help {
    background-color: #f9f9f9;
}

/* 路線図画像のスタイル */
.rosenzu-img {
    max-width: 90%; 
    height: auto; 
    display: block; 
    margin: 10px auto 30px auto; 
}

/* -------------------------------------- */
/* 💡鉄道各社のボタンエリア */
/* -------------------------------------- */

.company-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 15px; 
    padding: 10px 0;
}

.company-button {
    display: block; 
    text-decoration: none;
    
    /* 💡修正1: 元のテキスト（現在はspanタグ内）を非表示にする設定を削除 */
    /* color: transparent; */ 
    /* text-indent: -9999px; */ 
    
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    overflow: hidden;

    position: relative;
    width: 100%;
    height: 0;
    padding-top: 50%; /* 縦横比1:2（高さを幅の50%に） */
    
    background-size: cover; 
    background-position: center; 
    
    transition: transform 0.2s;
}

.company-button:hover {
    transform: translateY(-2px);
}

/* 💡修正2: 疑似要素による手動テキスト設定を削除 */
/* .company-button::after と .company-buttons a:nth-child(n)::after を削除 */

/* 💡修正3: HTMLのspanタグに対して中央配置を適用 */
.company-button span {
    position: absolute;
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%); /* 真ん中に配置 */
    
    color: white; 
    font-weight: bold;
    font-size: 1.8em; /* 大きく表示 */
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
    text-align: center;
    width: 90%; /* テキストの折り返しと中央配置のために幅を設定 */
    line-height: 1.2;
    z-index: 10;
    
    /* 💡京都市営地下鉄のフォントサイズ調整をここで直接行う */
}

/* 京都市営地下鉄のフォントサイズ調整（長い名称のため） */
.company-buttons a:nth-child(8) span {
    font-size: 1.5em; 
}


/* -------------------------------------- */
/* フッターのスタイル */
/* -------------------------------------- */

.site-footer {
    background-color: #0056b3;
    color: white;
    padding: 15px 10px;
    text-align: center;
    width: 100%;
}

.footer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-link {
    color: white;
    text-decoration: none;
    font-size: 1.1em;
    font-weight: bold;
    padding: 8px 15px;
    border-radius: 5px;
    transition: background-color 0.3s;
    width: 100%;
    box-sizing: border-box;
}

.footer-link:hover {
    background-color: #003d7a;
}

.copyright {
    margin-top: 15px;
    font-size: 0.8em;
}

/* -------------------------------------- */
/* レスポンシブ対応 (タブレット・PC向け) */
/* -------------------------------------- */

@media (min-width: 768px) {
    .menu-toggle {
        display: none;
    }
    
    #menu-links {
        display: flex !important; 
        flex-direction: row; 
        position: static;
        background: none;
        box-shadow: none;
        margin-left: auto; 
        width: auto;
    }

    #menu-links li {
        border-top: none;
    }
}

@media (max-width: 600px) {
    .footer-container {
        flex-direction: row;
        justify-content: center;
        gap: 30px;
    }

    .footer-link {
        font-size: 1.2em;
        width: auto;
    }

    .company-buttons {
        grid-template-columns: 1fr; 
    }
    
    .company-button {
        padding-top: 33.3%; 
    }
    
    /* 💡スマホでのフォントサイズ調整 */
    .company-button span {
        font-size: 1.5em; 
    }
    /* 💡スマホでの京都市営地下鉄のフォントサイズ調整 */
    .company-buttons a:nth-child(8) span {
        font-size: 1.2em;
    }
}