/* ===== News list (news.php) ===== */
.news-hero {
    text-align: center;
    padding: 40px 0 32px;
}
.news-hero h1 {
    font-size: 32px;
    font-weight: 800;
    color: #322659;
    margin-bottom: 8px;
}
.news-hero p {
    font-size: 15px;
    color: #888;
}
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    padding-bottom: 60px;
}
.news-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(0,0,0,.06);
    border: 1.5px solid #ede9f8;
    display: flex;
    flex-direction: column;
    transition: all .2s;
    text-decoration: none;
}
.news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 32px rgba(159,122,234,.15);
}
.news-card__cover {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: linear-gradient(135deg, #f0ebff, #e8f8f6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    flex-shrink: 0;
}
.news-card__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.news-card__body {
    padding: 18px 20px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.news-card__meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: #bbb;
    margin-bottom: 10px;
}
.news-card__title {
    font-size: 17px;
    font-weight: 700;
    color: #322659;
    margin-bottom: 8px;
    line-height: 1.35;
}
.news-card__excerpt {
    font-size: 14px;
    color: #777;
    line-height: 1.5;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.news-card__read {
    margin-top: 16px;
    font-size: 13px;
    font-weight: 700;
    color: #9F7AEA;
}
.news-empty {
    text-align: center;
    padding: 80px 20px;
    color: #888;
    font-size: 16px;
}

/* ===== Article detail (news_detail.php) ===== */
.article-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #9F7AEA;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    margin: 20px 0 16px;
    transition: opacity .15s;
}
.article-back:hover { opacity: .7; }

.article-wrap {
    max-width: 780px;
    margin: 0 auto;
    padding: 30px 20px;
    padding-bottom: 40px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 2px 20px rgba(50,38,89,.08);
    border: 1px solid #f0ebff;
    margin-bottom: 60px;
}

.article-cover {
    width: 100%;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 24px;
    max-height: 380px;
}
.article-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.article-cover-placeholder {
    height: 220px;
    background: linear-gradient(135deg, #f0ebff, #e8f8f6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
}
.article-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: #aaa;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.article-title {
    font-size: 28px;
    font-weight: 800;
    color: #322659;
    margin-bottom: 24px;
    line-height: 1.3;
}
.article-content {
    font-size: 16px;
    color: #444;
    line-height: 1.8;
}
.article-content h2,
.article-content h3 {
    color: #322659;
    margin: 28px 0 12px;
    font-weight: 700;
}
.article-content h2 { font-size: 22px; }
.article-content h3 { font-size: 18px; }
.article-content p  { margin-bottom: 14px; }
.article-content ul,
.article-content ol { margin: 0 0 14px 24px; }
.article-content li { margin-bottom: 6px; }
.article-content strong { color: #322659; }
.article-content a { color: #9F7AEA; }
.article-content blockquote {
    border-left: 4px solid #9F7AEA;
    padding: 10px 16px;
    margin: 20px 0;
    background: #faf5ff;
    border-radius: 0 10px 10px 0;
    color: #555;
    font-style: italic;
}

/* Inline images in article content */
.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    display: block;
    margin: 24px auto;
    box-shadow: 0 4px 20px rgba(0,0,0,.1);
}
.article-content figure {
    margin: 28px 0;
    text-align: center;
}
.article-content figcaption {
    font-size: 13px;
    color: #aaa;
    margin-top: 10px;
    font-style: italic;
}
.article-content .article-img-wide {
    width: 100%;
    border-radius: 12px;
    margin: 24px 0;
}
.article-content .article-img-half {
    max-width: 50%;
}

@media (max-width: 600px) {
    .article-wrap { padding: 20px 14px; border-radius: 14px; }
    .article-title { font-size: 22px; }
    .article-content .article-img-half { max-width: 100%; }
}

/* ===== Comments (news_detail.php) ===== */
.comments-section {
    margin-top: 48px;
    border-top: 2px solid #ede9f8;
    padding-top: 32px;
}
.comments-title {
    font-size: 20px;
    font-weight: 700;
    color: #322659;
    margin-bottom: 24px;
}
.comment-form {
    background: #faf5ff;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 28px;
}
.comment-form h4 {
    font-size: 15px;
    color: #322659;
    margin-bottom: 12px;
}
.comment-textarea {
    width: 100%;
    min-height: 80px;
    border: 1.5px solid #ede9f8;
    border-radius: 10px;
    padding: 12px;
    font-size: 14px;
    color: #322659;
    resize: vertical;
    box-sizing: border-box;
    font-family: inherit;
}
.comment-textarea:focus { outline: none; border-color: #9F7AEA; }
.comment-submit {
    margin-top: 10px;
    padding: 10px 24px;
    background: linear-gradient(135deg, #9F7AEA, #38B2AC);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s;
}
.comment-submit:hover { transform: translateY(-1px); }
.comment-submit:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.comment-login-prompt {
    text-align: center;
    padding: 20px;
    color: #888;
    font-size: 14px;
    background: #faf5ff;
    border-radius: 16px;
    margin-bottom: 28px;
}
.comment-login-prompt a { color: #9F7AEA; font-weight: 600; }
.comment-list { display: flex; flex-direction: column; gap: 16px; }
.comment-item {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: #fff;
    border-radius: 14px;
    border: 1.5px solid #ede9f8;
}
.comment-avatar .gt-avatar-wrap { width: 36px; height: 36px; flex-shrink: 0; }
.comment-avatar .gt-avatar-initial { font-size: 14px; }
.comment-body { flex: 1; }
.comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}
.comment-author {
    font-size: 13px;
    font-weight: 700;
    color: #322659;
    text-decoration: none;
}
.comment-author:hover { color: #9F7AEA; }
.comment-date { font-size: 11px; color: #bbb; }
.comment-text { font-size: 14px; color: #555; line-height: 1.5; word-break: break-word; }
.comment-delete {
    margin-left: auto;
    background: none;
    border: none;
    color: #e53e3e;
    font-size: 12px;
    cursor: pointer;
    opacity: .5;
    transition: opacity .15s;
    flex-shrink: 0;
}
.comment-delete:hover { opacity: 1; }
