/**
 * myLogbook single-entry components — Zone 4.
 */

/* ---- Hero/overview section ---- */

.ml-entry-hero {
  background-color: var(--ml-bg-surface);
  border: 1px solid var(--ml-border);
  border-radius: var(--ml-radius-lg);
  padding: var(--ml-space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--ml-space-sm);
}

.ml-entry-eyebrow {
  font-size: var(--ml-text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ml-accent);
  font-weight: 700;
  margin: 0;
}

.ml-entry-hero h1 {
  margin: 0;
}

.ml-entry-excerpt {
  color: var(--ml-text-secondary);
  margin: 0;
  max-width: 65ch;
}

.ml-entry-hero-image {
  width: 100%;
  max-width: 42rem;
  max-height: 22rem;
  object-fit: cover;
  border-radius: var(--ml-radius-md);
  margin-top: var(--ml-space-sm);
  margin-inline: auto;
}

.ml-entry-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ml-space-2xs);
}

.ml-entry-badge {
  font-size: var(--ml-text-xs);
  font-weight: 600;
  color: var(--ml-text-secondary);
  background-color: var(--ml-bg-muted);
  border: 1px solid var(--ml-border);
  border-radius: var(--ml-radius-pill);
  padding: 3px 10px;
}

/* ---- Content section wrapper ----
   .ml-content-body is the Zone 2 TOC contract: real headings inside get
   picked up automatically as nested TOC entries. */

.ml-content-body {
  line-height: var(--ml-leading-relaxed);
}

.ml-content-body > *:first-child {
  margin-top: 0;
}

/* ---- Item table (Parts List / Ingredients) ---- */

.ml-item-table {
  display: flex;
  flex-direction: column;
  gap: var(--ml-space-xs);
}

.ml-item-row {
  display: grid;
  grid-template-columns: 3rem 1fr auto;
  gap: var(--ml-space-sm);
  align-items: center;
  background-color: var(--ml-bg-surface);
  border: 1px solid var(--ml-border);
  border-radius: var(--ml-radius-md);
  padding: var(--ml-space-xs) var(--ml-space-sm);
}

.ml-item-thumb,
.ml-item-thumb-fallback {
  width: 3rem;
  height: 3rem;
  border-radius: var(--ml-radius-sm);
  object-fit: cover;
  border: 1px solid var(--ml-border);
  flex-shrink: 0;
}

.ml-item-thumb-fallback {
  background-color: var(--ml-bg-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ml-item-thumb-fallback img {
  width: 1.25rem;
  height: 1.25rem;
  opacity: 0.55;
}

.ml-item-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ml-item-name {
  font-weight: 600;
  font-size: var(--ml-text-sm);
  color: var(--ml-text-primary);
  overflow-wrap: break-word;
}

.ml-item-badge {
  display: inline-flex;
  align-self: flex-start;
  font-size: var(--ml-text-xs);
  color: var(--ml-text-muted);
  border: 1px solid var(--ml-border);
  border-radius: var(--ml-radius-pill);
  padding: 1px 8px;
  text-decoration: none;
}

.ml-item-badge-link:hover {
  color: var(--ml-accent);
  border-color: var(--ml-accent);
}

.ml-item-amount {
  font-weight: 600;
  font-size: var(--ml-text-sm);
  color: var(--ml-text-secondary);
  white-space: nowrap;
}

/* ---- Simple pill list (Tools Needed / Equipment) ---- */

.ml-simple-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ml-space-xs);
}

.ml-simple-item {
  font-size: var(--ml-text-sm);
  color: var(--ml-text-secondary);
  background-color: var(--ml-bg-muted);
  border-radius: var(--ml-radius-pill);
  padding: 5px 12px;
}

@media (max-width: 30rem) {
  .ml-item-row {
    grid-template-columns: 2.5rem 1fr auto;
  }
  .ml-item-thumb,
  .ml-item-thumb-fallback {
    width: 2.5rem;
    height: 2.5rem;
  }
}
