@charset "utf-8";

/*===============================================
* layput
===============================================*/
.postal-archive-container {
    background-color: #fff;
    margin-bottom: 40px;
}

/* 自治体一覧
-------------------------------*/
.municipality-nav {
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 15px 24px;
}

.municipality-nav-title {
    font-weight: 700;
}

.municipality-nav .municipality-group {
    padding: 10px 0;
}

.municipality-nav .municipality-group:not(:last-child) {
    border-bottom: 1px solid #eee;
}

.municipality-nav .municipality-group a {
    display: inline-block;
    margin-right: 10px;
    font-size: 14px;
}

/* 訪問達成率
-------------------------------*/
.progress-container {
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 15px 20px;
    margin: 20px 0 30px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 8px;
    font-size: 13px;
    color: #555;
}

.progress-info strong {
    font-size: 16px;
    color: #0068b7;
}

.progress-bar-bg {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: #0068b7;
    width: 0%;
    transition: width 1s ease-out;
}

/* タブ切替
-------------------------------*/
.postal-tabs {
    display: flex;
    gap: 5px;
    border-bottom: 2px solid #eee;
    margin-bottom: 0;
    padding: 0 10px;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 8px 15px;
    font-weight: bold;
    color: #777;
    cursor: pointer;
    font-size: 13px;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: #333;
}

.tab-btn.active {
    color: #333;
    border-bottom-color: #0068b7;
}

.tab-content {
    display: none;
    padding-top: 0;
}

.tab-content.active {
    display: block;
}

/*===============================================
* 郵便局リスト
===============================================*/
.postal-list {
    list-style: none;
    padding: 0;
    margin: 0;
    border-top: 1px solid #eee;
}

.postal-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    background: #fff;
    transition: background 0.1s;
    position: relative;
    min-height: 48px;
}

.postal-item:hover {
    background-color: #f5f9fc;
}

/* 1. ステータスバー */
.item-status-bar {
    width: 4px;
    height: 32px;
    border-radius: 2px;
    margin-right: 12px;
    flex-shrink: 0;
}

.status-visited {
    background-color: #388e3c;
}

.status-unvisited {
    background-color: #ddd;
}

/* 2. 左側：局名エリア */
.item-main-area {
    display: flex;
    align-items: center;
    flex-grow: 1;
    margin-right: 10px;
    min-width: 0;
    flex-wrap: wrap;
    gap: 6px;
}

.item-name {
    font-size: 15px;
    font-weight: bold;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ステータスバッジ (テキスト) */
.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    height: auto;
    flex-shrink: 0;
    line-height: 1.2;
    white-space: nowrap;
}

.status-badge.closed {
    background-color: #e6a23c;
}

.status-badge.abolished {
    background-color: #666;
}

/* 3. 右側：メタ情報 */
.item-meta-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
}

.item-city-link {
    font-size: 10px;
    color: #555;
    background: #f0f0f0;
    padding: 3px 6px;
    border-radius: 3px;
    text-decoration: none;
    transition: background 0.2s;
    position: relative;
    z-index: 2;
    white-space: nowrap;
}

.item-city-link:hover {
    background: #e0e0e0;
    text-decoration: none;
    color: #333;
}

.item-code {
    font-size: 12px;
    color: #555;
    font-family: "Consolas", "Monaco", monospace;
    letter-spacing: 0.03em;
}

.p-tag {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 10px;
    font-weight: bold;
    color: #fff;
}

.tag-saving {
    background-color: #388e3c;
}

.tag-lunch {
    background-color: #d32f2f;
}

.tag-disabled {
    background-color: #eee;
    color: #ccc;
}

.row-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/*-- sp --*/
@media (max-width: 600px) {
    .postal-item {
        display: grid;
        grid-template-columns: 4px 1fr;
        grid-template-rows: auto auto;
        column-gap: 12px;
        row-gap: 6px;
        padding: 10px 12px;
        align-items: start;
    }

    .item-status-bar {
        grid-column: 1;
        grid-row: 1 / 3;
        height: 100%;
        margin: 0;
    }

    .item-main-area {
        grid-column: 2;
        grid-row: 1;
        width: 100%;
        margin: 0;
    }

    .item-name {
        font-size: 15px;
        white-space: normal;
    }

    .item-meta-group {
        grid-column: 2;
        grid-row: 2;
        width: 100%;
        margin: 0;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .item-code {
        font-size: 11px;
    }

    .p-tag {
        width: 22px;
        height: 22px;
        font-size: 9px;
    }
}