/* guitarmemo — orange theme, mobile-first, no emojis */

:root {
  --orange-600: #ea580c;
  --orange-500: #f97316;
  --orange-100: #ffedd5;
  --orange-50: #fff7ed;
  --ink: #1c1917;
  --muted: #78716c;
  --line: #e7e5e4;
  --bg: #ffffff;
  --danger: #dc2626;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(28, 25, 23, 0.08), 0 4px 14px rgba(28, 25, 23, 0.06);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--orange-50);
  line-height: 1.5;
}

h1 { font-size: 1.5rem; margin: 0.5rem 0; letter-spacing: -0.01em; }
h2 { font-size: 1.15rem; margin: 1.75rem 0 0.75rem; }

a { color: var(--orange-600); text-decoration: none; }
a:hover { text-decoration: underline; }

.muted { color: var(--muted); }
.empty { color: var(--muted); padding: 1rem 0; }

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem 1rem 4rem;
}

/* Header / nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  background: rgba(255, 247, 237, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--ink);
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  line-height: 1;
}
.brand:hover { text-decoration: none; }
.brand-accent { color: var(--orange-500); }
.brand-logo { width: 20px; height: 20px; border-radius: 5px; display: block; }

.site-nav {
  margin-left: auto;
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 0.5rem 1rem 1rem;
  box-shadow: var(--shadow);
}
.site-nav.open { display: flex; }

.nav-link {
  display: block;
  padding: 0.6rem 0.25rem;
  color: var(--ink);
  font-weight: 600;
  border-radius: 8px;
}
.nav-link:hover { text-decoration: none; color: var(--orange-600); }
.nav-link.active { color: var(--orange-600); }

.nav-avatar { padding: 0.35rem 0; }

.nav-toggle {
  margin-left: auto;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.18s ease, opacity 0.18s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (min-width: 720px) {
  .nav-toggle { display: none; }
  .site-nav {
    position: static;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }
  .nav-link { padding: 0.4rem 0.6rem; }
}

/* Buttons & forms */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.55rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}
.btn:hover { text-decoration: none; border-color: var(--orange-500); }
.btn:active { transform: translateY(1px); }

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

.btn-danger { color: var(--danger); border-color: #fecaca; }
.btn-danger:hover { border-color: var(--danger); }

.btn-small { min-height: 36px; padding: 0.3rem 0.7rem; font-size: 0.9rem; }

.btn-link {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  padding: 0.6rem 0.25rem;
}
.btn-link:hover { color: var(--orange-600); }

.stack { display: flex; flex-direction: column; gap: 0.9rem; max-width: 480px; }
.stack label { display: flex; flex-direction: column; gap: 0.35rem; font-weight: 600; font-size: 0.95rem; }

input[type="text"], input[type="password"], input[type="file"], select {
  font: inherit;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  min-height: 44px;
}
input:focus, select:focus {
  outline: 2px solid var(--orange-500);
  outline-offset: 1px;
  border-color: var(--orange-500);
}

.inline-form { display: inline; }
.row-form { max-width: 480px; }

/* Flash */
.flash {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  margin: 0.75rem 0;
  font-weight: 600;
}
.flash-error { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.flash-notice { background: var(--orange-100); color: var(--orange-600); border: 1px solid #fed7aa; }

/* Hero */
.hero { padding: 1.5rem 0 0.5rem; }
.hero h1 { font-size: 1.9rem; letter-spacing: -0.03em; }

/* Cards & grids */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
}
@media (min-width: 720px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  color: var(--ink);
}
.card:hover { text-decoration: none; transform: translateY(-2px); }

.card-media {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--orange-100);
}
.card-media-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--orange-500);
}

.card-body { padding: 0.6rem 0.75rem 0.75rem; display: flex; flex-direction: column; gap: 0.2rem; }
.card-title { font-weight: 700; font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-meta { font-size: 0.8rem; color: var(--muted); display: flex; align-items: center; gap: 0.3rem; flex-wrap: wrap; }

.icon { display: inline-flex; width: 1.1em; height: 1.1em; }
.icon svg { width: 100%; height: 100%; }
.icon-lg { width: 2.4rem; height: 2.4rem; }
.icon-xs { width: 0.9em; height: 0.9em; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
}
.badge-public { color: var(--orange-600); border-color: #fed7aa; background: var(--orange-100); }

/* Detail pages */
.detail h1 { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }

/* Page header: title + badge + inline actions all on one aligned row */
.page-head .title-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin: 0.5rem 0;
  line-height: 1.2;
}
.title-row .title-text { min-width: 0; }
.title-row .inline-form { display: inline-flex; }
.title-row .btn { align-self: center; }

.page-sub {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0.25rem 0 0;
}

.btn-icon { padding: 0.4rem; min-width: 40px; }
.btn-icon .icon { width: 1.15rem; height: 1.15rem; }

/* Inline rename */
.inline-edit {
  cursor: text;
  border-radius: 8px;
  padding: 0;
  margin-left: -0.35rem;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.inline-edit:hover { background: var(--orange-100); }

/* NOTE: the global `input[type="text"]` rule (specificity 0,1,1) beats a lone
   class, so this selector must be more specific (0,2,0) to win. Editing keeps
   the exact same box as the resting title, only the background intensifies. */
.inline-edit .inline-edit-input {
  font: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: inherit;
  min-height: 0;
  min-width: 4ch;
  max-width: 100%;
  box-sizing: border-box;
}
.inline-edit .inline-edit-input:focus {
  outline: none;
  border: none;
}
.inline-edit.editing {
  background: var(--orange-100);
  border-color: var(--orange-500);
}

/* "+" add-album tile: a simple rectangle with a single plus */
.card-add {
  cursor: pointer;
  font: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  transition: border-color 0.15s ease, color 0.15s ease;
}
.card-add:hover { border-color: var(--orange-500); color: var(--orange-500); }

/* Album card with a hover "x" to unlink it from the page */
.card-wrap { position: relative; }
.card-wrap .card { height: 100%; }
.card-remove { position: absolute; top: 6px; right: 6px; z-index: 2; }
.card-remove-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(28, 25, 23, 0.6);
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease;
}
.card-wrap:hover .card-remove-btn,
.card-wrap:focus-within .card-remove-btn { opacity: 1; }
.card-remove-btn:hover { background: var(--danger); }

/* Album picker dropdown panel */
.picker-panel {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.5rem;
  margin: 0.5rem 0 1rem;
  max-width: 480px;
}
.picker-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.picker-item {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  font-weight: 600;
  padding: 0.65rem 0.75rem;
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: var(--ink);
}
.picker-item:hover { background: var(--orange-100); color: var(--orange-600); }

/* Members: inline with "owned by", expand to manage */
.members-inline { display: inline-block; position: relative; }
.members-summary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.members-summary::-webkit-details-marker { display: none; }
.members-avatars { display: inline-flex; align-items: center; }
.members-avatars .avatar { margin-left: -8px; border: 2px solid var(--bg); }
.members-avatars .avatar:first-child { margin-left: 0; }
.members-count { font-weight: 700; color: var(--muted); font-size: 0.85rem; }
.members-inline .members-body {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 30;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
  min-width: 260px;
}

.player {
  width: 100%;
  border-radius: var(--radius);
  background: #000;
  margin: 0.75rem 0;
}
.player-video { max-height: 70vh; }
.player-image { object-fit: contain; max-height: 70vh; background: var(--orange-100); }
audio.player { background: var(--bg); }

.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.75rem 0; }

.chip {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: var(--orange-100);
  color: var(--orange-600);
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0.15rem 0.15rem 0.15rem 0;
}

.panel {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  margin: 1rem 0;
}
.panel h2 { margin-top: 0; }

.member-list { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.member-row { display: flex; align-items: center; gap: 0.6rem; }
.member-row .inline-form { margin-left: auto; }

.picker { display: flex; flex-direction: column; gap: 0.4rem; max-width: 560px; }
.picker-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.picker-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Avatars */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  background: var(--orange-100);
  color: var(--orange-600);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  flex-shrink: 0;
}
.avatar-sm { width: 32px; height: 32px; font-size: 0.9rem; }
.avatar-lg { width: 84px; height: 84px; font-size: 2rem; }

.profile-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1rem 0 0.5rem;
}

/* Progress bar */
.progress {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  height: 12px;
  background: var(--orange-100);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  height: 22px;
}
.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--orange-500);
  transition: width 0.15s ease;
}
.progress-label { font-size: 0.75rem; font-weight: 700; color: var(--ink); padding-right: 0.6rem; margin-left: auto; }

/* Footer */
.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 2rem 1rem calc(2rem + env(safe-area-inset-bottom));
}

/* Auth box */
.auth-box { max-width: 420px; margin: 2rem auto; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
