/*
Theme Name: CrossLink Theme
Theme URI: https://example.com/crosslink-theme
Author: Your Name
Description: 医療系国家試験 過去問DBサイト用の最小テーマ
Version: 1.0.0
Text Domain: crosslink-theme
*/

/* === Reset & Base === */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: #333;
    background: #f5f7fa;
}

a {
    color: #0066cc;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

/* === Layout === */
.site-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-header {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 15px 0;
}

.site-header .site-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-title {
    margin: 0;
    font-size: 1.5rem;
}

.site-title a {
    color: #333;
}

.site-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 20px;
}

.site-nav a {
    color: #333;
    font-weight: 500;
}

.site-main {
    padding: 30px 0;
}

.site-footer {
    background: #333;
    color: #fff;
    padding: 30px 0;
    text-align: center;
    font-size: 0.9rem;
}

.site-footer a {
    color: #fff;
}

/* === Content === */
.content-wrapper {
    display: flex;
    gap: 30px;
}

.content-main {
    flex: 1;
    min-width: 0;
}

.content-sidebar {
    width: 300px;
    flex-shrink: 0;
}

/* === Cards === */
.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    padding: 20px;
    margin-bottom: 20px;
}

/* === Ad Slots === */
.ad-slot {
    background: #f0f0f0;
    border: 2px dashed #ccc;
    padding: 20px;
    text-align: center;
    color: #999;
    margin: 20px 0;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-slot-sidebar {
    margin-bottom: 20px;
}

/* === Responsive === */
@media (max-width: 900px) {
    .content-wrapper {
        flex-direction: column;
    }

    .content-sidebar {
        width: 100%;
    }
}

/* ============================================================
   Home Cards（フロントページ専用）
   ============================================================ */
.home-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin: 30px 0;
}

.home-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
    padding: 28px 24px 24px;
    display: flex;
    flex-direction: column;
}

.home-card__title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 12px;
    color: #222;
}

.home-card__desc {
    flex: 1;
    font-size: 0.95rem;
    color: #555;
    margin: 0 0 20px;
    line-height: 1.75;
}

.home-card__btn {
    display: block;
    width: 100%;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.15s;
    /* 全カード共通: 塗りつぶしボタン */
    background: #0d9e7e;
    color: #fff;
    border: 2px solid #0d9e7e;
}

.home-card__btn:hover {
    opacity: 0.82;
    text-decoration: none;
    color: #fff;
}

@media (max-width: 900px) {
    .home-cards {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   買うページ（template-buy.php）
   ============================================================ */

.buy-page {
    max-width: 960px;
    margin: 0 auto;
}

.buy-page__heading {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0 0 12px;
    color: #222;
}

.buy-page__lead {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.8;
    margin: 0 0 8px;
}

.buy-page__disclaimer {
    font-size: 0.82rem;
    color: #999;
    margin: 0 0 24px;
}

.buy-page__empty {
    color: #888;
    padding: 40px 0;
    text-align: center;
}

/* ── カテゴリーフィルタータブ ── */
.buy-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 28px;
}

.buy-filter__tab {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1.5px solid #0d9e7e;
    color: #0d9e7e;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.buy-filter__tab:hover {
    background: #e6f7f3;
    text-decoration: none;
}

.buy-filter__tab.is-active {
    background: #0d9e7e;
    color: #fff;
}

/* ── 商品グリッド ── */
.buy-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

@media (max-width: 900px) {
    .buy-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {
    .buy-grid {
        grid-template-columns: 1fr;
    }
}

/* ── 商品カード ── */
.buy-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.07);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 画像エリア */
.buy-card__image-wrap {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.buy-card__image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.buy-card__image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
    font-size: 0.85rem;
}

/* テキスト情報 */
.buy-card__body {
    padding: 16px 16px 8px;
    flex: 1;
}

.buy-card__category {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #0d9e7e;
    background: #e6f7f3;
    border-radius: 4px;
    padding: 2px 8px;
    margin-bottom: 8px;
}

.buy-card__title {
    font-size: 0.98rem;
    font-weight: 700;
    color: #222;
    margin: 0 0 8px;
    line-height: 1.5;
}

.buy-card__desc {
    font-size: 0.88rem;
    color: #666;
    line-height: 1.7;
    margin: 0;
}

/* 購入ボタンエリア */
.buy-card__actions {
    padding: 12px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.buy-card__btn {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 0.92rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    transition: opacity 0.15s;
}

.buy-card__btn:hover {
    opacity: 0.82;
    text-decoration: none;
}

/* Amazon ボタン */
.buy-card__btn--amazon {
    background: #FF9900;
    color: #111;
    border: 2px solid #FF9900;
}

.buy-card__btn--amazon:hover {
    color: #111;
}

/* 楽天ボタン */
.buy-card__btn--rakuten {
    background: #BF0000;
    color: #fff;
    border: 2px solid #BF0000;
}

.buy-card__btn--rakuten:hover {
    color: #fff;
}

/* リンク準備中 */
.buy-card__no-link {
    display: block;
    text-align: center;
    font-size: 0.82rem;
    color: #bbb;
    padding: 6px 0;
}
