/* ============================================================
   WebCMS App — Shared Styles
   グレースケール骨格スタイル（デザインは後フェーズで追加）
   ============================================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-bg:          #f5f5f5;
  --color-surface:     #ffffff;
  --color-border:      #d0d0d0;
  --color-border-dark: #aaaaaa;
  --color-text:        #1a1a1a;
  --color-text-muted:  #666666;
  --color-text-light:  #999999;
  --color-primary:     #2a2a2a;
  --color-primary-hover: #000000;
  --color-accent:      #555555;
  --color-disabled:    #cccccc;
  --color-demo-badge:  #888888;

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.15);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "SF Mono", "Consolas", "Menlo", monospace;

  --topbar-height: 48px;
  --statusbar-height: 32px;
  --filetree-width: 250px;
  --chat-width: 300px;
}

html, body {
  height: 100%;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text);
  background-color: var(--color-bg);
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border: 1px solid var(--color-border-dark);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 13px;
  font-family: var(--font-sans);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.1s, border-color 0.1s;
}
.btn:hover {
  background: #f0f0f0;
}
.btn:active {
  background: #e8e8e8;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.btn-primary:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}

/* コミット確定ボタン：押すと即座にGitHubへコミットされることを色で明示 */
.btn-commit {
  background: #1a6ee8;
  color: #fff;
  border-color: #1a6ee8;
}
.btn-commit:hover {
  background: #1558c0;
  border-color: #1558c0;
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
}
.btn-ghost:hover {
  background: rgba(0,0,0,0.06);
}

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

.btn:disabled,
.btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ---------- App Header (dashboard / editor shared) ---------- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--topbar-height);
  padding: 0 16px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.app-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

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

.user-email {
  font-size: 13px;
  color: var(--color-text-muted);
}

/* ---------- Modal ---------- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 100;
  align-items: center;
  justify-content: center;
}
.modal-overlay.is-open {
  display: flex;
}
.modal-content {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 380px;
  max-width: 90vw;
  box-shadow: var(--shadow-md);
}
.modal-content h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}
.modal-content p {
  color: var(--color-text-muted);
  margin-bottom: 20px;
  font-size: 13px;
}
.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ---------- Utility ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}
