/*
Theme Name: موقع دروسي
Theme URI: https://example.com
Author: فريق دروسي
Description: قالب عربي نظيف وسريع لعرض الفصول والصفوف والمواد والكتب والملفات التعليمية بصيغة PDF.
Version: 1.0.0
Text Domain: duroosi
*/

:root {
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-soft: #eef3fb;
  --text: #172033;
  --muted: #5a667d;
  --border: #dce4f2;
  --primary: #14539a;
  --primary-dark: #0f3f76;
  --shadow: 0 10px 28px rgba(20, 41, 82, 0.07);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Cairo', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: min(1140px, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--primary-dark);
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #1b6bc2, #103d73);
  color: #fff;
}

.topbar-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.topbar-menu a {
  display: inline-block;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-weight: 600;
  color: var(--muted);
}

.topbar-menu a:hover,
.topbar-menu .current-menu-item > a,
.topbar-menu .current-category-ancestor > a {
  background: var(--surface-soft);
  color: var(--primary);
}

.menu-toggle {
  display: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  padding: 0.45rem 0.75rem;
  font: inherit;
  font-weight: 700;
}

.page-main {
  padding: 1.5rem 0 3.5rem;
}

.breadcrumbs {
  margin-bottom: 1rem;
}

.breadcrumbs ol {
  list-style: none;
  margin: 0;
  padding: 0.55rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.breadcrumbs li + li::before {
  content: "‹";
  margin-left: 0.4rem;
  color: #93a0b8;
}

.breadcrumbs a {
  color: var(--primary);
}

.page-heading {
  margin: 1rem 0 1.4rem;
}

.page-heading h1 {
  margin: 0 0 0.55rem;
  font-size: clamp(1.35rem, 2.3vw, 1.85rem);
  font-weight: 800;
  color: var(--text);
}

.page-heading .divider {
  display: block;
  width: 100%;
  height: 7px;
  background: repeating-linear-gradient(-45deg, #dce4f2, #dce4f2 3px, transparent 3px, transparent 6px);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 1rem;
}

.tile,
.content-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.65rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.tile:hover,
.content-card:hover {
  transform: translateY(-3px);
  border-color: #93c5fd;
}

.book-cover,
.content-art {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.85rem;
  color: #ffffff;
  position: relative;
}

.book-cover::before {
  content: "";
  position: absolute;
  inset-block: 0;
  right: 10px;
  width: 3px;
  background: rgba(255, 255, 255, 0.28);
}

.book-green {
  background: linear-gradient(155deg, #2f855a, #276749);
}

.book-blue {
  background: linear-gradient(155deg, #2b6cb0, #1e4e8c);
}

.book-gold {
  background: linear-gradient(155deg, #d69e2e, #b7791f);
  color: #1a202c;
}

.book-red {
  background: linear-gradient(155deg, #c53030, #9b2c2c);
}

.book-cover strong {
  font-size: 0.95rem;
  line-height: 1.4;
}

.book-cover small {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  opacity: 0.9;
}

.card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tile > strong,
.content-card > strong {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.content-card > small {
  font-size: 0.82rem;
  color: var(--muted);
}

.post-shell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.pdf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 1rem 0;
}

.pdf-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 1.15rem;
  border-radius: 10px;
  font-weight: 700;
  background: var(--primary);
  color: #ffffff;
}

.pdf-frame {
  width: 100%;
  height: 760px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.empty-state {
  margin: 0;
  padding: 1.25rem;
  border-radius: 12px;
  background: var(--surface);
  border: 1px dashed var(--border);
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 1.4rem 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

@media (max-width: 720px) {
  .menu-toggle {
    display: inline-flex;
  }
  .topbar {
    flex-wrap: wrap;
    padding-block: 0.7rem;
  }
  .topbar-menu {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    padding-top: 0.5rem;
  }
  .topbar-menu.is-open {
    display: flex;
  }
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  .pdf-frame {
    height: 480px;
  }
}
