/* Bootstrap Select Override */
/* 削除予定 */

/* グローバルボックスモデル設定 */
* {
    box-sizing: border-box;
}

/* Bootstrap Container Override */
.container {
    max-width: 100% !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
    width: 100%;
}

@media (min-width: 576px) {
    .container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
}

/* Bootstrap Row Override */
.row {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Bootstrap Column Override */
[class*="col-"] {
    padding-left: 5px !important;
    padding-right: 5px !important;
}

@media (min-width: 576px) {
    [class*="col-"] {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }
}

/* Container Classes */
.container-small,
.container-large {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 10px;
    overflow: hidden;
}

@media (min-width: 576px) {

    .container-small,
    .container-large {
        padding: 0 15px;
    }
}

/* Panel Styles - Bootstrap 3 Default */
.panel {
    margin-bottom: 20px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

.panel-default {
    border-color: #ddd;
}

.panel-default>.panel-heading {
    color: #333;
    background-color: #f5f5f5;
    border-color: #ddd;
}

.panel-body {
    padding: 15px;
}

@media (min-width: 768px) {
    .container-small {
        width: 300px;
    }

    .container-large {
        width: 970px;
    }
}

@media (min-width: 992px) {
    .container-small {
        width: 500px;
    }

    .container-large {
        width: 1170px;
    }
}

@media (min-width: 1200px) {
    .container-small {
        width: 700px;
    }

    .container-large {
        width: 1500px;
    }
}

/* Grid System - 5 Column Layout */
.col-lg-4-5,
.col-md-4-5,
.col-sm-4-5,
.col-xs-4-5,
.col-lg-3-5,
.col-md-3-5,
.col-sm-3-5,
.col-xs-3-5,
.col-lg-2-5,
.col-md-2-5,
.col-sm-2-5,
.col-xs-2-5,
.col-lg-1-5,
.col-md-1-5,
.col-sm-1-5,
.col-xs-1-5 {
    position: relative;
    min-height: 1px;
    padding-right: 15px;
    padding-left: 15px;
}

.col-xs-1-5 {
    width: 20%;
    float: left;
}

.col-xs-2-5 {
    width: 40%;
    float: left;
}

.col-xs-3-5 {
    width: 60%;
    float: left;
}

.col-xs-4-5 {
    width: 80%;
    float: left;
}

@media (min-width: 768px) {
    .col-sm-1-5 {
        width: 20%;
        float: left;
    }

    .col-sm-2-5 {
        width: 40%;
        float: left;
    }

    .col-sm-3-5 {
        width: 60%;
        float: left;
    }

    .col-sm-4-5 {
        width: 80%;
        float: left;
    }
}

@media (min-width: 992px) {
    .col-md-1-5 {
        width: 20%;
        float: left;
    }

    .col-md-2-5 {
        width: 40%;
        float: left;
    }

    .col-md-3-5 {
        width: 60%;
        float: left;
    }

    .col-md-4-5 {
        width: 80%;
        float: left;
    }
}

@media (min-width: 1200px) {
    .col-lg-1-5 {
        width: 20%;
        float: left;
    }

    .col-lg-2-5 {
        width: 40%;
        float: left;
    }

    .col-lg-3-5 {
        width: 60%;
        float: left;
    }

    .col-lg-4-5 {
        width: 80%;
        float: left;
    }
}

/* Page Layout */
html {
    position: relative;
    min-height: 100%;
    overflow-x: hidden;
}

body {
    padding-bottom: 80px;
    overflow-x: hidden;
}

.container {
    max-width: 100% !important;
}

.content {
    padding: 30px 10px 20px;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

@media (min-width: 576px) {
    .content {
        padding: 30px 15px 20px;
    }
}

.footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 80px;
    line-height: 80px;
    background-color: #f5f5f5;
}

.footer>.container {
    padding-right: 15px;
    padding-left: 15px;
}

/* Typography */
h1 {
    font-size: 3.2815vw;
}

@media (min-width: 768px) {
    h1 {
        font-size: 1.64vw;
    }
}

/* Content Areas */
#headContainer,
#contentContainer {
    padding-bottom: 2rem;
    overflow: hidden;
}

/* Paginator Spacing */
.paginator {
    margin: 20px 0;
}

@media (max-width: 767px) {
    .paginator.visible-xs-block {
        margin: 5px 0;
    }

    .paginator.visible-xs-block nav>ul {
        margin: 0;
    }
}

/* Sort Methods */
.sortMethd,
.sortMethd-active {
    display: inline-block;
    margin: 1%;
    font-size: 1.6em;
    color: #000;
}

.sortMethd-active {
    font-weight: bold;
}

/* Filter Controls Design */

/* デフォルト（モバイル） */
/* モバイル用フィルターボタン */
.filter-button-container {
    display: block;
    margin-bottom: 15px;
}

.filter-button {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.filter-button i {
    margin-right: 8px;
}

/* デスクトップ用インラインフィルター（デフォルト非表示） */
.filter-controls-container {
    display: none;
}

.filter-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: end;
    gap: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    margin: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: visible;
    position: relative;
    z-index: 1000;
}

/* デスクトップ対応（768px以上） */
@media (min-width: 768px) {

    /* モバイルボタン非表示 */
    .filter-button-container {
        display: none;
    }

    /* インラインフィルター表示 */
    .filter-controls-container {
        display: block;
    }
}

.filter-section {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 140px;
    max-width: 280px;
}

.filter-label {
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-select {
    min-width: auto;
    max-width: 100%;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    transition: all 0.3s ease;
    width: 100%;
}

.filter-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}


.filter-reset {
    margin-top: 18px;
    padding: 8px 16px;
    border: 2px solid #6c757d;
    background: transparent;
    color: #6c757d;
    border-radius: 6px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.filter-reset:hover {
    background: #6c757d;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.filter-reset i {
    margin-right: 5px;
}

/* レスポンシブ対応 */
/* スマートフォン */
@media (max-width: 575px) {
    .filter-controls {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
        padding: 15px;
    }

    .filter-section {
        width: 100%;
        max-width: none;
        flex: 1;
    }

    .filter-select {
        width: 100%;
    }
}

/* 小タブレット */
@media (min-width: 576px) and (max-width: 767px) {
    .filter-controls {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 10px;
    }

    .filter-section {
        flex: 1 1 calc(50% - 5px);
        min-width: 150px;
    }

    .filter-select {
        width: 100%;
    }
}


/* Search Input */
#custom-search-input {
    padding: 3px;
    border: solid 1px #e4e4e4;
    border-radius: 6px;
    background-color: #fff;
    margin-bottom: 30px;
}

#custom-search-input input {
    border: 0;
    box-shadow: none;
}

#custom-search-input button {
    margin: 2px 0 0 0;
    background: none;
    box-shadow: none;
    border: 0;
    color: #666;
    padding: 0 8px 0 10px;
    border-left: solid 1px #ccc;
}

#custom-search-input button:hover {
    border: 0;
    box-shadow: none;
    border-left: solid 1px #ccc;
}

#custom-search-input .glyphicon-search {
    font-size: 23px;
}

/* Modern Card Grid Layout */
.card-grid {
    display: grid;
    gap: 15px;
    padding: 15px 0;

    /* レスポンシブグリッド */
    grid-template-columns: 1fr;
    /* モバイル: 1カラム */
}

@media (min-width: 480px) {
    .card-grid {
        gap: 18px;
        padding: 18px 0;
    }
}

@media (min-width: 576px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
        /* 小タブレット: 2カラム */
        gap: 20px;
        padding: 20px 0;
    }
}

@media (min-width: 768px) {
    .card-grid {
        grid-template-columns: repeat(3, 1fr);
        /* タブレット: 3カラム */
    }
}

@media (min-width: 992px) {
    .card-grid {
        grid-template-columns: repeat(4, 1fr);
        /* デスクトップ中: 4カラム */
    }
}

@media (min-width: 1200px) {
    .card-grid {
        grid-template-columns: repeat(5, 1fr);
        /* デスクトップ大: 5カラム */
    }
}

.card-item {
    display: flex;
    flex-direction: column;
}

.card-item .panel {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Item Panel Styles - Legacy Support */
.itemPanel {
    display: flex;
    margin-bottom: 20px;
}

.itemPanel .panel {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

.itemPanel .info,
.card-item .info {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1;
    height: 100%;
}

.itemPanel .info .cover,
.card-item .info .cover {
    margin-bottom: 10px;
    min-height: 200px;
    text-align: center;
    width: 100%;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

@media (min-width: 480px) {

    .itemPanel .info .cover,
    .card-item .info .cover {
        min-height: 220px;
    }
}

@media (min-width: 576px) {

    .itemPanel .info .cover,
    .card-item .info .cover {
        min-height: 240px;
    }
}

.itemPanel .info .cover img,
.card-item .info .cover img {
    max-width: 100%;
    max-height: 100%;
    height: auto;
    width: auto;
    object-fit: cover;
}

.itemPanel .info .description,
.card-item .info .description {
    background-color: #fff;
    display: block;
    text-align: center;
    text-decoration: none;
    min-height: 2.5em;
    width: 100%;
    padding: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 1;
    margin-top: auto;
    border-top: 1px solid #eee;
    line-height: 1.3;
}

.itemPanel .info .description a,
.card-item .info .description a {
    color: #333;
    text-decoration: none;
    font-size: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


/* Book Detail Styles */
.bookDetail .divider {
    margin-top: 1em;
    margin-bottom: 1em;
}

.bookDetail .field-name {
    font-weight: 700;
    margin-top: 5px;
    margin-bottom: 5px;
}

.bookDetail .titles {
    width: 100%;
    margin-bottom: 2%;
    text-align: center;
}

.bookDetail .favArea {
    margin-bottom: 2%;
    width: 100%;
    text-align: right;
}

.bookDetail .tag,
.bookDetail .title {
    display: inline-block;
    border-radius: 3px;
    color: #fff;
    margin: 2px;
    padding: 2px 6px 3px;
    background: #364657;
    text-decoration: none;
}

.bookDetail .tag:hover,
.bookDetail .title:hover {
    color: #fff;
    background: #4d657c;
    outline-width: 0;
    text-decoration: none;
}

.bookDetail .tag:active,
.bookDetail .title:active {
    color: #fff;
    outline-width: 0;
}

.bookDetail .tag>.count,
.bookDetail .title>.count {
    margin-left: 4px;
}

.bookDetail .tag>.count::before,
.bookDetail .title>.count::before {
    content: "(";
}

.bookDetail .tag>.count::after,
.bookDetail .title>.count::after {
    content: ")";
}

.bookDetail .cover {
    width: 100%;
    margin-bottom: 3%;
    min-height: 350px;
    text-align: center;
}

.bookDetail .cover img {
    max-width: 100%;
    height: auto;
}

/* Responsive Design Improvements */
@media (max-width: 767px) {

    /* Mobile: 2 column layout */
    .itemPanel {
        margin-bottom: 20px;
    }

    .itemPanel .panel {
        height: auto;
        min-height: 300px;
    }

    .itemPanel .info .cover {
        min-height: 200px;
    }

    .itemPanel .info .description {
        font-size: 12px;
        line-height: 1.3;
        padding: 5px;
        position: relative;
        bottom: auto;
        width: 100%;
        height: auto;
        white-space: normal;
        overflow: visible;
    }

    .itemPanel .info .description a {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

@media (min-width: 768px) and (max-width: 991px) {

    /* Tablet: 3 column layout */
    .itemPanel {
        margin-bottom: 25px;
    }

    .itemPanel .panel {
        height: auto;
        min-height: 350px;
    }

    .itemPanel .info .cover {
        min-height: 250px;
    }

    .itemPanel .info .description {
        font-size: 13px;
        line-height: 1.4;
    }
}

@media (min-width: 992px) {

    /* Desktop: 4+ column layout */
    .itemPanel {
        margin-bottom: 30px;
    }

    .itemPanel .panel {
        height: auto;
        min-height: 400px;
    }
}