:root {
  --navy: #153047;
  --cream: #fbf7ef;
  --gold: #c8a15a;
  --teal: #2c7776;
  --ink: #1f2933;
  --muted: #67727e;
  --card: #ffffff;
  --line: #e4e7eb;
  --shadow: 0 8px 24px rgba(21, 48, 71, .08);
}

* {
  box-sizing: border-box
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.5
}

.wrap {
  width: min(1080px, calc(100% - 32px));
  margin-inline: auto
}

.site-header {
  background: var(--navy);
  color: #fff;
  border-bottom: 4px solid var(--gold)
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0
}

.site-header h1 {
  margin: .15rem 0 0;
  font-size: clamp(1.65rem, 3vw, 2.4rem)
}

.eyebrow {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: #d7e0e7
}

.home-link {
  text-decoration: none;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 999px;
  padding: .65rem 1rem
}

main {
  padding: 36px 0 64px
}

.hero {
  background: linear-gradient(135deg, #fff, #f5efe2);
  border: 1px solid #ece3d4;
  box-shadow: var(--shadow);
  border-radius: 22px;
  padding: 32px;
  margin-bottom: 34px
}

.hero h2,
.page-title h2 {
  margin: .2rem 0 .5rem;
  font-size: clamp(1.8rem, 4vw, 3rem);
  color: var(--navy)
}

.kicker {
  margin: 0;
  font-size: .8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .13em;
  color: var(--teal)
}

.subject-block {
  margin: 34px 0 46px
}

.subject-heading {
  margin-bottom: 16px
}

.subject-heading h3 {
  margin: 0;
  color: var(--navy);
  font-size: 1.55rem
}

.arabic-title {
  font-size: 1.2rem;
  color: var(--teal);
  margin-top: 3px;
  font-family: "Traditional Arabic", "Noto Naskh Arabic", "Segoe UI", serif
}

.year-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px
}

.year-card,
.term-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: .18s ease
}

.year-card {
  min-height: 140px;
  padding: 20px
}

.year-card:hover,
.term-card:hover {
  transform: translateY(-3px);
  border-color: #d7bd8c;
  box-shadow: 0 12px 28px rgba(21, 48, 71, .12)
}

.year-label {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--navy)
}

.open-text {
  font-size: .92rem;
  color: var(--teal);
  font-weight: 700
}

.term-intro {
  color: var(--muted);
  margin-top: 12px
}

.term-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px
}

.term-card {
  min-height: 180px;
  padding: 24px
}

.term-icon {
  font-size: 2rem
}

.term-label {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--navy);
  margin-top: auto;
  padding-top: 22px
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  font-size: .9rem;
  color: var(--muted);
  margin-bottom: 24px
}

.breadcrumb a {
  color: var(--teal)
}

.page-title {
  margin-bottom: 24px
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin: 22px 0 16px
}

.search-box {
  display: grid;
  gap: 6px;
  flex: 1;
  max-width: 560px;
  font-weight: 700;
  color: var(--navy)
}

.search-box input {
  width: 100%;
  border: 1px solid #ccd3da;
  border-radius: 12px;
  background: #fff;
  padding: 12px 14px;
  font: inherit
}

.count {
  font-size: .9rem;
  color: var(--muted)
}

.file-list {
  display: grid;
  gap: 12px
}

.file-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  box-shadow: 0 4px 14px rgba(21, 48, 71, .05)
}

.file-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0
}

.file-icon {
  font-size: 2rem
}

.file-main h3 {
  margin: 0;
  color: var(--navy);
  font-size: 1.02rem;
  overflow-wrap: anywhere
}

.file-main p {
  margin: .25rem 0 0;
  color: var(--muted);
  font-size: .82rem
}

.file-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0
}

.button {
  display: inline-block;
  text-decoration: none;
  background: var(--teal);
  color: #fff;
  border-radius: 10px;
  padding: .65rem .9rem;
  font-weight: 800;
  font-size: .9rem
}

.button.secondary {
  background: #eef4f4;
  color: var(--teal)
}

.empty-state {
  text-align: center;
  background: #fff;
  border: 1px dashed #cbd2d9;
  border-radius: 18px;
  padding: 44px 24px
}

.empty-icon {
  font-size: 2.8rem
}

.empty-state h3 {
  color: var(--navy);
  margin: .7rem 0 .35rem
}

.empty-state p {
  margin: 0;
  color: var(--muted)
}

.back-row {
  margin-top: 28px
}

.back-row a {
  color: var(--teal);
  font-weight: 800
}

.site-footer {
  border-top: 1px solid #e2ded6;
  padding: 24px 0;
  color: var(--muted);
  font-size: .9rem;
  background: #f7f1e7
}

[hidden] {
  display: none !important
}

@media (max-width:860px) {
  .year-grid {
    grid-template-columns: repeat(3, 1fr)
  }
}

@media (max-width:700px) {
  .term-grid {
    grid-template-columns: 1fr
  }
}

@media (max-width:620px) {
  .year-grid {
    grid-template-columns: repeat(2, 1fr)
  }

  .file-card {
    align-items: flex-start;
    flex-direction: column
  }

  .file-actions {
    width: 100%
  }

  .button {
    flex: 1;
    text-align: center
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column
  }
}

@media (max-width:420px) {
  .year-grid {
    grid-template-columns: 1fr
  }

  .hero {
    padding: 24px
  }
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 24px;
}

.week-card {
  min-height: 150px;
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.week-card:hover {
  transform: translateY(-3px);
  border-color: #d7bd8c;
  box-shadow: 0 12px 28px rgba(21, 48, 71, .12);
}

.week-number {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--navy);
}

.week-count {
  color: var(--muted);
  font-size: .88rem;
  margin-top: auto;
  padding: 16px 0 8px;
}

@media (max-width:900px) {
  .week-grid {
    grid-template-columns: repeat(3, 1fr)
  }
}

@media (max-width:650px) {
  .week-grid {
    grid-template-columns: repeat(2, 1fr)
  }
}

@media (max-width:420px) {
  .week-grid {
    grid-template-columns: 1fr
  }
}