/**
 * Components CSS — Єдині Новини
 */

/* ─── Card ─── */
.card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 28px 28px 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    border: 0.5px solid var(--border);
    transition: all 0.35s cubic-bezier(0.25,0.1,0.25,1);
    animation: fadeUp 0.6s ease-out both;
}

.card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    transform: translateY(-2px);
}

.card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 980px;
}

.badge-sources {
    color: var(--blue);
    background: var(--blue-pale);
}

.badge-urgent {
    color: var(--red);
    background: rgba(209,36,47,0.06);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.card-date {
    font-size: 13px;
    color: var(--text-tertiary);
}

.card h2 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.22;
    margin-bottom: 10px;
}

.card .body {
    font-size: 15px;
    font-weight: 400;
    line-height: 1.65;
    color: var(--text-secondary);
}

/* ─── Facts ─── */
.facts {
    margin-top: 0;
    padding-top: 10px;
    border-top: 0.5px solid var(--border);
}

.facts-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--blue);
    background: none;
    border: none;
    font-family: var(--font);
    cursor: pointer;
    padding: 0;
}

.facts-btn:hover {
    opacity: 0.7;
}

.facts-btn .arr {
    display: inline-block;
    font-size: 11px;
    transition: transform 0.3s ease;
}

.facts-btn.open .arr {
    transform: rotate(90deg);
}

.facts-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.25,0.1,0.25,1);
}

.facts-body.open {
    max-height: 800px;
}

.fl {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-tertiary);
    margin: 16px 0 6px;
}

.fi {
    display: flex;
    gap: 10px;
    padding: 6px 0;
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.fi .ic {
    flex-shrink: 0;
    margin-top: 2px;
}

/* ─── AI Opinion ─── */
.ai-opinion .facts-btn {
    color: var(--green);
}

.ai-text {
    font-size: 15px;
    line-height: 1.65;
    color: var(--text-secondary);
    padding: 12px 0 4px;
}

/* ─── Sources ─── */
.src-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 16px;
}

.stag {
    font-size: 12px;
    font-weight: 500;
    color: var(--blue);
    background: var(--blue-bg);
    padding: 4px 10px;
    border-radius: 980px;
    border: 1px solid rgba(0,91,187,0.08);
    transition: background 0.2s ease;
}

a.stag::after {
    content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23005BBB' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3Cpolyline points='15 3 21 3 21 9'/%3E%3Cline x1='10' y1='14' x2='21' y2='3'/%3E%3C/svg%3E");
    font-size: 10px;
    margin-left: 3px;
    opacity: 0.5;
}

a.stag:hover {
    background: var(--blue-pale);
}

a.stag:hover::after {
    opacity: 1;
}

/* ─── Source Filters ─── */
.source-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
}

.stag-filter {
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s ease;
}

.stag-filter:hover {
    background: var(--blue-pale);
}

.stag-filter.active {
    background: var(--blue);
    color: #fff;
    border-color: var(--blue);
}

.stag-reset {
    font-family: var(--font);
    cursor: pointer;
    color: var(--red);
    background: rgba(209,36,47,0.06);
    border-color: rgba(209,36,47,0.12);
    transition: all 0.2s ease;
}

.stag-reset:hover {
    background: rgba(209,36,47,0.12);
}

/* ─── Feed Loader ─── */
.feed-loader {
    text-align: center;
    padding: 24px 0 40px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-tertiary);
    letter-spacing: 0.3px;
}

/* ─── Article page ─── */
.article-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 40px 22px 80px;
}

.article-page h1 {
    font-size: clamp(28px, 5vw, 40px);
    font-weight: 700;
    letter-spacing: -1px;
    line-height: 1.15;
    margin-bottom: 16px;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.article-content {
    font-size: 17px;
    font-weight: 300;
    line-height: 1.8;
    color: var(--text-secondary);
}

.article-content h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin: 32px 0 12px;
}

.article-content h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin: 24px 0 10px;
}

.article-content p {
    margin-bottom: 16px;
}

.article-content ul,
.article-content ol {
    margin: 16px 0;
    padding-left: 24px;
}

.article-content li {
    margin-bottom: 8px;
    list-style: disc;
}

.article-content ol li {
    list-style: decimal;
}

.article-content img {
    border-radius: 12px;
    margin: 24px 0;
}

.article-content a {
    color: var(--blue);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.article-content a:hover {
    opacity: 0.7;
}

.article-content blockquote {
    border-left: 3px solid var(--blue);
    padding: 12px 20px;
    margin: 20px 0;
    background: var(--blue-bg);
    border-radius: 0 12px 12px 0;
    color: var(--text);
    font-style: italic;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 15px;
}

.article-content th,
.article-content td {
    padding: 10px 14px;
    border: 0.5px solid var(--border);
    text-align: left;
}

.article-content th {
    background: var(--blue-pale);
    font-weight: 600;
    color: var(--blue);
}

/* ─── Back link ─── */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--blue);
    margin-bottom: 24px;
}

.back-link:hover {
    opacity: 0.7;
}

/* ─── Category page ─── */
.cat-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 40px 22px 80px;
}

.cat-page h1 {
    font-size: clamp(28px, 5vw, 40px);
    font-weight: 700;
    letter-spacing: -1px;
    line-height: 1.15;
    margin-bottom: 8px;
    color: var(--blue);
}

.cat-page .cat-desc {
    font-size: 17px;
    font-weight: 300;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.subcat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.subcat-card {
    background: var(--card);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow);
    border: 0.5px solid var(--border);
    transition: all 0.3s ease;
    display: block;
}

.subcat-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.subcat-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.subcat-card span {
    font-size: 13px;
    color: var(--text-tertiary);
}

/* ─── Contact page ─── */
.contact-page {
    max-width: 560px;
    margin: 0 auto;
    padding: 60px 22px 80px;
}

.contact-page h1 {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 8px;
    color: var(--blue);
}

.contact-page .contact-desc {
    font-size: 17px;
    font-weight: 300;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
    margin-bottom: 6px;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 0.5px solid var(--border);
    border-radius: 12px;
    font-family: var(--font);
    font-size: 16px;
    background: var(--card);
    transition: border-color 0.2s ease;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(0,91,187,0.1);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-submit {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: var(--blue);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 980px;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.form-submit:hover {
    opacity: 0.85;
}

/* ─── 404 page ─── */
.not-found {
    text-align: center;
    padding: 100px 22px;
    max-width: 500px;
    margin: 0 auto;
}

.not-found h1 {
    font-size: 72px;
    font-weight: 700;
    color: var(--blue);
    letter-spacing: -3px;
}

.not-found p {
    font-size: 19px;
    font-weight: 300;
    color: var(--text-secondary);
    margin: 12px 0 24px;
}

.not-found a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 600;
    color: var(--blue);
}

.not-found a:hover {
    opacity: 0.7;
}

/* ─── Subcategory articles list ─── */
.articles-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.article-card {
    background: var(--card);
    border-radius: 16px;
    padding: 20px 24px;
    box-shadow: var(--shadow);
    border: 0.5px solid var(--border);
    transition: all 0.3s ease;
    display: block;
}

.article-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.article-card h3 {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 6px;
}

.article-card p {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 300;
}

/* ─── Pagination ─── */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 32px;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    border: 0.5px solid var(--border);
    transition: all 0.2s ease;
}

.pagination a:hover {
    background: var(--blue-pale);
    color: var(--blue);
}

.pagination .active {
    background: var(--blue);
    color: #fff;
    border-color: var(--blue);
}

/* Nav Telegram link */
.nav-tg {
    color: var(--green);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
}
.nav-tg:hover { text-decoration: underline; }

/* Telegram channel link */
.tg-channel {
    text-align: center;
    padding: 10px 0 0;
    font-size: 1.05rem;
    color: var(--text-secondary);
}
.tg-channel a {
    color: var(--blue);
    font-weight: 600;
    text-decoration: none;
}
.tg-channel a:hover { text-decoration: underline; }

/* Card title link */
.card-link {
    color: inherit;
    text-decoration: none;
}
.card-link:hover { color: var(--blue); }

/* Article page */
.article-back {
    max-width: 980px;
    margin: 0 auto;
    padding: 2%;
}
.article-back a {
    color: var(--blue);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
}
.article-back a:hover { text-decoration: underline; }
.article-title {
    font-size: 1.5rem;
    line-height: 1.35;
    margin: 8px 0 12px;
}
.facts-open {
    border-top: 1px solid var(--border);
    padding-top: 14px;
    margin-top: 14px;
}
.facts-open .fl:first-child { margin-top: 0; }

/* ─── Article Hero Image ─── */
.article-hero {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border-radius: 16px;
    margin: 12px 0 20px;
}
