/**
 * g-page-v2 レシピページ用 CSS
 *
 * 旧 g-page の _page-recipe.scss を踏まえ、v2 のモダンカードUIに合わせて再構成。
 * テーブル組みを廃止し、Flex/Grid ベースのカード表示にした。
 */

.recipe-page {
    max-width: 960px;
    margin: 0 auto;
    padding: 16px;
    color: var(--gpv2-text, #222);
}

.recipe-page .page-header {
    margin: 0 0 16px;
}

.recipe-page .page-title {
    font-size: 1.6rem;
    margin: 0 0 8px;
}

.recipe-page .page-lead {
    font-size: 0.95rem;
    color: var(--gpv2-text-muted, #555);
    margin: 0;
}

/* ---------------------------------------
 *  カテゴリ選択ボタン
 * --------------------------------------- */
.recipe-toolbar {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 16px 0 24px;
}

#btn-recipe-select-menu {
    padding: 10px 24px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #ff7043, #ec407a);
    color: #fff;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

#btn-recipe-select-menu:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}

#btn-recipe-select-menu:active {
    transform: translateY(0);
}

/* ---------------------------------------
 *  カテゴリパネル（large / medium / small）
 * --------------------------------------- */
.recipe-select-menu-frame {
    display: none;
    margin: 0 0 20px;
    padding: 12px;
    background: #fafafa;
    border: 1px solid #e6e6e6;
    border-radius: 8px;
}

.recipe-select-menu-frame.is-active {
    display: flex;
    flex-flow: row wrap;
    gap: 8px;
}

.recipe-select-menu-frame__title {
    width: 100%;
    margin: 0 0 8px;
    font-size: 0.85rem;
    color: #777;
    font-weight: bold;
    letter-spacing: 0.04em;
}

.recipe-menu-select {
    padding: 8px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 999px;
    background: #fff;
    color: #333;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.recipe-menu-select:hover {
    background: #fff5f0;
    border-color: #ff7043;
}

/* ---------------------------------------
 *  レシピカード一覧
 * --------------------------------------- */
.recipe-main-frame {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    padding-bottom: 24px;
}

.recipe-loading,
.recipe-empty,
.recipe-error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 32px 16px;
    color: #888;
    font-size: 0.95rem;
}

.recipe-error {
    color: #c62828;
}

.recipe-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.recipe-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
}

.recipe-card__media {
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f5f5f5;
}

.recipe-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.recipe-card__body {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.recipe-card__title {
    margin: 0;
    font-size: 1rem;
    line-height: 1.4;
    font-weight: 700;
    color: #222;
}

.recipe-card__title a {
    color: inherit;
    text-decoration: none;
}

.recipe-card__title a:hover {
    text-decoration: underline;
}

.recipe-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.8rem;
    color: #666;
}

.recipe-card__meta span {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: #fff3e0;
    color: #ef6c00;
    border-radius: 999px;
    font-weight: 600;
}

.recipe-card__desc {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #444;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 600px) {
    .recipe-main-frame {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 12px;
    }

    .recipe-card__title { font-size: 0.95rem; }
    .recipe-card__desc  { font-size: 0.8rem; }
}
