/*
Theme Name: ICHD Center Theme
Theme URI: https://ichd-center.com
Author: ICHD Dev Team
Author URI: https://ichd-center.com
Description: ثيم خاص للمركز الدولي للتنمية البشرية، مصمم ليعمل كغلاف لتطبيق React مع دعم صفحات الووردبريس التقليدية.
Version: 1.5
License: GPLv2 or later
Text Domain: ichd-theme
*/

/* Reset & Basics */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Cairo', sans-serif;
    line-height: 1.6;
    background-color: var(--wp--preset--color--light, #f8fafc);
    color: var(--wp--preset--color--dark, #0f172a);
}

/* WordPress Alignment Classes */
.alignwide {
    max-width: var(--wp--style--global--wide-size);
    margin-left: auto;
    margin-right: auto;
}

.alignfull {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

/* Typography Helpers */
a {
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

.wp-block-button__link {
    text-decoration: none !important;
}

/* 
   🌟 FIX: Article & Content Formatting (Entry Content)
*/
.entry-content {
    font-size: 1.125rem; /* 18px */
    line-height: 1.8;
    color: #334155;
}

.entry-content p {
    margin-bottom: 1.5em; 
}

.entry-content ul {
    list-style-type: disc !important;
    margin-bottom: 1.5em;
    padding-right: 2em;
}

.entry-content ol {
    list-style-type: decimal !important;
    margin-bottom: 1.5em;
    padding-right: 2em;
}

.entry-content li {
    margin-bottom: 0.5em;
}

.entry-content h2 {
    font-size: 1.5em;
    font-weight: 700;
    margin-top: 1.5em;
    margin-bottom: 0.8em;
    color: #1e3a8a;
}

@media (min-width: 768px) {
    .entry-content h2 { font-size: 1.8em; }
}

.entry-content h3 {
    font-size: 1.25em;
    font-weight: 600;
    margin-top: 1.2em;
    margin-bottom: 0.6em;
    color: #1e293b;
}

@media (min-width: 768px) {
    .entry-content h3 { font-size: 1.5em; }
}

.entry-content blockquote {
    border-right: 4px solid #fbbf24;
    padding: 1em;
    background: #f8fafc;
    font-style: italic;
    margin-bottom: 1.5em;
}

.dark .entry-content {
    color: #e2e8f0;
}
.dark .entry-content h2, 
.dark .entry-content h3 {
    color: #f8fafc;
}
.dark .entry-content blockquote {
    background: #1e293b;
    color: #cbd5e1;
}

/* =========================================
   🌟 IMPROVED COMMENTS SECTION 🌟
   ========================================= */

#comments {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

/* Title */
#comments .comments-title {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 20px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
}

@media (min-width: 768px) {
    #comments .comments-title { font-size: 1.6rem; margin-bottom: 30px; }
}

#comments .comments-title::before {
    content: '';
    display: block;
    width: 6px;
    height: 24px;
    background-color: #fbbf24; /* Secondary Color */
    border-radius: 4px;
}

/* Comment List Container */
#comments .comment-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Single Comment Item */
#comments .comment-list li {
    margin-bottom: 15px;
}

@media (min-width: 768px) {
    #comments .comment-list li { margin-bottom: 20px; }
}

/* Comment Body (The Card) */
#comments .comment-body {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 15px;
    position: relative;
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

@media (min-width: 768px) {
    #comments .comment-body { padding: 24px; border-radius: 16px; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05); }
    #comments .comment-body:hover { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); }
}

/* Header: Author + Meta */
#comments .comment-meta {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 10px;
}

@media (min-width: 768px) {
    #comments .comment-meta { margin-bottom: 15px; gap: 15px; }
}

/* Avatar */
#comments .comment-author .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #f3f4f6;
    display: block;
}

@media (min-width: 768px) {
    #comments .comment-author .avatar { width: 50px; height: 50px; border-width: 3px; }
}

/* Author Name & Date Wrapper */
#comments .comment-author-info {
    display: flex;
    flex-direction: column;
}

#comments .comment-author .fn {
    font-style: normal;
    font-weight: 800;
    font-size: 0.9rem;
    color: #1e3a8a;
    line-height: 1.2;
}

@media (min-width: 768px) {
    #comments .comment-author .fn { font-size: 1rem; }
}

#comments .comment-author .fn a {
    color: inherit;
    text-decoration: none;
}

#comments .comment-metadata {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 2px;
}

@media (min-width: 768px) {
    #comments .comment-metadata { font-size: 0.8rem; margin-top: 4px; }
}

#comments .comment-metadata a {
    color: inherit;
    text-decoration: none;
}

/* Comment Content */
#comments .comment-content p {
    margin: 0 0 10px;
    color: #4b5563;
    line-height: 1.6;
    font-size: 0.95rem;
}

@media (min-width: 768px) {
    #comments .comment-content p { margin: 0 0 15px; font-size: 1rem; line-height: 1.7; }
}

/* Reply Button */
#comments .reply {
    text-align: left;
    margin-top: 8px;
}

#comments .comment-reply-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    background-color: #f1f5f9;
    color: #64748b;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-decoration: none !important;
    transition: all 0.2s;
}

@media (min-width: 768px) {
    #comments .comment-reply-link { padding: 6px 16px; font-size: 0.85rem; gap: 5px; }
}

#comments .comment-reply-link:hover {
    background-color: #1e3a8a;
    color: #fff;
}

/* Nested Replies */
#comments .children {
    list-style: none;
    padding: 0;
    margin: 15px 10px 0 0; /* Indent from Right */
    border-right: 2px solid #e2e8f0;
    padding-right: 10px;
}

@media (min-width: 768px) {
    #comments .children { margin: 20px 20px 0 0; border-right-width: 3px; padding-right: 20px; }
}

/* Comment Respond Form */
#comments .comment-respond {
    background: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    margin-top: 30px;
    border: 1px solid #e2e8f0;
}

@media (min-width: 768px) {
    #comments .comment-respond { padding: 30px; border-radius: 16px; margin-top: 40px; }
}

#comments .comment-reply-title {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 15px;
    color: #1e293b;
    display: block;
}

@media (min-width: 768px) {
    #comments .comment-reply-title { font-size: 1.2rem; margin-bottom: 20px; }
}

#comments .comment-reply-title small a {
    color: #ef4444;
    font-size: 0.8rem;
    margin-right: 10px;
}

/* Inputs */
#comments .comment-form p {
    margin-bottom: 15px;
}

@media (min-width: 768px) {
    #comments .comment-form p { margin-bottom: 20px; }
}

#comments label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    color: #475569;
}

@media (min-width: 768px) {
    #comments label { margin-bottom: 8px; font-size: 0.9rem; }
}

#comments input[type="text"],
#comments input[type="email"],
#comments input[type="url"],
#comments textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

@media (min-width: 768px) {
    #comments input[type="text"],
    #comments input[type="email"],
    #comments input[type="url"],
    #comments textarea { padding: 12px 16px; border-radius: 10px; font-size: 1rem; }
}

#comments textarea {
    height: 100px;
    resize: vertical;
}

@media (min-width: 768px) {
    #comments textarea { height: 120px; }
}

#comments input:focus,
#comments textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Submit Button */
#comments .form-submit .submit {
    background: #1e3a8a;
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.3s;
    width: 100%; /* Full width on mobile */
}

@media (min-width: 768px) {
    #comments .form-submit .submit { width: auto; padding: 12px 30px; border-radius: 10px; font-size: 1rem; }
}

#comments .form-submit .submit:hover {
    background: #1e40af;
}

/* Cookies Consent */
#comments .comment-form-cookies-consent {
    display: flex;
    align-items: center;
    gap: 10px;
}
#comments .comment-form-cookies-consent input {
    width: auto;
}
#comments .comment-form-cookies-consent label {
    margin: 0;
    font-weight: 400;
    font-size: 0.8rem;
}

@media (min-width: 768px) {
    #comments .comment-form-cookies-consent label { font-size: 0.85rem; }
}

/* Dark Mode Overrides */
.dark #comments { border-top-color: #334155; }
.dark #comments .comments-title { color: #f1f5f9; }
.dark #comments .comment-body { background: #1e293b; border-color: #334155; }
.dark #comments .comment-author .fn { color: #60a5fa; }
.dark #comments .comment-metadata { color: #94a3b8; }
.dark #comments .comment-content p { color: #cbd5e1; }
.dark #comments .comment-reply-link { background-color: #334155; color: #cbd5e1; }
.dark #comments .comment-reply-link:hover { background-color: #60a5fa; color: #1e293b; }
.dark #comments .children { border-right-color: #334155; }
.dark #comments .comment-respond { background: #1e293b; border-color: #334155; }
.dark #comments .comment-reply-title { color: #f1f5f9; }
.dark #comments label { color: #cbd5e1; }
.dark #comments input[type="text"],
.dark #comments input[type="email"],
.dark #comments input[type="url"],
.dark #comments textarea { background: #0f172a; border-color: #334155; color: #f1f5f9; }
.dark #comments input:focus, .dark #comments textarea:focus { border-color: #60a5fa; }