@charset "UTF-8";
/*
 * マンションライブラリ 棟カード（o-product-list__item--library）
 * 参照: https://www.livable.co.jp/mansion/library/tokyo/a13118/ の Building_* / UnitListItem_* の値に合わせる。
 * 既存の o-product-list / m-contact-property / a-tag / a-price を流用し、足りない分だけ補う。
 */

/* ---- 棟ヘッダー（写真左・情報右は既存 .o-product-list__link の flex を流用） ---- */
.o-product-list__item--library .o-library-header {
    text-decoration: none;
    color: #14212b;
}

.o-product-list__item--library .o-library-header__image-wrapper {
    overflow: hidden;
    line-height: 0;
}

.o-product-list__item--library .o-library-header__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.o-product-list__item--library .o-product-list__headline-text {
    font-size: 1.8rem;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: .012em;
}

.o-product-list__item--library .m-contact-property__info-text {
    font-size: 1.4rem;
    font-weight: 300;
    line-height: 1.2;
    letter-spacing: .012em;
    color: #14212b;
}

/* 情報カラムを写真の高さいっぱいに伸ばし、「詳細」を最下部に押し出す（本サイトの Building_detail と同じ構造） */
.o-product-list__item--library .o-product-list__right {
    align-self: stretch;
}

.o-product-list__item--library .o-product-list__info-wrapper {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.o-product-list__item--library .o-product-list__info-list {
    flex-grow: 1;
}

.o-product-list__item--library .o-library-header__detail {
    display: inline-flex;
    align-items: center;
    gap: .8rem;
    margin-top: 1.2rem;
    margin-left: auto;
    color: #14212b;
    font-size: 1.4rem;
    font-weight: 300;
    line-height: 1.4;
    letter-spacing: .012em;
}

.o-product-list__item--library .o-library-header__detail-icon {
    width: 16px;
    height: 16px;
}

/* ---- 売出し中物件 ---- */
.o-library-body {
    border-top: 1px solid #e3e8eb;
    border-bottom: 1px solid #e3e8eb;
}

.o-library-body__count {
    margin: 0;
    padding: 1.6rem 2.4rem;
    background-color: #fafafa;
    font-size: 1.6rem;
    font-weight: 300;
    line-height: 1.6;
    letter-spacing: .012em;
    color: #14212b;
}

.o-library-body__count-number {
    margin: 0 .2rem 0 .4rem;
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1;
    color: #d84d54;
}

/* ---- 住戸一覧 ---- */
.o-library-units {
    list-style: none;
    margin: 0 2.4rem;
    padding: 0;
}

.o-library-units__item:not(:last-child) {
    border-bottom: 1px solid #e3e8eb;
}

.o-library-units__more .o-library-units {
    border-top: 1px solid #e3e8eb;
}

/*
 * 住戸行（PC）: 本サイトの UnitListItem と同じ 3 行構成の grid。
 *   列: 間取り図 112px | 本文 | 右端（枚数バッジ / 部屋の詳細）
 *   行: ラベル / 基本情報＋枚数バッジ / 価格＋部屋の詳細
 * .o-library-unit__body / .o-library-unit__side は display: contents で枠だけ外し、
 * 中の要素を直接グリッドに置く。ラベルが無いときは 1 行目が空（高さ 0）のまま残り、
 * row-gap の 12px だけが効いて基本情報が 12px 下がる（本サイトが空の <ul> を描画するのと同じ挙動）。
 */
.o-library-unit {
    position: relative;
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr) auto;
    grid-template-areas:
        "madori tags   ."
        "madori base   photo"
        "madori price  detail";
    gap: 1.2rem 1.6rem;
    align-content: start; /* min-height で余った高さを行に配分しない（空のラベル行が膨らむのを防ぐ） */
    align-items: center;
    box-sizing: border-box;
    width: 100%;
    min-height: 112px; /* 本サイト PC は行の高さが画像（112px）で決まる */
    padding: 1.2rem 0;
    text-decoration: none;
    color: #14212b;
    background-color: #fff;
}

.o-library-unit__body,
.o-library-unit__side {
    display: contents;
}

/* 本サイト PC は画像に上下余白が無い。画像は絶対配置で行の上端に置き、
   行の高さ計算（grid の行サイズ）には関与させない。1 列目 112px は画像分の場所取り */
.o-library-unit__madori {
    position: absolute;
    top: 0;
    left: 0;
    width: 112px;
}

.o-library-unit__madori-image {
    display: block;
    width: 112px;
    height: 112px;
    object-fit: contain;
    background-color: #fff;
    border-radius: 0;
}

.o-library-unit__tags {
    grid-area: tags;
    display: flex;
    flex-wrap: wrap;
    gap: .8rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.o-library-unit__tags .a-tag {
    margin: 0; /* 既存 .a-tag の下マージン 8px を打ち消す（タグ間は ul の gap で確保）。本サイトのラベル行は 18px */
    font-size: 1rem;
    font-weight: 300;
    line-height: 1;
    letter-spacing: .012em;
    padding: .3rem .8rem;
    border-radius: 9999px;
}

.o-library-unit__base {
    grid-area: base;
    margin: 0;
    font-size: 1.6rem;
    font-weight: 300;
    line-height: 1.2;
    letter-spacing: .012em;
    word-break: break-all;
}

.o-library-unit__base sup {
    font-size: 0.6em;
    vertical-align: super;
}

.o-library-unit__price {
    grid-area: price;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .4rem 2px;
    color: #d84d54;
}

.o-library-unit__price .a-price__number {
    font-size: 2.4rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: .012em;
    color: #d84d54;
}

.o-library-unit__price .a-price__unit {
    font-size: 1.6rem;
    font-weight: 600;
    line-height: 1.6;
    letter-spacing: .012em;
    color: #d84d54;
}

.o-library-unit__price .a-price__tax {
    font-size: 1.2rem;
    font-weight: 300;
    line-height: 1;
    letter-spacing: .012em;
    color: #d84d54;
}

.o-library-unit__photo {
    grid-area: photo;
    justify-self: end;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .8rem;
    width: 89px;
    height: 19px;
    background-color: #fafafa;
    border-radius: 32px;
    color: #124a7b;
    font-size: 1rem;
    font-weight: 300;
    line-height: 1;
    letter-spacing: .012em;
    white-space: nowrap;
}

.o-library-unit__photo-icon {
    width: 12px;
    height: 12px;
    color: #124a7b;
}

.o-library-unit__detail {
    grid-area: detail;
    justify-self: end;
    display: inline-flex;
    align-items: center;
    gap: .8rem;
    color: #14212b;
    font-size: 1.4rem;
    font-weight: 300;
    line-height: 1.4;
    letter-spacing: .012em;
    white-space: nowrap;
}

.o-library-unit__detail-icon {
    width: 16px;
    height: 16px;
}

/* ---- 折りたたみ（grid-template-rows 0fr → 1fr のアニメーション） ---- */
.o-library-units__more {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .3s ease-out;
}

.o-library-units__more > .o-library-units {
    overflow: hidden;
    min-height: 0;
}

.o-library-units__more[aria-hidden="false"] {
    grid-template-rows: 1fr;
}

.o-library-units__more[aria-hidden="false"] > .o-library-units {
    border-top: 1px solid #e3e8eb;
}

.o-library-units__more-wrap {
    display: grid;
    grid-template-columns: 215px;
    justify-content: center;
    padding: .8rem 0 2.4rem;
}

.o-library-units__more-button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 40px;
    padding: 0 1.6rem;
    background-color: #fafafa;
    border: 1px solid #e3e8eb;
    border-radius: 9999px;
    color: #14212b;
    cursor: pointer;
    transition: box-shadow .3s ease-out;
}

.o-library-units__more-button:hover {
    box-shadow: 0 0 16px 0 rgba(20, 33, 43, .05);
}

.o-library-units__more-text {
    font-size: 1.4rem;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: .012em;
    text-align: center;
}

.o-library-units__more-count {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: .012em;
    color: #d84d54;
}

.o-library-units__more-icon {
    position: absolute;
    right: 1.6rem;
    width: 20px;
    height: 20px;
}

/* 開閉状態で文言とアイコンを切り替える */
.o-library-units__more-button[aria-expanded="true"] .o-library-units__more-text--show,
.o-library-units__more-button[aria-expanded="true"] .o-library-units__more-icon--down,
.o-library-units__more-button[aria-expanded="false"] .o-library-units__more-text--hide,
.o-library-units__more-button[aria-expanded="false"] .o-library-units__more-icon--up {
    display: none;
}

/* ---- 下部 CTA（3 分割・2 行構成） ---- */
.o-library-cta {
    display: grid;
    grid-template-columns: 400px auto auto;
}

.o-library-cta__item {
    min-width: 0;
}

.o-library-cta__item:not(:last-child) {
    border-right: 1px solid #e3e8eb;
}

.o-library-cta__link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .8rem;
    width: 100%;
    height: 72px;
    text-align: center;
    text-decoration: none;
    transition: background-color .3s ease-out;
}

/* 薄赤背景は本サイト同様 hover 時のみ（通常時は 3 つとも白） */
.o-library-cta__link:hover {
    background-color: #fdf7f8;
}

.o-library-cta__what {
    font-size: 1.4rem;
    font-weight: 300;
    line-height: 1.2;
    letter-spacing: .012em;
    color: #5b646b;
}

.o-library-cta__do {
    display: flex;
    align-items: center;
    gap: .8rem;
    font-size: 1.4rem;
    font-weight: 300;
    line-height: 1.2;
    letter-spacing: .012em;
    color: #d84d54;
}

.o-library-cta__icon {
    width: 16px;
    height: 16px;
    color: #d84d54;
}

/* ---- SP ---- */
@media screen and (max-width: 834px) {
    .o-product-list__item--library .o-product-list__headline-text {
        font-size: 1.6rem;
        line-height: 1.6;
    }

    .o-library-units {
        margin: 0 1.6rem;
    }

    /*
     * 住戸行（SP）: 本サイト SP と同じ 2 カラム構成。
     *   左: 間取り図（112px） → その 8px 下に枚数バッジ（列幅いっぱい）
     *   右: ラベル / 基本情報 / 価格 / 部屋の詳細 を 12px 間隔で縦に積む
     * 枚数バッジは間取り図と同じセル（madori）に重ねて margin-top で画像直下に固定する。
     * 右カラムの高さに影響されず常に画像の 8px 下に付く（本サイトの imageBlock と同じ挙動）。
     */
    .o-library-unit {
        grid-template-columns: 112px minmax(0, 1fr);
        /* 最終行を 1fr にし、左カラム（画像＋バッジ 139px）の方が高いときの余りを最終行だけに寄せる。
           auto だと余りが全行に均等配分され「部屋の詳細」が価格から離れてしまう */
        grid-template-rows: auto auto auto 1fr;
        grid-template-areas:
            "madori tags"
            "madori base"
            "madori price"
            "madori detail";
        align-items: start;
        padding: 1.6rem 0; /* 本サイト SP は画像も含めて上下 16px */
    }

    .o-library-unit__madori {
        top: 1.6rem; /* SP は画像も上下 16px の余白の内側 */
    }

    /* 本サイト SP は間取り図に 1px の枠線（PC は枠なし） */
    .o-library-unit__madori-image {
        box-sizing: border-box;
        border: 1px solid #e3e8eb;
    }

    .o-library-unit__base {
        font-size: 1.4rem;
    }

    /* 枚数バッジは本サイト SP と同じく間取り図カラムの幅いっぱい（112px）・画像の 8px 下 */
    .o-library-unit__photo {
        grid-area: madori;
        align-self: start;
        justify-self: stretch;
        width: auto;
        margin-top: calc(112px + .8rem);
    }

    .o-library-unit__detail {
        grid-area: detail;
        justify-self: start;
    }

    .o-library-cta {
        grid-template-columns: repeat(2, 1fr);
    }

    .o-library-cta__item--form {
        grid-column: 1 / -1;
        border-right: 0;
        border-bottom: 1px solid #e3e8eb;
    }
}
