/* 災害時モーダル + 詳細ページ
 * クラス命名は FLOCSS 準拠（l- = レイアウト, c- = コンポーネント, p- = ページ固有）。
 * 既存テーマが素の CSS のため SCSS は使用しない。
 */

/* =============================
   モーダル本体
   ============================= */
.l-disaster-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.l-disaster-modal[hidden],
.l-disaster-modal.is-hidden {
    display: none !important;
}

.l-disaster-modal__backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(20, 20, 20, 0.65);
    cursor: pointer;
}

.c-disaster-modal {
    position: relative;
    width: 100%;
    max-width: 720px;
    max-height: calc(100vh - 40px);
    background: #ffffff;
    border-top: 6px solid #c0392b;
    border-radius: 6px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
}

.c-disaster-modal__close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    color: #c0392b;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    z-index: 2;
}

.c-disaster-modal__close:hover,
.c-disaster-modal__close:focus {
    color: #ffffff;
    background: #c0392b;
    border-radius: 50%;
    outline: none;
}

.c-disaster-modal__header {
    padding: 24px 56px 16px 28px;
    border-bottom: 1px solid #f0e0e0;
    background: #fff8f5;
    display: flex;
    align-items: center;
}

.c-disaster-modal__label {
    display: inline-block;
    margin: 0 1em 0 0 !important;
    padding: 3px 10px;
    background: #c0392b;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    border-radius: 3px;
    letter-spacing: 0.05em;
}

.c-disaster-modal__title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #222222;
    line-height: 1.4;
    padding: 0 !important;
}

.c-disaster-modal__body {
    padding: 20px 28px;
    overflow-y: auto;
    flex: 1 1 auto;
    -webkit-overflow-scrolling: touch;
    color: #222222;
    font-size: 15px;
    line-height: 1.7;
}

.c-disaster-modal__message {
    margin: 0 0 20px;
    word-break: break-word;
}

.c-disaster-modal__message p {
    margin: 0 0 10px;
}

.c-disaster-modal__message p:last-child {
    margin-bottom: 0;
}

.c-disaster-modal__list-wrap {
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid #eeeeee;
}

.c-disaster-modal__list-title {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 700;
    color: #c0392b;
}

.c-disaster-modal__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.c-disaster-modal__item {
    margin: 0;
    padding: 0;
}

.c-disaster-modal__item + .c-disaster-modal__item {
    border-top: 1px dotted #dddddd;
}

.c-disaster-modal__item-link {
    display: block;
    padding: 12px 0;
    color: #222222;
    text-decoration: none;
    transition: background 0.15s ease;
}

.c-disaster-modal__item-link:hover,
.c-disaster-modal__item-link:focus {
    background: #fff8f5;
    color: #c0392b;
    text-decoration: none;
    outline: none;
}

.c-disaster-modal__date {
    display: inline-block;
    margin-right: 10px;
    font-size: 12px;
    color: #888888;
}

.c-disaster-modal__post-title {
    display: inline;
    font-size: 15px;
    font-weight: 600;
}

.c-disaster-modal__excerpt {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    color: #555555;
    line-height: 1.6;
}

.c-disaster-modal__more {
    display: inline-block;
    margin-top: 6px;
    font-size: 12px;
    color: #c0392b;
    font-weight: 600;
}

.c-disaster-modal__footer {
    padding: 16px 28px;
    border-top: 1px solid #eeeeee;
    background: #fafafa;
    text-align: right;
}

.c-disaster-modal__close-btn {
    display: inline-block;
    min-width: 120px;
    padding: 10px 24px;
    background: #c0392b;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.c-disaster-modal__close-btn:hover,
.c-disaster-modal__close-btn:focus {
    background: #a52a1f;
    outline: none;
}

/* スクロールロック時に body へ付与 */
body.is-disaster-modal-open {
    overflow: hidden;
}

@media (max-width: 767px) {
    .l-disaster-modal {
        padding: 10px;
        align-items: flex-start;
        padding-top: 30px;
        display: flex;
        flex-direction: column;
    }

    .c-disaster-modal {
        max-height: calc(100vh - 60px);
    }

    .c-disaster-modal__header {
        padding: 20px 50px 14px 18px;
    }

    .c-disaster-modal__title {
        font-size: 18px;
    }

    .c-disaster-modal__body {
        padding: 16px 18px;
        font-size: 14px;
    }

    .c-disaster-modal__footer {
        padding: 12px 18px;
        text-align: center;
    }

    .c-disaster-modal__close-btn {
        width: 100%;
    }
}

/* =============================
   詳細ページ (single-disaster_post.php)
   ============================= */
.p-disaster-detail {
    padding: 30px 0 60px;
}

.c-disaster-detail__label {
    display: inline-block;
    margin: 0 0 12px;
    padding: 4px 12px;
    background: #c0392b;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    border-radius: 3px;
    letter-spacing: 0.05em;
}

.c-disaster-detail__date {
    display: block;
    margin-bottom: 8px;
    color: #888888;
    font-size: 13px;
}

.c-disaster-detail__title {
    margin: 0 0 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #c0392b;
    font-size: 26px;
    font-weight: 700;
    color: #222222;
    line-height: 1.4;
}

.c-disaster-detail__thumbnail {
    margin: 0 0 24px;
}

.c-disaster-detail__thumbnail img {
    max-width: 100%;
    height: auto;
}

.c-disaster-detail__body {
    font-size: 16px;
    line-height: 1.8;
    color: #222222;
}

.c-disaster-detail__body p {
    margin: 0 0 16px;
}

.c-disaster-detail__back {
    margin: 40px 0 0;
    text-align: center;
}

.c-disaster-detail__back a {
    display: inline-block;
    padding: 10px 32px;
    background: #c0392b;
    color: #ffffff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 700;
}

.c-disaster-detail__back a:hover,
.c-disaster-detail__back a:focus {
    background: #a52a1f;
    text-decoration: none;
}

@media (max-width: 767px) {
    .c-disaster-detail__title {
        font-size: 20px;
    }

    .c-disaster-detail__body {
        font-size: 15px;
    }
}
