
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    background: #0f172a;
    color: #e5e7eb;
    line-height: 1.6;
}

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

header {
    background: linear-gradient(135deg, #1e293b, #020617);
    padding: 16px 24px;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid #1f2937;
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.logo {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.badge {
    font-size: 0.7rem;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid #4b5563;
    color: #9ca3af;
}

.tagline {
    color: #9ca3af;
    font-size: 0.85rem;
}

.nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.nav button,
.nav a {
    border: none;
    background: #020617;
    color: #9ca3af;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    text-decoration: none;
}

.nav button.active,
.nav button:hover,
.nav a.active,
.nav a:hover {
    background: #e5e7eb;
    color: #020617;
}

.subscribe-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

#subscribeBtn {
    border-radius: 999px;
    border: none;
    padding: 8px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    background: #22c55e;
    color: #022c22;
}

main {
    max-width: 1100px;
    margin: 24px auto 40px;
    padding: 0 16px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.card {
    background: #020617;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid #1f2937;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(0,0,0,0.6);
    border-color: #374151;
}

.card-img-wrap {
    position: relative;
    padding-top: 56.25%;
    overflow: hidden;
}

.card-img-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-category {
    position: absolute;
    left: 10px;
    bottom: 10px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.7rem;
    background: rgba(15,23,42,0.8);
    border: 1px solid rgba(148,163,184,0.8);
}

.card-content {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
}

.card-meta {
    font-size: 0.75rem;
    color: #9ca3af;
}

.card-excerpt {
    font-size: 0.85rem;
    color: #d1d5db;
    margin-top: 2px;
}

.card-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #9ca3af;
}

.chip {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 999px;
    background: #020617;
    border: 1px solid #374151;
}

.read-more {
    font-size: 0.8rem;
    color: #38bdf8;
}

.empty-state {
    border: 1px dashed #1f2937;
    border-radius: 14px;
    padding: 18px;
    text-align: center;
    color: #9ca3af;
    background: rgba(2, 6, 23, 0.6);
}

.article {
    max-width: 760px;
    margin: 24px auto 40px;
    padding: 0 16px;
}

.article-back {
    font-size: 0.8rem;
    color: #9ca3af;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
}

.article h1 {
    font-size: 1.7rem;
    margin-bottom: 6px;
}

.article-subtitle {
    font-size: 1.0rem;
    color: #cbd5f5;
    margin-bottom: 10px;
}

.article-meta {
    font-size: 0.85rem;
    color: #9ca3af;
    margin-bottom: 12px;
}

.article-img {
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid #1f2937;
    margin-bottom: 16px;
}

.article-img img {
    width: 100%;
    display: block;
}

.article-body p {
    margin-bottom: 10px;
    font-size: 0.98rem;
    color: #e5e7eb;
}

.article-footer {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #9ca3af;
}

.btn-secondary {
    font-size: 0.8rem;
    border-radius: 999px;
    padding: 6px 12px;
    border: 1px solid #4b5563;
    background: transparent;
    color: #e5e7eb;
    text-decoration: none;
}

@media (max-width: 640px) {
    .header-inner {
        flex-direction: column;
        align-items: flex-start;
    }
    .subscribe-wrap {
        width: 100%;
        justify-content: space-between;
    }
}

/* Modal */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 30;
}

.modal {
    background: #020617;
    border-radius: 18px;
    padding: 18px 20px;
    max-width: 360px;
    width: 90%;
    border: 1px solid #374151;
}

.modal h2 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.modal p {
    font-size: 0.9rem;
    color: #d1d5db;
    margin-bottom: 10px;
}

.modal button {
    border-radius: 999px;
    border: none;
    padding: 6px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    background: #e5e7eb;
    color: #020617;
}

/* Native Ads Styles */
.native-ad {
    background: #020617;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid #1f2937;
    margin-bottom: 18px;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.native-ad:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.4);
    border-color: #374151;
}

.native-ad-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.native-ad-image {
    position: relative;
    padding-top: 56.25%;
    overflow: hidden;
    background: #1f2937;
}

.native-ad-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ad-sponsored {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.65rem;
    background: rgba(15,23,42,0.9);
    border: 1px solid rgba(148,163,184,0.6);
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.native-ad-content {
    padding: 12px 14px 14px;
}

.native-ad-title {
    font-size: 1rem;
    font-weight: 600;
    color: #e5e7eb;
    line-height: 1.4;
}

#homepage-ads {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid #1f2937;
}

#homepage-ads::before {
    content: "Pubblicità";
    display: block;
    font-size: 0.75rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 18px;
}

.article-ads-container {
    margin: 32px 0;
    padding: 24px 0;
    border-top: 1px solid #1f2937;
    border-bottom: 1px solid #1f2937;
}

.article-ads-container::before {
    content: "Pubblicità";
    display: block;
    font-size: 0.75rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 18px;
}

/* Inline Native Ads - внутри текста статьи */
.native-ad-group {
    margin: 20px 0;
    clear: both;
}

.native-ads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin: 0;
}

.native-ad-inline {
    margin: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.native-ad-content-block {
    background: #020617;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #1f2937;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.native-ad-content-block::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #374151, transparent);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.native-ad-content-block:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    border-color: #374151;
}

.native-ad-content-block:hover::before {
    opacity: 1;
}

.native-ad-link-inline {
    display: block;
    text-decoration: none;
    color: inherit;
}

.native-ad-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    flex: 1;
}

.native-ad-image-inline {
    position: relative;
    width: 100%;
    padding-top: 60%;
    overflow: hidden;
    background: #1f2937;
}

.native-ad-image-inline img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ad-sponsored-small {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.6rem;
    background: rgba(15,23,42,0.9);
    border: 1px solid rgba(148,163,184,0.5);
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 500;
}

.native-ad-text {
    padding: 10px 12px;
    flex: 1;
    display: flex;
    align-items: center;
}

.native-ad-title-inline {
    font-size: 0.85rem;
    font-weight: 600;
    color: #e5e7eb;
    line-height: 1.4;
    margin: 0;
    transition: color 0.2s ease;
}

.native-ad-link-inline:hover .native-ad-title-inline {
    color: #38bdf8;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .native-ads-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .native-ad-group {
        margin: 24px 0;
    }
}

@media (max-width: 640px) {
    .native-ad-content-block {
        border-radius: 10px;
    }
    
    .native-ad-title-inline {
        font-size: 0.9rem;
    }
    
    .native-ad-text {
        padding: 12px 14px;
    }
}
