/*
Theme Name: E3ref Press
Theme URI: https://e3refblog.com
Author: OpenAI
Author URI: https://openai.com
Description: قالب مجلة عربية سريع ومتجاوب لمدونة اعرف، بواجهة مقالات وأقسام وشريط عاجل وأماكن إعلانات جاهزة.
Version: 1.0.0
Requires at least: 6.2
Tested up to: 6.6
Requires PHP: 7.4
Text Domain: e3ref-press
Domain Path: /languages
Tags: blog, news, rtl-language-support, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

:root {
  --e3ref-primary: #3454d1;
  --e3ref-primary-dark: #223a9f;
  --e3ref-accent: #f4b400;
  --e3ref-ink: #172033;
  --e3ref-muted: #667085;
  --e3ref-bg: #f6f7fb;
  --e3ref-card: #ffffff;
  --e3ref-border: #e6e8ef;
  --e3ref-radius: 16px;
  --e3ref-shadow: 0 10px 30px rgba(23, 32, 51, .07);
  --e3ref-container: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  direction: rtl;
  background: var(--e3ref-bg);
  color: var(--e3ref-ink);
  font-family: "Tajawal", "Noto Kufi Arabic", Tahoma, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--e3ref-primary); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.screen-reader-text {
  border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%);
  height: 1px; margin: -1px; overflow: hidden; padding: 0;
  position: absolute !important; width: 1px; word-wrap: normal !important;
}
.screen-reader-text:focus {
  background: #fff; clip: auto !important; clip-path: none; color: #111;
  display: block; font-size: 14px; height: auto; right: 8px; padding: 12px 16px;
  top: 8px; width: auto; z-index: 100000;
}
.e3ref-container { width: min(calc(100% - 32px), var(--e3ref-container)); margin-inline: auto; }

/* Top bar */
.e3ref-topbar { background: #11182a; color: #dbe1f0; font-size: 13px; }
.e3ref-topbar-inner { min-height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.e3ref-topbar-meta, .e3ref-social { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.e3ref-social a { color: #fff; opacity: .88; }
.e3ref-social a:hover { opacity: 1; color: var(--e3ref-accent); }

/* Header */
.e3ref-header-main { background: var(--e3ref-card); }
.e3ref-header-inner { min-height: 116px; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.e3ref-brand { display: flex; align-items: center; gap: 14px; min-width: 220px; }
.custom-logo { max-height: 72px; width: auto; display: block; }
.e3ref-site-title { margin: 0; font-size: clamp(28px, 4vw, 42px); line-height: 1.1; font-weight: 900; color: var(--e3ref-primary); }
.e3ref-site-title span { color: var(--e3ref-accent); }
.e3ref-site-description { margin: 6px 0 0; color: var(--e3ref-muted); font-size: 14px; }
.e3ref-header-ad { flex: 1; text-align: left; }
.e3ref-ad-placeholder { min-height: 76px; border: 1px dashed #ccd2df; border-radius: 12px; display: grid; place-items: center; color: #98a2b3; background: #fafbfe; font-size: 13px; }

/* Navigation */
.e3ref-nav-wrap { position: sticky; top: 0; z-index: 990; background: var(--e3ref-primary); box-shadow: 0 8px 20px rgba(52,84,209,.18); }
.e3ref-nav-inner { min-height: 58px; display: flex; align-items: center; gap: 20px; }
.e3ref-menu-toggle { display: none; border: 0; background: transparent; color: #fff; font-size: 24px; padding: 8px; }
.e3ref-primary-nav { flex: 1; }
.e3ref-primary-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 4px; }
.e3ref-primary-nav li { position: relative; }
.e3ref-primary-nav a { display: block; color: #fff; font-weight: 700; padding: 17px 14px; line-height: 1.45; }
.e3ref-primary-nav a:hover, .e3ref-primary-nav .current-menu-item > a, .e3ref-primary-nav .current-menu-ancestor > a { background: rgba(255,255,255,.12); color: #fff; }
.e3ref-primary-nav .sub-menu { position: absolute; top: 100%; right: 0; min-width: 220px; display: none; flex-direction: column; align-items: stretch; background: #fff; border-radius: 0 0 12px 12px; box-shadow: var(--e3ref-shadow); overflow: hidden; }
.e3ref-primary-nav .sub-menu a { color: var(--e3ref-ink); padding: 11px 15px; }
.e3ref-primary-nav .sub-menu a:hover { background: #f3f5fb; color: var(--e3ref-primary); }
.e3ref-primary-nav li:hover > .sub-menu, .e3ref-primary-nav li:focus-within > .sub-menu { display: flex; }
.e3ref-search-toggle { border: 0; background: rgba(255,255,255,.13); color: #fff; width: 42px; height: 42px; border-radius: 50%; font-size: 18px; }
.e3ref-search-panel { display: none; background: #fff; border-top: 1px solid var(--e3ref-border); }
.e3ref-search-panel.is-open { display: block; }
.e3ref-search-panel form { display: flex; gap: 10px; padding-block: 14px; }
.e3ref-search-panel input[type="search"] { flex: 1; border: 1px solid var(--e3ref-border); border-radius: 10px; padding: 12px 14px; outline: 0; }
.e3ref-search-panel button { border: 0; background: var(--e3ref-primary); color: #fff; border-radius: 10px; padding: 10px 22px; font-weight: 800; }

/* Breaking ticker */
.e3ref-breaking { background: #fff; border-bottom: 1px solid var(--e3ref-border); }
.e3ref-breaking-inner { min-height: 50px; display: flex; align-items: center; gap: 14px; overflow: hidden; }
.e3ref-breaking-label { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; background: #e6293f; color: #fff; border-radius: 8px; padding: 7px 13px; font-weight: 800; font-size: 14px; }
.e3ref-breaking-label::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 5px rgba(255,255,255,.18); }
.e3ref-ticker { position: relative; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; }
.e3ref-ticker-track { display: inline-flex; gap: 34px; align-items: center; animation: e3refTicker 36s linear infinite; }
.e3ref-ticker:hover .e3ref-ticker-track { animation-play-state: paused; }
.e3ref-ticker-item::after { content: "•"; color: var(--e3ref-accent); margin-inline-start: 34px; }
@keyframes e3refTicker { from { transform: translateX(-5%); } to { transform: translateX(55%); } }

/* General content */
.e3ref-main { padding-block: 32px 56px; }
.e3ref-content-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 28px; align-items: start; }
.e3ref-card { background: var(--e3ref-card); border: 1px solid var(--e3ref-border); border-radius: var(--e3ref-radius); box-shadow: var(--e3ref-shadow); }
.e3ref-section-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.e3ref-section-title { position: relative; margin: 0; padding-right: 17px; font-size: clamp(22px, 3vw, 30px); line-height: 1.35; }
.e3ref-section-title::before { content: ""; position: absolute; right: 0; top: 5px; bottom: 5px; width: 6px; border-radius: 8px; background: linear-gradient(var(--e3ref-primary), var(--e3ref-accent)); }
.e3ref-section-more { color: var(--e3ref-primary); font-weight: 800; font-size: 14px; }

/* Hero */
.e3ref-hero { display: grid; grid-template-columns: 1.45fr 1fr; gap: 18px; margin-bottom: 34px; }
.e3ref-hero-primary, .e3ref-hero-small { position: relative; overflow: hidden; border-radius: 18px; background: #18213a; color: #fff; }
.e3ref-hero-primary { min-height: 455px; }
.e3ref-hero-side { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.e3ref-hero-small { min-height: 218px; }
.e3ref-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.e3ref-hero a:hover img { transform: scale(1.035); }
.e3ref-hero-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(8,13,28,.92), rgba(8,13,28,.06) 65%); }
.e3ref-hero-content { position: absolute; right: 0; left: 0; bottom: 0; padding: 26px; z-index: 2; }
.e3ref-hero-small .e3ref-hero-content { padding: 17px; }
.e3ref-badge { display: inline-flex; background: var(--e3ref-accent); color: #161616; border-radius: 999px; padding: 4px 10px; font-size: 12px; line-height: 1.6; font-weight: 900; margin-bottom: 10px; }
.e3ref-hero-title { margin: 0; font-size: clamp(25px, 3vw, 39px); line-height: 1.45; }
.e3ref-hero-small .e3ref-hero-title { font-size: 18px; line-height: 1.55; }
.e3ref-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; color: var(--e3ref-muted); font-size: 13px; }
.e3ref-hero .e3ref-meta { color: #e5e9f3; margin-top: 9px; }

/* Post cards */
.e3ref-post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.e3ref-post-card { overflow: hidden; transition: transform .2s ease, box-shadow .2s ease; }
.e3ref-post-card:hover { transform: translateY(-4px); box-shadow: 0 14px 35px rgba(23,32,51,.11); }
.e3ref-card-thumb { position: relative; display: block; aspect-ratio: 16/10; overflow: hidden; background: #e9edf7; }
.e3ref-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.e3ref-post-card:hover .e3ref-card-thumb img { transform: scale(1.035); }
.e3ref-card-body { padding: 17px 18px 19px; }
.e3ref-card-title { margin: 7px 0 9px; font-size: 18px; line-height: 1.65; }
.e3ref-excerpt { color: var(--e3ref-muted); font-size: 14px; line-height: 1.8; margin: 9px 0 0; }
.e3ref-placeholder-image { width: 100%; height: 100%; display: grid; place-items: center; background: linear-gradient(135deg, #dfe5fb, #f8e8aa); color: var(--e3ref-primary); font-weight: 900; font-size: 26px; }

/* Category blocks */
.e3ref-category-block { margin-top: 38px; }
.e3ref-horizontal-posts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.e3ref-horizontal-card { display: grid; grid-template-columns: 150px minmax(0, 1fr); overflow: hidden; min-height: 135px; }
.e3ref-horizontal-card .e3ref-card-thumb { aspect-ratio: auto; height: 100%; }
.e3ref-horizontal-card .e3ref-card-body { padding: 15px; }
.e3ref-horizontal-card .e3ref-card-title { font-size: 16px; margin-top: 4px; }

/* Sidebar */
.e3ref-sidebar { display: grid; gap: 22px; }
.widget { background: #fff; border: 1px solid var(--e3ref-border); border-radius: var(--e3ref-radius); padding: 20px; box-shadow: var(--e3ref-shadow); }
.widget-title { position: relative; margin: 0 0 17px; padding: 0 13px 11px 0; font-size: 20px; border-bottom: 1px solid var(--e3ref-border); }
.widget-title::before { content: ""; position: absolute; right: 0; top: 3px; height: 26px; width: 5px; border-radius: 7px; background: var(--e3ref-primary); }
.widget ul { list-style: none; padding: 0; margin: 0; }
.widget li { padding: 9px 0; border-bottom: 1px solid #eef0f4; }
.widget li:last-child { border-bottom: 0; }
.widget select, .widget input { max-width: 100%; }
.e3ref-popular-list { display: grid; gap: 13px; }
.e3ref-popular-item { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 11px; align-items: center; }
.e3ref-popular-item img, .e3ref-popular-thumb { width: 88px; height: 68px; border-radius: 9px; object-fit: cover; background: #edf0f8; }
.e3ref-popular-item h4 { margin: 0; font-size: 14px; line-height: 1.55; }

/* Archive */
.e3ref-page-header { margin-bottom: 25px; padding: 24px 26px; }
.e3ref-page-title { margin: 0; font-size: clamp(27px, 4vw, 42px); line-height: 1.35; }
.e3ref-archive-description { color: var(--e3ref-muted); margin-top: 10px; }
.e3ref-category-chips { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
.e3ref-category-chips a { border: 1px solid var(--e3ref-border); background: #fff; border-radius: 999px; padding: 6px 13px; font-weight: 700; font-size: 13px; }
.e3ref-category-chips a:hover { border-color: var(--e3ref-primary); background: var(--e3ref-primary); color: #fff; }
.navigation.pagination { margin-top: 28px; }
.nav-links { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.page-numbers { min-width: 42px; height: 42px; display: grid; place-items: center; padding: 0 12px; border-radius: 10px; background: #fff; border: 1px solid var(--e3ref-border); }
.page-numbers.current, .page-numbers:hover { background: var(--e3ref-primary); color: #fff; border-color: var(--e3ref-primary); }

/* Article */
.e3ref-article { padding: clamp(20px, 4vw, 42px); }
.e3ref-breadcrumbs { color: var(--e3ref-muted); font-size: 13px; margin-bottom: 18px; }
.e3ref-breadcrumbs a { color: var(--e3ref-primary); }
.e3ref-entry-title { margin: 0 0 14px; font-size: clamp(30px, 4vw, 48px); line-height: 1.45; letter-spacing: -.02em; }
.e3ref-entry-meta { padding-bottom: 19px; border-bottom: 1px solid var(--e3ref-border); }
.e3ref-entry-image { margin: 26px 0; overflow: hidden; border-radius: 16px; }
.e3ref-entry-image img { width: 100%; display: block; }
.e3ref-entry-content { font-size: 18px; line-height: 2.05; color: #242d3d; }
.e3ref-entry-content > *:first-child { margin-top: 0; }
.e3ref-entry-content h2 { font-size: 29px; line-height: 1.5; margin: 38px 0 15px; }
.e3ref-entry-content h3 { font-size: 24px; line-height: 1.55; margin: 31px 0 13px; }
.e3ref-entry-content a { color: var(--e3ref-primary); text-decoration: underline; text-underline-offset: 4px; }
.e3ref-entry-content blockquote { border-right: 5px solid var(--e3ref-primary); margin: 28px 0; padding: 16px 20px; background: #f3f5fc; border-radius: 12px 0 0 12px; }
.e3ref-entry-content table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.e3ref-entry-content th, .e3ref-entry-content td { border: 1px solid var(--e3ref-border); padding: 11px; }
.e3ref-entry-content pre { overflow-x: auto; direction: ltr; text-align: left; background: #111827; color: #e5e7eb; padding: 18px; border-radius: 12px; }
.e3ref-entry-content iframe { max-width: 100%; }
.e3ref-inline-ad { margin: 28px 0; }
.e3ref-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 25px; }
.e3ref-tags a { border-radius: 999px; background: #eef1fb; color: var(--e3ref-primary); padding: 5px 11px; font-size: 13px; font-weight: 700; }
.e3ref-share { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--e3ref-border); }
.e3ref-share-title { margin: 0 0 13px; font-size: 18px; }
.e3ref-share-links { display: flex; flex-wrap: wrap; gap: 9px; }
.e3ref-share-links a { display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; padding: 8px 13px; color: #fff; font-size: 13px; font-weight: 800; }
.e3ref-share-facebook { background: #1877f2; }
.e3ref-share-x { background: #111; }
.e3ref-share-whatsapp { background: #16a34a; }
.e3ref-share-telegram { background: #229ed9; }
.e3ref-author-box { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 16px; align-items: center; margin-top: 28px; padding: 18px; background: #f7f8fc; border-radius: 14px; }
.e3ref-author-box img { border-radius: 50%; }
.e3ref-author-box h3 { margin: 0 0 4px; font-size: 18px; }
.e3ref-author-box p { margin: 0; color: var(--e3ref-muted); font-size: 14px; }
.e3ref-related { margin-top: 32px; }

/* Comments */
.comments-area { margin-top: 28px; padding: 26px; }
.comments-title { margin-top: 0; }
.comment-list { list-style: none; padding: 0; }
.comment-body { border-bottom: 1px solid var(--e3ref-border); padding: 18px 0; }
.comment-meta { font-size: 13px; color: var(--e3ref-muted); }
.comment-content { margin-top: 10px; }
.comment-respond input, .comment-respond textarea { width: 100%; border: 1px solid var(--e3ref-border); border-radius: 10px; padding: 11px 13px; }
.comment-respond textarea { min-height: 150px; }
.form-submit .submit { border: 0; background: var(--e3ref-primary); color: #fff; border-radius: 10px; padding: 10px 18px; font-weight: 800; }

/* Footer */
.e3ref-footer { background: #11182a; color: #dce2f0; }
.e3ref-footer-widgets { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 30px; padding-block: 46px 35px; }
.e3ref-footer .widget { background: transparent; border: 0; box-shadow: none; padding: 0; }
.e3ref-footer .widget-title { color: #fff; border-color: rgba(255,255,255,.12); }
.e3ref-footer .widget li { border-color: rgba(255,255,255,.1); }
.e3ref-footer a:hover { color: var(--e3ref-accent); }
.e3ref-footer-brand { margin-bottom: 12px; color: #fff; font-size: 28px; font-weight: 900; }
.e3ref-footer-bottom { border-top: 1px solid rgba(255,255,255,.1); }
.e3ref-footer-bottom-inner { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 13px; }
.e3ref-footer-menu ul { list-style: none; display: flex; flex-wrap: wrap; gap: 14px; padding: 0; margin: 0; }

/* Empty / 404 */
.e3ref-empty { padding: 48px 30px; text-align: center; }
.e3ref-empty h1, .e3ref-empty h2 { margin-top: 0; }
.e3ref-button { display: inline-flex; align-items: center; justify-content: center; background: var(--e3ref-primary); color: #fff; border-radius: 10px; padding: 10px 18px; font-weight: 800; }
.e3ref-button:hover { color: #fff; background: var(--e3ref-primary-dark); }

/* Alignment helpers */
.alignwide { margin-right: max(-80px, calc((100% - 100vw) / 2)); margin-left: max(-80px, calc((100% - 100vw) / 2)); max-width: none; }
.alignfull { width: 100vw; max-width: 100vw; margin-right: calc(50% - 50vw); margin-left: calc(50% - 50vw); }

@media (max-width: 1040px) {
  .e3ref-content-layout { grid-template-columns: minmax(0, 1fr) 290px; gap: 22px; }
  .e3ref-post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .e3ref-hero { grid-template-columns: 1.25fr 1fr; }
}

@media (max-width: 860px) {
  .e3ref-header-inner { min-height: 92px; }
  .e3ref-header-ad { display: none; }
  .e3ref-menu-toggle { display: inline-flex; }
  .e3ref-nav-inner { min-height: 54px; }
  .e3ref-primary-nav { display: none; position: absolute; top: 54px; right: 0; left: 0; background: #fff; box-shadow: var(--e3ref-shadow); }
  .e3ref-primary-nav.is-open { display: block; }
  .e3ref-primary-nav ul { flex-direction: column; align-items: stretch; gap: 0; padding: 8px 16px 15px; }
  .e3ref-primary-nav a { color: var(--e3ref-ink); padding: 12px 10px; border-bottom: 1px solid #edf0f5; }
  .e3ref-primary-nav a:hover { background: #f4f6fb; color: var(--e3ref-primary); }
  .e3ref-primary-nav .sub-menu { position: static; display: block; box-shadow: none; padding-right: 16px; }
  .e3ref-primary-nav .sub-menu a { font-size: 14px; }
  .e3ref-content-layout { grid-template-columns: 1fr; }
  .e3ref-sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .e3ref-hero { grid-template-columns: 1fr; }
  .e3ref-hero-primary { min-height: 390px; }
  .e3ref-footer-widgets { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  body { font-size: 15px; }
  .e3ref-container { width: min(calc(100% - 20px), var(--e3ref-container)); }
  .e3ref-topbar-inner { min-height: 36px; }
  .e3ref-topbar-meta .e3ref-date { display: none; }
  .e3ref-header-inner { min-height: 82px; }
  .custom-logo { max-height: 58px; }
  .e3ref-site-title { font-size: 30px; }
  .e3ref-site-description { display: none; }
  .e3ref-breaking-inner { min-height: 46px; gap: 9px; }
  .e3ref-breaking-label { padding: 6px 10px; font-size: 12px; }
  .e3ref-main { padding-block: 20px 40px; }
  .e3ref-hero-primary { min-height: 330px; }
  .e3ref-hero-side { grid-template-columns: 1fr; }
  .e3ref-hero-small { min-height: 230px; }
  .e3ref-hero-content { padding: 18px; }
  .e3ref-hero-title { font-size: 25px; }
  .e3ref-hero-small .e3ref-hero-title { font-size: 19px; }
  .e3ref-post-grid, .e3ref-horizontal-posts, .e3ref-sidebar, .e3ref-footer-widgets { grid-template-columns: 1fr; }
  .e3ref-horizontal-card { grid-template-columns: 120px minmax(0, 1fr); }
  .e3ref-page-header { padding: 19px; }
  .e3ref-article { padding: 18px; }
  .e3ref-entry-title { font-size: 30px; }
  .e3ref-entry-content { font-size: 17px; line-height: 2; }
  .e3ref-entry-content h2 { font-size: 25px; }
  .e3ref-footer-bottom-inner { padding-block: 16px; flex-direction: column; text-align: center; }
  .alignwide { margin-inline: 0; }
}
