
:root {
  --primary: #1e40af;
  --primary-light: #3b82f6;
  --primary-bg: #eff6ff;
  --text: #1f2937;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --muted: #6b7280;
  --border: #e2e8f0;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

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

/* Header styles */
header { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); color: white; margin-bottom: 2rem; }
header .container { text-align: center; }
header .header-inner { display: flex; align-items: center; justify-content: space-between; text-align: left; }
header .header-right { display: flex; align-items: center; gap: 1rem; }
header h1 { font-size: 1.75rem; margin: 0; color: white; font-weight: 600; }
header .site-name { color: white; text-decoration: none; font-size: 1.25rem; font-weight: 600; }
header .site-name:hover { opacity: 0.9; }
header .site-logo { display: flex; align-items: center; }
header .site-logo svg { height: 40px; width: auto; }
header .site-logo:hover { opacity: 0.9; }
header .site-description { margin-top: 0.5rem; opacity: 0.9; font-size: 1.1rem; }

header.compact { padding: 0.75rem 0; }
header.compact h1 { font-size: 1.25rem; }

header.hero { padding: 3rem 0; text-align: center; }
header.hero .site-logo { justify-content: center; }
header.hero .site-logo svg { height: 60px; }
header.hero .site-name { font-size: 2rem; }

header.minimal { padding: 0.5rem 0; background: transparent; color: var(--text); border-bottom: 1px solid var(--border); }
header.minimal .site-name { color: var(--text); }
header.minimal .social-links a { color: var(--muted); }

/* Social links */
.social-links { display: flex; align-items: center; gap: 0.75rem; }
.social-links a { color: white; text-decoration: none; display: flex; align-items: center; gap: 0.25rem; opacity: 0.9; transition: opacity 0.2s; }
.social-links a:hover { opacity: 1; }
.social-icon { width: 1.25rem; height: 1.25rem; }
footer .social-links { justify-content: center; margin-bottom: 1rem; }
footer .social-links a { color: var(--muted); }
footer .social-links a:hover { color: var(--primary); }

main { padding-bottom: 3rem; min-height: 60vh; }

/* Search box */
.search-box { position: relative; width: 200px; }
.search-input { width: 100%; padding: 0.4rem 0.75rem 0.4rem 2rem; border: 1px solid rgba(255,255,255,0.3); border-radius: 6px; font-size: 0.8rem; background: rgba(255,255,255,0.15); color: white; }
.search-input:focus { outline: none; background: rgba(255,255,255,0.25); }
.search-input::placeholder { color: rgba(255,255,255,0.7); }
.search-input:disabled { cursor: not-allowed; }
.search-icon { position: absolute; left: 0.5rem; top: 50%; transform: translateY(-50%); width: 0.875rem; height: 0.875rem; color: rgba(255,255,255,0.7); }

/* Article list layouts */
.article-list { list-style: none; }
.article-list.layout-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
.article-list.layout-large { display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: 2rem; }
.article-list.layout-list { display: flex; flex-direction: column; gap: 1.5rem; }

.article-list li { background: var(--card-bg); border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.08); border: 1px solid var(--border); transition: all 0.2s; }
.article-list li:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(30,64,175,0.12); border-color: var(--primary-light); }
.article-list a { text-decoration: none; color: inherit; display: block; }

.article-list.layout-grid img, .article-list.layout-large img { width: 100%; height: 200px; object-fit: cover; }
.article-list.layout-large img { height: 280px; }
.article-list.layout-list li a { display: flex; }
.article-list.layout-list img { width: 280px; height: 180px; object-fit: cover; flex-shrink: 0; }

.article-list .no-image { width: 100%; height: 200px; background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); }
.article-list.layout-list .no-image { width: 280px; height: 180px; flex-shrink: 0; }

.article-list .article-content { padding: 1.25rem; }
.article-list h2 { color: var(--text); font-size: 1.1rem; margin-bottom: 0.5rem; line-height: 1.4; transition: color 0.2s; }
.article-list.layout-large h2 { font-size: 1.35rem; }
.article-list a:hover h2 { color: var(--primary); }
.article-list p { color: var(--muted); font-size: 0.875rem; margin-bottom: 0.75rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.article-list .card-meta { font-size: 0.75rem; color: var(--muted); display: flex; align-items: center; flex-wrap: wrap; }
.article-list .card-meta time { color: var(--primary-light); font-weight: 500; font-size: 0.75rem; }
.article-list .card-meta .card-author { color: var(--muted); font-size: 0.75rem; }
.article-list .card-meta .card-author .author-name { color: var(--text); font-weight: 500; font-size: 0.75rem; }

/* Featured article (magazine layout) */
.featured-article { margin-bottom: 2rem; background: var(--card-bg); border-radius: 16px; overflow: hidden; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.featured-article a { display: block; text-decoration: none; color: inherit; }
.featured-article img { width: 100%; height: 400px; object-fit: cover; }
.featured-article .no-image { width: 100%; height: 400px; background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); }
.featured-article .featured-content { padding: 2rem; }
.featured-article h2 { font-size: 1.75rem; margin-bottom: 1rem; color: var(--text); }
.featured-article p { font-size: 1rem; color: var(--muted); margin-bottom: 1rem; }
.featured-article time { color: var(--primary-light); font-weight: 500; }

/* Article single page */
.article-single { background: var(--card-bg); border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.08); border: 1px solid var(--border); }
.article-single .featured-image { width: 100%; max-height: 400px; object-fit: cover; }
.article-single .article-header { padding: 2rem 2rem 1rem; border-bottom: 1px solid var(--border); }
.article-single .article-header h1 { font-size: 2rem; margin-bottom: 0.75rem; color: var(--text); }
.article-single .article-meta { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.article-single .article-meta time { color: var(--primary-light); font-size: 0.875rem; font-weight: 500; }
.article-single .article-meta .author { color: var(--muted); font-size: 0.875rem; }
.article-single .article-meta .author a { color: var(--primary); text-decoration: none; font-weight: 500; }
.article-single .article-meta .author a:hover { text-decoration: underline; }
.article-single .article-body { padding: 2rem; }
.article-single .article-body h2 { margin-top: 1.5rem; margin-bottom: 0.75rem; color: var(--primary); font-size: 1.5rem; }
.article-single .article-body h3 { margin-top: 1.25rem; margin-bottom: 0.5rem; color: var(--text); font-size: 1.25rem; }
.article-single .article-body p { margin-bottom: 1rem; line-height: 1.8; }
.article-single .article-body ul, .article-single .article-body ol { margin-bottom: 1rem; padding-left: 2rem; }
.article-single .article-body li { margin-bottom: 0.5rem; }
.article-single .article-body a { color: var(--primary); }
.article-single .article-body a:hover { color: var(--primary-light); }
.article-single .article-body img { max-width: 100%; height: auto; border-radius: 8px; margin: 1rem 0; }
.article-single .article-body blockquote { border-left: 4px solid var(--primary-light); padding-left: 1rem; margin: 1rem 0; color: var(--muted); font-style: italic; }
.article-single .article-body pre { background: #1f2937; color: #e5e7eb; padding: 1rem; border-radius: 8px; overflow-x: auto; margin: 1rem 0; }
.article-single .article-body code { background: var(--primary-bg); padding: 0.2rem 0.4rem; border-radius: 4px; font-size: 0.9em; }
.article-single .article-body pre code { background: none; padding: 0; }

/* Article layout variants */
.article-single.layout-wide { max-width: none; border-radius: 0; border-left: none; border-right: none; }
.article-single.layout-wide .article-body { max-width: 900px; margin: 0 auto; }
.article-single.layout-centered { max-width: 720px; margin: 0 auto; }
.article-single.layout-centered .article-header { text-align: center; }
.article-single.layout-centered .article-meta { justify-content: center; }

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

/* Page header (legal pages) */
.page-header { margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.page-header h1 { font-size: 2rem; color: var(--text); margin-bottom: 0.5rem; }

/* Author card */
.author-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid var(--border);
}
.author-card-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}
.author-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.author-initials {
    font-size: 2.2rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.author-info {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.author-name {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    line-height: 1.2;
}
.author-role {
    font-size: 0.95rem;
    color: var(--primary);
    font-weight: 500;
}
.author-stats {
    font-size: 0.9rem;
    color: var(--muted);
}
.author-bio-text {
    color: var(--text);
    font-size: 1.05rem;
    line-height: 1.8;
    margin: 0;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.author-articles-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}
@media (max-width: 600px) {
    .author-card { padding: 1.5rem; }
    .author-card-header { flex-direction: column; text-align: center; gap: 1rem; }
    .author-avatar { width: 80px; height: 80px; }
    .author-initials { font-size: 1.8rem; }
    .author-name { font-size: 1.5rem; }
    .author-info { align-items: center; }
}

/* Legal pages */
.legal-page { background: var(--card-bg); border-radius: 12px; padding: 2rem; box-shadow: 0 1px 3px rgba(0,0,0,0.08); border: 1px solid var(--border); }
.legal-page h1 { font-size: 2rem; color: var(--text); margin-bottom: 1.5rem; }
.legal-content h2 { font-size: 1.25rem; color: var(--primary); margin: 1.5rem 0 0.75rem; }
.legal-content p { margin-bottom: 1rem; line-height: 1.8; }

/* Contact form */
.contact-form { margin-top: 1.5rem; }
.contact-form .form-group { margin-bottom: 1.25rem; }
.contact-form label { display: block; font-weight: 500; margin-bottom: 0.5rem; color: var(--text); }
.contact-form input, .contact-form textarea { width: 100%; padding: 0.75rem; border: 1px solid var(--border); border-radius: 8px; font-size: 1rem; font-family: inherit; transition: border-color 0.2s, box-shadow 0.2s; }
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--primary-light); box-shadow: 0 0 0 3px var(--primary-bg); }
.contact-form .btn-submit { background: var(--primary); color: white; border: none; padding: 0.75rem 2rem; border-radius: 8px; font-size: 1rem; font-weight: 500; cursor: pointer; transition: background 0.2s; }
.contact-form .btn-submit:hover { background: var(--primary-light); }
.contact-success { background: #d1fae5; border: 1px solid #6ee7b7; color: #065f46; padding: 1rem 1.5rem; border-radius: 8px; margin-bottom: 1rem; }
.contact-success p { margin: 0; }

/* Article navigation (prev/next) */
.article-navigation { display: flex; gap: 1rem; margin-top: 2rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.article-navigation a { flex: 1; display: block; padding: 1rem 1.25rem; background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; text-decoration: none; transition: all 0.2s; }
.article-navigation a:hover { border-color: var(--primary-light); box-shadow: 0 4px 12px rgba(30,64,175,0.1); }
.article-navigation .nav-label { display: block; font-size: 0.75rem; color: var(--muted); margin-bottom: 0.25rem; text-transform: uppercase; letter-spacing: 0.5px; }
.article-navigation .nav-title { display: block; font-size: 0.95rem; color: var(--text); font-weight: 500; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.article-navigation a:hover .nav-title { color: var(--primary); }
.article-navigation .nav-prev { text-align: left; }
.article-navigation .nav-next { text-align: right; }
@media (max-width: 640px) { .article-navigation { flex-direction: column; } .article-navigation .nav-next { text-align: left; } }

footer { background: var(--primary-bg); margin-top: 4rem; padding: 1.5rem 0; color: var(--muted); font-size: 0.875rem; text-align: center; border-top: 1px solid var(--border); }
footer a { color: var(--muted); text-decoration: none; margin: 0 0.5rem; }
footer a:hover { color: var(--primary); }
footer .footer-links { margin-bottom: 0.5rem; }
