/**
 * Clinic Card Component
 * クリニックカードコンポーネント
 *
 * Usage: loop-card-clinic.php
 */

:where(.c-card-clinic-001) {
    display: block;
    background: var(--wp--preset--color--white);
    border: var(--wp--custom--border--width--1) solid var(--wp--preset--color--gray-lighter);
    border-radius: var(--wp--custom--border--radius--lg);
    overflow: hidden;
    box-shadow: var(--wp--custom--shadow--sm);
    transition: all var(--wp--custom--transition--duration--base) var(--wp--custom--transition--timing--ease);
    height: 100%;
}

:where(.c-card-clinic-001):hover {
    transform: translateY(-4px);
    box-shadow: var(--wp--custom--shadow--lg);
    border-color: var(--wp--preset--color--secondary-light);
}

:where(.c-card-clinic-001__link) {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

/* ========================================
   サムネイル
   ======================================== */

:where(.c-card-clinic-001__thumbnail) {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    overflow: hidden;
    background: var(--wp--preset--color--gray-lighter);
}

:where(.c-card-clinic-001__thumbnail img) {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--wp--custom--transition--duration--base) var(--wp--custom--transition--timing--ease);
}

:where(.c-card-clinic-001):hover :where(.c-card-clinic-001__thumbnail img) {
    transform: scale(1.05);
}

/* ロゴ */
:where(.c-card-clinic-001__logo) {
    position: absolute;
    top: var(--wp--preset--spacing--base);
    right: var(--wp--preset--spacing--base);
    width: 64px;
    height: 64px;
    background: var(--wp--preset--color--white);
    border-radius: var(--wp--custom--border--radius--md);
    padding: var(--wp--preset--spacing--xs);
    box-shadow: var(--wp--custom--shadow--md);
    z-index: var(--wp--custom--z-index--10);
}

:where(.c-card-clinic-001__logo img) {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: static;
}

/* ========================================
   コンテンツ
   ======================================== */

:where(.c-card-clinic-001__content) {
    display: flex;
    flex-direction: column;
    gap: var(--wp--preset--spacing--base);
    padding: var(--wp--preset--spacing--lg);
    flex: 1;
}

/* タイトル */
:where(.c-card-clinic-001__title) {
    margin: 0;
    font-size: var(--wp--preset--font-size--xl);
    font-weight: var(--wp--custom--font-weight--bold);
    line-height: var(--wp--custom--line-height--sm);
    color: var(--wp--preset--color--gray-darkest);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

/* ========================================
   バッジ
   ======================================== */

:where(.c-card-clinic-001__badges) {
    display: flex;
    flex-wrap: wrap;
    gap: var(--wp--preset--spacing--xs);
}

:where(.c-card-clinic-001__badge) {
    display: inline-flex;
    align-items: center;
    gap: var(--wp--preset--spacing--4-xs);
    padding: var(--wp--preset--spacing--xs) var(--wp--preset--spacing--sm);
    border-radius: var(--wp--custom--border--radius--full);
    font-size: var(--wp--preset--font-size--sm);
    font-weight: var(--wp--custom--font-weight--semibold);
}

:where(.c-card-clinic-001__badge--prefecture) {
    background: var(--wp--preset--color--secondary-lightest);
    color: var(--wp--preset--color--secondary-darker);
    border: var(--wp--custom--border--width--1) solid var(--wp--preset--color--secondary-lighter);
}

:where(.c-card-clinic-001__badge--area) {
    background: var(--wp--preset--color--secondary-lightest);
    color: var(--wp--preset--color--secondary-darker);
    border: var(--wp--custom--border--width--1) solid var(--wp--preset--color--secondary-lighter);
}

:where(.c-card-clinic-001__badge .material-symbols-outlined) {
    font-size: 1.6rem;
}

/* ========================================
   アクセス情報
   ======================================== */

:where(.c-card-clinic-001__access) {
    display: flex;
    align-items: center;
    gap: var(--wp--preset--spacing--xs);
    margin: 0;
    padding: var(--wp--preset--spacing--sm) var(--wp--preset--spacing--base);
    font-size: var(--wp--preset--font-size--sm);
    font-weight: var(--wp--custom--font-weight--medium);
    color: var(--wp--preset--color--gray-darkest);
    background: var(--wp--preset--color--gray-lightest);
    border-radius: var(--wp--custom--border--radius--sm);
    border-left: 3px solid var(--wp--preset--color--secondary);
}

:where(.c-card-clinic-001__access .material-symbols-outlined) {
    font-size: 2rem;
    color: var(--wp--preset--color--secondary);
}

/* ========================================
   院長情報
   ======================================== */

:where(.c-card-clinic-001__director) {
    display: flex;
    align-items: center;
    gap: var(--wp--preset--spacing--base);
    padding: var(--wp--preset--spacing--base);
    background: var(--wp--preset--color--gray-lightest);
    border-radius: var(--wp--custom--border--radius--md);
    border: var(--wp--custom--border--width--1) solid var(--wp--preset--color--gray-light);
}

:where(.c-card-clinic-001__director-photo) {
    width: 56px;
    height: 56px;
    border-radius: var(--wp--custom--border--radius--circle);
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid var(--wp--preset--color--white);
    box-shadow: var(--wp--custom--shadow--sm);
}

:where(.c-card-clinic-001__director-photo img) {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

:where(.c-card-clinic-001__director-info) {
    display: flex;
    flex-direction: column;
    gap: var(--wp--preset--spacing--4-xs);
}

:where(.c-card-clinic-001__director-label) {
    font-size: var(--wp--preset--font-size--sm);
    font-weight: var(--wp--custom--font-weight--medium);
    color: var(--wp--preset--color--gray-dark);
}

:where(.c-card-clinic-001__director-name) {
    font-size: var(--wp--preset--font-size--base);
    font-weight: var(--wp--custom--font-weight--bold);
    color: var(--wp--preset--color--gray-darkest);
}

/* ========================================
   概要
   ======================================== */

:where(.c-card-clinic-001__summary) {
    margin: 0;
    font-size: var(--wp--preset--font-size--sm);
    line-height: var(--wp--custom--line-height--base);
    color: var(--wp--preset--color--gray-dark);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

/* ========================================
   料金情報
   ======================================== */

:where(.c-card-clinic-001__fees) {
    display: flex;
    gap: var(--wp--preset--spacing--base);
    padding: var(--wp--preset--spacing--base);
    background: linear-gradient(
        135deg,
        var(--wp--preset--color--secondary-lightest) 0%,
        var(--wp--preset--color--white) 100%
    );
    border: var(--wp--custom--border--width--1) solid var(--wp--preset--color--secondary-lighter);
    border-radius: var(--wp--custom--border--radius--md);
}

:where(.c-card-clinic-001__fee-item) {
    display: flex;
    flex-direction: column;
    gap: var(--wp--preset--spacing--4-xs);
}

:where(.c-card-clinic-001__fee-label) {
    font-size: var(--wp--preset--font-size--sm);
    font-weight: var(--wp--custom--font-weight--semibold);
    color: var(--wp--preset--color--secondary-dark);
}

:where(.c-card-clinic-001__fee-amount) {
    font-size: var(--wp--preset--font-size--lg);
    font-weight: var(--wp--custom--font-weight--bold);
    color: var(--wp--preset--color--secondary-darker);
}

/* ========================================
   メタ情報
   ======================================== */

:where(.c-card-clinic-001__meta) {
    display: flex;
    flex-direction: column;
    gap: var(--wp--preset--spacing--sm);
    margin-top: auto;
    padding-top: var(--wp--preset--spacing--base);
    border-top: var(--wp--custom--border--width--1) solid var(--wp--preset--color--gray-lighter);
}

:where(.c-card-clinic-001__meta-item) {
    font-size: var(--wp--preset--font-size--sm);
    line-height: var(--wp--custom--line-height--base);
    color: var(--wp--preset--color--gray-dark);
}

:where(.c-card-clinic-001__meta-label) {
    font-weight: var(--wp--custom--font-weight--bold);
    color: var(--wp--preset--color--gray-darkest);
    margin-right: var(--wp--preset--spacing--4-xs);
}

/* ========================================
   施術リスト（アコーディオン）
   ======================================== */

:where(.c-card-clinic-001__treatment-list) {
    display: flex;
    flex-direction: column;
    gap: var(--wp--preset--spacing--xs);
}

:where(.c-card-clinic-001__treatment-category) {
    border: var(--wp--custom--border--width--1) solid var(--wp--preset--color--gray-light);
    border-radius: var(--wp--custom--border--radius--sm);
    overflow: hidden;
}

:where(.c-card-clinic-001__treatment-toggle) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: var(--wp--preset--spacing--sm) var(--wp--preset--spacing--base);
    background: var(--wp--preset--color--gray-lightest);
    border: none;
    cursor: pointer;
    font-size: var(--wp--preset--font-size--sm);
    text-align: left;
    transition: all var(--wp--custom--transition--duration--base) var(--wp--custom--transition--timing--ease);
}

:where(.c-card-clinic-001__treatment-toggle):hover {
    background: var(--wp--preset--color--secondary-lightest);
}

:where(.c-card-clinic-001__treatment-toggle[aria-expanded="true"]) {
    background: var(--wp--preset--color--secondary-lightest);
    border-bottom: var(--wp--custom--border--width--1) solid var(--wp--preset--color--gray-light);
}

:where(.c-card-clinic-001__treatment-category-name) {
    font-weight: var(--wp--custom--font-weight--bold);
    color: var(--wp--preset--color--gray-darkest);
    flex: 1;
}

:where(.c-card-clinic-001__treatment-count) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 var(--wp--preset--spacing--xs);
    margin-left: var(--wp--preset--spacing--xs);
    margin-right: var(--wp--preset--spacing--xs);
    font-size: var(--wp--preset--font-size--sm);
    font-weight: var(--wp--custom--font-weight--bold);
    color: var(--wp--preset--color--white);
    background: var(--wp--preset--color--secondary);
    border-radius: var(--wp--custom--border--radius--circle);
}

:where(.c-card-clinic-001__treatment-icon) {
    font-size: 2rem;
    color: var(--wp--preset--color--gray-dark);
    transition: transform var(--wp--custom--transition--duration--base) var(--wp--custom--transition--timing--ease);
}

:where(.c-card-clinic-001__treatment-toggle[aria-expanded="true"]) :where(.c-card-clinic-001__treatment-icon) {
    transform: rotate(180deg);
}

:where(.c-card-clinic-001__treatment-items) {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--wp--preset--spacing--xs);
    padding: var(--wp--preset--spacing--base);
    background: var(--wp--preset--color--white);
}

:where(.c-card-clinic-001__treatment-items[hidden]) {
    display: none;
}

:where(.c-card-clinic-001__treatment-item) {
    display: block;
    padding: var(--wp--preset--spacing--xs) var(--wp--preset--spacing--sm);
    font-size: var(--wp--preset--font-size--sm);
    color: var(--wp--preset--color--secondary-dark);
    background: var(--wp--preset--color--secondary-lightest);
    border: var(--wp--custom--border--width--1) solid var(--wp--preset--color--secondary-lighter);
    border-radius: var(--wp--custom--border--radius--sm);
    text-decoration: none;
    text-align: center;
    transition: all var(--wp--custom--transition--duration--base) var(--wp--custom--transition--timing--ease);
}

:where(.c-card-clinic-001__treatment-item):hover {
    background: var(--wp--preset--color--secondary-light);
    border-color: var(--wp--preset--color--secondary);
    color: var(--wp--preset--color--secondary-darker);
    transform: translateY(-2px);
    box-shadow: var(--wp--custom--shadow--sm);
}

:where(.c-card-clinic-001__treatment-item--no-link) {
    color: var(--wp--preset--color--gray-dark);
    background: var(--wp--preset--color--gray-lightest);
    border-color: var(--wp--preset--color--gray-light);
    cursor: default;
}

:where(.c-card-clinic-001__treatment-item--no-link):hover {
    background: var(--wp--preset--color--gray-lightest);
    border-color: var(--wp--preset--color--gray-light);
    color: var(--wp--preset--color--gray-dark);
    transform: none;
    box-shadow: none;
}

/* ========================================
   レスポンシブ
   ======================================== */

@media (max-width: 768px) {
    :where(.c-card-clinic-001__content) {
        padding: var(--wp--preset--spacing--base);
        gap: var(--wp--preset--spacing--sm);
    }

    :where(.c-card-clinic-001__title) {
        font-size: var(--wp--preset--font-size--lg);
    }

    :where(.c-card-clinic-001__logo) {
        width: 48px;
        height: 48px;
        top: var(--wp--preset--spacing--sm);
        right: var(--wp--preset--spacing--sm);
    }

    :where(.c-card-clinic-001__director-photo) {
        width: 48px;
        height: 48px;
    }

    :where(.c-card-clinic-001__fees) {
        flex-direction: column;
        gap: var(--wp--preset--spacing--sm);
    }

    /* モバイルでの施術リスト */
    :where(.c-card-clinic-001__treatment-items) {
        grid-template-columns: 1fr;
    }
}
