/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: "Georgia", "Times New Roman", serif;
    background: #faf8f4;
    color: #1a1a1a;
    min-height: 100vh;
}

/* ---------- Header ---------- */
header {
    padding: 0.8rem 0 0.8rem 2rem;
    background: #db1b1b;
    border-bottom: 3px solid #a01010;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.4rem;
    padding-right: 2rem;
}

header h1 {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 1.2rem;
    color: #fff;
    letter-spacing: 0.5px;
    font-weight: 700;
}

nav {
    display: flex;
    gap: 0;
    align-items: center;
    position: relative;
    width: 100%;
}

/* ---------- Auth bar ---------- */

.auth-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    padding-right: 0.8rem;
    visibility: hidden;
}

.auth-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,0.5);
}

.auth-name {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.85);
    font-weight: 500;
}

.auth-btn {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    padding: 0.2rem 0.6rem;
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 4px;
    transition: all 0.15s;
}

.auth-btn:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border-color: rgba(255,255,255,0.7);
}

.auth-login {
    background: rgba(255,255,255,0.12);
    font-weight: 600;
}

nav span {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.85rem;
    cursor: default;
}

.nav-active {
    color: #fff;
    font-weight: 600;
    border-bottom: 2px solid #fff;
    padding-bottom: 2px;
}

.nav-link {
    padding: 0 0.75rem 2px;
    white-space: nowrap;
    text-align: center;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}

.nav-link:hover {
    color: #fff;
}

.nav-link.nav-active {
    color: #fff;
    font-weight: 600;
    border-bottom: 2px solid #fff;
}

.nav-disabled {
    color: rgba(255,255,255,0.45);
}

/* ---------- Main ---------- */
main {
    max-width: 700px;
    margin: 2.5rem auto;
    padding: 0 1.5rem;
}

/* ---------- Digest ---------- */
.digest-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #db1b1b;
}

.digest-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: -0.3px;
    margin-bottom: 0.3rem;
}

.digest-date {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.8rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* ---------- Article item ---------- */
.digest-item {
    margin-bottom: 1.6rem;
    padding-bottom: 1.6rem;
    border-bottom: 1px solid #e0ddd5;
    line-height: 1.65;
}

.digest-item:last-child {
    border-bottom: none;
}

.digest-item p {
    font-size: 1rem;
    color: #2a2a2a;
}

.digest-item p a {
    color: #db1b1b;
    text-decoration: none;
    font-weight: 600;
}

.digest-item p a:hover {
    text-decoration: underline;
}

/* ---------- Tags ---------- */
.digest-tags {
    margin-top: 0.4rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.tag {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.tag-country {
    background: #e8e0d0;
    color: #6b5b3e;
}

.tag-sector {
    background: #dce7f0;
    color: #3a5f80;
}

.tag-field {
    background: #f0dce0;
    color: #804050;
}

.digest-meta {
    margin-top: 0.35rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.7rem;
    color: #999;
    letter-spacing: 0.3px;
}

/* ---------- Loading / error ---------- */
.loading {
    text-align: center;
    color: #999;
    padding: 3rem 0;
    font-size: 1rem;
    font-style: italic;
}

.loading.hidden { display: none; }

.error {
    text-align: center;
    color: #cc4444;
    padding: 2rem 0;
}

/* ---------- Footer ---------- */
footer {
    text-align: center;
    padding: 1.5rem 2rem;
    font-size: 0.85rem;
    color: #888;
}
footer a {
    color: #888;
    text-decoration: underline;
}
