/*
 * トップページ（front-page.php）専用のスタイル。
 * 既存の style.css は body を flex で中央寄せしているため、
 * 縦に長いトップページでは解除してから組み立てる。
 */

:root {
    --rm-accent: #cf2030;
    --rm-accent-dark: #b01b28;
    --rm-text: #1f2328;
    --rm-text-sub: #5c6670;
    --rm-border: #e4e7eb;
    --rm-surface: #ffffff;
    --rm-bg: #f6f7f9;
}

body.home {
    display: block;
    align-items: stretch;
    justify-content: flex-start;
    background: var(--rm-bg);
    color: var(--rm-text);
    line-height: 1.7;
}

.rm-page {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 56px 20px 80px;
}

/* ---------------- 見出し ---------------- */

.rm-hero {
    text-align: center;
    margin-bottom: 48px;
}

.rm-hero__eyebrow {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--rm-accent);
}

.rm-hero__title {
    margin: 0 0 16px;
    font-size: 36px;
    font-weight: 700;
    line-height: 1.3;
}

.rm-hero__lead {
    margin: 0;
    font-size: 16px;
    color: var(--rm-text-sub);
}

/* ---------------- あなたの回答状況 ---------------- */

/* イベント一覧が主役なので、パネルは小さめ・控えめにする */
.rm-me {
    margin-bottom: 20px;
    padding: 14px 18px;
    background: var(--rm-surface);
    border: 1px solid var(--rm-border);
    border-radius: 10px;
}

/* display を指定している要素があるため、hidden 属性で確実に消えるようにする */
.rm-me[hidden],
.rm-me [hidden] {
    display: none !important;
}

.rm-me__title {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 700;
}

.rm-me__lead {
    margin: 0 0 10px;
    font-size: 12px;
    color: var(--rm-text-sub);
}

.rm-me__fields {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
}

.rm-me__field {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1 1 220px;
}

.rm-me__label {
    font-size: 12px;
    font-weight: 600;
    color: var(--rm-text-sub);
}

.rm-me__select {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #cfd5dc;
    border-radius: 6px;
    background: #fff;
    font-family: inherit;
    font-size: 14px;
    color: var(--rm-text);
}

.rm-me__select:disabled {
    background: #f3f4f6;
    color: #8b949e;
}

.rm-me__who {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 12px;
    margin-bottom: 8px;
}

.rm-me__name {
    margin: 0;
    font-size: 14px;
}

.rm-me__chapter {
    margin-left: 4px;
    font-size: 12px;
    color: var(--rm-text-sub);
}

/* 文字だけのボタン（切り替える／やめる） */
.rm-me__switch,
.rm-me__cancel {
    padding: 0;
    background: none;
    border: none;
    border-radius: 0;
    color: var(--rm-accent);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.rm-me__cancel {
    margin-top: 8px;
}

.rm-me__switch:hover,
.rm-me__cancel:hover {
    border-color: transparent;
    color: var(--rm-accent-dark);
}

.rm-me__counts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 8px;
    padding: 0;
    list-style: none;
}

.rm-me__count {
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.rm-me__count strong {
    margin: 0 1px;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.rm-me__count--attend {
    background: #e9f6ed;
    color: #1d7a3e;
}

.rm-me__count--absent {
    background: #eceef0;
    color: #45505c;
}

.rm-me__count--none {
    background: #fff3e0;
    color: #a65000;
}

/* 回答済みイベントの一覧。左にイベント名、右に出欠 */
.rm-me__list {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--rm-border);
}

.rm-me__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px 12px;
    padding: 6px 0;
    border-bottom: 1px solid var(--rm-border);
}

.rm-me__item-name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--rm-text);
    text-decoration: none;
}

a.rm-me__item-name:hover {
    color: var(--rm-accent-dark);
    text-decoration: underline;
}

.rm-me__item-statuses {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px;
    flex: none;
    max-width: 60%;
}

/* 一覧内ではカード用の右寄せ指定を打ち消す */
.rm-me__item-statuses .rm-my-status {
    margin-left: 0;
}

.rm-me__empty,
.rm-me__message {
    margin: 0;
    font-size: 12px;
    color: var(--rm-text-sub);
}

.rm-me__message {
    margin-top: 8px;
}

/* 期限のお知らせ内の「回答済み」 */
.rm-alert__answered {
    flex: none;
    padding: 2px 8px;
    background: #e9f6ed;
    color: #1d7a3e;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
}

.rm-alert__answered[hidden] {
    display: none;
}

/* カード上部の「あなた：◯◯」バッジ */
.rm-badge--me[hidden] {
    display: none;
}

.rm-badge--me-attend {
    background: #1d7a3e;
    color: #fff;
}

.rm-badge--me-absent {
    background: #6b747d;
    color: #fff;
}

.rm-badge--me-none {
    background: #fff3e0;
    color: #a65000;
    box-shadow: inset 0 0 0 1px #f0c48a;
}

/* 日程ごとの「あなた：出席」など */
.rm-my-status {
    margin-left: auto;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.rm-my-status[hidden] {
    display: none;
}

.rm-my-status--attend {
    background: #e9f6ed;
    color: #1d7a3e;
}

.rm-my-status--absent {
    background: #eceef0;
    color: #45505c;
}

.rm-my-status--none {
    background: #fff3e0;
    color: #a65000;
}

/* ---------------- 締切が近いお知らせ ---------------- */

/* パネル同様、控えめなサイズにする */
.rm-alert {
    margin-bottom: 40px;
    padding: 12px 18px;
    background: #fff6f6;
    border: 1px solid #f3c6ca;
    border-left: 3px solid var(--rm-accent);
    border-radius: 8px;
}

.rm-alert__title {
    margin: 0 0 2px;
    font-size: 14px;
    font-weight: 700;
    color: var(--rm-accent-dark);
}

.rm-alert__lead {
    margin: 0 0 6px;
    font-size: 12px;
    color: var(--rm-text-sub);
}

.rm-alert__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.rm-alert__item {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 5px 0;
    border-top: 1px solid #f3c6ca;
}

.rm-alert__item:first-child {
    border-top: none;
}

.rm-alert__days {
    flex: none;
    padding: 1px 8px;
    background: var(--rm-accent);
    color: #fff;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.rm-alert__name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
    font-weight: 600;
}

.rm-alert__link {
    flex: none;
    color: var(--rm-accent-dark);
    font-size: 13px;
    font-weight: 600;
    text-decoration: underline;
}

/* ---------------- セクション見出し ---------------- */

.rm-section-title {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin: 0 0 24px;
    font-size: 22px;
    font-weight: 700;
}

.rm-section-title__count {
    font-size: 14px;
    font-weight: 500;
    color: var(--rm-text-sub);
}

.rm-empty {
    margin: 0;
    padding: 48px 20px;
    background: var(--rm-surface);
    border: 1px dashed var(--rm-border);
    border-radius: 12px;
    text-align: center;
    color: var(--rm-text-sub);
}

/* ---------------- イベントカード ---------------- */

.rm-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.rm-card {
    display: flex;
    flex-direction: column;
    padding: 22px 24px 24px;
    background: var(--rm-surface);
    border: 1px solid var(--rm-border);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.04);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.rm-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 24, 40, 0.08);
}

/* 受付が終わったイベントは控えめに見せる（情報としては残す） */
.rm-card--closed {
    background: #fafbfc;
}

.rm-card--closed .rm-card__title {
    color: var(--rm-text-sub);
}

.rm-card__head {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.rm-card__title {
    margin: 0 0 16px;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.5;
}

/* ---------------- バッジ ---------------- */

.rm-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.5;
    white-space: nowrap;
}

.rm-badge--type {
    background: #eef1f5;
    color: #45505c;
}

.rm-badge--type-forum {
    background: #fdeaec;
    color: #b01b28;
}

.rm-badge--type-networking {
    background: #e8f1fd;
    color: #1b5fb0;
}

.rm-badge--type-regular {
    background: #e9f6ed;
    color: #1d7a3e;
}

.rm-badge--type-workshop {
    background: #f1ecfb;
    color: #5b3bb0;
}

.rm-badge--soon {
    background: var(--rm-accent);
    color: #fff;
}

.rm-badge--full {
    background: #fff3e0;
    color: #a65000;
}

.rm-badge--closed {
    background: #eceef0;
    color: #6b747d;
}

/* ---------------- 日程 ---------------- */

.rm-dates {
    margin: 0 0 16px;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--rm-border);
}

/* 日付と席数は必ず2行に分ける。
   1行に並べるとカードの幅しだいで折り返し位置が変わり、見え方がそろわないため */
.rm-dates__item {
    padding: 10px 0 10px 12px;
    border-bottom: 1px solid var(--rm-border);
    border-left: 3px solid #dde1e6;
}

.rm-dates__when {
    font-size: 15px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.rm-dates__label {
    margin-left: 8px;
    padding: 2px 8px;
    background: #eef1f5;
    border-radius: 4px;
    font-size: 12px;
    color: var(--rm-text-sub);
    white-space: nowrap;
}

.rm-dates__seats {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.rm-seat {
    font-size: 13px;
    color: var(--rm-text-sub);
    white-space: nowrap;
}

.rm-seat--available {
    font-weight: 700;
    color: #1d7a3e;
}

.rm-seat--full {
    font-weight: 700;
    color: #a65000;
}

/* ---------------- 本文・フッター ---------------- */

.rm-card__body {
    margin: 0 0 20px;
}

/* 本文の改行をそのまま活かす */
.rm-card__text {
    font-size: 14px;
    color: var(--rm-text-sub);
    white-space: pre-line;
    overflow-wrap: anywhere;
}

/* 冒頭3行。1行が長くて折り返した場合もここで3行に抑える */
.rm-card__text--lead {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
}

/* display を指定しているため、hidden 属性だけでは消えない。明示的に隠す */
.rm-card__text[hidden] {
    display: none;
}

/* 開いているときは、本文と周囲を見分けやすくする */
.rm-card__body.is-expanded .rm-card__text--full {
    padding: 12px 14px;
    background: #f6f7f9;
    border-radius: 8px;
    color: var(--rm-text);
}

.rm-card__more {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    padding: 0;
    background: none;
    border: none;
    border-radius: 0;
    color: var(--rm-accent);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.rm-card__more[hidden] {
    display: none;
}

.rm-card__more:hover {
    border-color: transparent;
    text-decoration: underline;
}

/* 開閉を示す三角。開いているときは上向きになる */
.rm-card__more::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    transition: transform 0.2s ease;
}

.rm-card__body.is-expanded .rm-card__more::after {
    transform: rotate(180deg);
}

.rm-card__foot {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--rm-border);
}

.rm-card__deadline {
    margin: 0 0 12px;
    font-size: 13px;
    color: var(--rm-text-sub);
}

.rm-card__deadline strong {
    margin-left: 6px;
    color: var(--rm-text);
    font-variant-numeric: tabular-nums;
}

.rm-button {
    display: block;
    padding: 13px 20px;
    background: var(--rm-accent);
    color: #fff;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    transition: background 0.2s ease;
}

.rm-button:hover {
    background: var(--rm-accent-dark);
}

.rm-button--disabled {
    background: #eceef0;
    color: #8b949e;
    cursor: default;
}

.rm-button--disabled:hover {
    background: #eceef0;
}

/* ---------------- フッター ---------------- */

.rm-foot {
    margin-top: 56px;
    text-align: center;
}

.rm-foot__link {
    font-size: 13px;
    color: #8b949e;
    text-decoration: none;
}

.rm-foot__link:hover {
    color: var(--rm-text-sub);
    text-decoration: underline;
}

/* ---------------- スマートフォン ---------------- */

@media (max-width: 768px) {
    .rm-page {
        padding: 36px 16px 56px;
    }

    .rm-hero__title {
        font-size: 28px;
    }

    .rm-hero__lead {
        font-size: 15px;
    }

    .rm-card-grid {
        grid-template-columns: 1fr;
    }

    .rm-section-title {
        font-size: 19px;
    }
}

@media (max-width: 480px) {
    .rm-me {
        padding: 12px 14px;
    }

    .rm-me__item-statuses {
        max-width: 55%;
    }

    .rm-hero__title {
        font-size: 24px;
    }

    .rm-card {
        padding: 18px 18px 20px;
    }
}
