/* ============================================
   DomainUI Articles — Professional Article Site
   Modern magazine-style layout
   ============================================ */

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

/* Base */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f8fafc;
    color: #1e293b;
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: #4f46e5; text-decoration: none; transition: color 0.15s; }
a:hover { color: #4338ca; }
img { max-width: 100%; height: auto; }

/* Container */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 800px; margin: 0 auto; padding: 0 24px; }

/* ============================================
   HEADER
   ============================================ */
.site-header {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.site-header .container {
    display: flex;
    align-items: center;
    height: 64px;
    gap: 32px;
}
.site-logo {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    text-decoration: none;
    letter-spacing: -0.5px;
    white-space: nowrap;
    flex-shrink: 0;
}
.site-logo:hover { color: #4f46e5; }
.site-nav {
    display: flex;
    gap: 2px;
    align-items: center;
    flex: 1;
    overflow: hidden;
}
.site-nav a {
    padding: 8px 14px;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.15s;
    white-space: nowrap;
}
.site-nav a:hover { color: #1e293b; background: #f1f5f9; }
.site-nav a.active { color: #4f46e5; background: #eef2ff; }

/* Search bar */
.search-form {
    display: flex;
    flex-shrink: 0;
    width: 260px;
}
.search-form input {
    flex: 1;
    padding: 8px 14px;
    border: 1px solid #e2e8f0;
    border-right: none;
    border-radius: 8px 0 0 8px;
    font-size: 14px;
    outline: none;
    background: #f8fafc;
    color: #1e293b;
    transition: all 0.15s;
}
.search-form input:focus { border-color: #a5b4fc; background: #fff; box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }
.search-form button {
    padding: 8px 14px;
    background: #4f46e5;
    color: #fff;
    border: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.search-form button:hover { background: #4338ca; }

/* ============================================
   HERO SECTION — Featured Article
   ============================================ */
.hero-section {
    padding: 40px 0 0;
}
.hero-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 8px 32px rgba(0,0,0,0.04);
    border: 1px solid #e2e8f0;
    position: relative;
}
.hero-accent-bar {
    height: 5px;
    width: 100%;
}
.hero-body {
    padding: 40px 48px 44px;
}
.hero-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #94a3b8;
}
.hero-category {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #fff !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.hero-date, .hero-reading {
    font-weight: 500;
}
.hero-title {
    font-size: 36px;
    font-weight: 800;
    line-height: 1.2;
    color: #0f172a;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}
.hero-title a { color: inherit; }
.hero-title a:hover { color: var(--accent, #4f46e5); }
.hero-excerpt {
    font-size: 17px;
    line-height: 1.7;
    color: #475569;
    margin-bottom: 24px;
    max-width: 720px;
}
.hero-read-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.15s;
}
.hero-read-more:hover { gap: 12px; }
.hero-read-more svg { transition: transform 0.15s; }
.hero-read-more:hover svg { transform: translateX(3px); }

/* ============================================
   CATEGORY PILLS BAR
   ============================================ */
.categories-bar {
    padding: 24px 0;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
}
.category-pills {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
}
.category-pills::-webkit-scrollbar { display: none; }
.cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    white-space: nowrap;
    transition: all 0.15s;
    flex-shrink: 0;
}
.cat-pill:hover {
    border-color: var(--cat-color, #4f46e5);
    color: var(--cat-color, #4f46e5);
    background: #fafafe;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.cat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.cat-count {
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 2px 7px;
    border-radius: 10px;
}

/* ============================================
   SECTIONS
   ============================================ */
.section {
    padding: 48px 0;
}
.section-dark {
    background: #0f172a;
    margin-top: 8px;
}
.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 28px;
}
.section-title {
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.3px;
}
.section-subtitle {
    font-size: 14px;
    color: #94a3b8;
    font-weight: 500;
}

/* ============================================
   ARTICLE CARDS GRID
   ============================================ */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
.article-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
}
.article-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    transform: translateY(-2px);
    border-color: #cbd5e1;
}
.card-color-accent {
    height: 4px;
    width: 100%;
    flex-shrink: 0;
}
.card-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.card-meta-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.card-category {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.card-category:hover { opacity: 0.8; }
.card-date {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 500;
}
.card-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
    color: #0f172a;
    margin-bottom: 8px;
    letter-spacing: -0.2px;
}
.card-title a { color: inherit; }
.card-title a:hover { color: #4f46e5; }
.card-large .card-title {
    font-size: 22px;
}
.card-excerpt {
    font-size: 14px;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 12px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-meta-bottom {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: #94a3b8;
    font-weight: 500;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

/* ============================================
   IAB CATEGORY TILES (Explore Topics)
   ============================================ */
.iab-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}
.iab-tile {
    position: relative;
    border-radius: 14px;
    padding: 24px 20px;
    color: #fff;
    text-decoration: none;
    overflow: hidden;
    transition: all 0.25s;
    background: linear-gradient(135deg, var(--tile-color), color-mix(in srgb, var(--tile-color) 80%, black));
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}
.iab-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.2);
    color: #fff;
}
.tile-icon {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 48px;
    font-weight: 900;
    opacity: 0.15;
    line-height: 1;
}
.tile-name {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    position: relative;
    z-index: 1;
}
.tile-count {
    font-size: 12px;
    font-weight: 600;
    background: rgba(255,255,255,0.2);
    padding: 3px 10px;
    border-radius: 20px;
    display: inline-block;
    margin-top: 8px;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(4px);
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    background: #0f172a;
    color: #94a3b8;
    margin-top: 0;
}
.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 48px 0 32px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    gap: 48px;
}
.footer-brand { max-width: 300px; }
.footer-logo {
    font-size: 20px;
    font-weight: 800;
    color: #f1f5f9;
    margin-bottom: 8px;
}
.footer-tagline {
    font-size: 14px;
    color: #64748b;
    line-height: 1.6;
}
.footer-links {
    display: flex;
    gap: 64px;
}
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-col h4 {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #f1f5f9;
    margin-bottom: 4px;
}
.footer-col a {
    font-size: 14px;
    color: #64748b;
    transition: color 0.15s;
}
.footer-col a:hover { color: #a5b4fc; }
.footer-bottom {
    padding: 20px 0;
    text-align: center;
}
.footer-copyright {
    font-size: 13px;
    color: #475569;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 80px 20px;
}
.empty-icon {
    margin-bottom: 24px;
}
.empty-state h2 {
    font-size: 22px;
    color: #475569;
    margin-bottom: 8px;
}
.empty-state p {
    font-size: 15px;
    color: #94a3b8;
    max-width: 400px;
    margin: 0 auto;
}

/* ============================================
   SECTION HEADINGS (legacy pages)
   ============================================ */
.section-heading {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 20px;
}
.section-heading small { font-size: 14px; color: #94a3b8; font-weight: 400; margin-left: 8px; }

/* ============================================
   ARTICLE LIST (category/search pages)
   ============================================ */
.article-list { margin-bottom: 40px; }
.article-card-list {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 14px;
    transition: all 0.2s;
}
.article-card-list:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    transform: translateY(-1px);
}
.article-card-title {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 6px;
    line-height: 1.35;
}
.article-card-title a { color: inherit; }
.article-card-title a:hover { color: #4f46e5; }
.article-card-excerpt {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 10px;
    line-height: 1.6;
}
.article-card-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 12px;
    color: #94a3b8;
}
.article-card-meta .iab-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
}

/* ============================================
   ARTICLE PAGE
   ============================================ */
.article-breadcrumb {
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 20px;
}
.article-breadcrumb a { color: #64748b; }
.article-breadcrumb a:hover { color: #4f46e5; }
.article-header {
    margin-bottom: 32px;
}
.article-header h1 {
    font-size: 36px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}
.article-header-meta {
    display: flex;
    gap: 16px;
    align-items: center;
    font-size: 13px;
    color: #94a3b8;
}
.article-content {
    font-size: 17px;
    line-height: 1.85;
    color: #334155;
}
.article-content h2 {
    font-size: 26px;
    font-weight: 800;
    color: #0f172a;
    margin: 36px 0 14px;
    letter-spacing: -0.3px;
}
.article-content h3 {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin: 28px 0 10px;
}
.article-content p { margin-bottom: 18px; }
.article-content ul, .article-content ol { margin: 0 0 18px 28px; }
.article-content li { margin-bottom: 8px; }
.article-content blockquote {
    border-left: 4px solid #a5b4fc;
    padding: 16px 24px;
    margin: 20px 0;
    background: #f8fafc;
    color: #475569;
    font-style: italic;
    border-radius: 0 12px 12px 0;
}
.article-content strong { color: #0f172a; }

/* Related Articles */
.related-section {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid #e2e8f0;
}

/* ============================================
   CATEGORY PAGE
   ============================================ */
.category-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 40px;
}
.category-sidebar {
    position: sticky;
    top: 88px;
    align-self: start;
}
.sidebar-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
}
.sidebar-card h3 {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.sidebar-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    color: #475569;
    transition: color 0.15s;
}
.sidebar-link:last-child { border-bottom: none; }
.sidebar-link:hover { color: #4f46e5; }
.sidebar-count {
    font-size: 11px;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

/* Category accent bar */
.category-accent {
    width: 60px;
    height: 5px;
    border-radius: 3px;
    margin-bottom: 16px;
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 30px 0;
}
.pagination a, .pagination .disabled {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
}
.pagination a {
    background: #4f46e5;
    color: #fff;
    transition: background 0.15s;
}
.pagination a:hover { background: #4338ca; color: #fff; }
.pagination .disabled { background: #f1f5f9; color: #94a3b8; }
.pagination .page-info { font-size: 14px; color: #64748b; }

/* ============================================
   SEARCH
   ============================================ */
.search-header { margin-bottom: 24px; }
.search-header h1 { font-size: 24px; font-weight: 700; }
.search-header p { font-size: 14px; color: #64748b; margin-top: 4px; }
.search-highlight { background: #fef08a; padding: 1px 4px; border-radius: 3px; }

/* No Results */
.no-results { text-align: center; padding: 60px 20px; color: #94a3b8; }
.no-results h2 { font-size: 20px; color: #64748b; margin-bottom: 8px; }
.no-results p { font-size: 14px; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .card-large .card-title { font-size: 19px; }
    .hero-title { font-size: 30px; }
    .hero-body { padding: 32px; }
}

@media (max-width: 768px) {
    .container { padding: 0 16px; }
    .site-header .container { gap: 12px; }
    .site-nav { display: none; }
    .search-form { width: 200px; }

    .hero-section { padding: 24px 0 0; }
    .hero-body { padding: 24px; }
    .hero-title { font-size: 24px; }
    .hero-excerpt { font-size: 15px; }
    .hero-meta { gap: 10px; flex-wrap: wrap; }

    .categories-bar { padding: 16px 0; }

    .section { padding: 32px 0; }
    .section-title { font-size: 20px; }

    .articles-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .card-large .card-title { font-size: 18px; }

    .iab-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .iab-tile { padding: 18px 16px; min-height: 100px; }
    .tile-name { font-size: 13px; }
    .tile-icon { font-size: 36px; }

    .category-layout { grid-template-columns: 1fr; }
    .category-sidebar { position: static; }

    .article-header h1 { font-size: 26px; }
    .article-content { font-size: 16px; }
    .article-content h2 { font-size: 22px; }

    .footer-top { flex-direction: column; gap: 32px; }
    .footer-links { gap: 40px; }
}

@media (max-width: 480px) {
    .container { padding: 0 12px; }
    .search-form { width: 160px; }
    .hero-title { font-size: 22px; }
    .hero-body { padding: 20px; }
    .iab-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-links { flex-direction: column; gap: 24px; }
    .article-header h1 { font-size: 22px; }
}
