.page-header { margin-top: 60px; padding: 60px 0; background: var(--gray-100); border-bottom: 1px solid var(--gray-200); }
.page-header__inner { grid-column: 1 / -1; max-width: 1120px; margin: 0; text-align: left; }
.page-header__title { font-size: 36px; line-height: 1.25; letter-spacing: -0.01em; font-weight: 700; }
.page-header__sub { margin-top: 10px; font-size: 18px; line-height: 1.6; color: var(--gray-700); max-width: 72ch; }
.breadcrumbs { color: var(--gray-600); font-size: 14px; }
.breadcrumbs a { color: inherit; text-decoration: underline; }
.search-form { display: grid; grid-template-columns: repeat(12, 1fr); gap: 12px; border: 2px solid var(--black); background: #fff; padding: 16px; overflow: visible; position: relative; z-index: 1; }
.form-group { overflow: visible; position: relative; z-index: 2; }
.events-section, .events-container { overflow: visible; }
.form-group select.form-input { background: #fff; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.span-2 { grid-column: span 2; }
.form-group.span-3 { grid-column: span 3; }
.form-group.span-4 { grid-column: span 4; }
.form-group.span-12 { grid-column: span 12; }
.form-label { font-weight: 600; }
.form-input { width: 100%; border: 2px solid var(--black); padding: 10px 12px; font-size: 16px; font-family: inherit; border-radius: 0; }
.form-input:focus { outline: none; border-color: var(--primary); }
.checkbox-row { display: flex; align-items: center; gap: 8px; padding: 12px 0; }
.row-actions { display: flex; flex-direction: row; align-items: center; }
.left-actions { display: flex; gap: 12px; }
.right-counter { margin-left: auto; }
.btn { padding: 10px 16px; border: 2px solid var(--black); background: #fff; color: var(--black); text-decoration: none; cursor: pointer; border-radius: 0; }
.btn.btn-primary { background: var(--black); color: var(--white); }
.btn.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: var(--white); }
.btn.btn-secondary { background: transparent; }
.btn.btn-secondary:hover { background: var(--black); color: var(--white); }
.events-section { padding: 100px 0; background: var(--white); }
.events-container { max-width: 1440px; margin: 0 auto; padding: 0 48px; }
.events-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.events-empty { color: var(--gray-700); }
.event-card { background: var(--gray-100); border-radius: 0; overflow: hidden; transition: all .3s; text-decoration: none; color: var(--black); display: flex; flex-direction: column; border: 2px solid transparent; }
.event-card:hover { transform: translateY(-8px); box-shadow: 0 16px 32px rgba(0,0,0,.1); border-color: var(--primary); text-decoration: none; color: var(--black); }
.event-image { width: 100%; height: 200px; background: var(--primary); position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.event-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; position: relative; z-index: 0; display: block; }
.event-card:hover .event-image img { transform: scale(1.05); }
.event-image-placeholder { font-size: 48px; color: var(--white); }
.event-type { position: absolute; top: 16px; left: 16px; padding: 8px 16px; background: var(--black); color: var(--white); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; z-index: 1; }
.event-type.seminar { background: var(--primary-dark); }
.event-type.exhibition { background: #FF5E5B; }
.event-type.workshop { background: var(--primary); }
.event-content { padding: 24px; flex-grow: 1; display: flex; flex-direction: column; }
.event-date-location { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; font-size: 14px; color: var(--gray-600); }
.event-date { display: flex; align-items: center; gap: 4px; font-weight: 600; color: var(--primary); }
.event-location { display: flex; align-items: center; gap: 4px; }
.event-title { font-size: 20px; font-weight: 700; margin-bottom: 12px; line-height: 1.3; }
.event-organizer { font-size: 14px; color: var(--gray-600); margin-bottom: 16px; }
.event-description { font-size: 14px; line-height: 1.6; color: var(--gray-700); margin-bottom: 20px; flex-grow: 1; }
.event-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 20px; border-top: 1px solid var(--gray-300); }
.event-capacity { font-size: 14px; color: var(--gray-600); }
.event-capacity strong { color: var(--primary); font-weight: 700; }
.event-status { padding: 6px 16px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.event-status.open { background: var(--primary-light); color: var(--primary-dark); }
.event-status.few { background: #FFE5B4; color: #D2691E; }
.event-status.full { background: var(--gray-300); color: var(--gray-600); }
.event-detail { padding: 32px 0 64px; background: var(--white); }
.event-detail__inner { max-width: 1040px; margin: 0 auto; padding: 0 48px; }
.event-detail__meta { display:flex; flex-wrap:wrap; gap:12px; align-items:center; margin: 8px 0 16px; }
.event-detail__title { font-size: 28px; font-weight: 700; line-height: 1.3; margin: 8px 0 16px; }
.event-detail__hero { margin: 16px 0 24px; border: 2px solid var(--black); background: var(--gray-100); }
.event-detail__hero img { width: 100%; height: 420px; object-fit: cover; display:block; }
.event-detail__grid { display:grid; grid-template-columns: 2fr 1fr; gap: 24px; }
.event-detail__body { font-size: 16px; line-height: 1.9; color: var(--gray-800); background: var(--white); border: 2px solid var(--black); padding: 24px; }
.event-detail__side { display:flex; flex-direction:column; gap:16px; }
.event-detail__info { border: 2px solid var(--black); background: var(--gray-100); padding: 16px; }
.event-detail__info dl { display:grid; grid-template-columns: 100px 1fr; row-gap: 10px; column-gap: 12px; font-size: 14px; }
.event-detail__actions { border: 2px solid var(--black); background: var(--white); padding: 16px; display:flex; gap:12px; }
.event-detail__back { margin-top: 24px; }
@media (max-width: 1024px) { .events-grid { grid-template-columns: repeat(2, 1fr); } .event-detail__grid { grid-template-columns: 1fr; } .event-detail__hero img { height: 280px; } }
@media (max-width: 640px) { .events-grid { grid-template-columns: 1fr; } .form-group { grid-column: span 12; } }
/* ===== Status badge ===== */
.event-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  border-radius: 4px;
  border: 1px solid transparent;
  background: #f5f5f5;
  color: #333;
}

/* 代表的なキーごとの色（Kurocoの status.key に合わせます） */
.event-status.recruitment {        /* 募集中 */
  background: #E6FFF9;  color: #007A6F;  border-color: #7DE3D7;
}
.event-status.few, 
.event-status.limited {            /* 残りわずか */
  background: #FFF4E6;  color: #A85B00;  border-color: #FFC486;
}
.event-status.full, 
.event-status.closed {             /* 満席・終了 */
  background: #EEE;     color: #666;      border-color: #CCC;
}
.event-status.soon, 
.event-status.upcoming {           /* 受付前（例） */
  background: #E8F1FF;  color: #0F4AA8;  border-color: #A6C3FF;
}

/* 一覧カードのフッター右側に収まり良く */
.event-card .event-status { margin-left: auto; }

/* ===== Category badge (左上バッジ) ===== */
.event-cat {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  border-radius: 2px;
  color: #fff;
  background: #111; /* デフォルト */
  text-transform: uppercase;
  box-shadow: 0 6px 16px rgba(0,0,0,.16);
}

/* カテゴリキーごとに色付け（Kuroco 側の category.key に合わせて拡張してください） */
.event-cat.seminar   { background: #008A7F; } /* セミナー */
.event-cat.workshop  { background: #00B5A5; } /* ワークショップ */
.event-cat.exhibition{ background: #FF5E5B; } /* 展示会 */
.event-cat.forum     { background: #1F2D6B; } /* フォーラム */
/* リボン風 注目バッジ */
.event-card {
    position: relative; /* リボンを基準に配置 */
    overflow: hidden;   /* はみ出し隠し */
}

.event-featured {
    position: absolute;
    top: 12px;
    right: -40px; /* リボンの幅に合わせて調整 */
    background: #FF5E5B;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 50px;
    text-align: center;
    transform: rotate(45deg);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    z-index: 3;
}

.pagination-wrapper {
    margin-top: 48px;
    display: flex;
    justify-content: center;
    width: 100%;
}

.pagination-wrapper nav {
    display: flex;
    justify-content: center;
    width: 100%;
}

.pagination-wrapper .pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.pagination-wrapper .page-item {
    display: inline-flex;
}

.pagination-wrapper .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 2px solid var(--black);
    background: #fff;
    color: var(--black);
    font-weight: 600;
    text-decoration: none;
}

.pagination-wrapper .page-link:hover,
.pagination-wrapper .page-link:focus {
    background: var(--primary);
    color: #fff;
    border-color: var(--black);
    text-decoration: none;
}

.pagination-wrapper .page-item.active .page-link {
    background: var(--primary);
    color: #fff;
    border-color: var(--black);
}

.pagination-wrapper .page-item.disabled .page-link {
    background: var(--gray-100);
    color: var(--gray-500);
    border-color: var(--gray-200);
    cursor: not-allowed;
}

/* ===== Responsive overrides for events index ===== */
/* Smartphone: specific row layout for search form; one card per row */
@media (max-width: 767px) {
  /* Grid placements by order */
  .events-section .search-form { grid-template-columns: repeat(12, 1fr) !important; }
  .events-section .search-form .form-group:nth-of-type(1) { grid-column: 1 / -1 !important; }
  .events-section .search-form .form-group:nth-of-type(2) { grid-column: 1 / span 6 !important; }
  .events-section .search-form .form-group:nth-of-type(3) { grid-column: 7 / -1 !important; }
  .events-section .search-form .form-group:nth-of-type(4) { grid-column: 1 / span 6 !important; }
  .events-section .search-form .form-group:nth-of-type(5) { grid-column: 7 / -1 !important; }
  .events-section .search-form .form-group:nth-of-type(6) { grid-column: 1 / -1 !important; }
  .events-section .search-form .form-group:nth-of-type(7) { grid-column: 1 / -1 !important; }
  .events-section .search-form .form-group:nth-of-type(8) { grid-column: 1 / -1 !important; }

  /* Action rows: split to 3 lines (検索 / リセット / 表示件数) */
  .events-section .search-form .row-actions { display: grid !important; grid-template-columns: 1fr !important; row-gap: 8px; }
  .events-section .search-form .left-actions { display: grid !important; grid-template-columns: 1fr !important; gap: 8px; }
  .events-section .search-form .right-counter { margin-left: 0 !important; justify-self: start !important; }
  .events-section .search-form .left-actions .btn { width: 100%; }

  /* Cards: 1 per row, no horizontal scroll */
  .events-section .events-grid { display: grid !important; grid-auto-flow: row !important; grid-template-columns: 1fr !important; gap: 16px !important; overflow: visible !important; padding-bottom: 0 !important; }
  .events-section .event-card { width: 100% !important; }
}

/* Tablet: row layout per spec; two cards per row */
@media (min-width: 768px) and (max-width: 1023px) {
  .events-section .search-form { grid-template-columns: repeat(12, 1fr) !important; }
  /* 1st row: キーワード(1-12) */
  .events-section .search-form .form-group:nth-of-type(1) { grid-column: 1 / -1 !important; }
  /* 2nd row: 種別(1-6), ステータス(7-12) */
  .events-section .search-form .form-group:nth-of-type(2) { grid-column: 1 / span 6 !important; }
  .events-section .search-form .form-group:nth-of-type(3) { grid-column: 7 / -1 !important; }
  /* 3rd row: FROM(1-6), TO(7-12) */
  .events-section .search-form .form-group:nth-of-type(4) { grid-column: 1 / span 6 !important; }
  .events-section .search-form .form-group:nth-of-type(5) { grid-column: 7 / -1 !important; }
  /* 4th row: 開催予定(1-6), 並び替え(7-12) */
  .events-section .search-form .form-group:nth-of-type(6) { grid-column: 1 / span 6 !important; }
  .events-section .search-form .form-group:nth-of-type(7) { grid-column: 7 / -1 !important; }
  /* 5th row: 検索 / リセット / 表示件数（右カウンタ） */
  .events-section .search-form .form-group:nth-of-type(8) { grid-column: 1 / -1 !important; }
  .events-section .search-form .row-actions { display: flex !important; align-items: center; }
  .events-section .search-form .left-actions { display: flex !important; gap: 12px; }
  .events-section .search-form .right-counter { margin-left: auto !important; }

  /* Cards: 2 per row, no horizontal scroll */
  .events-section .events-grid { display: grid !important; grid-auto-flow: row !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 24px !important; overflow: visible !important; padding-bottom: 0 !important; }
}
