/* Anotações — só o que é deste módulo. A base (.module-*, .form-modal-*) vem do app.css do host.
   Servido em /_content/Cesar.Modules.Notes.Web/css/notes.css. */
@layer components {
    .notes-toolbar {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 10px;
    }

    .notes-sort {
        flex: 0 0 auto;
        width: 220px;
    }

    .notes-layout {
        display: grid;
        grid-template-columns: 200px minmax(0, 1fr);
        gap: 24px;
        align-items: start;
    }

    /* ---------- tags (lateral) ---------- */
    .notes-sidebar {
        position: sticky;
        top: 76px;
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .notes-sidebar-head {
        padding: 0 4px 6px;
    }

    .notes-tags {
        display: flex;
        margin: 0;
        padding: 0;
        flex-direction: column;
        gap: 2px;
        list-style: none;
    }

    .notes-tag-button {
        position: relative;
        display: flex;
        width: 100%;
        align-items: center;
        gap: 8px;
        padding: 9px 12px 9px 14px;
        border: none;
        border-radius: 8px;
        color: var(--ink-muted);
        background: none;
        font: inherit;
        font-size: 15px;
        text-align: left;
        cursor: pointer;
        transition: background 120ms ease, color 120ms ease;
    }

    .notes-tag-button::before {
        content: "";
        position: absolute;
        top: 50%;
        left: 0;
        width: 3px;
        height: 0;
        border-radius: 3px;
        background: var(--green);
        translate: 0 -50%;
        transition: height 160ms ease;
    }

    .notes-tag-button:hover {
        color: var(--ink);
        background: var(--surface-hover);
    }

    .notes-tag-button[aria-current="true"] {
        color: var(--ink);
        background: var(--green-soft);
        font-weight: 600;
    }

    .notes-tag-button[aria-current="true"]::before {
        height: 60%;
    }

    .notes-tag-button:focus-visible {
        outline: 2px solid var(--green);
        outline-offset: 1px;
    }

    .notes-tag-name {
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .notes-tag-count {
        color: var(--ink-muted);
        font-size: var(--text-xs);
        font-variant-numeric: tabular-nums;
    }

    /* ---------- grade de notas ---------- */
    .notes-results {
        display: flex;
        min-width: 0;
        flex-direction: column;
        gap: 10px;
    }

    .notes-results-head {
        min-height: 20px;
        padding: 0 4px;
    }

    .notes-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
        gap: 14px;
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .notes-card {
        display: flex;
        min-width: 0;
    }

    .notes-card-button {
        display: flex;
        width: 100%;
        min-height: 150px;
        flex-direction: column;
        gap: 8px;
        padding: 16px 18px;
        border: 1px solid var(--line);
        border-radius: 14px;
        color: var(--ink);
        background: var(--surface-strong);
        box-shadow: var(--shadow-1);
        font: inherit;
        text-align: left;
        cursor: pointer;
        transition: border-color 120ms ease, box-shadow 120ms ease, translate 120ms ease;
    }

    .notes-card-button:hover {
        border-color: var(--line-hover);
        box-shadow: var(--shadow-2);
        translate: 0 -1px;
    }

    .notes-card-button:focus-visible {
        outline: 2px solid var(--green);
        outline-offset: 2px;
    }

    .notes-card.is-pinned .notes-card-button {
        border-color: var(--green);
    }

    .notes-card-head {
        display: flex;
        align-items: flex-start;
        gap: 8px;
    }

    .notes-card-title {
        flex: 1;
        min-width: 0;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        font-family: Georgia, "Times New Roman", serif;
        font-size: 1.05rem;
        font-weight: 600;
        line-height: 1.3;
    }

    .notes-card-pin {
        width: 14px;
        height: 14px;
        flex: 0 0 auto;
        margin-top: 3px;
        color: var(--green);
    }

    .notes-card-body {
        flex: 1;
        display: -webkit-box;
        -webkit-line-clamp: 4;
        -webkit-box-orient: vertical;
        overflow: hidden;
        color: var(--ink-muted);
        font-size: var(--text-sm);
        line-height: 1.45;
        white-space: pre-line;
    }

    .notes-card-foot {
        display: flex;
        align-items: flex-end;
        justify-content: space-between;
        gap: 8px;
    }

    .notes-card-tags {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        min-width: 0;
    }

    .notes-card-date {
        flex: 0 0 auto;
        color: var(--ink-muted);
        font-size: var(--text-2xs);
        white-space: nowrap;
    }

    .notes-modal {
        width: min(600px, calc(100vw - 32px));
    }

    .notes-modal textarea {
        min-height: 200px;
        font-size: 15px;
        line-height: 1.5;
    }

    @media (max-width: 720px) {
        .notes-toolbar .module-search {
            flex-basis: 100%;
        }

        .notes-sort {
            flex: 1;
            width: auto;
        }

        .notes-layout {
            grid-template-columns: 1fr;
            gap: 12px;
        }

        .notes-sidebar {
            position: static;
        }

        .notes-tags {
            flex-direction: row;
            gap: 6px;
            overflow-x: auto;
            padding-bottom: 4px;
            scrollbar-width: none;
        }

        .notes-tag-item {
            flex: 0 0 auto;
        }

        .notes-tag-button {
            padding: 8px 12px;
            border: 1px solid var(--line-control);
            border-radius: 999px;
            font-size: var(--text-sm);
        }

        .notes-tag-button::before {
            display: none;
        }

        .notes-tag-button[aria-current="true"] {
            border-color: var(--green);
        }

        .notes-grid {
            grid-template-columns: 1fr;
        }
    }
}
