/*
Theme Name: Moroccan News
Theme URI: https://voiceofmorocco.live
Description: Professional bilingual Arabic/French news theme
Version: 2.1.0
Author: Voice of Morocco
Text Domain: moroccan-news
*/

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

:root {
    --red:    #d32f2f;
    --dark:   #0f0f0f;
    --nav:    #1a237e;
    --text:   #1a1a1a;
    --muted:  #6b7280;
    --bg:     #f3f4f6;
    --white:  #ffffff;
    --card:   #ffffff;
    --border: #e5e7eb;
    --shadow: 0 1px 6px rgba(0,0,0,.08);
    --shadow-h: 0 6px 24px rgba(0,0,0,.14);
    --radius: 10px;
}

html { direction: rtl; scroll-behavior: smooth; }
body { font-family: 'Cairo', 'Roboto', sans-serif; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.7; }
a { text-decoration: none; color: inherit; transition: color .2s; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }
.container { max-width: 1220px; margin: 0 auto; padding: 0 16px; }
.inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

/* TOP BAR */
.top-bar { background: var(--dark); color: #9ca3af; font-size: 12px; padding: 7px 0; }
.top-date { font-weight: 500; }
.top-social { display: flex; gap: 10px; }
.top-social a { color: #9ca3af; display: flex; align-items: center; transition: color .2s; }
.top-social a:hover { color: var(--red); }

/* HEADER */
.site-header { background: var(--dark); padding: 14px 0; border-bottom: 3px solid var(--red); }
.logo-wrap a { display: flex; flex-direction: column; gap: 2px; }
.logo-text { font-size: 26px; font-weight: 900; color: #fff; letter-spacing: 3px; text-transform: uppercase; line-height: 1; }
.logo-text span { color: var(--red); }
.logo-sub { font-size: 10px; color: #6b7280; letter-spacing: 1px; }
.logo-wrap .custom-logo { max-height: 55px; width: auto; }

.header-search { position: relative; }
.header-search form { display: flex; }
.header-search input { background: #1a1a1a; border: 1px solid #333; border-radius: 6px 0 0 6px; padding: 8px 14px; color: #fff; font-family: 'Cairo', sans-serif; font-size: 13px; width: 220px; outline: none; border-left: none; }
.header-search input::placeholder { color: #555; }
.header-search input:focus { border-color: var(--red); }
.header-search button { background: var(--red); border: none; color: #fff; padding: 0 14px; border-radius: 0 6px 6px 0; cursor: pointer; display: flex; align-items: center; transition: background .2s; }
.header-search button:hover { background: #b71c1c; }

/* NAVIGATION */
.main-nav { background: var(--nav); position: sticky; top: 0; z-index: 200; box-shadow: 0 2px 12px rgba(0,0,0,.4); }
.main-nav .inner { justify-content: flex-start; gap: 0; }

#primary-menu { display: flex; }
#primary-menu li { position: relative; }
#primary-menu li a { display: block; padding: 13px 16px; color: #d1d5db; font-weight: 700; font-size: 13.5px; transition: all .2s; }
#primary-menu li a:hover,
#primary-menu li.current-menu-item > a,
#primary-menu li.current-menu-ancestor > a { color: #fff; background: var(--red); }
#primary-menu li ul { display: none; position: absolute; top: 100%; right: 0; background: #1a237e; min-width: 180px; border-top: 2px solid var(--red); box-shadow: 0 6px 18px rgba(0,0,0,.35); z-index: 300; }
#primary-menu li:hover > ul { display: block; }
#primary-menu li ul li a { padding: 10px 16px; font-size: 13px; border-bottom: 1px solid rgba(255,255,255,.07); }

/* FR / AR LANGUAGE BUTTONS */
.nav-lang { display: flex; gap: 5px; margin-right: auto; padding: 0 14px; flex-shrink: 0; }
.lang-btn { padding: 5px 11px; border-radius: 4px; font-size: 12px; font-weight: 800; color: #9ca3af; border: 1px solid rgba(255,255,255,.18); transition: all .2s; letter-spacing: .5px; }
.lang-btn:hover, .lang-btn.active { background: var(--red); color: #fff; border-color: var(--red); }

/* HAMBURGER */
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 10px 16px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: #fff; border-radius: 2px; transition: all .3s; }

/* TICKER */
.ticker-bar { background: #fff; border-bottom: 2px solid var(--border); padding: 9px 0; overflow: hidden; }
.ticker-bar .inner { gap: 14px; }
.ticker-label { background: var(--red); color: #fff; font-size: 11px; font-weight: 800; padding: 4px 14px; border-radius: 3px; white-space: nowrap; flex-shrink: 0; letter-spacing: 1px; }
.ticker-content { overflow: hidden; flex: 1; }
.ticker-scroll { display: flex; gap: 50px; animation: ticker-rtl 45s linear infinite; white-space: nowrap; }
.ticker-scroll:hover { animation-play-state: paused; }
.ticker-scroll a { font-size: 13px; font-weight: 600; color: var(--text); }
.ticker-scroll a:hover { color: var(--red); }
.ticker-sep { color: var(--red); font-weight: 900; }
@keyframes ticker-rtl { 0% { transform: translateX(-60%); } 100% { transform: translateX(60%); } }

/* HERO */
.hero-section { background: #fff; padding: 20px 0 0; border-bottom: 1px solid var(--border); }
.hero-grid { display: grid; grid-template-columns: 1fr 320px; gap: 14px; }
.hero-main { position: relative; border-radius: var(--radius); overflow: hidden; }
.hero-main .thumb { width: 100%; height: 430px; object-fit: cover; display: block; }
.hero-overlay { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(transparent, rgba(0,0,0,.78) 55%, rgba(0,0,0,.94)); padding: 40px 20px 20px; }
.hero-cat { display: inline-block; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; padding: 3px 11px; border-radius: 3px; margin-bottom: 10px; letter-spacing: .5px; }
.hero-title { font-size: 21px; font-weight: 800; line-height: 1.45; color: #fff; margin-bottom: 8px; }
.hero-title a { color: #fff; }
.hero-title a:hover { color: #fca5a5; }
.hero-meta { font-size: 11px; color: #9ca3af; }

.hero-side { display: flex; flex-direction: column; gap: 10px; }
.hero-side-item { display: flex; gap: 11px; background: #fff; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; flex: 1; transition: box-shadow .2s; color: var(--text); }
.hero-side-item:hover { box-shadow: var(--shadow-h); }
.hero-side-item img { width: 100px; height: 80px; object-fit: cover; flex-shrink: 0; }
.hero-side-item .blank { width: 100px; height: 80px; background: linear-gradient(135deg, var(--nav), var(--red)); flex-shrink: 0; }
.hero-side-body { padding: 10px 10px 10px 0; display: flex; flex-direction: column; justify-content: center; }
.hero-side-cat { font-size: 10px; font-weight: 800; color: var(--red); margin-bottom: 4px; }
.hero-side-title { font-size: 13px; font-weight: 700; line-height: 1.45; }
.hero-side-time { font-size: 10px; color: var(--muted); margin-top: 4px; }

/* LAYOUT */
.main-layout { display: grid; grid-template-columns: 1fr 300px; gap: 24px; padding: 24px 0 50px; }

/* SECTION HEADER */
.section-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 2px solid var(--border); }
.section-hd h2 { font-size: 17px; font-weight: 900; color: var(--text); padding-right: 12px; border-right: 4px solid var(--red); }
.see-all { font-size: 12px; color: var(--red); font-weight: 700; }
.see-all:hover { text-decoration: underline; }

/* CARDS GRID */
.articles-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 28px; }
.article-card { background: var(--card); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); transition: transform .22s, box-shadow .22s; }
.article-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-h); }
.article-card .card-img { width: 100%; height: 175px; object-fit: cover; }
.card-img-placeholder { width: 100%; height: 175px; background: linear-gradient(135deg, var(--nav), var(--red)); }
.card-body { padding: 14px; }
.card-cat { display: inline-block; background: var(--red); color: #fff; font-size: 10px; font-weight: 800; padding: 2px 9px; border-radius: 3px; margin-bottom: 7px; letter-spacing: .4px; }
.card-cat:hover { background: #b71c1c; color: #fff; }
.card-title { font-size: 14px; font-weight: 700; line-height: 1.55; color: var(--text); margin-bottom: 9px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-title a:hover { color: var(--red); }
.card-time { font-size: 11px; color: var(--muted); }

/* LIST */
.articles-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 28px; }
.list-item { display: flex; gap: 12px; background: var(--card); border-radius: 8px; border: 1px solid var(--border); overflow: hidden; box-shadow: var(--shadow); transition: box-shadow .2s; }
.list-item:hover { box-shadow: var(--shadow-h); }
.list-item img { width: 115px; height: 88px; object-fit: cover; flex-shrink: 0; }
.list-item .blank { width: 115px; height: 88px; background: linear-gradient(135deg, var(--nav), var(--red)); flex-shrink: 0; }
.list-body { padding: 12px 12px 12px 0; display: flex; flex-direction: column; justify-content: center; }
.list-cat { font-size: 10px; font-weight: 800; color: var(--red); margin-bottom: 4px; }
.list-title { font-size: 14px; font-weight: 700; line-height: 1.4; }
.list-title a:hover { color: var(--red); }
.list-time { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* SIDEBAR */
.sidebar { display: flex; flex-direction: column; gap: 18px; }
.widget-box { background: var(--card); border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden; }
.widget-hd { background: var(--dark); color: #fff; font-size: 13.5px; font-weight: 800; padding: 12px 16px; letter-spacing: .3px; }
.widget-body { padding: 14px; }
.sidebar-post { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.sidebar-post:last-child { border-bottom: none; padding-bottom: 0; }
.sidebar-post a img { width: 70px; height: 55px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.sidebar-post-placeholder { width: 70px; height: 55px; background: linear-gradient(135deg, var(--nav), var(--red)); border-radius: 6px; flex-shrink: 0; }
.sidebar-post-cat { font-size: 10px; font-weight: 800; color: var(--red); margin-bottom: 3px; }
.sidebar-post-title { font-size: 12.5px; font-weight: 700; line-height: 1.4; }
.sidebar-post-title a:hover { color: var(--red); }
.sidebar-post-time { font-size: 10px; color: var(--muted); margin-top: 3px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-cloud a { background: var(--bg); border: 1px solid var(--border); padding: 5px 11px; border-radius: 20px; font-size: 12px; font-weight: 600; color: var(--text); transition: all .2s; }
.tag-cloud a:hover { background: var(--red); color: #fff; border-color: var(--red); }

/* SINGLE POST */
.single-wrap { padding: 28px 0 50px; }
.single-main { background: var(--card); border-radius: 12px; padding: 30px; border: 1px solid var(--border); box-shadow: var(--shadow); margin-bottom: 24px; }
.single-cat { display: inline-block; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; padding: 3px 11px; border-radius: 3px; margin-bottom: 12px; letter-spacing: .4px; }
.single-cat:hover { background: #b71c1c; color: #fff; }
.single-title { font-size: 26px; font-weight: 900; line-height: 1.4; margin-bottom: 14px; }
.single-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); padding-bottom: 16px; border-bottom: 1px solid var(--border); margin-bottom: 22px; }
.single-thumb { width: 100%; max-height: 460px; object-fit: cover; border-radius: 10px; margin-bottom: 24px; }
.single-content { font-size: 16px; line-height: 2; color: var(--text); }
.single-content[dir="ltr"] { font-family: 'Roboto', sans-serif; text-align: left; }
.single-content p { margin-bottom: 16px; }
.single-content h2, .single-content h3 { font-weight: 800; margin: 24px 0 10px; }
.single-content img { border-radius: 8px; margin: 16px 0; }
.single-content a { color: var(--red); text-decoration: underline; }
.single-content blockquote { border-right: 4px solid var(--red); padding: 12px 18px; margin: 20px 0; background: #f9f9f9; border-radius: 0 6px 6px 0; font-style: italic; color: var(--muted); }
.single-tags { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.single-tags > span { font-size: 12px; font-weight: 700; color: var(--muted); }
.single-tags a { background: var(--bg); border: 1px solid var(--border); padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; color: var(--text); transition: all .2s; }
.single-tags a:hover { background: var(--red); color: #fff; border-color: var(--red); }
.related-section { margin-top: 30px; }

/* ARCHIVE */
.archive-wrap { padding: 24px 0 50px; }
.archive-header { background: var(--card); border-radius: var(--radius); padding: 18px 22px; margin-bottom: 22px; border: 1px solid var(--border); border-right: 4px solid var(--red); }
.archive-header h1 { font-size: 20px; font-weight: 900; }
.archive-header h1 span { color: var(--red); }

/* PAGINATION */
.pagination { display: flex; gap: 6px; justify-content: center; padding: 30px 0 10px; flex-wrap: wrap; }
.pagination .page-numbers { padding: 8px 15px; border-radius: 7px; border: 1px solid var(--border); background: var(--card); font-size: 13px; font-weight: 700; color: var(--text); transition: all .2s; }
.pagination .page-numbers:hover,
.pagination .page-numbers.current { background: var(--red); color: #fff; border-color: var(--red); }
.pagination .nav-links { display: flex; gap: 6px; }

/* FOOTER */
.site-footer { background: #0d0d0d; color: #9ca3af; padding: 44px 0 0; margin-top: 10px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 40px; padding-bottom: 36px; border-bottom: 1px solid #1f1f1f; }
.footer-brand .logo-text { font-size: 22px; font-weight: 900; color: #fff; letter-spacing: 3px; margin-bottom: 12px; display: block; }
.footer-brand .logo-text span { color: var(--red); }
.footer-brand .custom-logo { max-height: 50px; width: auto; margin-bottom: 12px; filter: brightness(0) invert(1); }
.footer-brand > p { font-size: 13px; line-height: 1.8; margin-bottom: 16px; }
.footer-social { display: flex; gap: 10px; }
.footer-social a { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: #1a1a1a; color: #9ca3af; border: 1px solid #2a2a2a; transition: all .2s; }
.footer-social a:hover { background: var(--red); color: #fff; border-color: var(--red); }
.footer-hd { font-size: 13px; font-weight: 800; color: #fff; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 2px solid var(--red); display: inline-block; }
.footer-links { display: flex; flex-direction: column; gap: 2px; }
.footer-links li a { font-size: 13px; color: #9ca3af; padding: 5px 0; display: block; transition: color .2s; }
.footer-links li a:hover { color: var(--red); padding-right: 6px; }
.footer-bottom { padding: 16px 0; text-align: center; font-size: 12px; color: #4b5563; border-top: 1px solid #111; }

/* FRENCH */
.lang-fr .card-title, .lang-fr .list-title, .lang-fr .hero-title { font-family: 'Roboto', sans-serif; }

/* NO RESULTS — hidden */
.no-results-msg { display: none; }

/* RESPONSIVE TABLET */
@media (max-width: 960px) {
    .hero-grid { grid-template-columns: 1fr; }
    .hero-side { display: none; }
    .main-layout { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .articles-grid { grid-template-columns: repeat(2, 1fr); }
    .header-search input { width: 180px; }
}

/* RESPONSIVE MOBILE */
@media (max-width: 640px) {
    .articles-grid { grid-template-columns: 1fr; }
    .hero-main .thumb { height: 260px; }
    .logo-text { font-size: 20px; letter-spacing: 2px; }
    .header-search { display: none; }
    .footer-grid { grid-template-columns: 1fr; }
    .single-title { font-size: 20px; }
    .single-main { padding: 18px; }
    .nav-toggle { display: flex; }
    .nav-lang { display: none; }
    #primary-menu { display: none; flex-direction: column; position: absolute; top: 100%; right: 0; left: 0; background: var(--nav); border-top: 2px solid var(--red); box-shadow: 0 6px 18px rgba(0,0,0,.4); z-index: 400; }
    #primary-menu.open { display: flex; }
    #primary-menu li ul { position: static; box-shadow: none; border: none; background: rgba(0,0,0,.15); }
    .main-nav .inner { position: relative; }
}
