:root {
    --primary-color: #004d40;
    --primary-light: #e0f2f1;
    --border-color: #cfd8dc;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;

    --tag: #d8f2b0;
    --tag-hitnet: #e9d38c;
    --tag-mirai: #a3d0ff;
}

body {
    font-family: sans-serif;
    background-color: var(--bg-color);
    margin: 0;
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ヘッダー */
.site-header {
    background: #fff;
    padding: 1rem 0;
    border-bottom: 4px solid var(--primary-color);
    margin-bottom: 20px;
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.site-header h1 {
    margin: 0;
    font-size: 1.3rem;
    color: var(--primary-color);
}

/* フッダー */
.site-footer {
    background: #fff;
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
    margin-top: 30px;
    text-align: center;
}
.footer-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.site-footer .banners {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
    align-items: flex-end;
}
.site-footer .links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
}

/* 検索パネル */
.search-panel {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.search-input-wrapper {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.search-input-wrapper input,
.search-input-wrapper select {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.btn-search {
    background: var(--primary-color);
    color: #fff;
    border: none;
    /* padding: 0 20px; */
    padding: .5rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
}

.search-options {
    /* display: flex; */
    gap: 15px;
    font-size: 0.85rem;
}

.search-button-wrapper {
    text-align: center;
    margin-top: 1rem;
}

.no-results {
    color: rgb(252, 97, 97);
    font-weight: bold;
}

/* ページング */
.pager-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 15px;
}

.pager-wrapper.bottom {
    border-bottom: none;
    border-top: 1px solid var(--border-color);
    margin-top: 20px;
    padding-bottom: 50px;
}

.pagination {
    display: flex;
    align-items: stretch; /* 子要素の高さを揃える */
    gap: 5px;            /* 要素間の隙間 */
}
.pagination a,
.pagination span {
    text-decoration: none;
    color: #333;
    padding: 5px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    /* margin-left: 5px; */
    font-size: 0.85rem;
}
.pagination span {
    color: #c2c2c2;
    border-color: #c2c2c2;
}
.pagination a:hover,
.pagination a.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}
.pagination select {
    padding: 5px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.85rem;
}
.pagination select:hover {
    border-color: var(--primary-color);
}

/* 結果カード */
.result-card {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 15px;
    /* display: grid;
    grid-template-columns: 150px 1fr;
    overflow: hidden;
    transition: all 0.3s ease; */
}

.card-header {
    display: flex;
    display: grid;
    align-items: flex-end;
    grid-template-columns: 10rem 1fr;
    /* padding: 15px 20px; */
    padding: 15px 20px 0 20px;
    background-color: #fcfcfc;
    /* border-bottom: 1px solid #eee; */
    gap: 20px;
    border-top-right-radius: 10px;
    border-top-left-radius: 10px;
}

.title-group {
    flex: 1;
}

.item-image {
    position: relative;
    width: 10rem;
    /* background: #eee; */
    border: 1px solid var(--border-color);
    padding: .4rem
}

.item-image img {
    width: 100%;
    /* height: 100%; */
    object-fit: cover;
    display: block;
}

.item-image .has-icon {
    position: relative; /* アイコン配置の基準点 */
    display: block; /* <a>タグを画像と同じサイズにする */
    overflow: hidden; /* 画像の角丸からはみ出さないように */
    width: 100%;
    height: 100%;
}

.item-image .has-icon:hover .zoom-icon {
    opacity: 1; /* はっきりと表示 */
    transform: scale(1.1); /* 少し大きく */
}

.item-image .zoom-icon {
    position: absolute;
    bottom: 5px; /* 下からの距離 */
    right: 5px;  /* 右からの距離 */
    width: 24px;  /* アイコンの幅 */
    height: 24px; /* アイコンの高さ */
    background-color: rgba(0, 0, 0, 0.6); /* 半透明の黒背景 */
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 16px; /* アイコン自体のサイズ */
    border-radius: 50%; /* 円形にする */
    box-shadow: 0 0 5px rgba(0,0,0,0.3);
    opacity: 0.8; /* 通常時は少し薄く */
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none; /* アイコン自体はクリックイベントを通す */
    z-index: 10;
}


.card-main {
    padding: 15px 20px;
    /* padding:  0 20px 15px 20px; */
    position: relative;
}

.category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 8px;
}

.category-tag {
    background: var(--tag);
    color: #505050;
    font-size: 0.65rem;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 3px;
    border: 1px solid var(--tag);
}
.category-tag.hitnet {
    background: var(--tag-hitnet);
    /* color: #000; */
    border-color: var(--tag-hitnet);
}
.category-tag.mirai {
    background: var(--tag-mirai);
    /* color: #000; */
    border-color: var(--tag-mirai);
}

.item-title {
    margin: 0 0 10px 0;
    margin: 0;
    font-size: 1.1rem;
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.details-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
}
.details-table th {
    width: 7rem;
    width: 10rem;
    text-align: left;
    padding: .4rem;
    background: #f9f9f9;
    border-bottom: 1px solid #eee;
    background: #eeeeee;
    border-bottom: 1px solid #c9c9c9;
}
.details-table td {
    padding: .4rem;
    border-bottom: 1px solid #eee;
}

.description {
    /* color: #666; */
    /* font-style: italic; */
    /* margin-top: 10px !important; */
    line-height: 1.4;
}

.pdf_link {
    display: inline-block;
    padding: 4px 12px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    transition: all 0.2s;
}

.pdf_link::after {
    content: '';
    width: 0.75rem;
    height: 0.75rem;
    display: inline-block;
    background-image: url(../images/pdf_icon.svg);
    background-repeat: no-repeat;
    margin-left: .5rem;
    vertical-align: -0.1em;
}

.pdf_link:hover {
    background: #00332b;
    color: #fff;
}

/* 隠しコンテンツ */
.result-card .hidden-content {
    display: none;
}

.result-card.is-open .hidden-content {
    display: table-row;
}


/* 詳細表示ボタン */
.button-container {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.toggle-details {
    padding: 8px 20px;
    cursor: pointer;
    margin-top: 12px;
    background: none;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
    display: block;
    margin: 0 auto;
}

.toggle-details:hover {
    background: var(--primary-color);
    color: #fff;
}

/* モーダル本体のスタイル */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85); /* 背景を暗く */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    cursor: zoom-out; /* クリックで閉じられることを示す */
}

/* 表示状態 */
.modal-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

/* モーダル内の画像 */
.modal-content {
    max-width: 90%;
    max-height: 90%;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    transform: scale(0.9);
    transition: transform 0.3s;
    cursor: default;
}

.modal-overlay.is-visible .modal-content {
    /* transform: scale(1); */
    width: 70%;
}

/* 閉じるボタン（任意） */
.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
}


/* スマホ対応 */
@media screen and (max-width: 768px) {

    .pager-wrapper {
        display: block;
        text-align: center;
    }

    .pager-wrapper .stats {
        margin-bottom: .5rem;
    }

    .result-card .card-header {
        grid-template-columns: 1fr;
    }

    .item-image {
        width: 100%;
        /* border-right: none; */
        text-align: center;
        padding: 0;
    }
    .item-image .has-icon {
        width: 60%;
        display: inline-block;
    }

    .header-flex {
        flex-direction: column;
        gap: 10px;
    }

    .details-table,
    .details-table tbody,
    .details-table tr {
        width: 100%;
    }

    .details-table tr {
        border-bottom: 1px solid #ddd;
    }

    .details-table tr:not(.hidden-content) th,
    .result-card.is-open .details-table th {
        display: block;
        width: 100%;
        padding: .2rem;
        box-sizing: border-box;
    }

    .details-table tr:not(.hidden-content) td,
    .result-card.is-open .details-table td {
        display: block;
        justify-content: space-between;
        border: none;
        /* padding: 5px 10px; */
        /* width: calc(100% - 2rem);
        padding: .2rem .2rem .2rem 1.5rem; */
        width: 100%;
        box-sizing: border-box;
    }

    .pagination {
        display: block;
    }
    .pagination select {
        display: none;
    }
}