/*
Theme Name: Hadith Magazine
Theme URI: https://hadithmagazine.com
Author: Antigravity
Author URI: https://github.com/google-deepmind
Description: A hybrid site hosting a wpForo community and a bespoke Islamic Magazine.
Version: 1.0
Text Domain: hadith-magazine
*/

:root {
  --primary: #0A4D3C; --primary-dark: #052b21; --accent: #C5A059;
  --bg-body: #F9F9F6; --bg-card: #FFFFFF; --text-main: #1D2D28; --text-light: #5F6F69;
  --border-radius: 12px; --border-light: 1px solid rgba(10, 77, 60, 0.1);
  --shadow-card: 0 8px 24px rgba(10, 77, 60, 0.08); --shadow-hover: 0 12px 32px rgba(10, 77, 60, 0.15);
  --shadow-dropdown: 0 10px 30px rgba(0, 0, 0, 0.1); --primary-transparent: rgba(10, 77, 60, 0.08);
  --font-cairo: 'Cairo', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-cairo); background: var(--bg-body); color: var(--text-main); line-height: 2; background-image: radial-gradient(var(--accent) 0.5px, transparent 0.5px); background-size: 20px 20px; }
a { text-decoration: none; color: inherit; transition: 0.3s; }
h1, h2, h3, h4, h5, h6, .title-font, blockquote, .hero-title, .card-title, .issue-title, .article-title, .widget-head, .comment-reply-title, .wp-block-search__label { font-family: var(--font-cairo); }

/* --- Layout --- */
.top-bar { background: var(--primary); color: white; font-size: 0.85rem; padding: 0.5rem 0; border-bottom: 3px solid var(--accent); }
.top-container, .header-inner, .nav-container, .container { max-width: 1300px; margin: 0 auto; padding: 0 1.5rem; }
.site-header { background: var(--bg-card); padding: 1.5rem 0; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03); position: relative; z-index: 1000; }
body.menu-open .site-header { z-index: 100001; }
.header-inner { display: flex; justify-content: space-between; align-items: center; }
.logo h1 { font-size: 2.8rem; color: var(--primary); font-weight: 700; line-height: 1; }
.custom-logo-link img { max-height: 100px; width: auto; display: block; }

/* --- Navigation & Search --- */
.main-menu { list-style: none; display: flex; gap: 1.5rem; }
.main-menu li { position: relative; padding: 1.2rem 0; }
.main-menu a { font-weight: 700; font-size: 1rem; }
.main-menu a:hover, .main-menu li:hover > a { color: var(--primary); }
.main-menu ul { position: absolute; top: 100%; right: 0; background: white; min-width: 220px; list-style: none; padding: 0.8rem 0; box-shadow: var(--shadow-dropdown); border-radius: 0 0 10px 10px; opacity: 0; visibility: hidden; transform: translateY(10px); transition: 0.3s; border-top: 3px solid var(--primary); z-index: 1000; }
.main-menu li:hover > ul { opacity: 1; visibility: visible; transform: translateY(0); }
.main-menu ul a { display: block; padding: 0.7rem 1.5rem; font-size: 0.95rem; font-weight: 500; color: #444; }
.main-menu ul a:hover { background: var(--primary-transparent); color: var(--primary); padding-right: 1.8rem; }
.menu-item-wrapper { display: flex; justify-content: space-between; align-items: center; }
.sub-menu-toggle { border: none; background: none; padding: 0 15px; cursor: pointer; color: var(--primary); font-size: 1.2rem; }

.header-actions { display: none; align-items: center; gap: 1rem; }
.search-toggle-btn { background: none; border: none; cursor: pointer; color: var(--primary); font-size: 1.4rem; padding: 0.5rem; }

.header-search form { background: #f4f4f4; padding: 0.5rem 1.2rem; border-radius: 30px; display: flex; align-items: center; width: 300px; transition: 0.3s; }
.header-search form:focus-within { background: white; box-shadow: 0 0 0 2px var(--primary-transparent); }
.header-search form input { border: none; background: transparent; width: 100%; outline: none; font-family: inherit; font-size: 0.9rem; }
.header-search form button { background: none; border: none; cursor: pointer; color: var(--primary); font-size: 1.1rem; }

/* --- Grid & Cards --- */
.container { display: flex; flex-wrap: wrap; gap: 3rem; margin: 3rem auto; align-items: start; }
.container > main { flex: 1; min-width: 300px; }
.container > aside { flex: 0 0 320px; }
.cards-grid, .archive-grid, .topics-grid, .issues-library-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(var(--cols, 3), 1fr); }

.card, .issue-item, .topic-card { background: var(--bg-card); border-radius: var(--border-radius); overflow: hidden; box-shadow: var(--shadow-card); border: var(--border-light); transition: 0.3s; display: flex; flex-direction: column; text-align: center; }
.card:hover, .issue-item:hover, .topic-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); border-color: var(--accent);}

.card-img, .issue-thumb, .hero-img { background-size: cover; background-position: center; transition: 0.5s; background-color: #eee; }
.card-img { height: 160px; position: relative; }
.card-body, .topic-card .card-body { padding: 1.2rem; flex-grow: 1; display: flex; flex-direction: column; }
.card-title, .issue-title, .topic-card .card-title { font-size: 1.2rem; color: var(--primary); line-height: 1.4; margin-bottom: 0.8rem; }
.card-excerpt { font-size: 0.9rem; color: var(--text-light); }

/* --- Hero --- */
.hero-wrapper { background: white; border-radius: var(--border-radius); box-shadow: var(--shadow-card); overflow: hidden; border: var(--border-light); margin-bottom: 3rem; display: grid; grid-template-columns: 1.6fr 1fr; }
.hero-feature { position: relative; height: 450px; overflow: hidden; }
.hero-feature:hover .hero-img { transform: scale(1.03); }
.hero-overlay { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(to top, rgba(10, 77, 60, 0.95), transparent); padding: 2rem; color: white; }
.hero-title { font-size: 2.2rem; line-height: 1.3; margin-bottom: 0.5rem; }
.hero-list { padding: 2rem; display: flex; flex-direction: column; gap: 1.5rem; background: #fff; text-align: right; }
.list-item { padding-bottom: 1.5rem; border-bottom: 1px dashed #ddd; }
.list-item:last-child { border: none; }
.list-cat { color: var(--accent); font-size: 0.8rem; font-weight: bold; margin-bottom: 4px; display: block; }
.list-title { font-size: 1.2rem; font-weight: bold; }
.list-title:hover { color: var(--primary); }

/* --- Badges & Buttons --- */
.badge, .cat-badge, .cat-tag, .cat-label { background: var(--accent); color: white; padding: 4px 12px; border-radius: 4px; font-size: 0.8rem; font-weight: bold; display: inline-block; }
.card .cat-badge, .badge-author { background: var(--primary); }
.card .cat-badge { position: absolute; top: 10px; right: 10px; z-index: 10; }
.cat-tag { text-transform: uppercase; }
.cat-label { border-radius: 20px; }
.btn-primary, .submit, .share-btn, .share-trigger-btn, .btn-download-pdf, .next-page-btn, .prev-page-btn, .wp-block-search__inside-wrapper button { display: block; width: 100%; background: var(--primary); color: white; padding: 0.8rem; border-radius: 6px; font-weight: bold; cursor: pointer; text-align: center; border: none; transition: 0.3s; font-family: var(--font-cairo); }
.btn-primary:hover, .submit:hover, .share-trigger-btn:hover { background: var(--primary-dark); transform: translateY(-2px); }
.btn-download-pdf { background: var(--accent); font-size: 1rem; }
.btn-download-pdf:hover { background: #b08e4d; color: white; }

/* --- Section Head --- */
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2rem; border-bottom: 2px solid rgba(10, 77, 60, 0.1); padding-bottom: 0.5rem; }
.section-head h2 { font-size: 2rem; color: var(--primary); position: relative; padding-left: 1rem; }
.section-head h2::after { content: ''; position: absolute; bottom: -7px; right: 0; width: 100%; height: 3px; background: var(--accent); }
.more-btn { font-size: 0.9rem; font-weight: bold; color: var(--text-light); display: flex; align-items: center; gap: 5px; }
.more-btn:hover { color: var(--primary); gap: 8px; }

/* --- Single Post & Article --- */
.post-content-wrapper, .article-wrapper { padding: 2.5rem 3rem; background: var(--bg-card); border-radius: var(--border-radius); box-shadow: var(--shadow-card); border: var(--border-light); }
.featured-image-single { width: 100%; height: 400px; background-size: cover; background-position: center; }
.featured-image { width: 100%; height: auto; margin-bottom: 2rem; border-radius: var(--border-radius); overflow: hidden; }
.featured-image img { width: 100%; height: auto; display: block; }
.post-meta-single { font-size: 0.85rem; color: var(--text-light); margin-bottom: 1rem; display: flex; gap: 10px; align-items: center; font-weight: 600; }
.post-title-single, .article-title { font-size: 2rem; color: var(--primary); line-height: 1.3; margin: 1.5rem 0; }
.post-body, .article-content-academic { font-size: 1.1rem; color: #333; line-height: 1.8; border-bottom: 1px solid #eee; padding-bottom: 2rem; margin-bottom: 2rem; text-align: justify; }
.post-body p, .article-content-academic p { margin-bottom: 1.5rem; }
.post-body blockquote, .abstract-box { border-right: 4px solid var(--accent); background: #f9f9f9; padding: 1rem 1.5rem; margin: 2rem 0; font-size: 1.3rem; color: var(--primary); font-style: italic; }
.abstract-box { border-color: var(--primary); background: #fdfbf7; margin-bottom: 3rem; }
.abstract-title { font-family: var(--font-cairo); font-weight: bold; font-style: normal; color: var(--primary); display: block; margin-bottom: 0.5rem; font-size: 0.9rem; }
.post-tags a { background: #f4f4f4; color: var(--text-main); padding: 6px 14px; border-radius: 6px; font-size: 0.85rem; border: none; margin-left: 5px}
.post-tags a::before { content: '#'; opacity: 0.5; margin-left: 2px; }
.post-tags a:hover { background: var(--primary); color: white; transform: translateY(-2px); }

/* --- Post Footer --- */
.post-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 3rem; border-top: 1px solid #eee; padding-top: 2rem; }
.share-area { margin-top: 0 !important; }
.share-trigger-btn { width: auto; padding: 0.6rem 1.5rem; }

/* --- Article Navigation --- */
.pagination-area { display: flex; justify-content: space-between; align-items: center; margin: 3rem 0; padding-top: 2rem; border-top: 1px dashed #ddd; font-family: var(--font-cairo); }
.page-counter { color: var(--text-main); font-weight: bold; font-size: 1.1rem; }
.next-page-btn, .prev-page-btn { display: inline-flex; width: auto; align-items: center; gap: 8px; padding: 0.7rem 1.5rem; }
.next-page-btn svg, .prev-page-btn svg { width: 18px; height: 18px; }
.footer-nav { text-align: left; margin-top: 1.5rem; }
.back-link { color: var(--text-main); font-weight: bold; font-family: var(--font-cairo); opacity: 0.8; }
.back-link:hover { opacity: 1; color: var(--primary); }

/* --- Comments --- */
.comments-area { margin-top: 4rem; border-top: 2px solid var(--primary-transparent); padding-top: 3rem; }
.comments-title, .comment-reply-title { font-size: 1.8rem; color: var(--primary); margin-bottom: 2rem; }
.comment-list { list-style: none; padding: 0; }
.comment-body { background: #fff; border: 1px solid #eee; border-radius: 12px; padding: 2rem; margin-bottom: 2rem; box-shadow: 0 4px 12px rgba(0,0,0,0.02); transition: 0.3s; }
.comment-body:hover { border-color: var(--accent); }
.comment-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.comment-author { display: flex; align-items: center; gap: 12px; }
.avatar { width: 50px; height: 50px; border-radius: 50%; border:2px solid var(--accent); box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.comment-author .fn { font-weight: bold; font-size: 1.1rem; color: var(--text-main); }
.author-comment { border-color: var(--accent); background: #fdfdf9; }
.badge-author { background: var(--primary); color: white; font-size: 0.75rem; padding: 2px 8px; border-radius: 4px; font-weight: bold; }
.comment-metadata { font-size: 0.85rem; color: var(--text-light); }
.comment-content { line-height: 1.8; color: #444; margin-bottom: 1.5rem; }
.comment-reply-link { color: var(--primary); font-weight: bold; display: inline-flex; align-items: center; gap: 5px; font-size: 0.95rem; }
.comment-reply-link::before { content: '↩'; transform: rotate(90deg); display: inline-block; }

/* --- Comment Form --- */
.comment-respond { margin-top: 4rem; }
.comment-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.comment-form input, .comment-form textarea { width: 100%; padding: 14px; border: 1px solid #e0e0e0; border-radius: 8px; font-family: inherit; margin-bottom: 1.5rem; font-size: 1rem; background: white; transition: 0.3s; }
.comment-form input:focus, .comment-form textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-transparent); outline: none; }
.comment-form .submit { background: var(--primary); width: auto; min-width: 180px; align-self: flex-end; float: left; margin-top: 10px; }
@media (max-width: 600px) { .comment-form .form-row { grid-template-columns: 1fr; gap: 0; } }

/* --- Widgets --- */
.widget { background: var(--bg-card); border-radius: var(--border-radius); box-shadow: var(--shadow-card); border: var(--border-light); padding: 1.5rem; margin-bottom: 2rem; }
.widget-head, .wp-block-search__label, .issue-card-title { font-size: 1.4rem; color: var(--primary); border-bottom: 2px solid var(--accent); padding-bottom: 0.5rem; margin-bottom: 1rem; display: block; }
.side-links li, .issue-list li { list-style: none; border-bottom: 1px solid #f0f0f0; }
.side-links a, .issue-link { display: block; padding: 10px 0; font-weight: 600; }
.side-links a:hover, .issue-link:hover { color: var(--primary); padding-right: 8px; }
.author-img { width: 100px; height: 100px; border-radius: 50%; border: 3px solid var(--accent); padding: 3px; background: white; margin: 0 auto 1rem; display: block; }

/* --- Archive & Pagination --- */
.page-header { margin-bottom: 3rem; border-bottom: 2px solid rgba(10, 77, 60, 0.1); padding-bottom: 1.5rem; display: flex; justify-content: space-between; align-items: center; }
.page-title { font-size: 2.4rem; color: var(--primary); position: relative; padding-right: 20px; }
.page-title::before { content: ''; position: absolute; right: 0; top: 8px; bottom: 8px; width: 6px; background: var(--accent); border-radius: 2px; }
.pagination { display: flex; justify-content: center; gap: 8px; margin: 40px 0; }
.pagination .page-numbers { min-width: 40px; height: 40px; padding: 0 10px; background: white; color: var(--primary); border: 1px solid #eee; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; }
.pagination .page-numbers.current { background: var(--primary); color: white; }
.pagination .page-numbers:hover:not(.current) { background: var(--bg-body); border-color: var(--primary); transform: translateY(-2px); }

/* --- Footer & Misc --- */
.site-footer { background: var(--primary); color: white; text-align: center; padding: 3rem; margin-top: 5rem; border-top: 5px solid var(--accent); }
.issue-cover-v2 img { width: auto; max-width: 100%; height: 300px; object-fit: contain; border-radius: 10px; box-shadow: 10px 10px 25px rgba(0,0,0,0.2); }
.detail-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px dashed #eee; font-size: 0.95rem; }

/* --- Share Modal --- */
.share-modal { display: none; position: fixed; z-index: 9999; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); align-items: center; justify-content: center; }
.share-modal.is-active { display: flex; }
.share-modal-content { background: white; padding: 30px; border-radius: 15px; width: 90%; max-width: 400px; text-align: center; position: relative; }
.share-links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.share-link { padding: 12px; border-radius: 8px; color: white; font-weight: 600; }
.share-link.fb { background: #1877F2; } .share-link.x { background: #000; } .share-link.wa { background: #25D366; } .share-link.copy { background: var(--primary); }

/* --- Mobile Menu --- */
.menu-toggle { display: none; background: none; border: none; cursor: pointer; align-items: center; gap: 0.5rem; color: var(--primary); }
.hamburger-box { width: 24px; height: 18px; position: relative; display: inline-block; }
.hamburger-inner, .hamburger-inner::before, .hamburger-inner::after { width: 24px; height: 2px; background: var(--primary); position: absolute; transition: 0.3s; border-radius: 4px; }
.hamburger-inner { top: 50%; transform: translateY(-50%); }
.hamburger-inner::before { content: ""; top: -8px; } .hamburger-inner::after { content: ""; top: 8px; }
.menu-toggle.is-active .hamburger-inner { background: transparent; }
.menu-toggle.is-active .hamburger-inner::before { top: 0; transform: rotate(45deg); }
.menu-toggle.is-active .hamburger-inner::after { top: 0; transform: rotate(-45deg); }

@media (max-width: 900px) {
  .container > aside { flex: 1 1 100%; }
  .header-actions { display: flex; }
  .header-search { position: absolute; top: 100%; left: 0; right: 0; background: white; padding: 1rem; box-shadow: 0 10px 20px rgba(0,0,0,0.05); border-top: 1px solid #eee; display: none; z-index: 1000; }
  .header-search.is-active { display: block; }
  .header-search form { width: 100%; max-width: none; }

  .hero-wrapper, .cards-grid, .archive-grid, .topics-grid, .issues-library-grid { --cols: 2 !important; grid-template-columns: 1fr; }
  .hero-wrapper { grid-template-columns: 1fr; }

  .menu-toggle { display: flex; }
  .main-navigation { position: fixed; top: 0; right: -100%; width: 300px; height: 100vh; background: white; z-index: 100000; transition: 0.4s; padding-top: 80px; box-shadow: -5px 0 30px rgba(0,0,0,0.1); }
  .main-navigation.is-active { right: 0; }
  .main-menu { flex-direction: column; gap: 0; }
  .main-menu li { border-bottom: 1px solid rgba(0,0,0,0.05); }
  .main-menu a { display: block; padding: 1rem 2rem; }
  .main-menu ul { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: none; display: none; background: #fdfdfd; }
  .main-menu li.is-open > ul { display: block; }
  .menu-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.4); z-index: 99999; opacity: 0; visibility: hidden; transition: 0.3s; }
  .menu-overlay.is-active { opacity: 1; visibility: visible; }
}
@media (max-width: 767px) { 
  .cards-grid, .archive-grid, .issues-library-grid, .topics-grid { --cols: 1 !important; }
  .section-head h2 { font-size: 1.5rem; }
  .hero-title { font-size: 1.6rem; }
  .page-title, .article-title, .post-title-single { font-size: 1.8rem; }
}

.card-header,
.issue-thumb {
    padding: 1rem;
    background: rgba(10, 77, 60, 0.03);
}
.issue-thumb {
    margin-bottom: 1em;
}
img{
  max-width: 100%;
}
.cat-badge,
.issue-date{
    margin-bottom: 0.8rem;
}
.issue-cover-v2 {
    text-align: center;
}
.post-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-card);
    border: var(--border-light);
}
.article-head {
    text-align: center;
    margin-bottom: 2em;
}
.reply{
  text-align: left;
}

ol.children {
    margin-right: 3rem;
    border-right: 2px solid rgba(10, 77, 60, 0.1);
    padding-right: 1.5rem;
    list-style: none;
}
p.comment-form-cookies-consent input {
    width: unset;
}
.shortcode-grid {
    margin-top: 2em;
}
.top-bar .top-container {
    display: flex;
    justify-content: space-between;
}

/* HM Categories Widget */
.widget_hm_categories_widget {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.hm-cat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px dotted #e0e0e0;
}
.hm-cat-item:last-child {
    border-bottom: none;
}
.hm-cat-count {
    background: #f0f0f0;
    color: #666;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 40px;
    text-align: center;
    order: 2; /* Count on the left (end of row) */
}
.hm-cat-link {
    font-family: 'Cairo', sans-serif;
    color: var(--dark);
    font-weight: 500;
    transition: color 0.2s;
    order: 1; /* Category name on the right (start of row) */
}
.hm-cat-link:hover {
    color: var(--primary);
}
.widget_hm_categories_widget .widget-title {
    position: relative;
    padding-bottom: 15px;
    margin-bottom: 20px;
    color: #0c4d3c;
    font-size: 1.5rem;
}
.widget_hm_categories_widget .widget-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 2px;
    background: #c5a059;
}

.wp-block-search__inside-wrapper {
    flex-wrap: wrap !important;
}
.wp-block-search__inside-wrapper button{
    width: auto;  
}
input#wp-block-search__input-1 {
    border-radius: 6px;
}
.detail-label{
  font-weight: bold;
}
.blank-container .container{
  display: block !important;
	max-width: 1450px;
}