/* ============================================================================
   COMPONENT: note — Care Notebook feed entries (FEA-0011). One card holds the
   whole feed; each entry is a hairline-separated row (prototype feed).
   ========================================================================== */

@layer components {
  .notebook { overflow: hidden; }

  .notebook__toolbar,
  .notebook__footer {
    padding: var(--space-md);
    border-block-start: var(--border-width) solid var(--color-border);
  }

  .notebook__toolbar {
    padding-block-end: var(--space-sm);
    border-block-start: 0;
    border-block-end: var(--border-width) solid var(--color-border);
  }

  /* Full-width Post update CTA inside the notebook card (prototype). */
  .notebook__post {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2xs);
    inline-size: 100%;
    min-block-size: var(--touch-target);
    padding-inline: var(--space-md);
    font-size: var(--text-md);
    font-weight: var(--weight-medium);
    color: var(--color-text);
    background: var(--surface);
    border: var(--border-width) solid var(--color-border-strong);
    border-radius: var(--radius-lg);
    cursor: pointer;

    &:hover { border-color: var(--accent); }
    &:focus-visible { outline: none; box-shadow: var(--focus-ring); }
  }

  .notebook-feed {
    list-style: none;
    margin: 0;
    padding: var(--space-md);
    padding-block-start: var(--space-sm);
  }

  .notebook-feed > .note + .note,
  .notebook-feed > .photo + .note,
  .notebook-feed > .note + .photo {
    border-block-start: var(--border-width) solid var(--color-border);
    margin-block-start: var(--space-md);
    padding-block-start: var(--space-md);
  }

  .notebook-feed__empty {
    padding: var(--space-xl) var(--space-md);
    border-block-start: 0;
  }

  .note__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    margin: 0;
  }

  .note__byline { display: flex; align-items: center; gap: var(--space-xs); min-inline-size: 0; }
  .note__author { font-weight: var(--weight-medium); font-size: var(--text-sm); }
  .note__you { font-weight: var(--weight-normal); }
  .note__time { font-size: var(--text-xs); flex: none; text-align: end; }
  .note__edited { font-size: inherit; }

  /* Visited / Called / Note type pills (prototype badge colours). */
  .note__type {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2xs);
    margin: var(--space-xs) 0 0;
  }

  .note-type {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3xs);
    padding: var(--space-3xs) var(--space-xs);
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    border-radius: var(--radius-pill);
    line-height: 1.2;
  }

  .note-type--visited { background: var(--status-success-bg); color: var(--status-success-fg); }
  .note-type--called  { background: var(--status-info-bg); color: var(--status-info-fg); }
  .note-type--note     { background: var(--surface-sunken); color: var(--color-text-muted); }

  .note__presence { font-size: var(--text-xs); }

  .note__body {
    margin-block: var(--space-xs) 0;
    font-size: var(--text-sm);
    line-height: var(--leading-normal);
  }

  .note__photos {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-block-start: var(--space-xs);
  }

  .note__thumb {
    inline-size: 3.5rem;
    block-size: 3.5rem;
    object-fit: cover;
    border-radius: var(--radius-md);
    border: var(--border-width) solid var(--color-border);
    background: var(--surface-sunken);
  }

  .note__actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-block-start: var(--space-sm);
  }

  .note__action {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3xs);
    min-block-size: var(--touch-target);
    padding-inline: var(--space-2xs);
    font-size: var(--text-sm);
    font-weight: var(--weight-normal);
    color: var(--color-text-muted);
    background: none;
    border: 0;
    cursor: pointer;
    text-decoration: none;

    &:hover { color: var(--color-text); text-decoration: underline; }
    &:focus-visible { outline: none; box-shadow: var(--focus-ring); }
  }

  .note__action--danger { color: var(--status-danger-fg); }
  .note__action--danger:hover { color: var(--status-danger-fg); }

  /* Locked entries the viewer cannot edit (prototype lock row). */
  .note__locked {
    display: flex;
    align-items: center;
    gap: var(--space-3xs);
    margin: var(--space-sm) 0 0;
    font-size: var(--text-xs);
  }

  /* confirm-dialog styles live in components/confirm-dialog.css */

  @media (min-width: 48rem) {
    .notebook-feed {
      padding-inline: var(--space-lg);
    }

    .notebook__toolbar,
    .notebook__footer {
      padding-inline: var(--space-lg);
    }
  }

  @media (max-width: 47.99rem) {
    .notebook__footer { display: none; }
  }
}
