/* ==========================================================================
   曜日カラー共通設定（土曜：青、日曜：赤、平日：dark）
   ========================================================================== */
.date-sun {
  color: #dc3545 !important;
}

.date-sat {
  color: #0d6efd !important;
}

.date-weekday {
  color: #212529 !important;
}

/* ==========================================================================
   共通タグスタイル（一覧・カレンダー・モーダル共用）
   ========================================================================== */
.event-tag {
  display: inline-block;
  font-size: 75%;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  line-height: 1;
  user-select: none;
  transition: opacity 0.15s ease;
}

.tag-city {
  background-color: #e7f1ff;
  color: #0c63e4;
  border: 1px solid #b6d4fe;
  line-height: 1;
}

.tag-target {
  background-color: #f3e8ff;
  color: #6b21a8;
  border: 1px solid #d8b4fe;
  line-height: 1;
}

.tag-type {
  background-color: #fff3cd;
  color: #664d03;
  border: 1px solid #ffecb5;
  line-height: 1;
}

.tag-sport {
  background-color: #d1e7dd;
  color: #0f5132;
  border: 1px solid #badbcc;
  line-height: 1;
}

.tag-keyword {
  background-color: #e2e3e5;
  color: #41464b;
  border: 1px solid #d3d6d8;
  line-height: 1;
}

#btn-keyword-search {
  width: 60px;
  flex-shrink: 0;
}

/* ==========================================================================
   検索一覧画面（event.php）：フィルター開閉トグル＆エリア
   ========================================================================== */
.filter-accordion {
  width: 100%;
}

.filter-toggle-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  font-size: 100%;
  font-weight: 700;
  color: #212529;
  cursor: pointer;
  transition: background-color 0.15s ease;
  line-height: 1.4;
}

.filter-toggle-btn:hover {
  background-color: #eef1f4;
}

.filter-toggle-btn .filter-toggle-arrow {
  transition: transform 0.2s ease;
  font-size: 90%;
  color: #6c757d;
}

.filter-toggle-btn:not(.collapsed) .filter-toggle-arrow {
  transform: rotate(180deg);
}

.filter-toggle-btn:not(.collapsed) {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom-color: #e9ecef;
}

#filterCollapse .filter-section {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-top: none;
}

.filter-section {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 1rem 1.25rem;
}

.filter-group:not(:last-child) {
  border-bottom: 1px dashed #dee2e6;
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
}

.filter-group-label {
  font-size: 85%;
  font-weight: 700;
  color: #495057;
  margin-bottom: 0.35rem;
}

.filter-tag-btn {
  border-radius: 3px;
  font-size: 75%;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.15s ease, box-shadow 0.15s ease;
}

.filter-tag-btn:hover {
  opacity: 0.8;
}

.filter-tag-btn.is-active {
  box-shadow: 0 0 0 2px #212529;
  font-weight: 700;
}

.filter-keyword-form {
  max-width: 480px;
}

/* ==========================================================================
   検索一覧画面（event.php）：ヘッダー・件数・表示切替
   ========================================================================== */
.event-list-header {
  border-bottom: 2px solid #e9ecef;
  padding-bottom: 0.75rem;
}

.event-count {
  font-size: 95%;
  color: #495057;
  white-space: nowrap;
}

.event-count span {
  font-size: 120%;
  font-weight: 700;
  color: #0073cc;
}

.active-tags {
  margin-left: 0.5rem;
}

.active-filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 75%;
  font-weight: 600;
  padding: 0.2rem 0.3rem 0.2rem 0.4rem;
  border-radius: 3px;
  line-height: 1;
}

.active-filter-tag .btn-remove-tag {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font-size: 100%;
  font-weight: bold;
  line-height: 1;
  color: #000;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  opacity: 0.7;
  transition: opacity 0.15s ease;
}

.active-filter-tag .btn-remove-tag:hover {
  opacity: 1;
}

.view-switch-area {
  font-size: 87.5%;
  color: #333333;
  white-space: nowrap;
}

.view-switch-label {
  font-weight: 600;
  line-height: 1;
}

.btn-view-switch {
  background: none;
  border: none;
  padding: 0.25rem 0.4rem;
  font-size: 115%;
  color: #333333;
  cursor: pointer;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.btn-view-switch.is-active {
  color: #0073cc;
}

/* ==========================================================================
   検索一覧画面（event.php）：イベントカード
   ========================================================================== */
.event-card {
  background-color: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  overflow: hidden;
  box-sizing: border-box;
}

.event-card.is-hidden {
  display: none !important;
}

.event-card-thumb {
  background-color: #f0f2f5;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.event-card-thumb.js-event-modal-trigger {
  cursor: pointer;
}

.event-card-thumb img {
  width: 100%;
  height: auto;
  display: block;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.event-card-thumb:hover img {
  transform: scale(1.02);
}

.event-card-body {
  display: flex;
  flex-direction: column;
}

.event-date {
  font-size: 87.5%;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.event-date i {
  margin-right: 0.25rem;
}

.event-title {
  font-size: 105%;
  font-weight: 700;
  line-height: 1.4;
  color: #212529;
  margin: 0 0 0.4rem 0;
}

.event-title.js-event-modal-trigger {
  cursor: pointer;
  transition: color 0.15s ease;
}

.event-title.js-event-modal-trigger:hover {
  color: #0073cc;
  text-decoration: underline;
}

.event-place {
  font-size: 85%;
  line-height: 1.1;
  color: #6c757d;
  margin-bottom: 0.75rem;
}

.event-place i {
  margin-right: 0.25rem;
}

.event-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: auto;
}

.event-tags .event-tag {
  cursor: pointer;
}

.event-tags .event-tag:hover {
  opacity: 0.8;
}

#event-list-container.view-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}

#event-list-container.view-grid .event-card {
  display: flex;
  flex-direction: column;
}

#event-list-container.view-grid .event-card-thumb {
  width: 100%;
  aspect-ratio: 3 / 4;
}

#event-list-container.view-grid .event-card-body {
  padding: 0.85rem;
  flex: 1;
}

#event-list-container.view-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

#event-list-container.view-list .event-card {
  display: flex;
  flex-direction: row;
}

#event-list-container.view-list .event-card-thumb {
  width: 150px;
  min-width: 150px;
  max-width: 150px;
  aspect-ratio: 3 / 4;
}

#event-list-container.view-list .event-card-body {
  padding: 0.85rem 1.25rem;
  flex: 1;
  justify-content: center;
}

@media (max-width: 767.98px) {
  #event-list-container.view-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
  }

  #event-list-container.view-grid .event-card-body {
    padding: 0.6rem;
  }

  #event-list-container.view-grid .event-title {
    font-size: 95%;
  }

  #event-list-container.view-list .event-card {
    flex-direction: row;
  }

  #event-list-container.view-list .event-card-thumb {
    width: 110px;
    min-width: 110px;
    max-width: 110px;
    aspect-ratio: 3 / 4;
  }

  #event-list-container.view-list .event-card-body {
    padding: 0.6rem 0.75rem;
  }

  #event-list-container.view-list .event-title {
    font-size: 95%;
  }
}

/* ==========================================================================
   カレンダー画面（calendar.php）：月ナビゲーション
   ========================================================================== */
.month-nav-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.month-nav-arrow {
  background: #ffffff;
  border: 1px solid #ced4da;
  border-radius: 4px;
  padding: 0.4rem 0.65rem;
  cursor: pointer;
  color: #495057;
  font-size: 90%;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.month-nav-arrow:hover:not(:disabled) {
  background-color: #f8f9fa;
  border-color: #adb5bd;
  color: #212529;
}

.month-nav-arrow:disabled {
  background-color: #f1f3f5;
  color: #adb5bd;
  border-color: #e9ecef;
  cursor: not-allowed;
  opacity: 0.6;
}

.month-nav-scroll {
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex: 1;
  scroll-behavior: smooth;
}

.month-nav-scroll::-webkit-scrollbar {
  display: none;
}

.month-btn-list {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  width: max-content;
}

.month-btn {
  padding: 0.4rem 0.75rem;
  border: 1px solid #ced4da;
  background-color: #ffffff;
  color: #333333;
  font-size: 85%;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1;
  transition: all 0.15s ease;
}

.month-btn:hover:not(:disabled) {
  background-color: #f8f9fa;
  border-color: #adb5bd;
}

.month-btn.is-active {
  background-color: #0073cc;
  color: #ffffff;
  border-color: #0073cc;
}

.month-btn.is-disabled,
.month-btn:disabled {
  background-color: #f1f3f5;
  color: #adb5bd;
  border-color: #e9ecef;
  cursor: not-allowed;
}

/* ==========================================================================
   カレンダー画面（calendar.php）：テーブルレイアウト
   ========================================================================== */
.calendar-table {
  border: 1px solid #ced4da;
  border-radius: 4px;
  overflow: hidden;
  background-color: #ffffff;
}

.calendar-row {
  display: flex;
  border-bottom: 1px solid #ced4da;
}

.calendar-row:last-child {
  border-bottom: none;
}

.calendar-date-col {
  width: 110px;
  min-width: 110px;
  padding: 0.75rem 0.5rem;
  background-color: #f0f3ff;
  border-right: 1px solid #ced4da;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  box-sizing: border-box;
}

.calendar-date {
  font-size: 95%;
  font-weight: 700;
  line-height: 1.2;
  border-right: none !important;
  background: transparent !important;
}

.calendar-events-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.75rem 1rem 0.65rem 1rem;
}

.calendar-event-hr {
  border: 0;
  border-top: 1px solid #ced4da;
  margin: 0;
  opacity: 1;
}

.calendar-event-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0;
  box-sizing: border-box;
}

.calendar-event-thumb {
  width: 38px;
  min-width: 38px;
  height: 50px;
  border-radius: 3px;
  overflow: hidden;
  background-color: #f0f2f5;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.calendar-event-thumb img {
  width: 100%;
  height: auto;
  display: block;
}

.calendar-event-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.calendar-event-title {
  font-size: 95%;
  font-weight: 700;
  color: #212529;
  line-height: 1.35;
  margin: 0;
  cursor: pointer;
  transition: color 0.15s ease;
}

.calendar-event-title:hover {
  color: #0073cc;
  text-decoration: underline;
}

.calendar-event-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.calendar-event-tags .event-tag {
  cursor: default;
}

.calendar-empty-box {
  background-color: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  font-size: 95%;
}

@media (max-width: 767.98px) {
  .calendar-row {
    flex-direction: column;
  }

  .calendar-date-col {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #ced4da;
    padding: 0.4rem 0.75rem;
    justify-content: flex-start;
  }

  .calendar-events-col {
    padding: 0.6rem 0.75rem 0.5rem 0.75rem;
    gap: 0.65rem;
  }

  .calendar-event-item {
    gap: 0.5rem;
  }

  .calendar-event-title {
    font-size: 90%;
  }
}

/* ==========================================================================
   詳細モーダルウィンドウ（event.php / calendar.php 共用）
   ========================================================================== */
.modal-header .modal-title {
  font-size: 115%;
  font-weight: 700;
  color: #212529;
  line-height: 1.4;
}

.event-modal-grid {
  display: flex;
  flex-direction: row;
}

.event-modal-col-img {
  width: 50%;
  background-color: transparent;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.event-modal-main-wrapper {
  width: 100%;
  position: relative;
  display: block;
  text-decoration: none;
}

.event-modal-main-img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  display: block;
}

.event-modal-main-img.can-zoom {
  cursor: zoom-in;
}

.event-modal-main-link {
  display: block;
  width: 100%;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid #dc3545;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.event-modal-media-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  width: 100%;
  margin-top: 0.75rem;
}

.event-modal-subthumb-item {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #dee2e6;
  background-color: #f0f2f5;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  text-decoration: none;
  box-sizing: border-box;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.event-modal-subthumb-item.is-pdf {
  border: 2px solid #dc3545;
}

.event-modal-subthumb-item:hover {
  transform: scale(1.04);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.event-modal-subthumb-item:not(.is-pdf):hover {
  border-color: #0d6efd;
}

.event-modal-subthumb-item img {
  width: 100%;
  height: auto;
  display: block;
}

.badge-pdf {
  position: absolute;
  top: 0;
  right: 0;
  background-color: #dc3545;
  color: #ffffff;
  font-size: 65%;
  font-weight: 700;
  padding: 2px 1px 2px 4px;
  border-bottom-left-radius: 3px;
  line-height: 1;
  letter-spacing: 0.3px;
  pointer-events: none;
}

.badge-pdf-lg {
  font-size: 75%;
  padding: 4px 8px;
  top: 0;
  right: 0;
  border-bottom-left-radius: 4px;
}

.event-modal-col-info {
  width: 50%;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}

.event-modal-date {
  font-size: 95%;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.event-modal-date i {
  margin-right: 0.25rem;
}

.event-modal-name {
  font-size: 125%;
  font-weight: 700;
  color: #212529;
  line-height: 1.4;
  margin: 0 0 0.5rem 0;
}

.event-modal-place {
  font-size: 90%;
  color: #495057;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.event-modal-place i {
  margin-right: 0.25rem;
}

.event-modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e9ecef;
}

.event-modal-meta-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.event-modal-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.event-modal-meta-label {
  font-size: 80%;
  font-weight: 700;
  color: #6c757d;
  line-height: 1.2;
}

.event-modal-meta-value {
  font-size: 90%;
  color: #212529;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.event-modal-link {
  color: #0073cc;
  text-decoration: none;
  font-weight: 600;
}

.event-modal-link:hover {
  text-decoration: underline;
}

.event-modal-link i {
  font-size: 85%;
  margin-left: 0.25rem;
}

@media (max-width: 991.98px) {
  #event-detail-modal .modal-dialog {
    max-width: min(800px, calc(100% - 1rem));
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 767.98px) {
  #event-detail-modal .modal-dialog {
    max-width: min(450px, calc(100% - 1rem));
    margin-left: auto;
    margin-right: auto;
  }

  .event-modal-grid {
    flex-direction: column;
  }

  .event-modal-col-img {
    width: 100%;
    padding: 1rem;
  }

  .event-modal-main-wrapper {
    max-width: 100%;
    margin: 0 auto;
  }

  .event-modal-media-list {
    max-width: 100%;
    margin: 0.75rem auto 0 auto;
  }

  .event-modal-col-info {
    width: 100%;
    padding: 1rem;
  }

  .event-modal-name {
    font-size: 110%;
  }
}

/* ==========================================================================
   ライトボックス（event.php / calendar.php 共用）
   ========================================================================== */
.event-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  z-index: 1070;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  cursor: zoom-out;
}

.event-lightbox.d-none {
  display: none !important;
}

.event-lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.event-lightbox-content img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  cursor: default;
}

.event-lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 200%;
  line-height: 1;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.15s ease;
  z-index: 1071;
}

.event-lightbox-close:hover {
  opacity: 1;
}