/*
 * "من الألف إلى المتنبي" — styles ported from the original design.
 * The page is always RTL (dir="rtl" on <html>), so "right" is the start side.
 * Arabic typography rules: never add letter-spacing or synthetic italics to
 * Arabic text (they break the joined letterforms), keep generous line-height
 * for diacritics, and avoid justified body text.
 */

@font-face {
  font-family: Amiri;
  src: url('/fonts/amiri.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: NotoArabic;
  src: url('/fonts/noto-arabic.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: NotoArabic;
  src: url('/fonts/noto-arabic-bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

:root {
  --purple: #8f489b;
  --cyan: #1dbbd0;
  --ink: #422849;
  --paper: #fffaf6;
  --line: #e5d8e4;
  --muted: #66516c;
  --deep: #663571;
  --teal: #22626a;
  --card: #ead8ed;
  --card-hover: #e2cce6;
  --card-line: #b99abd;
  --surface: #fffcf9;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: NotoArabic, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a {
  color: inherit;
  text-decoration: none;
}
a:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 6px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  font-family: Amiri, serif;
  font-weight: 400;
  line-height: 1.4;
}
em,
i {
  font-style: normal;
  color: var(--deep);
}
[lang='en'] {
  font-family: Arial, sans-serif;
}

.skip {
  position: absolute;
  top: -100px;
  inset-inline-start: 0;
  background: white;
  padding: 12px;
  z-index: 10;
}
.skip:focus {
  top: 0;
}

/* Masthead + navigation */
.masthead {
  max-width: 1320px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 30px 40px 26px;
}
.brand {
  border-right: 3px solid var(--cyan);
  padding-right: 18px;
  display: flex;
  flex-direction: column;
}
.brand-ar {
  font-size: 14px;
  color: var(--purple);
}
.brand-en {
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 0.05em;
}
.preview {
  font-size: 14px;
  color: var(--muted);
}
nav {
  display: flex;
  gap: 42px;
  align-items: center;
  justify-content: center;
  border-top: 1px solid var(--line);
  border-bottom: 2px solid var(--purple);
  padding: 16px 24px;
  background: var(--surface);
}
nav a {
  font-size: 15px;
  padding: 3px 0;
  border-bottom: 2px solid transparent;
}
nav a:hover {
  color: var(--purple);
}
nav a.is-active {
  color: var(--purple);
  border-bottom-color: var(--cyan);
}

main {
  max-width: 1240px;
  margin: auto;
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1.5fr 0.95fr;
  background: #fff;
  margin-top: 38px;
  min-height: 550px;
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.intro {
  padding: 48px 60px 46px;
}
.eyebrow {
  font-size: 14px;
  color: var(--purple);
  font-weight: 700;
}
h1 {
  font-size: clamp(3.5rem, 6vw, 5.5rem);
  line-height: 1.34;
  margin-top: 16px;
  color: var(--deep);
}
.sub-title {
  color: var(--deep);
  font-size: 25px;
  font-family: Amiri, serif;
  margin-top: 8px;
}
.intro-copy {
  margin: 19px 0 26px;
  color: var(--muted);
}
.button {
  display: inline-block;
  background: var(--deep);
  color: white;
  padding: 12px 28px;
  font-size: 15px;
  border-bottom: 3px solid var(--cyan);
  border-radius: 2px;
}
.button:hover {
  background: var(--purple);
}
.letter-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, #9450a0 0%, #8f489b 42%, #713b7e 100%);
  color: #fff;
  border: 2px solid #7d4089;
  border-radius: 8px;
  box-shadow:
    6px 6px 0 #8ad6df,
    0 16px 30px #66357126,
    inset 0 1px 0 #ffffff35;
  margin: 26px 26px 30px;
  padding: 35px 26px;
}
.calligraphy {
  display: block;
  width: 100%;
  max-width: 430px;
  height: auto;
  object-fit: contain;
  margin: 10px 0 24px;
  filter: brightness(0) invert(1);
}
.letter-caption {
  font-family: Amiri, serif;
  font-size: 28px;
  text-align: center;
  line-height: 1.7;
  border-top: 1px solid #ffffff60;
  padding-top: 25px;
  width: 95%;
  color: #fff;
  position: relative;
}
.letter-caption::before {
  content: '';
  position: absolute;
  top: -2px;
  right: calc(50% - 24px);
  width: 48px;
  height: 3px;
  background: #78e0eb;
}

/* Section cards */
.sections {
  padding: 52px 0;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.section-heading h2 {
  font-size: 36px;
  color: var(--deep);
}
.section-heading > span {
  font-size: 14px;
  color: var(--muted);
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.card {
  padding: 28px 32px;
  min-height: 330px;
  display: flex;
  flex-direction: column;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--card-line);
  border-top: 6px solid var(--cyan);
  border-radius: 2px;
  transition: background 0.2s;
}
.card:hover {
  background: var(--card-hover);
}
.card-index {
  font-size: 14px;
  color: var(--deep);
}
.card h3 {
  font-size: 42px;
  line-height: 1.4;
  margin: 19px 0 13px;
  min-height: 118px;
  color: var(--deep);
}
.card p {
  font-size: 16px;
  line-height: 1.9;
  max-width: 280px;
  margin-bottom: 25px;
  color: var(--muted);
}
.card-link {
  border-top: 1px solid var(--card-line);
  margin-top: auto;
  padding-top: 15px;
  font-size: 14px;
  color: var(--deep);
}

/* Latest posts */
.latest {
  padding: 0 0 52px;
}

/* Section blocks (home sections, category pages, articles) */
.content-section {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 44px;
  border-top: 1px solid var(--line);
  padding: 44px 0;
  scroll-margin-top: 24px;
}
.page-section {
  border-top: 0;
  padding-top: 52px;
}
.section-label {
  font-family: Arial, sans-serif;
  font-size: 40px;
  color: var(--purple);
  line-height: 1.4;
}
.section-label span,
.section-label-link {
  display: block;
  font-family: NotoArabic, sans-serif;
  font-size: 14px;
  margin-top: 12px;
  color: var(--muted);
}
.section-label-link:hover {
  color: var(--purple);
}
.content-section h2 {
  font-size: 40px;
  margin-bottom: 12px;
  color: var(--deep);
}
.page-title {
  font-size: clamp(2.4rem, 4.5vw, 3.4rem);
  line-height: 1.45;
  margin: 0 0 12px;
}
.section-intro {
  max-width: 820px;
  color: var(--muted);
}
.post-count {
  margin-top: 24px;
  font-size: 14px;
  color: var(--deep);
  font-weight: 700;
}
.empty {
  margin-top: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-right: 3px solid var(--cyan);
  border-radius: 2px;
  padding: 20px 24px;
}
.empty-label {
  color: var(--deep);
  font-size: 14px;
  font-weight: 700;
}
.empty p {
  font-size: 16px;
  margin-top: 4px;
}

/* Post list */
.post-list {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.post-count + .post-list {
  margin-top: 12px;
}
.post-item {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-right: 3px solid var(--cyan);
  border-radius: 2px;
  padding: 22px 26px;
  transition:
    background 0.2s,
    border-color 0.2s;
}
.post-item:hover {
  background: #f8eff8;
  border-right-color: var(--purple);
}
.post-item h3 {
  font-size: 30px;
  color: var(--deep);
  margin: 6px 0 6px;
}
.post-item p {
  color: var(--muted);
  font-size: 16px;
  max-width: 780px;
}
.post-more {
  display: inline-block;
  margin-top: 10px;
  font-size: 14px;
  color: var(--purple);
  font-weight: 700;
}
.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  font-size: 13px;
  color: var(--muted);
}
.post-meta > * + *::before {
  content: '·';
  margin-inline: 10px;
  color: var(--card-line);
}
.post-meta-section {
  color: var(--purple);
  font-weight: 700;
}
.section-more {
  display: inline-block;
  margin-top: 18px;
  font-size: 15px;
  color: var(--deep);
  border-bottom: 2px solid var(--cyan);
}
.section-more:hover {
  color: var(--purple);
}

/* Article */
.article {
  max-width: 780px;
}
.article-header {
  border-bottom: 1px solid var(--line);
  padding-bottom: 22px;
  margin-bottom: 8px;
}
.article-summary {
  font-size: 19px;
  color: var(--muted);
  margin-bottom: 14px;
}
.episode {
  margin: 24px 0 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-right: 3px solid var(--cyan);
  padding: 18px 22px;
}
.episode audio {
  display: block;
  width: 100%;
  margin-top: 10px;
}
.post-body {
  font-size: 19px;
  line-height: 2.1;
  overflow-wrap: break-word;
}
.post-body > * {
  margin: 0 0 1.1em;
}
.post-body > :first-child {
  margin-top: 28px;
}
.post-body h2,
.post-body h3 {
  color: var(--deep);
  margin-top: 1.6em;
  margin-bottom: 0.4em;
}
.post-body h2 {
  font-size: 32px;
}
.post-body h3 {
  font-size: 26px;
}
.post-body a {
  color: var(--purple);
  border-bottom: 1px solid var(--cyan);
}
.post-body strong {
  color: var(--deep);
}
.post-body ul,
.post-body ol {
  padding-right: 1.4em;
  padding-left: 0;
}
.post-body blockquote {
  margin-right: 0;
  margin-left: 0;
  padding: 6px 22px;
  border-right: 3px solid var(--purple);
  background: #f6edf6;
  font-family: Amiri, serif;
  font-size: 23px;
  color: var(--deep);
}
.post-body blockquote p {
  margin: 0.4em 0;
}
.post-body hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2em 0;
}
/* Free verse: one line per line, larger Amiri. */
.post-body .verse {
  font-family: Amiri, serif;
  font-size: 24px;
  line-height: 2;
  color: var(--deep);
  white-space: pre-line;
  border-right: 3px solid var(--cyan);
  padding-right: 22px;
}
/* Classical verse (بيت): two hemistichs side by side, each stretched to its
 * column the way Arabic poetry is traditionally set. */
.post-body .bayt {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 48px;
  font-family: Amiri, serif;
  font-size: 24px;
  color: var(--deep);
  background: #f6edf6;
  border-top: 3px solid var(--purple);
  padding: 18px 28px;
}
.post-body .bayt span {
  text-align: justify;
  text-align-last: justify;
}
.post-body .bayt + .bayt {
  margin-top: -1.1em;
  border-top: 0;
  padding-top: 0;
}

/* About */
.about {
  background: #f6edf6;
  color: var(--ink);
  border-radius: 2px;
  border-top: 3px solid var(--purple);
  border-right: 3px solid var(--cyan);
  padding: 42px 54px;
  margin: 30px 0 55px;
  scroll-margin-top: 24px;
}
.about .eyebrow {
  color: var(--deep);
}
.about h2 {
  font-size: 42px;
  margin: 12px 0 18px;
  color: var(--deep);
}
.about p:not(.eyebrow) {
  max-width: 870px;
  color: var(--muted);
  margin-top: 12px;
}

/* Footer */
footer {
  padding: 25px 40px;
  max-width: 1320px;
  margin: auto;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 25px;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--muted);
}
.footer-name {
  font-family: Amiri, serif;
  font-size: 25px;
  color: var(--purple);
}
footer a:hover {
  color: var(--purple);
}

@media (max-width: 1300px) {
  main {
    margin-left: 32px;
    margin-right: 32px;
  }
}

@media (max-width: 800px) {
  .masthead {
    padding: 20px 24px;
    gap: 14px;
    align-items: flex-start;
  }
  .preview {
    max-width: 140px;
    font-size: 12px;
  }
  .brand-en {
    font-size: 12px;
  }
  nav {
    gap: 12px 25px;
    flex-wrap: wrap;
    padding: 12px 18px;
  }
  nav a {
    font-size: 14px;
  }
  main {
    margin: 0 20px;
  }
  .hero {
    grid-template-columns: 1fr;
    margin-top: 24px;
  }
  .intro {
    padding: 35px 28px;
  }
  h1 {
    font-size: 60px;
  }
  .letter-panel {
    margin: 0 22px 28px;
    padding: 22px;
    min-height: 260px;
    box-shadow:
      4px 4px 0 #8ad6df,
      0 10px 22px #66357120,
      inset 0 1px 0 #ffffff35;
  }
  .calligraphy {
    max-width: 350px;
    margin: 0 0 14px;
  }
  .letter-caption {
    font-size: 24px;
    padding-top: 16px;
  }
  .sections {
    padding: 36px 0;
  }
  .latest {
    padding-bottom: 36px;
  }
  .section-heading {
    align-items: flex-start;
    gap: 20px;
  }
  .section-heading h2 {
    font-size: 29px;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .card {
    min-height: 270px;
  }
  .card h3 {
    font-size: 38px;
    min-height: 0;
  }
  .card h3 br {
    display: none;
  }
  .card p {
    max-width: none;
  }
  .content-section {
    grid-template-columns: 1fr;
    gap: 15px;
    padding: 30px 0;
  }
  .page-section {
    padding-top: 32px;
  }
  .section-label {
    font-size: 25px;
    display: flex;
    gap: 15px;
    align-items: center;
  }
  .section-label span,
  .section-label-link {
    margin: 0;
  }
  .content-section h2 {
    font-size: 34px;
  }
  .page-title {
    font-size: 38px;
  }
  .post-item {
    padding: 18px 20px;
  }
  .post-item h3 {
    font-size: 26px;
  }
  .post-body {
    font-size: 18px;
  }
  .post-body .bayt {
    grid-template-columns: 1fr;
    padding: 16px 20px;
    font-size: 22px;
  }
  .post-body .bayt span:last-child {
    padding-right: 2em;
  }
  .about {
    padding: 28px 25px;
    margin: 25px 0 35px;
  }
  .about h2 {
    font-size: 32px;
  }
  footer {
    padding: 20px;
    flex-wrap: wrap;
    gap: 10px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .card,
  .post-item {
    transition: none;
  }
}

.sample-label{font-weight:700;color:#663571}

/* Maha review — unified Arabic typography and turquoise accents. */
h1, h2, h3, .sub-title, .letter-caption, .footer-name,
.post-body blockquote, .post-body .verse, .post-body .bayt {
  font-family: NotoArabic, Arial, sans-serif;
}
h1, h2, h3 { font-weight: 700; line-height: 1.65; }
body { border-top: 6px solid var(--cyan); }
.masthead { max-width: none; padding-inline: max(40px, calc((100% - 1240px) / 2)); background: linear-gradient(90deg, #fffaf6 25%, #e7f7f8 100%); }
nav { background: #e5f7f8; border-top-color: #b5e4e8; border-bottom: 3px solid var(--cyan); }
nav a { font-weight: 700; }
nav a.is-active { color: var(--deep); border-bottom-color: var(--purple); }
.hero { border-top: 5px solid var(--cyan); }
h1 { font-size: clamp(3rem, 5vw, 4.4rem); line-height: 1.7; }
.sub-title { font-size: 23px; font-weight: 700; }
.eyebrow { border-inline-start: 4px solid var(--cyan); padding-inline-start: 12px; }
.letter-caption { font-size: 23px; font-weight: 700; line-height: 1.9; }
.button { background: var(--cyan); color: var(--ink); border: 0; border-radius: 999px; padding: 12px 30px; font-weight: 700; }
.button:hover { background: #78e0eb; }
.section-heading h2 { font-size: 30px; border-bottom: 4px solid var(--cyan); padding-bottom: 8px; }
.card { background: var(--card); border-top-width: 8px; }
.card:hover { background: #e2cce6; }
.card h3 { font-size: 32px; min-height: 108px; }
.content-section h2 { font-size: 32px; }
.section-label { color: #22626a; }
.post-item h3 { font-size: 25px; }
.page-title { font-size: clamp(2rem, 4vw, 2.8rem); }
.post-body blockquote, .post-body .verse, .post-body .bayt { font-size: 21px; }
.about { background: linear-gradient(120deg, #e5f7f8 0%, #f6edf6 100%); border-top: 5px solid var(--cyan); border-right-color: var(--purple); }
.about h2 { font-size: 32px; }
.footer-name { font-size: 21px; font-weight: 700; }
footer { border-top: 3px solid #b5e4e8; }
@media (max-width: 800px) {
  h1 { font-size: clamp(2.1rem, 9vw, 3.1rem); }
  .card h3 { font-size: 28px; min-height: 0; }
  .section-heading { flex-direction: column; gap: 8px; }
  .section-heading h2 { font-size: 24px; }
  .content-section h2, .about h2 { font-size: 27px; }
  .page-title { font-size: 29px; }
  .letter-caption { font-size: 20px; }
  .masthead { flex-wrap: wrap; padding-inline: 24px; }
  .brand { min-width: 0; }
  .post-item h3 { font-size: 23px; }
}

/* Literary subcategories */
.creative-nav { display:flex; flex-wrap:wrap; gap:12px; margin:24px 0; }
.creative-nav a { display:inline-flex; align-items:center; justify-content:center; white-space:nowrap; line-height:1.8; background:#e5f7f8; color:var(--deep); border:1px solid #b5e4e8; border-radius:999px; padding:9px 20px; font-size:16px; font-weight:700; }
.creative-nav a:hover { background:#cceef1; }
.creative-group { margin-top:36px; padding-top:24px; border-top:2px solid var(--cyan); }
@media(max-width:800px) { .creative-nav a { font-size:14px; padding:8px 16px; } }

/* Editorial paper: decorative Arabic newsprint behind a clean torn sheet. */
.paper-surface {
 position:relative; isolation:isolate; overflow:hidden;
 background:#eadcc7 url('/img/paper-grain.svg') repeat;
 border:1px solid #e6d6be; border-radius:2px;
 box-shadow:0 4px 15px rgba(96,73,43,.065);
}
.paper-surface::before {
 content:""; position:absolute; inset:0; z-index:-2; pointer-events:none;
 background-image:url('/img/arabic-newsprint.svg'); background-size:100% auto;
 opacity:.8;
}
.paper-surface::after {
 content:""; position:absolute; inset:24px 20px; z-index:-1; pointer-events:none;
 background-color:#fbf6e9;
 background-image:url('/img/paper-grain.svg'),radial-gradient(ellipse at 1% 20%,rgba(174,141,91,.08),transparent 60%),linear-gradient(115deg,transparent 45%,rgba(174,146,104,.025) 46%,rgba(255,255,255,.3) 46.5%,transparent 47%);
 background-size:500px 500px,100% 100%,100% 100%;
 clip-path:polygon(1% .3%,5% .55%,9% .15%,14% .5%,19% .1%,25% .55%,31% .2%,37% .6%,43% .1%,49% .4%,55% 0,61% .5%,68% .15%,74% .5%,81% .1%,88% .5%,94% .15%,99% .4%,98.8% 7%,99.6% 14%,99% 21%,99.7% 29%,99.1% 36%,99.7% 44%,99% 52%,99.6% 60%,99% 68%,99.8% 76%,99.1% 84%,99.7% 93%,99% 99.5%,94% 99.8%,88% 99.4%,81% 99.9%,74% 99.4%,68% 99.9%,61% 99.5%,55% 100%,49% 99.5%,43% 99.9%,37% 99.4%,31% 99.8%,25% 99.4%,19% 99.9%,14% 99.5%,9% 99.9%,5% 99.4%,1% 99.7%,1.3% 93%,.4% 85%,1.1% 77%,.3% 69%,1% 61%,.4% 53%,1.2% 45%,.3% 37%,1% 29%,.4% 21%,1.2% 14%,.4% 7%);
}
.article.paper-surface {max-width:850px;min-width:0;padding:58px 52px;}
.article .page-title {font-size:clamp(1.8rem,3.5vw,2.8rem);}
.article .post-body {color:#422849;}
.post-item.paper-surface {padding:38px 42px;}
.post-item.paper-surface::after {inset:20px 13px;}
.post-item.paper-surface:hover {background-color:#e5d3b7;}
.author-bio {margin-top:35px;padding-top:20px;border-top:1px solid #ded4c2;}
.author-bio h2 {font-size:18px;margin:0 0 8px;}
.author-bio p {font-size:15px;line-height:1.9;margin:0;}
.framing-label {color:var(--teal);font-size:16px;font-weight:700;margin:0 0 12px;}
.coming-soon {margin:24px 0;padding:30px;border-top:1px solid var(--line);}
.coming-badge {display:inline-block;border-radius:999px;background:#e5f7f8;color:var(--deep);padding:8px 26px;font-weight:700;font-size:20px;}
.about-paper {padding:46px 48px;max-width:100%;}
.about-paper .post-body p {max-width:none;}
.post-meta {gap:6px 12px;}
.post-meta bdi {unicode-bidi:isolate;}
.post-meta > * + *::before {content:none;}
@media(max-width:800px) {
 .article.paper-surface {width:100%;padding:42px 30px;}
 .paper-surface::after {inset:20px 13px;}
 .article .post-body {font-size:17px;line-height:2.1;}
 .article .post-meta {font-size:12px;}
 .post-item.paper-surface {padding:35px 28px;}
 .post-item.paper-surface::after {inset:19px 10px;}
 .post-item h3 {font-size:25px;}
 .about-paper {padding:32px 28px;}
}

.preview {display:flex;flex-direction:column;gap:6px;}
.edition-label {color:var(--deep);font-size:15px;font-weight:700;}

.hero h1 > span {display:block;}
