/* =========================================================
   Api News — Notifications
   Brand colours, standard system font, no icons.
   NEW and EARLIER sections; unread titles bold, read light.
   ========================================================= */


/* =========================================================
   TOKENS
   ========================================================= */

:root {
    --brown: #412e03;
    --brown-dark: #2c1f02;
    --gold: #d89b00;
    --gold-dark: #a87700;
    --gold-soft: #fdf6e3;

    --bg: #fafafa;
    --white: #ffffff;
    --line: #e6e6e3;
    --line-soft: #efefec;

    --text: #1f1c16;
    --text-soft: #5f5c55;
    --muted: #8a877f;
    --read: #77746c;

    --radius: 8px;
}


/* =========================================================
   GLOBAL
   ========================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    min-height: 100vh;

    background: var(--bg);
    color: var(--text);

    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
}

button:focus-visible,
a:focus-visible,
.notification-item:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}


/* =========================================================
   HEADER (same pattern as the dashboard)
   ========================================================= */

.account-header {
    position: sticky;
    top: 0;
    z-index: 100;

    background: var(--white);
    border-bottom: 1px solid var(--line);
}

.account-header-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;

    width: min(1000px, calc(100% - 40px));
    min-height: 64px;
    margin: 0 auto;
}

.header-back {
    justify-self: start;

    padding: 8px 0;

    color: var(--brown);

    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;

    transition: color 0.2s ease;
}

.header-back:hover {
    color: var(--gold-dark);
}

.header-back-short {
    display: none;
}

.header-title {
    justify-self: center;

    color: var(--brown);
    opacity: 0.5;

    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.28em;
    text-transform: uppercase;

    user-select: none;
}

.header-home {
    justify-self: end;

    display: inline-flex;

    padding: 4px;

    transition: opacity 0.2s ease, transform 0.2s ease;
}

.header-home:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.header-logo {
    display: block;

    width: 40px;
    height: 40px;

    object-fit: contain;
}


/* =========================================================
   PAGE + HEADING
   ========================================================= */

.notifications-page {
    min-height: calc(100vh - 140px);
    padding: 30px 0 56px;
}

.notifications-container {
    width: min(820px, calc(100% - 40px));
    margin: 0 auto;
}

.notifications-heading {
    margin-bottom: 20px;
}

.section-label {
    margin-bottom: 4px;

    color: var(--gold-dark);

    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.notifications-heading h1 {
    color: var(--text);

    font-size: 24px;
    font-weight: 700;
    line-height: 1.25;
}

.notifications-heading p:not(.section-label) {
    margin-top: 4px;

    color: var(--text-soft);

    font-size: 13.5px;
}


/* =========================================================
   TOOLBAR
   ========================================================= */

.notification-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;

    margin-bottom: 8px;
    padding-bottom: 12px;

    border-bottom: 1px solid var(--line);
}

.notification-filter {
    display: inline-flex;

    border: 1px solid var(--line);
    border-radius: 6px;

    overflow: hidden;
}

.filter-button {
    padding: 7px 16px;

    background: var(--white);
    border: 0;

    color: var(--text-soft);

    font-size: 13px;
    font-weight: 600;

    cursor: pointer;

    transition: background 0.2s ease, color 0.2s ease;
}

.filter-button + .filter-button {
    border-left: 1px solid var(--line);
}

.filter-button:hover {
    color: var(--brown);
}

.filter-button.active {
    background: var(--brown);
    color: var(--white);
}

.mark-all-button {
    padding: 7px 0;

    background: none;
    border: 0;

    color: var(--brown);

    font-size: 13px;
    font-weight: 600;

    cursor: pointer;

    transition: color 0.2s ease;
}

.mark-all-button:hover {
    color: var(--gold-dark);
}

.mark-all-button:disabled {
    color: var(--muted);
    opacity: 0.6;
    cursor: default;
}


/* =========================================================
   SECTIONS: NEW  /  EARLIER
   ========================================================= */

.notification-group + .notification-group {
    margin-top: 18px;
    padding-top: 18px;

    border-top: 1px solid var(--line);
}

.notification-group-label {
    margin: 12px 0 8px;

    color: var(--brown);

    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.notification-group + .notification-group .notification-group-label {
    margin-top: 0;

    color: var(--muted);
}

.notification-group-list {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);

    overflow: hidden;
}


/* =========================================================
   ONE NOTIFICATION
   ========================================================= */

.notification-item {
    position: relative;

    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;

    padding: 14px 18px;

    border-bottom: 1px solid var(--line-soft);

    cursor: pointer;

    transition: background 0.15s ease;
}

.notification-item:last-child {
    border-bottom: 0;
}

.notification-item:hover {
    background: #fcfbf8;
}

/* Unread: thin brown line on the left */
.notification-item.unread::before {
    content: "";

    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;

    width: 3px;

    background: var(--brown);
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-kind {
    margin-bottom: 2px;

    color: var(--muted);

    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.notification-title {
    color: var(--text);

    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;

    overflow-wrap: anywhere;
}

.notification-message {
    margin-top: 2px;

    color: var(--text-soft);

    font-size: 13px;
    line-height: 1.5;
}

.notification-time {
    flex: 0 0 auto;

    padding-top: 2px;

    color: var(--muted);

    font-size: 12px;
    white-space: nowrap;
}

/* Read: light text */
.notification-item.read .notification-title {
    color: var(--read);
    font-weight: 400;
}

.notification-item.read .notification-message,
.notification-item.read .notification-kind {
    color: #9c998f;
}

.notification-item.unread .notification-time {
    color: var(--brown);
    font-weight: 600;
}


/* =========================================================
   LOADING / EMPTY / ERROR
   ========================================================= */

.notifications-loading {
    padding: 50px 0;

    color: var(--muted);

    font-size: 13.5px;
    text-align: center;
}

.notifications-empty,
.notifications-error {
    padding: 48px 24px;

    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);

    text-align: center;
}

.notifications-empty h2,
.notifications-error h2 {
    color: var(--text);

    font-size: 17px;
    font-weight: 700;
}

.notifications-empty p,
.notifications-error p {
    max-width: 440px;
    margin: 6px auto 18px;

    color: var(--text-soft);

    font-size: 13.5px;
}

.browse-articles-button,
.retry-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 38px;
    padding: 0 18px;

    background: var(--brown);
    border: 1px solid var(--brown);
    border-radius: 6px;

    color: var(--white);

    font-size: 13px;
    font-weight: 600;

    cursor: pointer;

    transition: background 0.2s ease;
}

.browse-articles-button:hover,
.retry-button:hover {
    background: var(--brown-dark);
}


/* =========================================================
   FOOTER
   ========================================================= */

.account-footer {
    padding: 20px;

    border-top: 1px solid var(--line);

    color: var(--muted);

    font-size: 12px;
    text-align: center;
}


/* =========================================================
   PHONES
   ========================================================= */

@media (max-width: 600px) {

    .account-header-inner,
    .notifications-container {
        width: calc(100% - 28px);
    }

    .account-header-inner {
        min-height: 58px;
        gap: 8px;
    }

    .header-back {
        font-size: 13px;
    }

    .header-back-long {
        display: none;
    }

    .header-back-short {
        display: inline;
    }

    .header-title {
        font-size: 11.5px;
        letter-spacing: 0.18em;
    }

    .header-logo {
        width: 36px;
        height: 36px;
    }

    .notifications-page {
        padding: 20px 0 40px;
    }

    .notifications-heading h1 {
        font-size: 21px;
    }

    .notification-item {
        flex-direction: column;
        gap: 4px;

        padding: 12px 14px;
    }

    .notification-title {
        font-size: 14.5px;
    }

    .notification-time {
        padding-top: 0;
    }
}
