:root {
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius: 12px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    padding: 2rem 1rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.header-top {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 1rem;
}

.btn-home {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-home:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: var(--primary-color);
}

header h1 {
    font-size: 2.25rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.date-switcher {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}

.date-switcher label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.date-switcher input[type="date"] {
    font-size: 0.95rem;
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-main);
    cursor: pointer;
}

.date-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-main);
    text-decoration: none;
    font-size: 1.1rem;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.date-nav-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.empty-state code {
    font-size: 0.9em;
    background: #f1f5f9;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

.digest-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 480px;
    margin: 0 auto;
}

.digest-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-main);
    box-shadow: var(--shadow);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.digest-list a:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
}

.digest-list .digest-date {
    font-weight: 600;
}

.digest-list .digest-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    align-items: start;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.card-image-wrapper {
    position: relative;
    width: 100%;
    height: 200px;
    background-color: #e2e8f0;
    overflow: hidden;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(15, 23, 42, 0.85);
    color: #ffffff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    backdrop-filter: blur(4px);
}

.card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.card-title-ru {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.card-title-orig {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-bottom: 1rem;
    font-style: italic;
}

.card-summary {
    background-color: #f1f5f9;
    padding: 0.85rem;
    border-radius: 8px;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--primary-color);
}

.full-text-details {
    margin-bottom: 1.25rem;
}

.btn-toggle {
    cursor: pointer;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
    user-select: none;
    outline: none;
}

.btn-toggle:hover {
    text-decoration: underline;
}

.full-text-content {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: #334155;
    max-height: 300px;
    overflow-y: auto;
    padding: 0.75rem;
    background: #fafafa;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.full-text-content p {
    margin-bottom: 0.75rem;
}

.card-footer {
    margin-top: auto;
    padding-top: 0.5rem;
}

.btn-primary {
    display: inline-block;
    width: 100%;
    text-align: center;
    background-color: var(--primary-color);
    color: #ffffff;
    text-decoration: none;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

@media (max-width: 600px) {
    .grid {
        grid-template-columns: 1fr;
    }
}
