/* ==========================================================================
   管理画面用スタイルシート
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS変数（カラーパレット）
   -------------------------------------------------------------------------- */
:root {
  /* プライマリカラー */
  --admin-primary: #3b82f6;
  --admin-primary-hover: #2563eb;
  --admin-primary-light: #eff6ff;
  
  /* セカンダリカラー */
  --admin-secondary: #6b7280;
  --admin-secondary-hover: #4b5563;
  
  /* 危険色 */
  --admin-danger: #ef4444;
  --admin-danger-hover: #dc2626;
  --admin-danger-light: #fef2f2;
  
  /* 成功色 */
  --admin-success: #22c55e;
  --admin-success-hover: #16a34a;
  --admin-success-light: #f0fdf4;
  
  /* 警告色 */
  --admin-warning: #f59e0b;
  --admin-warning-hover: #d97706;
  --admin-warning-light: #fffbeb;
  
  /* 情報色 */
  --admin-info: #3b82f6;
  --admin-info-light: #eff6ff;
  
  /* 背景色 */
  --admin-bg: #f3f4f6;
  --admin-bg-white: #ffffff;
  --admin-bg-dark: #1f2937;
  
  /* テキスト色 */
  --admin-text: #1f2937;
  --admin-text-light: #6b7280;
  --admin-text-white: #ffffff;
  
  /* ボーダー色 */
  --admin-border: #e5e7eb;
  --admin-border-dark: #d1d5db;
  
  /* シャドウ */
  --admin-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --admin-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --admin-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  
  /* サイドバー幅 */
  --admin-sidebar-width: 240px;
}

/* --------------------------------------------------------------------------
   リセット・ベーススタイル（管理画面用）
   -------------------------------------------------------------------------- */
.admin-body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--admin-text);
  background-color: var(--admin-bg);
}

.admin-body * {
  box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   レイアウト
   -------------------------------------------------------------------------- */
#admin-container {
  display: flex;
  min-height: 100vh;
}

#admin-sidebar {
  width: var(--admin-sidebar-width);
  background-color: var(--admin-bg-dark);
  color: var(--admin-text-white);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}

#admin-main {
  flex: 1;
  margin-left: var(--admin-sidebar-width);
  padding: 24px;
  min-height: 100vh;
}

/* --------------------------------------------------------------------------
   サイドバー
   -------------------------------------------------------------------------- */
.admin-sidebar-header {
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-sidebar-header h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.admin-sidebar-header a {
  color: var(--admin-text-white);
  text-decoration: none;
}

.admin-sidebar-nav {
  padding: 16px 0;
}

.admin-sidebar-nav a {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.admin-sidebar-nav a:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--admin-text-white);
}

.admin-sidebar-nav a.selected {
  background-color: rgba(59, 130, 246, 0.2);
  color: var(--admin-text-white);
  border-left-color: var(--admin-primary);
}

.admin-sidebar-nav .nav-icon {
  margin-right: 12px;
  font-size: 18px;
  width: 24px;
  text-align: center;
}

/* --------------------------------------------------------------------------
   ページヘッダー
   -------------------------------------------------------------------------- */
.admin-page-header {
  margin-bottom: 24px;
}

.admin-page-header h2 {
  margin: 0 0 8px 0;
  font-size: 24px;
  font-weight: 600;
  color: var(--admin-text);
}

.admin-breadcrumb {
  font-size: 13px;
  color: var(--admin-text-light);
}

.admin-breadcrumb a {
  color: var(--admin-primary);
  text-decoration: none;
}

.admin-breadcrumb a:hover {
  text-decoration: underline;
}

.admin-breadcrumb span {
  margin: 0 8px;
}

/* --------------------------------------------------------------------------
   カード
   -------------------------------------------------------------------------- */
.admin-card {
  background-color: var(--admin-bg-white);
  border-radius: 8px;
  box-shadow: var(--admin-shadow);
  padding: 24px;
  margin-bottom: 24px;
}

.admin-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--admin-border);
}

.admin-card-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   フラッシュメッセージ
   -------------------------------------------------------------------------- */
.admin-flash {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  font-weight: 500;
}

.admin-flash-icon {
  margin-right: 12px;
  font-size: 18px;
}

.admin-flash-success {
  background-color: var(--admin-success-light);
  color: #166534;
  border: 1px solid #bbf7d0;
}

.admin-flash-error {
  background-color: var(--admin-danger-light);
  color: #991b1b;
  border: 1px solid #fecaca;
}

.admin-flash-info {
  background-color: var(--admin-info-light);
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.admin-flash-warning {
  background-color: var(--admin-warning-light);
  color: #92400e;
  border: 1px solid #fde68a;
}

/* --------------------------------------------------------------------------
   ボタン
   -------------------------------------------------------------------------- */
.admin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.admin-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.admin-btn-primary {
  background-color: var(--admin-primary);
  color: var(--admin-text-white);
  border-color: var(--admin-primary);
}

.admin-btn-primary:hover:not(:disabled) {
  background-color: var(--admin-primary-hover);
  border-color: var(--admin-primary-hover);
}

.admin-btn-secondary {
  background-color: var(--admin-bg-white);
  color: var(--admin-text);
  border-color: var(--admin-border-dark);
}

.admin-btn-secondary:hover:not(:disabled) {
  background-color: var(--admin-bg);
  border-color: var(--admin-secondary);
}

.admin-btn-danger {
  background-color: var(--admin-danger);
  color: var(--admin-text-white);
  border-color: var(--admin-danger);
}

.admin-btn-danger:hover:not(:disabled) {
  background-color: var(--admin-danger-hover);
  border-color: var(--admin-danger-hover);
}

.admin-btn-success {
  background-color: var(--admin-success);
  color: var(--admin-text-white);
  border-color: var(--admin-success);
}

.admin-btn-success:hover:not(:disabled) {
  background-color: var(--admin-success-hover);
  border-color: var(--admin-success-hover);
}

.admin-btn-sm {
  padding: 4px 12px;
  font-size: 13px;
}

.admin-btn-lg {
  padding: 12px 24px;
  font-size: 16px;
}

.admin-btn-icon {
  margin-right: 8px;
}

/* --------------------------------------------------------------------------
   フォーム要素
   -------------------------------------------------------------------------- */
.admin-form-group {
  margin-bottom: 16px;
}

.admin-form-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--admin-text);
}

.admin-form-label-required::after {
  content: " *";
  color: var(--admin-danger);
}

.admin-form-input,
.admin-form-select,
.admin-form-textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--admin-text);
  background-color: var(--admin-bg-white);
  border: 1px solid var(--admin-border-dark);
  border-radius: 6px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.admin-form-input:focus,
.admin-form-select:focus,
.admin-form-textarea:focus {
  outline: none;
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.admin-form-input::placeholder {
  color: var(--admin-text-light);
}

.admin-form-textarea {
  min-height: 120px;
  resize: vertical;
}

.admin-form-checkbox {
  display: flex;
  align-items: center;
}

.admin-form-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-right: 8px;
  accent-color: var(--admin-primary);
}

.admin-form-inline {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-form-inline .admin-form-input {
  width: auto;
}

/* --------------------------------------------------------------------------
   テーブル
   -------------------------------------------------------------------------- */
.admin-table-container {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table th,
.admin-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--admin-border);
}

.admin-table th {
  background-color: var(--admin-bg);
  font-weight: 600;
  color: var(--admin-text);
  white-space: nowrap;
}

.admin-table tbody tr:hover {
  background-color: var(--admin-primary-light);
}

.admin-table tbody tr:nth-child(even) {
  background-color: #f9fafb;
}

.admin-table tbody tr:nth-child(even):hover {
  background-color: var(--admin-primary-light);
}

/* --------------------------------------------------------------------------
   バッジ
   -------------------------------------------------------------------------- */
.admin-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 9999px;
}

.admin-badge-success {
  background-color: var(--admin-success-light);
  color: #166534;
}

.admin-badge-danger {
  background-color: var(--admin-danger-light);
  color: #991b1b;
}

.admin-badge-warning {
  background-color: var(--admin-warning-light);
  color: #92400e;
}

.admin-badge-info {
  background-color: var(--admin-info-light);
  color: #1e40af;
}

.admin-badge-secondary {
  background-color: #f3f4f6;
  color: var(--admin-text-light);
}

/* --------------------------------------------------------------------------
   リスト
   -------------------------------------------------------------------------- */
.admin-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.admin-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--admin-border);
  transition: background-color 0.2s ease;
}

.admin-list-item:hover {
  background-color: var(--admin-bg);
}

.admin-list-item:last-child {
  border-bottom: none;
}

.admin-list-item-content {
  flex: 1;
}

.admin-list-item-actions {
  display: flex;
  gap: 8px;
}

/* --------------------------------------------------------------------------
   統計カード
   -------------------------------------------------------------------------- */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.admin-stat-card {
  background-color: var(--admin-bg-white);
  border-radius: 8px;
  box-shadow: var(--admin-shadow);
  padding: 20px;
}

.admin-stat-label {
  font-size: 13px;
  color: var(--admin-text-light);
  margin-bottom: 4px;
}

.admin-stat-value {
  font-size: 28px;
  font-weight: 600;
  color: var(--admin-text);
}

.admin-stat-icon {
  font-size: 24px;
  margin-bottom: 8px;
}

/* --------------------------------------------------------------------------
   アクションバー
   -------------------------------------------------------------------------- */
.admin-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.admin-action-bar-left {
  display: flex;
  gap: 12px;
  align-items: center;
}

.admin-action-bar-right {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* --------------------------------------------------------------------------
   空の状態
   -------------------------------------------------------------------------- */
.admin-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--admin-text-light);
}

.admin-empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.admin-empty-title {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--admin-text);
}

/* --------------------------------------------------------------------------
   ユーティリティ
   -------------------------------------------------------------------------- */
.admin-mt-4 { margin-top: 16px; }
.admin-mb-4 { margin-bottom: 16px; }
.admin-mr-2 { margin-right: 8px; }
.admin-ml-2 { margin-left: 8px; }

.admin-text-right { text-align: right; }
.admin-text-center { text-align: center; }

.admin-flex { display: flex; }
.admin-flex-wrap { flex-wrap: wrap; }
.admin-items-center { align-items: center; }
.admin-justify-between { justify-content: space-between; }
.admin-gap-2 { gap: 8px; }
.admin-gap-4 { gap: 16px; }

.admin-hidden { display: none; }

/* --------------------------------------------------------------------------
   レスポンシブ（基本対応）
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  #admin-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  
  #admin-sidebar.open {
    transform: translateX(0);
  }
  
  #admin-main {
    margin-left: 0;
  }
  
  .admin-stats {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   サイドバイサイドエディタ
   ========================================================================== */

.side-by-side-editor {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 200px);
  min-height: 500px;
  background-color: var(--admin-bg-white);
  border-radius: 8px;
  box-shadow: var(--admin-shadow);
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   ツールバー
   -------------------------------------------------------------------------- */
.editor-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background-color: var(--admin-bg);
  border-bottom: 1px solid var(--admin-border);
  flex-shrink: 0;
}

.editor-toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.editor-toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.editor-toolbar-divider {
  width: 1px;
  height: 24px;
  background-color: var(--admin-border-dark);
  margin: 0 4px;
}

/* モード切替タブ */
.editor-mode-tabs {
  display: flex;
  background-color: var(--admin-bg-white);
  border-radius: 6px;
  padding: 2px;
  border: 1px solid var(--admin-border);
}

.editor-mode-tab {
  padding: 6px 14px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--admin-text-light);
  border-radius: 4px;
  transition: all 0.2s ease;
}

.editor-mode-tab:hover {
  color: var(--admin-text);
  background-color: var(--admin-bg);
}

.editor-mode-tab.active {
  background-color: var(--admin-primary);
  color: var(--admin-text-white);
}

/* フォーマットボタン */
.editor-format-buttons {
  display: flex;
  align-items: center;
  gap: 2px;
}

.editor-format-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 4px;
  font-size: 14px;
  color: var(--admin-text);
  transition: all 0.15s ease;
}

.editor-format-btn:hover {
  background-color: var(--admin-border);
}

.editor-format-btn:active {
  background-color: var(--admin-border-dark);
}

/* ショートカットヒント */
.editor-shortcut-hint {
  font-size: 12px;
  color: var(--admin-text-light);
}

/* --------------------------------------------------------------------------
   エディタコンテナ
   -------------------------------------------------------------------------- */
.editor-container {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.editor-pane {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.editor-pane-left {
  width: 50%;
  border-right: 1px solid var(--admin-border);
}

.editor-pane-right {
  width: 50%;
}

.editor-pane-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background-color: #f8f9fa;
  border-bottom: 1px solid var(--admin-border);
  font-size: 12px;
  font-weight: 500;
  color: var(--admin-text-light);
  flex-shrink: 0;
}

.editor-line-info {
  font-family: monospace;
  font-size: 11px;
}

/* テキストエリア */
.editor-textarea-wrapper {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.editor-textarea {
  width: 100%;
  height: 100%;
  padding: 16px;
  border: none;
  resize: none;
  font-family: 'SF Mono', 'Consolas', 'Monaco', 'Menlo', monospace;
  font-size: 14px;
  line-height: 1.6;
  color: var(--admin-text);
  background-color: var(--admin-bg-white);
  tab-size: 2;
}

.editor-textarea:focus {
  outline: none;
}

.editor-textarea::placeholder {
  color: var(--admin-text-light);
}

/* プレビュー */
.editor-preview {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background-color: var(--admin-bg-white);
  line-height: 1.7;
}

.editor-preview h1 {
  font-size: 1.8em;
  margin: 0.5em 0;
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--admin-border);
}

.editor-preview h2 {
  font-size: 1.5em;
  margin: 0.8em 0 0.4em;
  padding-bottom: 0.2em;
  border-bottom: 1px solid var(--admin-border);
}

.editor-preview h3 {
  font-size: 1.25em;
  margin: 0.8em 0 0.4em;
}

.editor-preview p {
  margin: 0.5em 0;
}

.editor-preview ul,
.editor-preview ol {
  padding-left: 1.5em;
  margin: 0.5em 0;
}

.editor-preview li {
  margin: 0.25em 0;
}

.editor-preview code {
  background-color: #f1f3f4;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'SF Mono', 'Consolas', 'Monaco', 'Menlo', monospace;
  font-size: 0.9em;
}

.editor-preview pre {
  background-color: #f6f8fa;
  padding: 16px;
  border-radius: 6px;
  overflow-x: auto;
}

.editor-preview pre code {
  background: none;
  padding: 0;
}

.editor-preview blockquote {
  margin: 0.5em 0;
  padding: 0.5em 1em;
  border-left: 4px solid var(--admin-primary);
  background-color: var(--admin-primary-light);
  color: var(--admin-text);
}

.editor-preview a {
  color: var(--admin-primary);
  text-decoration: none;
}

.editor-preview a:hover {
  text-decoration: underline;
}

.editor-preview table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
}

.editor-preview th,
.editor-preview td {
  border: 1px solid var(--admin-border);
  padding: 8px 12px;
  text-align: left;
}

.editor-preview th {
  background-color: var(--admin-bg);
  font-weight: 600;
}

.editor-preview-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--admin-text-light);
}

/* リサイズハンドル */
.editor-resize-handle {
  width: 8px;
  background-color: var(--admin-bg);
  cursor: col-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color 0.15s ease;
}

.editor-resize-handle:hover {
  background-color: var(--admin-border-dark);
}

.editor-resize-handle-bar {
  width: 2px;
  height: 40px;
  background-color: var(--admin-border-dark);
  border-radius: 1px;
}

/* スクロール同期チェックボックス */
.editor-sync-scroll {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  cursor: pointer;
}

.editor-sync-scroll input {
  width: 14px;
  height: 14px;
  accent-color: var(--admin-primary);
}

/* 保存ステータス */
.editor-save-status {
  margin-left: 12px;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
}

.editor-save-status.unsaved {
  background-color: var(--admin-warning-light);
  color: #92400e;
}

.editor-save-status.saving {
  background-color: var(--admin-info-light);
  color: #1e40af;
}

.editor-save-status.saved {
  background-color: var(--admin-success-light);
  color: #166534;
}

/* --------------------------------------------------------------------------
   レスポンシブ対応
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .side-by-side-editor {
    height: auto;
    min-height: auto;
  }
  
  .editor-container {
    flex-direction: column;
  }
  
  .editor-pane-left,
  .editor-pane-right {
    width: 100% !important;
    border-right: none;
  }
  
  .editor-pane-left {
    border-bottom: 1px solid var(--admin-border);
  }
  
  .editor-textarea-wrapper {
    height: 400px;
  }
  
  .editor-preview {
    height: 400px;
  }
  
  .editor-resize-handle {
    display: none;
  }
  
  .editor-shortcut-hint {
    display: none;
  }
}

@media (max-width: 640px) {
  .editor-toolbar {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .editor-toolbar-left {
    width: 100%;
    justify-content: space-between;
  }
  
  .editor-format-buttons {
    display: none;
  }
  
  .editor-textarea-wrapper {
    height: 300px;
  }
  
  .editor-preview {
    height: 300px;
  }
}

/* --------------------------------------------------------------------------
   ドロップダウンメニュー
   -------------------------------------------------------------------------- */
.editor-dropdown {
  position: relative;
  display: inline-block;
}

.editor-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  display: none;
  min-width: 160px;
  padding: 8px;
  background-color: var(--admin-bg-white);
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  box-shadow: var(--admin-shadow-lg);
}

.editor-dropdown.open .editor-dropdown-menu {
  display: block;
}

/* 色選択メニュー */
.color-picker-menu {
  min-width: 180px;
  padding: 12px;
}

.color-picker-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}

.color-btn {
  width: 28px;
  height: 28px;
  border: 2px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.color-btn:hover {
  transform: scale(1.15);
  border-color: var(--admin-text);
}

.color-picker-custom {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid var(--admin-border);
}

.color-picker-custom input[type="color"] {
  width: 36px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--admin-border);
  border-radius: 4px;
  cursor: pointer;
}

.color-btn-apply {
  flex: 1;
  padding: 4px 8px;
  font-size: 12px;
  background-color: var(--admin-primary);
  color: var(--admin-text-white);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.color-btn-apply:hover {
  background-color: var(--admin-primary-hover);
}

/* --------------------------------------------------------------------------
   モーダル
   -------------------------------------------------------------------------- */
.editor-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.5);
  padding: 20px;
}

.editor-modal.open {
  display: flex;
}

.editor-modal-content {
  width: 100%;
  max-width: 480px;
  background-color: var(--admin-bg-white);
  border-radius: 12px;
  box-shadow: var(--admin-shadow-lg);
  overflow: hidden;
}

.editor-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background-color: var(--admin-bg);
  border-bottom: 1px solid var(--admin-border);
}

.editor-modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.editor-modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--admin-text-light);
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.editor-modal-close:hover {
  background-color: var(--admin-border);
  color: var(--admin-text);
}

.editor-modal-body {
  padding: 20px;
}

.editor-modal-hint {
  margin: 12px 0 0;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--admin-text-light);
  background-color: var(--admin-info-light);
  border-radius: 6px;
}

.editor-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 20px;
  background-color: var(--admin-bg);
  border-top: 1px solid var(--admin-border);
}

/* テーブルプレビュー */
.table-preview-container {
  margin-top: 16px;
}

.table-preview {
  max-height: 200px;
  overflow: auto;
  padding: 12px;
  background-color: var(--admin-bg);
  border: 1px solid var(--admin-border);
  border-radius: 6px;
}

.table-preview table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.table-preview th,
.table-preview td {
  padding: 6px 10px;
  border: 1px solid var(--admin-border-dark);
  text-align: left;
}

.table-preview th {
  background-color: var(--admin-bg-white);
  font-weight: 600;
}

.table-preview td {
  background-color: var(--admin-bg-white);
}



html, body,
h1, h2, h3, h4, h5, h6,
p, blockquote, address, pre, div, form, hr,
ul, ol, li, dl, dt, dd,
table, caption, tr, td, th,
ins, del,
a, sup, sub,
em, strong, dfn, code, samp, kbd, var, cite, abbr, acronym {
	margin: 0;
	padding: 0;
	font-style: normal;
	font-weight: normal;
	text-decoration: none;
}

body {
	margin: 0 auto;
	line-height: 1.5;
	color: #000;
	font-size: 100%;
	background: #f2f2f2;
}

.main {
	padding-top: 1em;
	padding-bottom: 1em;
}

.inner {
	margin: 0 auto;
	max-width: 55rem;
}

header {
	color: black;
	background: #FFD6AA;
}

header .outer {
	width: 100%;
	min-height: 300px;
	background: url(/header.jpg);
	background-position: left calc(100% - 5rem) bottom 0;
	background-repeat: no-repeat;
}

p, ul, ol, dl, pre, address {
	margin: 1em 30px;
	letter-spacing: 0.01em;
}

p.breadcrumbs {
	margin-left: 0;
}

p {
}

h1, h2, h3, h4, h5, h6 {
	margin: 0.5em 0; 
}


h1, h2, h3, h4 {
	font-weight: bold;
}

h1 {
	margin: 0;
	padding: 40px 0;
	font-size: 300%;
}

@media screen and (max-width: 600px) {
	h1 {
		font-size: 200%;
	}
	header .outer {
		background-position: right 0 bottom 0;
		background-size: contain;
	}
}
  

h1 span {
	background: rgba(255, 214, 170, 0.7);

}

/* https://jajaaan.co.jp/css/css-headline/ */
h2 {
	display: inline-block;
	position: relative;
	padding: 1rem 2rem calc(1rem + 10px);
	background: #fffbb0;
	margin-top: 4rem;
	font-size: 140%;
}

h2:first-child {
	margin-top: 10px;
}

h2:before {
	position: absolute;
	top: -7px;
	left: -7px;
	width: 100%;
	height: 100%;
	content: '';
	border: 2px solid #828282;
  }
  
  

h3 {
	padding: 0 20px;
	border-bottom: 2px dotted #d8beb8;
	font-size: 135%;
	margin-top: 2rem;
}

h4 {
	padding: 0 25px;
	font-size: 110%;
}

h5, h6 {
	padding: 0 30px;
	font-size: 100%;
}

pre {
	padding: 0.5em 10px;
	background-color: #fff;
	white-space: pre;
}

address {
	text-align: right;
}

blockquote {
	margin: 1.5em 30px;
	border: 1px solid #700;
}

li {
	margin: 0.5em 10px;
}

li li, li p, li pre, li dt, li dd,
dd li, dd p, dd pre, dd dt, dd dd {
	font-size: 100%;
}

li ul, li ol, li dl, li p,
dd ul, dd ol, dd dl, dd p {
	margin: 0.1em 10px;
}

dt {
	margin: 0.6em 10px 0.1em 10px;
	background-color: #e8e8e8;
}

dd {
	margin: 0.1em 10px 0.6em 30px;
}

table {
	margin: 0 30px 0.5em 30px;
	border-collapse: collapse;
}
td, th {
	border: 1px solid #CCC;
	padding: 0.1em 5px;
}
th {
	background: #F3F3F3;
}

a:link, a:visited, a:active, a:hover, a:focus {
	border-bottom: 1px solid;
}

a:link {
	border-bottom-color: rgb(62, 84, 194);
	color: rgb(62, 84, 194);
}

a:visited {
	border-bottom-color: rgb(161, 62, 194);
	color: rgb(161, 62, 194);
}

a:active, a:hover {
	border-bottom-color: rgb(194, 62, 97);
	color: rgb(194, 62, 97);
}

em, strong {
	color: #d30e0e;
}

strong {
	font-weight: bold;
}

del, del * {
	color: #999;
	text-decoration: line-through;
}

ins {
	border-bottom: 1px dashed #999;
}

footer {
	background: #333;
	padding: 1em 0;
	color: white;
}

hr {
	margin: 20px 0;
}

ul.schedule > li,
ul.schedule > li > ul > li {
	font-weight: bold;
}

ul.schedule > li > ul {
	font-weight: normal;
}

body {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

footer {
	  margin-top: auto;
}

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

.menu {
	background: #FFD6AA;
	padding-bottom: 1em;
}

.menu menu {
	list-style-type: none;
	display: flex;
	gap: 1em;
	margin: 0;
	padding: 0;
}

.menu menu a {
	background: #faba75;
	color: black;
	border: none;
	font-weight: bold;
}

.menu menu li {
	margin: 0;
}

.menu menu li a {
	display: inline-block;
	padding: 0.5em 1em;
}

.menu menu li a:hover {
	background: rgb(123, 87, 49);	
}

details {
	margin: 1em 0.5em;
}

/* https://pa-tu.work/t/6960 */
.message {
	position: relative;
	margin: 2rem;
	padding: 0.5rem;
	box-shadow: 0 0 0 0.5rem #dfcfab;
	background-color: #dfcfab;
	border-left: 10px dotted white;
}

.message p {
	color: #333;
}

.message-title {
	font-weight: bold;
}

@media only screen and (min-width: 800px) {
	#menu-button {
		display: none;
	}
}

@media only screen and (max-width: 799px) {
	#menu-button {
		color: black;
		font-weight: bold;
	}

	.menu menu {
		display: block;
	}

	.menu menu li a {
		display: block;
	}

	.menu menu.hidden {
		display: none;
	}
}

@media only screen and (min-width: 800px) {
	.rooms {
		display: flex;
		width: 55rem;
	}

	.room {
		width: 27.5rem;
	}

	.rooms3 .room {
		width: 18.3rem;
	}

	.rooms4 {
		width: 60rem;
	}

	.rooms4 .room {
		width: 15rem;
	}

	.inner:has(.rooms4) {
		max-width: 60rem;
	}
}

.field-name {
	display: inline-block;
	background: #bbb;
	margin: 2px 5px;
	border-radius: 5px;
}

input:not([type]), input[type=text], textarea {
	padding: 0.15em 0.1em;
	font-size: 110%;
}

#search-form input[name=query] {
	border: 1px gray solid;
	border-radius: 20px;
	padding: 10px 20px;
}

@media only screen and (max-width: 799px) {
	#application-submit-form input[type=text], #application-submit-form textarea {
		max-width: 200px;
	}
}

#search-form input[type=submit] {
	appearance: none;
	border: none;
	border-radius: 50%;
	justify-content: center;
	align-items: center;
	width: 2em;
	height: 2em;
	background: #6fa1ff;
	color: #FFF;
	text-decoration: none;
	text-align: center;
	margin: 10px 0;
	cursor: pointer;
	font-size: 110%;
}

a.toppage-button {
	appearance: none;
	border: none;
	border-radius: 10px;
	background: grey;
	color: #FFF;
	text-decoration: none;
	text-align: center;
	padding: 10px;
	font-size: 110%;
}

#news summary {
	overflow: auto;
	display: block;
	list-style: none;
	cursor: pointer;
}

#news summary::-webkit-details-marker {
  display:none;
}

#news summary > * {
	float: left;
}

#news summary .news-date {
	display: inline-block;
	width: 8em;
}

p:has(#news-list-button) {
	margin-top: 2em;
}

#gallery {
	overflow: auto;
}

#galleryBody {
	margin: 0 auto;
	width: 100%;
	overflow: hidden;
}

#gotoPrevious, #gotoNext, #currentPhoto {
	height: calc(300px + 3rem);
	float: left;
}

#currentPhoto {
	overflow: hidden;
}

#currentPhotoInner {
	display: flex;
	flex-direction: row;
	width: 100%;
	position: relative;
	top: 0;
	left: 0;
}

#currentPhotoInner > div {
	width: 100%;
	flex-shrink: 0;
}

#currentPhotoInner > div > * {
	width: 100%;
}

#gotoPrevious, #gotoNext {
	width: 30px;
    display: flex;
    align-items: center;
	cursor: pointer;
}

#search {
	overflow: auto;
}

#search > * {
	float: left;
}


/* https://saruwakakun.com/html-css/reference/speech-bubble */
.balloon {
	width: 100%;
	margin: 3em 0px;
	overflow: hidden;
}

.balloon .faceicon {
	float: left;
	margin-right: -90px;
	width: 80px;
}

.balloon .faceicon img{
	width: 100%;
	height: auto;
	border-radius: 50%;
}

.balloon .chatting {
	width: 100%;
}

.says {
	display: inline-block;
	position: relative; 
	margin: 5px 0 0 105px;
	padding: 17px 13px;
	border-radius: 12px;
	background: #e0cfaf;
}

.says:after {
	content: "";
	display: inline-block;
	position: absolute;
	top: 18px; 
	left: -24px;
	border: 12px solid transparent;
	border-right: 12px solid #e0cfaf;
}

.says p {
	margin: 0;
	padding: 0;
}


@media only screen and (min-width: 800px) {
	#event-overview {	
		display: grid;
		grid-template-columns: 1fr 1fr;
	}

	#event-overview-infos {
		display: grid;
		grid-template-columns: 1fr 1fr;
	}
}

#event-overview-paragraphs h {
	font-weight: bold;
	font-size: 200%;
}

.event-overview-info {
	border: 1px grey solid;
	border-radius: 5px;
	margin: 10px;
	padding: 10px;
}

#event-overview-infos h {
	font-weight: bold;
}

#container {
	overflow: auto;
}
#side, #main {
	float: left;	
}
#side {
	width: 15rem;
}
#side > * {
	margin-right: 15px;
	background: #333;
}
#side a {
	display: block;
	color: white;
	border: 0px;
	padding: 5px;
}
#side .selected a {
	background: #366;
}
#side a:hover {
	background: #666;
}
#main {
	max-width: 40rem;
}

.rooms p {
	margin: 1em 15px;
}

.event-overview-info p, .event-overview-info ul, .event-overview-info ol {
	margin: 1em 10px;
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */
