/* =========================================================
   التجاوب — الأساس سطح المكتب (1440 / 1920) ثم تابلت وجوال
   ========================================================= */

/* شاشات كبيرة 1920 */
@media (min-width: 1700px) {
  :root { --container: 1520px; }
  body { font-size: 18px; }
  .slider { min-height: 580px; }
  .slide-caption h2 { font-size: 36px; }
  .feature-main { min-height: 500px; }
  .grid-4 { gap: 28px; }
}

/* لابتوب */
@media (max-width: 1200px) {
  .main-nav a { padding: 8px 10px; font-size: 15px; }
  .grid-4 { grid-template-columns: repeat(3, 1fr); }
  .photo-grid { grid-template-columns: repeat(3, 1fr); }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters .btn { grid-column: 1 / -1; justify-content: center; }
  .details-layout { grid-template-columns: 1fr 300px; }
}

/* تابلت */
@media (max-width: 992px) {
  .container { width: min(var(--container), 100% - 36px); }
  .menu-toggle { display: inline-grid; }
  .header-inner { min-height: 72px; flex-wrap: wrap; }
  .brand img { height: 54px; }
  .brand-text strong { font-size: 19px; }
  .brand-text small { font-size: 11px; }
  .main-nav { order: 3; flex-basis: 100%; display: none; padding-bottom: 14px; }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; gap: 4px; }
  .main-nav a { padding: 12px 14px; background: var(--bg); }
  .header-tools { margin-inline-start: auto; }
  .hero-grid { grid-template-columns: 1fr; }
  .slider { min-height: 400px; }
  .slide-caption h2 { font-size: 24px; }
  .hero-side { display: none; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .news-feature { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .details-layout { grid-template-columns: 1fr; }
  .sticky { position: static; }
  .home-strip { grid-template-columns: repeat(3, 1fr); }
  .book-card { grid-template-columns: 180px 1fr; }
  .contact-layout { grid-template-columns: 1fr; }
  .about-layout { grid-template-columns: 1fr; }
}

/* جوال */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .brand { gap: 10px; }
  .brand img { height: 46px; }
  .brand-text strong { font-size: 16px; }
  .brand-text small { display: block; font-size: 11px; line-height: 1.3; margin: 0 0 2px; }
  .topbar .date { font-size: 11px; text-align: center; flex: 1 1 100%; order: 2; }
  .topbar-social { margin-inline-start: auto; }
  .topbar .container { flex-wrap: wrap; }
  .section { padding-top: 38px; }
  .section-head h2 { font-size: 22px; }
  .page-hero { padding: 32px 0 28px; }
  .page-hero h1 { font-size: 26px; }
  .slider { min-height: 340px; }
  .slide-caption { padding: 20px 18px 62px; }
  .slide-caption h2 { font-size: 19px; }
  .slider-dots { right: 18px; bottom: 26px; }
  .slider-nav { left: 14px; }
  .slider-nav button { width: 32px; height: 32px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .h-card .thumb { width: 108px; }
  .filters { grid-template-columns: 1fr; padding: 16px; }
  .article { padding: 22px 18px 26px; }
  .article h1 { font-size: 23px; }
  .article-body p { font-size: 17px; line-height: 2; text-align: right; }
  .article-gallery { grid-template-columns: repeat(2, 1fr); }
  .post-nav { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; } .photo-grid button:first-child { grid-column: span 2; grid-row: auto; aspect-ratio: 16/10; }
  .home-strip { grid-template-columns: repeat(2, 1fr); }
  .book-card { grid-template-columns: 1fr; padding: 20px; text-align: center; }
  .book-cover { max-width: 200px; margin-inline: auto; }
  .book-facts { grid-template-columns: 1fr; text-align: right; }
  .actions { justify-content: center; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .form-grid { grid-template-columns: 1fr; }
  .prose-card { padding: 22px 18px; }
  .lightbox button { width: 42px; height: 42px; font-size: 20px; }
  .lb-prev { right: 8px; }
  .lb-next { left: 8px; }
  .ticker-label { padding: 4px 10px; font-size: 13px; }
}

@media print {
  .topbar, .site-header, .ticker, .site-footer, .article-tools, .post-nav, .sidebar, .to-top { display: none !important; }
  body { background: #fff; }
  .article { box-shadow: none; padding: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ترتيب هيدر الجوال: الشعار والاسم والأزرار في صف واحد بلا فراغ */
@media (max-width: 992px) {
  .header-inner { flex-wrap: wrap; gap: 8px 10px; padding-block: 8px; min-height: 0; }
  .brand { flex: 1 1 0; min-width: 0; }
  .brand-text { min-width: 0; }
  .brand-text strong { font-size: 18px; line-height: 1.4; font-weight: 800; letter-spacing: 0; }
  .header-tools { flex: 0 0 auto; display: flex; gap: 6px; }
  .header-tools .icon-btn { width: 40px; height: 40px; }
  .main-nav { padding-bottom: 8px; }
}
@media (max-width: 400px) {
  .brand img { height: 42px; }
  .brand-text strong { font-size: 16px; }
  .header-tools .icon-btn { width: 36px; height: 36px; }
  .header-tools { gap: 4px; }
}
