/* ═══════════════════════════════════════════════════════════════════
   IELTS Listening Mocks admin
   ═══════════════════════════════════════════════════════════════════ */

/* Generic admin button — used inside this page only so we don't get
   stylesheet-order arguments with the rest of the admin chrome. */
.alm-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem 1.05rem;
  border: 1px solid rgba(74, 58, 38, .18);
  background: #fff;
  color: #2A1F12;
  font: inherit;
  font-size: .88rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: background .14s, border-color .14s, transform .08s;
}
.alm-btn:hover { background: #FBF6EB; border-color: rgba(74, 58, 38, .35); }
.alm-btn:active { transform: translateY(1px); }
.alm-btn[disabled] { opacity: .45; cursor: not-allowed; }
.alm-btn-primary {
  background: #2A1F12;
  border-color: #2A1F12;
  color: #F5EBD3;
}
.alm-btn-primary:hover { background: #3a2c1c; border-color: #3a2c1c; }

/* ── List view ───────────────────────────────────────────────────── */

.alm-list { padding: 1rem 0 3rem; }

.alm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.alm-card {
  display: flex;
  flex-direction: column;
  gap: .8rem;
  padding: 1.2rem 1.3rem 1.1rem;
  background: #fff;
  border: 1px solid rgba(74, 58, 38, .12);
  border-radius: 14px;
  text-decoration: none;
  color: #2A1F12;
  transition: border-color .14s, box-shadow .14s, transform .12s;
}
.alm-card:hover {
  border-color: rgba(181, 122, 46, .55);
  box-shadow: 0 8px 24px -16px rgba(74, 58, 38, .35);
  transform: translateY(-1px);
}

.alm-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
}
.alm-card-eyebrow {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #7B6850;
}
.alm-card-status {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .25rem .55rem;
  border-radius: 999px;
}
.alm-card-status.is-draft { background: rgba(74, 58, 38, .09); color: #7B6850; }
.alm-card-status.is-live  { background: rgba(58, 138, 80, .12); color: #2C6C40; }

.alm-card-title {
  margin: 0;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.6rem;
  font-weight: 500;
  line-height: 1.15;
}

.alm-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
  margin-top: .2rem;
}
.alm-card-stat {
  padding: .55rem .7rem;
  background: rgba(74, 58, 38, .04);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.alm-card-stat.is-done {
  background: rgba(58, 138, 80, .08);
}
.alm-card-stat-label {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #7B6850;
}
.alm-card-stat-val {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 500;
}
.alm-card-stat.is-done .alm-card-stat-val { color: #2C6C40; }

.alm-card-foot {
  display: flex;
  align-items: center;
  gap: .3rem;
  margin-top: .2rem;
  font-size: .82rem;
  font-weight: 600;
  color: #B57A2E;
}

.alm-empty {
  text-align: center;
  padding: 3.5rem 1.5rem;
  border: 1px dashed rgba(74, 58, 38, .25);
  border-radius: 16px;
  background: #fff;
}
.alm-empty h3 {
  margin: 0 0 .5rem;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 500;
}
.alm-empty p {
  margin: 0 auto 1.2rem;
  max-width: 38rem;
  color: #5e4d3a;
  font-size: .95rem;
  line-height: 1.55;
}

/* ── Migration banner (one-time legacy slug rename prompt) ──────── */
.alm-migrate-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
  background: #fff8e6;
  border: 1px solid #e8d39a;
  border-radius: 12px;
}
.alm-migrate-text {
  flex: 1;
  font-size: .92rem;
  line-height: 1.5;
  color: #5e4d3a;
}
.alm-migrate-text strong { color: #4a3a26; }
.alm-migrate-text code {
  background: rgba(74, 58, 38, .08);
  padding: .1rem .35rem;
  border-radius: 4px;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: .85em;
}
.alm-migrate-banner button { flex: 0 0 auto; }

/* ── Editor view ─────────────────────────────────────────────────── */

.adm-page-h.alm-editor-head { align-items: flex-start; }
.alm-back {
  display: inline-block;
  margin-bottom: .25rem;
  font-size: .8rem;
  font-weight: 600;
  color: #7B6850;
  text-decoration: none;
}
.alm-back:hover { color: #2A1F12; }

/* Title + source edit (replaces the static h1 + desc) */
.alm-meta-edit {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin: .25rem 0 .55rem;
}
.alm-meta-edit-row {
  display: flex;
  align-items: center;
  gap: .55rem;
}
.alm-meta-edit-label {
  width: 3.6rem;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #7B6850;
}
.alm-meta-edit-title {
  flex: 1;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 6px;
  padding: .25rem .55rem;
  font: inherit;
  color: #2A1F12;
  transition: background .14s, border-color .14s;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.8rem;
  font-weight: 500;
  line-height: 1.1;
}
.alm-meta-edit-title:hover {
  background: rgba(74, 58, 38, .035);
}
.alm-meta-edit-title:focus {
  outline: none;
  background: #fff;
  border-color: #B57A2E;
  box-shadow: 0 0 0 2px rgba(181, 122, 46, .15);
}

.alm-draft-toggle {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: .85rem;
  color: #2A1F12;
  cursor: pointer;
}
.alm-draft-toggle input { margin: 0; }

.alm-editor {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  padding-bottom: 4rem;
}

.alm-part {
  background: #fff;
  border: 1px solid rgba(74, 58, 38, .12);
  border-radius: 14px;
  padding: 1.3rem 1.5rem 1.5rem;
}
.alm-part-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: .8rem;
  border-bottom: 1px solid rgba(74, 58, 38, .08);
}
.alm-part-title {
  margin: 0;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.6rem;
  font-weight: 500;
}
.alm-part-meta {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #7B6850;
}

.alm-audio {
  margin-bottom: 1.2rem;
  padding: 1rem 1.1rem;
  background: rgba(74, 58, 38, .04);
  border-radius: 10px;
}
.alm-audio-row {
  display: flex;
  align-items: center;
  gap: .8rem;
  flex-wrap: wrap;
}
.alm-audio-status {
  font-size: .85rem;
  font-weight: 500;
}
.alm-audio-status.is-ok { color: #2C6C40; }
.alm-audio-status.is-missing { color: #7B6850; font-style: italic; }

.alm-audio-progress {
  margin-top: .7rem;
  height: 4px;
  background: rgba(74, 58, 38, .12);
  border-radius: 999px;
  overflow: hidden;
}
.alm-audio-progress-bar {
  height: 100%;
  width: 0%;
  background: #B57A2E;
  transition: width .14s;
}

.alm-audio-player { margin-top: .7rem; }
.alm-audio-player audio { display: block; width: 100%; max-width: 520px; }

.alm-crop {
  margin-top: .9rem;
  padding-top: .8rem;
  border-top: 1px dashed rgba(74, 58, 38, .15);
}
.alm-crop-label {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .9rem;
  font-weight: 500;
  color: #2A1F12;
}
.alm-crop-input {
  width: 5rem;
  padding: .35rem .55rem;
  border: 1px solid rgba(74, 58, 38, .22);
  border-radius: 6px;
  font: inherit;
  font-size: .88rem;
  background: #fff;
}
.alm-crop-input:focus {
  outline: none;
  border-color: #B57A2E;
  box-shadow: 0 0 0 2px rgba(181, 122, 46, .15);
}
.alm-crop-fmt {
  font-style: normal;
  color: #7B6850;
  font-size: .82rem;
}
.alm-crop-hint {
  margin: .45rem 0 0;
  font-size: .78rem;
  color: #7B6850;
  line-height: 1.4;
  max-width: 46rem;
}

.alm-blocks {
  display: flex;
  flex-direction: column;
  gap: .65rem;
}

.alm-block {
  padding: .9rem 1rem;
  border: 1px solid rgba(74, 58, 38, .1);
  border-radius: 10px;
  background: #FBF6EB;
}
.alm-block-label {
  font-size: .9rem;
  color: #2A1F12;
}
.alm-block-label strong {
  font-weight: 700;
  color: #B57A2E;
}
.alm-block-stem {
  margin-top: .3rem;
  font-size: .85rem;
  font-style: italic;
  color: #5e4d3a;
  line-height: 1.4;
}

.alm-milestone {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin-top: .55rem;
}
.alm-milestone-label {
  font-size: .82rem;
  font-weight: 500;
  color: #5e4d3a;
}
.alm-milestone-input {
  width: 7rem;
  padding: .35rem .55rem;
  border: 1px solid rgba(74, 58, 38, .22);
  border-radius: 6px;
  font: inherit;
  font-size: .88rem;
  background: #fff;
}
.alm-milestone-input:focus {
  outline: none;
  border-color: #B57A2E;
  box-shadow: 0 0 0 2px rgba(181, 122, 46, .15);
}
.alm-milestone-fmt {
  font-style: normal;
  color: #7B6850;
  font-size: .82rem;
}

/* Map image editor — appears on map-labeling blocks under the
   milestone input. Paste a URL OR upload from device. */
.alm-mapurl {
  margin-top: .55rem;
}
.alm-mapurl-row {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex-wrap: wrap;
}
.alm-mapurl-label {
  font-size: .82rem;
  font-weight: 500;
  color: #5e4d3a;
  white-space: nowrap;
}
.alm-mapurl-input {
  flex: 1;
  padding: .35rem .55rem;
  border: 1px solid rgba(74, 58, 38, .22);
  border-radius: 6px;
  font: inherit;
  font-size: .85rem;
  background: #fff;
  min-width: 0;
}
.alm-mapurl-input:focus {
  outline: none;
  border-color: #B57A2E;
  box-shadow: 0 0 0 2px rgba(181, 122, 46, .15);
}
.alm-mapurl-upload { flex-shrink: 0; }

.alm-mapurl-progress {
  margin-top: .55rem;
  height: 4px;
  background: rgba(74, 58, 38, .12);
  border-radius: 999px;
  overflow: hidden;
}
.alm-mapurl-progress-bar {
  height: 100%;
  width: 0%;
  background: #B57A2E;
  transition: width .14s;
}

.alm-mapurl-preview {
  margin-top: .7rem;
  max-width: 360px;
}
.alm-mapurl-preview img {
  max-width: 100%;
  max-height: 240px;
  border-radius: 8px;
  border: 1px solid rgba(74, 58, 38, .14);
  background: #fff;
  display: block;
}

.alm-editor-foot {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.3rem;
  background: rgba(248, 245, 238, .92);
  border-top: 1px solid rgba(74, 58, 38, .12);
  backdrop-filter: blur(8px);
}
.alm-foot-hint {
  margin: 0;
  font-size: .78rem;
  color: #7B6850;
}
