/* ===== Native cross-document view transitions ===== */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation-duration: .35s; }
::view-transition-new(root) { animation-duration: .35s; }

/* ===== Design tokens ===== */
:root {
  --color-primary: #E1461B;
  --color-primary-dark: #B93714;
  --color-primary-tint: #FBDDCC;

  --color-bg: #F4EBDA;
  --color-card: #FFFCF5;
  --color-ink: #1E140B;
  --color-muted: #83705E;
  --color-line: #E3D3B8;

  --cat-parenting: #6A4FC4;
  --cat-tips: #D6960F;
  --cat-health: #D63F6E;
  --cat-tech: #1D8CA6;
  --cat-adab: #9C3D82;
  --cat-activities: #C97A16;
  --cat-news: #3C7A4C;

  --status-draft: #D6960F;
  --status-published: #3C7A4C;

  --font-display: "Markazi Text", Georgia, "Times New Roman", serif;
  --font-display-bold: "Cairo", "Segoe UI", Tahoma, sans-serif;
  --font-hero: "Lalezar", "Reem Kufi", sans-serif;
  --font-body: "Cairo", "Segoe UI", Tahoma, sans-serif;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;

  --shadow-sm: 0 2px 12px rgba(30, 20, 11, .08);
  --shadow-md: 0 24px 50px -26px rgba(30, 20, 11, .4);

  --container: 1180px;
}

/* ===== Reset ===== */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { direction: rtl; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-body);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  margin: 0;
  text-wrap: balance;
}
p { margin: 0; }
:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 1.75rem; }
@media (max-width: 640px) { .container { padding: 0 1.25rem; } }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Signature warm duotone photo treatment — unifies every real photo into one graded look */
.media-fill img, .article-cover img, .sidebar-item-media img {
  filter: sepia(.32) saturate(1.7) hue-rotate(-8deg) contrast(1.1) brightness(.96);
}

/* ===== Category label helper ===== */
[data-cat="صحة"] { --cat: var(--cat-health); }
[data-cat="تكنولوجيا"] { --cat: var(--cat-tech); }
[data-cat="نصائح"] { --cat: var(--cat-tips); }
[data-cat="أنشطة"] { --cat: var(--cat-activities); }
[data-cat="أدب"] { --cat: var(--cat-adab); }
[data-cat="تربية"] { --cat: var(--cat-parenting); }
[data-cat="أخبار"] { --cat: var(--cat-news); }

.tag {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  width: fit-content;
  background: var(--cat, var(--color-primary));
  color: #fff;
  padding: .3em .8em;
  border-radius: 3px;
  font-size: .7rem;
  font-weight: 800;
}

.cat-tile-icon svg *, .footer-social svg * {
  fill: currentColor;
  fill-opacity: .18;
}
.main-nav a svg * { fill: none; }

/* ===== Marquee ticker ===== */
.marquee {
  background: var(--color-ink);
  color: var(--color-bg);
  overflow: hidden;
  white-space: nowrap;
  padding: .55rem 0;
}
.marquee-track {
  display: inline-flex;
  animation: marquee-scroll 32s linear infinite;
}
.marquee-track span {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display-bold);
  font-size: .92rem;
  font-weight: 700;
  padding: 0 1.4rem;
}
.marquee-track span::after { content: "✦"; margin-inline-start: 1.4rem; color: var(--color-primary); }
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(50%); }
}
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; } }

/* ===== Header ===== */
.site-header {
  background: var(--color-bg);
  position: sticky; top: 0; z-index: 20;
  border-bottom: 2px solid var(--color-ink);
}
.utility-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .4rem 0;
  color: var(--color-muted);
  font-size: .85rem;
}
.social-links { display: flex; gap: .6rem; }
.social-links a {
  width: 30px; height: 30px;
  border: 1.5px solid var(--color-ink);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background-color .15s ease, color .15s ease;
}
.social-links a:hover { background: var(--color-ink); color: var(--color-bg); }
.utility-start { display: flex; align-items: center; gap: 1rem; }
.search-toggle {
  border: 1.5px solid var(--color-ink); background: none; color: var(--color-ink);
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background-color .15s ease, color .15s ease;
}
.search-toggle:hover { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.saved-nav-link { position: relative; }
.saved-count {
  position: absolute; top: -4px; left: -4px;
  min-width: 15px; height: 15px; padding: 0 3px;
  border-radius: 999px; background: var(--color-primary); color: #fff;
  font-size: .62rem; font-weight: 800; line-height: 15px; text-align: center;
}

.search-panel { border-bottom: 2px solid var(--color-ink); background: var(--color-card); padding: 1rem 0; }
.search-panel input {
  width: 100%; max-width: 480px; margin: 0 auto; display: block;
  padding: .7rem 1.1rem; border: 1.5px solid var(--color-ink); border-radius: 999px;
  font-family: inherit; font-size: .95rem; color: var(--color-ink); background: var(--color-bg);
}
.search-panel input:focus { border-color: var(--color-primary); outline: none; }
.search-results { max-width: 480px; margin: .75rem auto 0; display: flex; flex-direction: column; gap: .4rem; max-height: 320px; overflow-y: auto; }
.search-result { display: flex; align-items: center; gap: .6rem; padding: .55rem .75rem; border-radius: var(--radius-sm); }
.search-result:hover { background: var(--color-bg); }
.search-result .tag { font-size: .6rem; padding: .2em .55em; flex-shrink: 0; }
.search-result span:last-child { font-size: .88rem; font-weight: 600; }
.search-empty { text-align: center; color: var(--color-muted); font-size: .85rem; padding: .5rem; }

.brand-row { display: flex; justify-content: center; padding: .5rem 0 .4rem; }
.brand { display: inline-flex; align-items: center; gap: .9rem; }
.brand-mark { color: var(--color-primary); flex-shrink: 0; }
.brand-mark svg { width: 46px; height: 46px; display: block; }
.brand-text { display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; }
.brand-word { font-family: "Cairo", sans-serif; font-weight: 900; font-size: 2.5rem; line-height: 1.1; color: var(--color-ink); }
.brand-tagline { font-size: .9rem; font-weight: 700; color: var(--color-primary); font-family: "Cairo", sans-serif; }

.main-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .3rem 1.9rem;
  padding: 0 0 .5rem;
  font-weight: 700;
  font-size: .95rem;
  border-top: 1px solid var(--color-line);
}
.main-nav a {
  display: flex;
  align-items: center;
  gap: .4rem;
}
.main-nav a svg { color: var(--color-ink); opacity: .55; transition: opacity .15s ease; flex-shrink: 0; }
.main-nav a svg * { stroke-width: 2.1 !important; }
.main-nav a:hover svg,
.main-nav a[aria-current="page"] svg { opacity: 1; }
.main-nav a {
  padding-top: .6rem;
  padding-bottom: .3rem;
  border-bottom: 3px solid transparent;
  color: var(--color-ink);
}
.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: var(--cat, var(--color-primary));
  border-color: var(--cat, var(--color-primary));
}

/* ===== Editor's note & quote-of-the-day ===== */
.editor-note {
  margin: 2.5rem 0 0;
  padding: 2.1rem 2.4rem;
  border-radius: var(--radius-lg);
  background: var(--color-ink);
  color: var(--color-bg);
  display: flex;
  gap: 1.4rem;
  align-items: flex-start;
}
.editor-note-mark { color: var(--color-primary); flex-shrink: 0; margin-top: .2rem; }
.editor-note-label { font-family: var(--font-display-bold); font-size: .85rem; font-weight: 700; color: var(--color-primary); text-transform: uppercase; }
.editor-note-text { font-family: var(--font-display); font-size: 1.4rem; line-height: 1.6; margin: .5rem 0 0; color: #fff; }
.editor-note-sign { display: block; margin-top: .7rem; font-size: .85rem; font-weight: 700; opacity: .6; }

.quote-banner-wrap { background: var(--color-primary); margin: 2.5rem calc(50% - 50vw) 0; padding: 0 calc(50vw - 50%); }
.quote-banner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 1.1rem 1.75rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: #fff;
}
.quote-banner-icon { flex-shrink: 0; color: rgba(255,255,255,.8); }
.quote-banner b { font-family: var(--font-display-bold); font-weight: 700; }

/* ===== Hero cluster — overlay magazine-cover treatment ===== */
.hero { position: relative; display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.5rem; padding: 2.25rem 0 1rem; align-items: stretch; }
#heroContent { display: contents; }

.hero-main {
  position: relative;
  display: block;
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 560px;
}
.media-fill.hero-main-media {
  position: absolute; inset: 0;
  aspect-ratio: auto;
  border-radius: 0;
}
.hero-main-media::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(20,12,6,.94) 0%, rgba(20,12,6,.55) 42%, rgba(20,12,6,.05) 72%);
}
.hero-main-body {
  position: relative; z-index: 1;
  height: 100%;
  padding: 2.4rem;
  display: flex; flex-direction: column; justify-content: flex-end;
  color: #fff;
}
.hero-main-body .tag { margin-bottom: .9rem; align-self: flex-start; }
.hero-main-body h1 {
  font-family: var(--font-hero);
  font-weight: 400;
  font-size: clamp(2.1rem, 1.3rem + 3.4vw, 4rem);
  line-height: 1.15;
  margin-bottom: .9rem;
  color: #fff;
}
.hero-main-body .dek { color: rgba(255,255,255,.82); font-size: 1.05rem; line-height: 1.75; margin-bottom: .8rem; max-width: 46ch; }
.hero-main-body .meta { color: rgba(255,255,255,.65); }
.meta { font-size: .82rem; color: var(--color-muted); }

.hero-side { display: flex; flex-direction: column; gap: 1.5rem; }
.hero-side-item {
  position: relative;
  flex: 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 165px;
  display: block;
}
.media-fill.hero-side-media { position: absolute; inset: 0; aspect-ratio: auto; border-radius: 0; }
.hero-side-media::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(20,12,6,.92) 0%, rgba(20,12,6,.3) 55%, transparent 80%);
}
.hero-side-body { position: relative; z-index: 1; height: 100%; padding: 1.2rem; display: flex; flex-direction: column; justify-content: flex-end; }
.hero-side-body .tag { font-size: .62rem; padding: .22em .65em; margin-bottom: .5rem; align-self: flex-start; }
.hero-side-body h3 { font-size: 1.05rem; font-weight: 700; line-height: 1.4; color: #fff; }
.hero-side-item:hover h3 { color: var(--color-primary-tint); }

.frame-accent { display: none; }
.media-fill { position: relative; aspect-ratio: 4/3; border-radius: var(--radius-lg); overflow: hidden; background: var(--color-line); }
.media-fill img { width: 100%; height: 100%; object-fit: cover; }

/* ===== Grid / Cards ===== */
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 3rem 0 1.5rem;
}
.section-heading h2 { font-family: var(--font-hero); font-weight: 400; font-size: 2.1rem; }
.section-heading a { font-size: .85rem; font-weight: 700; color: var(--color-primary); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem 2rem;
  padding-bottom: 2.5rem;
}
.card { display: flex; flex-direction: column; }
.card .media-fill { aspect-ratio: 16 / 11; margin-bottom: 1.1rem; }
.card .media-fill img { transition: transform .4s cubic-bezier(.2,.8,.3,1); }
.card:hover .media-fill img { transform: scale(1.07); }
.card .tag { margin-bottom: .6rem; }
.card h3 { font-size: 1.2rem; font-weight: 700; line-height: 1.4; margin-bottom: .5rem; position: relative; }
.card:hover h3 { color: var(--cat, var(--color-primary)); }

.skeleton { position: relative; overflow: hidden; background: var(--color-line); }
.skeleton::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent);
  animation: shimmer 1.4s infinite;
}
@media (prefers-reduced-motion: reduce) { .skeleton::after { animation: none; } }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.empty-state { text-align: center; padding: 3rem 1rem; color: var(--color-muted); }

/* ===== Buttons / links ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  font-weight: 800;
  font-size: .92rem;
  color: var(--color-ink);
  cursor: pointer;
  background: none;
  border: none;
  border-bottom: 2px solid var(--color-primary);
  padding: .3rem 0;
  transition: gap .15s ease, color .15s ease;
}
.btn::after { content: "←"; transition: transform .15s ease; color: var(--color-primary); }
.btn:hover { gap: .7rem; color: var(--color-primary); }
.btn-primary, .btn-outline { color: var(--color-ink); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { color: var(--color-muted); border-color: transparent; }
.btn-ghost:hover { color: var(--color-primary); }
.btn-danger { color: #A33B5B; border-color: #A33B5B; }
.btn-danger::after { content: none; }

/* ===== Article page ===== */
.article-layout { display: grid; grid-template-columns: 1fr 300px; gap: 3rem; align-items: start; padding-top: .5rem; }
.article-sidebar {
  position: sticky;
  top: 5.5rem;
  background: var(--color-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
}
.article-sidebar h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 1.1rem;
  padding-bottom: .8rem;
  border-bottom: 2px solid var(--color-ink);
  font-family: var(--font-display);
}
.sidebar-item { display: flex; gap: .8rem; margin-bottom: 1.1rem; }
.sidebar-item:last-child { margin-bottom: 0; }
.sidebar-item-media {
  width: 72px; height: 72px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--color-line);
}
.sidebar-item-media img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-item-body { min-width: 0; }
.sidebar-item-body .tag { font-size: .6rem; padding: .2em .55em; margin-bottom: .4rem; }
.sidebar-item-body h4 { font-size: .87rem; font-weight: 700; line-height: 1.45; }
.sidebar-item:hover h4 { color: var(--cat, var(--color-primary)); }

.article-head { max-width: 800px; margin: 0 auto; padding: 3rem 0 1.75rem; text-align: center; }
.article-head h1 { font-family: var(--font-hero); font-weight: 400; font-size: clamp(1.9rem, 1.3rem + 2.4vw, 3.1rem); line-height: 1.25; margin: 1rem 0; }
.article-cover { max-width: 1000px; margin: 0 auto 2.75rem; aspect-ratio: 16/9; border-radius: var(--radius-lg); position: relative; overflow: hidden; }
.article-cover img { width: 100%; height: 100%; object-fit: cover; }
.article-body { max-width: 700px; margin: 0 auto; padding-bottom: 3rem; font-size: 1.1rem; line-height: 1.95; }
.article-body p { margin-bottom: 1.35rem; }
.article-body > p:first-of-type::first-letter {
  font-family: var(--font-display-bold);
  font-size: 4.6rem;
  font-weight: 700;
  float: right;
  line-height: .72;
  margin: .15rem 0 0 .5rem;
  color: var(--color-primary);
}
.article-body h2 { font-size: 1.55rem; font-weight: 700; margin: 2.2rem 0 1rem; }
.article-body h3 { font-size: 1.22rem; font-weight: 700; margin: 1.7rem 0 .8rem; }
.article-body img { border-radius: var(--radius-md); margin: 1.5rem 0; }
.article-body ul, .article-body ol { margin: 0 0 1.3rem; padding-inline-start: 1.4rem; }
.pull-quote {
  font-family: var(--font-display);
  font-size: 1.65rem;
  line-height: 1.5;
  font-weight: 700;
  color: var(--color-ink);
  border-inline-start: 4px solid var(--color-primary);
  padding: .2rem 0 .2rem 0;
  padding-inline-start: 1.5rem;
  margin: 2rem 0;
}
.article-nav {
  max-width: 700px; margin: 0 auto 3rem;
  display: flex; justify-content: space-between; gap: 1rem;
  padding-top: 1.5rem; border-top: 2px solid var(--color-ink);
}
.article-nav a { font-size: .9rem; font-weight: 700; color: var(--cat, var(--color-primary)); max-width: 45%; }

/* ===== Comments ===== */
.comments { max-width: 700px; margin: 0 auto 3.5rem; }
.comments h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: .35rem; }
.comments-sub { color: var(--color-muted); font-size: .92rem; margin-bottom: 1.5rem; }
.comment-form {
  display: flex; flex-direction: column; gap: .8rem;
  padding: 1.4rem; border-radius: var(--radius-md);
  background: var(--color-card);
  border: 2px solid var(--color-ink);
  margin-bottom: 1.75rem;
}
.comment-form input, .comment-form textarea {
  width: 100%; padding: .7rem 1rem; border-radius: var(--radius-sm);
  border: 1px solid var(--color-line); background: #fff;
  font-family: inherit; font-size: .95rem; color: var(--color-ink); resize: vertical;
}
.comment-form input:focus, .comment-form textarea:focus { outline: none; border-color: var(--color-primary); }
.comment-form button {
  align-self: flex-start; background: var(--color-ink); color: #fff;
  border: none; padding: .65rem 1.6rem; border-radius: 999px; font-weight: 700;
  cursor: pointer; transition: background-color .15s ease;
}
.comment-form button:hover { background: var(--color-primary); }
.comment-list { display: flex; flex-direction: column; gap: 1rem; }
.comment-bubble {
  padding: 1.1rem 1.3rem; border-radius: var(--radius-md);
  background: var(--color-card); box-shadow: var(--shadow-sm);
  border-inline-start: 3px solid var(--cat, var(--color-primary));
}
.comment-bubble-name { font-weight: 700; font-size: .92rem; color: var(--color-ink); }
.comment-bubble-time { font-size: .76rem; color: var(--color-muted); margin-right: .5rem; }
.comment-bubble-text { margin-top: .4rem; line-height: 1.75; font-size: .96rem; }
.comment-empty { color: var(--color-muted); font-size: .9rem; text-align: center; padding: 1rem 0; }

/* ===== Category page ===== */
.category-head {
  padding: 3.5rem 0 2rem;
  text-align: center;
  background: var(--cat, var(--color-primary));
  color: #fff;
  margin-bottom: 1rem;
}
.category-head .tag { justify-content: center; font-size: .9rem; margin-bottom: .9rem; background: rgba(255,255,255,.22); }
.category-head h1 { font-family: var(--font-hero); font-weight: 400; font-size: clamp(2.1rem, 1.5rem + 2.2vw, 3.1rem); color: #fff; }
.list-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem 2rem; padding: 2rem 0 1rem; }
.load-more { display: flex; justify-content: center; padding-bottom: 3rem; }

/* ===== Category showcase (homepage) — bold color blocks ===== */
.category-showcase {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: .85rem;
  padding: 2rem 0 .5rem;
}
.cat-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
  text-align: center;
  padding: 1.5rem .5rem 1.3rem;
  border-radius: var(--radius-md);
  background: var(--color-ink);
  border-bottom: 4px solid var(--cat, var(--color-primary));
  color: var(--color-bg);
  transition: transform .18s cubic-bezier(.2,.8,.3,1), border-color .18s ease;
}
.cat-tile:hover { transform: translateY(-6px); }
.cat-tile-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--cat, var(--color-primary));
  color: #fff;
  box-shadow: 0 6px 16px -6px rgba(0,0,0,.5);
}
.cat-tile-icon svg { width: 22px; height: 22px; }
.cat-tile-icon svg * { fill: none !important; stroke: #fff !important; stroke-width: 2 !important; }
.cat-tile-label { font-family: var(--font-display-bold); font-weight: 700; font-size: .95rem; color: var(--color-bg); }

/* ===== About page ===== */
.about-hero { max-width: 760px; margin: 0 auto; padding: 3.5rem 0 2rem; text-align: center; }
.about-mark { color: var(--color-primary); display: inline-flex; margin-bottom: 1.2rem; }
.about-hero h1 { font-family: var(--font-hero); font-weight: 400; font-size: clamp(1.9rem, 1.4rem + 2vw, 2.8rem); margin-bottom: 1rem; }
.about-lede { color: var(--color-muted); font-size: 1.08rem; line-height: 1.9; }

.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  max-width: 760px;
  margin: 0 auto 3rem;
}
.about-stat {
  text-align: center;
  padding: 1.75rem 1rem;
  border-radius: var(--radius-md);
  background: var(--color-ink);
  color: #fff;
}
.about-stat:nth-child(2) { background: var(--color-primary); }
.about-stat-num { display: block; font-family: var(--font-display); font-size: 2rem; font-weight: 700; margin-bottom: .3rem; }
.about-stat-label { font-size: .82rem; opacity: .75; font-weight: 600; }

.about-body { max-width: 680px; margin: 0 auto; padding-bottom: 4rem; font-size: 1.05rem; line-height: 1.9; }
.about-body h2 { font-size: 1.4rem; font-weight: 700; margin: 2.2rem 0 1rem; }
.about-body h2:first-child { margin-top: 0; }
.about-body p { margin-bottom: 1.1rem; color: var(--color-ink); }
.about-contact { list-style: none; margin: 1rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; font-weight: 700; }

/* ===== Footer ===== */
.site-footer { background: var(--color-ink); color: var(--color-bg); margin-top: 3rem; }
.footer-grid {
  padding: 3rem 0 2rem;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2.5rem;
}
.footer-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 1rem; }
.footer-word { font-family: "Cairo", sans-serif; font-weight: 900; font-size: 2rem; color: #fff; }
.footer-tagline { max-width: 380px; font-size: .9rem; line-height: 1.8; opacity: .75; }
.footer-social { display: flex; gap: .6rem; }
.footer-social a {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid rgba(244, 235, 218, .3);
  display: flex; align-items: center; justify-content: center;
}
.footer-social a:hover { background: var(--color-primary); border-color: var(--color-primary); }
.footer-col h3 { font-family: var(--font-display-bold); font-size: .9rem; font-weight: 700; color: var(--color-primary); margin-bottom: 1.1rem; text-transform: uppercase; }
.footer-col { display: flex; flex-direction: column; gap: .75rem; }
.footer-col a, .footer-col p { font-size: .88rem; opacity: .75; }
.footer-col a:hover { opacity: 1; color: var(--color-primary); }
.footer-note-teaser {
  display: block; margin-top: .3rem; padding: 1rem;
  border-radius: var(--radius-sm); background: rgba(244, 235, 218, .06);
  border: 1px solid rgba(244, 235, 218, .15);
  font-size: .85rem; line-height: 1.7; opacity: .95;
}
.footer-note-teaser b { font-family: var(--font-display-bold); font-weight: 700; display: block; margin-bottom: .35rem; color: var(--color-primary); font-size: .82rem; }
.footer-note-teaser:hover { background: rgba(244, 235, 218, .12); }
.footer-bottom {
  padding: 1.4rem 0;
  border-top: 1px solid rgba(244, 235, 218, .15);
  display: flex; align-items: center; justify-content: space-between;
  font-size: .8rem; opacity: .6; flex-wrap: wrap; gap: .5rem;
}
.footer-admin-link:hover { opacity: 1; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-main { min-height: 420px; }
  .hero-side { flex-direction: row; }
  .hero-side-item { min-height: 220px; }
  .card-grid, .list-grid { grid-template-columns: repeat(2, 1fr); }
  .category-showcase { grid-template-columns: repeat(4, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .article-layout { grid-template-columns: 1fr; }
  .article-sidebar { position: static; }
  .editor-note { flex-direction: column; }
}
@media (max-width: 600px) {
  .card-grid, .list-grid { grid-template-columns: 1fr; }
  .hero-side { flex-direction: column; }
  .main-nav { gap: .2rem 1rem; font-size: .88rem; justify-content: center; }
  .brand-word { font-size: 2.3rem; }
  .brand-mark svg { width: 42px; height: 42px; }
  .category-showcase { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-brand, .footer-col { align-items: center; text-align: center; }
}

/* ===== Save / bookmark button ===== */
.save-btn {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%;
  border: none; cursor: pointer;
  background: rgba(255, 255, 255, .9);
  color: var(--color-primary);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(2px);
  transition: transform .15s ease, background-color .15s ease;
}
.save-btn:hover { transform: scale(1.1); background: #fff; }
.save-btn.is-saved { color: var(--color-primary-dark); background: #fff; }
.save-article-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  border: 2px solid var(--color-ink); background: none;
  color: var(--color-ink); border-radius: 999px;
  padding: .55rem 1.2rem; font-weight: 800; font-size: .88rem;
  cursor: pointer; margin-top: 1rem; transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.save-article-btn:hover { border-color: var(--color-primary); background: var(--color-primary); color: #fff; }
.save-article-btn.is-saved { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }

/* ===== Scroll-reveal ===== */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in-view { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ===== Animated logo bloom ===== */
@keyframes petal-bloom {
  from { transform: scale(.2); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.brand-mark svg ellipse {
  transform-origin: 20px 20px;
  animation: petal-bloom .55s cubic-bezier(.2, .9, .3, 1.3) backwards;
}
.brand-mark svg ellipse:nth-of-type(1) { animation-delay: .05s; }
.brand-mark svg ellipse:nth-of-type(2) { animation-delay: .12s; }
.brand-mark svg ellipse:nth-of-type(3) { animation-delay: .19s; }
.brand-mark svg ellipse:nth-of-type(4) { animation-delay: .26s; }
.brand-mark svg ellipse:nth-of-type(5) { animation-delay: .33s; }
.brand-mark svg circle { animation: petal-bloom .4s ease .4s backwards; }
@media (prefers-reduced-motion: reduce) {
  .brand-mark svg ellipse, .brand-mark svg circle { animation: none; }
}

/* ===== Drifting petal ambient background (homepage hero) ===== */
.hero-decoration { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 3; }
.hero-decoration svg {
  position: absolute;
  color: #fff;
  opacity: .5;
  animation: petal-drift linear infinite;
}
.hero-decoration svg:nth-child(1) { top: 8%; right: 6%; width: 26px; animation-duration: 22s; }
.hero-decoration svg:nth-child(2) { top: 55%; right: 30%; width: 18px; animation-duration: 28s; animation-delay: -6s; color: var(--color-primary-tint); }
.hero-decoration svg:nth-child(3) { top: 20%; right: 55%; width: 22px; animation-duration: 25s; animation-delay: -12s; }
.hero-decoration svg:nth-child(4) { top: 75%; right: 12%; width: 16px; animation-duration: 20s; animation-delay: -3s; }
@keyframes petal-drift {
  0% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-22px) rotate(180deg); }
  100% { transform: translateY(0) rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-decoration svg { animation: none; }
}

/* ===== Saved (المحفوظات) page ===== */
.saved-head { padding: 3rem 0 1.75rem; text-align: center; }
.saved-head h1 { font-size: clamp(2rem, 1.5rem + 1.6vw, 2.75rem); font-weight: 700; margin-bottom: .5rem; }
.saved-head p { color: var(--color-muted); }

/* ===== Grain texture — tactile depth over the flat color fields ===== */
body::after {
  content: "";
  position: fixed; inset: 0;
  z-index: 999; pointer-events: none;
  opacity: .05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ===== Kinetic hero headline ===== */
@keyframes word-rise {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.kinetic-word {
  display: inline-block;
  overflow: hidden;
  animation: word-rise .65s cubic-bezier(.2,.8,.2,1) backwards;
}
@media (prefers-reduced-motion: reduce) { .kinetic-word { animation: none; } }

/* ===== Bento feature card (first "الأحدث" tile, larger + overlay style) ===== */
.card-feature {
  grid-column: span 2;
  grid-row: span 2;
  min-height: 520px;
  position: relative;
}
.card-feature .media-fill {
  position: absolute; inset: 0; aspect-ratio: auto; margin: 0;
}
.card-feature .media-fill::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(20,12,6,.92) 0%, rgba(20,12,6,.35) 55%, transparent 85%);
}
.card-feature .tag, .card-feature h3, .card-feature .meta {
  position: relative; z-index: 1;
}
.card-feature { padding: 1.5rem; display: flex; flex-direction: column; justify-content: flex-end; }
.card-feature .tag { align-self: flex-start; }
.card-feature h3 { font-family: var(--font-hero); font-weight: 400; color: #fff; font-size: 1.7rem; line-height: 1.35; }
.card-feature .meta { color: rgba(255,255,255,.7); }
@media (max-width: 900px) {
  .card-feature { grid-column: span 2; grid-row: span 1; min-height: 360px; }
}
@media (max-width: 600px) {
  .card-feature { grid-column: span 1; min-height: 320px; }
}

/* ===== Branded placeholder when a post has no cover (or its image fails to load) ===== */
.media-fill.no-cover {
  background:
    radial-gradient(circle at 78% 22%, color-mix(in srgb, var(--cat, var(--color-primary)) 45%, #fff) 0, transparent 58%),
    linear-gradient(135deg, color-mix(in srgb, var(--cat, var(--color-primary)) 70%, #1E140B), color-mix(in srgb, var(--cat, var(--color-primary)) 92%, #1E140B));
}
.media-fill.no-cover::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cg fill='%23fff'%3E%3Cellipse cx='20' cy='12' rx='4.2' ry='7.4' transform='rotate%280 20 20%29'/%3E%3Cellipse cx='20' cy='12' rx='4.2' ry='7.4' transform='rotate%2872 20 20%29'/%3E%3Cellipse cx='20' cy='12' rx='4.2' ry='7.4' transform='rotate%28144 20 20%29'/%3E%3Cellipse cx='20' cy='12' rx='4.2' ry='7.4' transform='rotate%28216 20 20%29'/%3E%3Cellipse cx='20' cy='12' rx='4.2' ry='7.4' transform='rotate%28288 20 20%29'/%3E%3C/g%3E%3Ccircle cx='20' cy='20' r='3.6' fill='%23000' fill-opacity='.25'/%3E%3C/svg%3E") center / min(30%, 140px) no-repeat;
  opacity: .24;
}

/* ===== Photo credit on article covers ===== */
.cover-credit {
  position: absolute; bottom: .7rem; inset-inline-start: .9rem;
  font-size: .72rem; font-weight: 600; color: #fff; opacity: .85;
  text-shadow: 0 1px 4px rgba(0,0,0,.65); pointer-events: none;
}

.footer-credit { opacity: .75; font-size: .85em; }
.footer-credit a { text-decoration: underline; text-underline-offset: 3px; }
