/* ============================================
   MOORISH DIRECTORY — Main Stylesheet
   Palette: Parchment · Forest Green · Gold · Charcoal
   ============================================ */

:root {
  --deep-green:   #0f3323;
  --mid-green:    #1a5c3a;
  --light-green:  #e4efe9;
  --gold:         #9a6f1e;
  --gold-hover:   #7a5510;
  --gold-bright:  #c9a227;
  --cream:        #fdf6e3;
  --parchment:    #f5ead0;
  --warm-white:   #ffffff;
  --text-dark:    #0a0a0a;
  --text-body:    #111008;
  --text-muted:   #7a6e58;
  --border:       #d4c4a0;
  --border-green: #c0d4c8;
  --card-bg:      #ffffff;
  --section-alt:  #f0ebe0;
  --header-bg:    #0f3323;
  --nav-bg:       #0d2e1f;
  --footer-bg:    #0f3323;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
}

/* ── Global overflow fix ── */
/* Break long unbreakable strings (URLs, long words) everywhere */
* {
  word-break: break-word;
  overflow-wrap: anywhere;
  min-width: 0;
}

/* Force iframes inside content to be responsive */
.content-wrap iframe,
main iframe,
p > iframe,
.with-sidebar iframe {
  max-width: 100% !important;
  width: 100% !important;
  display: block;
}

/* Images inside content stay within their container */
.content-wrap img,
main img,
.card img,
.video-card img,
.sidebar-block img {
  max-width: 100% !important;
  width: auto;
  height: auto;
}

/* Header logo keeps its explicit inline height */
.site-brand img {
  width: auto !important;
  height: 70px !important;
  max-width: none !important;
}

body {
  font-family: 'Georgia', 'Times New Roman', serif;
  background: var(--cream);
  color: var(--text-body);
  line-height: 1.8;
  font-size: 16px;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
  color: var(--deep-green);
  line-height: 1.3;
}
h1 { font-size: clamp(1.8rem, 4vw, 3rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2.2rem); margin-bottom: .5rem; }
h3 { font-size: 1.4rem; color: var(--mid-green); }
h4 { font-size: 1.15rem; color: var(--text-dark); }

p { margin-bottom: 1rem; color: var(--text-body); }
a { color: var(--gold); text-decoration: none; transition: color .2s; }
a:hover { color: var(--gold-hover); text-decoration: underline; }

strong, b { color: var(--text-dark); }
em, i { color: var(--mid-green); }

blockquote {
  border-left: 4px solid var(--gold-bright);
  margin: 1.5rem 0;
  padding: .75rem 1.5rem;
  background: var(--parchment);
  color: var(--text-body);
  font-style: italic;
  border-radius: 0 6px 6px 0;
}

ul, ol { padding-left: 1.5rem; margin-bottom: 1rem; color: var(--text-body); }
li { margin-bottom: .4rem; }

img { max-width: 100%; height: auto; border-radius: 4px; }

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* ── Geometric ornament divider ── */
.ornament {
  text-align: center;
  color: var(--gold-bright);
  font-size: 1.4rem;
  margin: 1.5rem 0;
  letter-spacing: 1rem;
  opacity: .7;
}

/* ── Header ── */
#site-header {
  background: var(--header-bg);
  border-bottom: 3px solid var(--gold-bright);
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 1rem;
}

.site-brand {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.site-brand .brand-title {
  font-family: 'Palatino Linotype', Palatino, serif;
  font-size: 1.4rem;
  color: var(--gold-bright);
  letter-spacing: .05em;
  font-weight: bold;
}

.site-brand .brand-subtitle {
  font-size: .68rem;
  color: rgba(253,246,227,.6);
  letter-spacing: .22em;
  text-transform: uppercase;
}

/* ── Navigation ── */
#main-nav {
  background: var(--nav-bg);
  border-bottom: 1px solid rgba(201,162,39,.3);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: .15rem;
}

.nav-inner a {
  display: inline-block;
  padding: .55rem .9rem;
  font-size: .8rem;
  color: rgba(253,246,227,.75);
  text-transform: uppercase;
  letter-spacing: .08em;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s, background .2s;
  font-family: sans-serif;
}

.nav-inner a:hover,
.nav-inner a.active {
  color: var(--gold-bright);
  border-bottom-color: var(--gold-bright);
  text-decoration: none;
}

/* Hamburger (mobile) */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid rgba(201,162,39,.5);
  color: var(--gold-bright);
  padding: .4rem .7rem;
  cursor: pointer;
  font-size: 1.2rem;
  border-radius: 4px;
}

/* ── Hero banner ── */
.hero {
  background: linear-gradient(
    160deg,
    var(--deep-green) 0%,
    #1a5c3a 60%,
    #2a7a50 100%
  );
  padding: 5rem 1.5rem 4.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('../images/site/hero-banner.jpg') center/cover no-repeat;
  opacity: .08;
}

.hero-content { position: relative; z-index: 1; max-width: 800px; margin: 0 auto; }

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  color: var(--gold-bright);
  text-shadow: 0 2px 16px rgba(0,0,0,.5);
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.15rem;
  color: var(--cream);
  max-width: 600px;
  margin: 0 auto 2rem;
  text-shadow: 0 1px 4px rgba(0,0,0,.4);
}

.hero-badge {
  font-size: 2.5rem;
  color: var(--gold-bright);
  display: block;
  margin-bottom: 1rem;
  text-shadow: 0 0 20px rgba(201,162,39,.4);
}

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: .65rem 1.6rem;
  background: var(--gold-bright);
  color: #1a1000;
  font-weight: bold;
  font-family: sans-serif;
  font-size: .88rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  border-radius: 3px;
  border: 2px solid var(--gold-bright);
  cursor: pointer;
  transition: background .2s, color .2s;
}

.btn:hover { background: #a07e1a; border-color: #a07e1a; color: #fff; text-decoration: none; }

.btn-outline {
  background: transparent;
  color: var(--cream);
  border-color: var(--cream);
}
.btn-outline:hover { background: var(--cream); color: var(--deep-green); text-decoration: none; }

/* ── Layout containers ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 4rem 1.5rem; }

.section-title {
  text-align: center;
  margin-bottom: 2.5rem;
}
.section-title h2 { color: var(--deep-green); }
.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--gold-bright);
  margin: .75rem auto 0;
}

/* ── Cards grid ── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.5rem;
  transition: border-color .2s, box-shadow .2s, transform .2s;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.card:hover {
  border-color: var(--gold-bright);
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
  transform: translateY(-3px);
}

.card-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .15em;
  color: var(--mid-green);
  margin-bottom: .5rem;
  font-family: sans-serif;
  font-weight: 600;
}

.card h3 {
  font-size: 1.05rem;
  margin-bottom: .65rem;
  color: var(--deep-green);
}

.card p {
  font-size: .88rem;
  color: var(--text-muted);
  flex: 1;
  margin-bottom: 0;
}

.card-link {
  display: inline-block;
  margin-top: 1rem;
  font-size: .82rem;
  color: var(--gold);
  font-family: sans-serif;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 600;
}

.card-link:hover { color: var(--gold-hover); text-decoration: none; }

/* ── Category sections on homepage ── */
.category-block {
  padding: 3rem 1.5rem;
  border-top: 1px solid var(--border);
}

.category-block:nth-child(even) {
  background: var(--section-alt);
}

/* ── Single page / article layout ── */
.page-header {
  background: linear-gradient(180deg, var(--deep-green) 0%, #1a5c3a 100%);
  padding: 3rem 1.5rem 2.5rem;
  border-bottom: 3px solid var(--gold-bright);
  text-align: center;
}

.page-header h1 { color: var(--cream); margin-bottom: 0; }

.page-header .page-meta {
  font-size: .8rem;
  color: rgba(253,246,227,.65);
  font-family: sans-serif;
  text-transform: uppercase;
  letter-spacing: .15em;
  margin-bottom: .75rem;
}

.content-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.content-wrap table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  overflow-x: auto;
  display: block;
}

.content-wrap th,
.content-wrap td {
  border: 1px solid var(--border);
  padding: .6rem .9rem;
  text-align: left;
  color: var(--text-body);
}

.content-wrap th {
  background: var(--light-green);
  color: var(--deep-green);
  font-weight: 600;
}

.content-wrap figure {
  margin: 1.5rem 0;
  text-align: center;
}

.content-wrap figcaption {
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: .4rem;
}

/* ── Video grid ── */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.video-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.video-card:hover {
  border-color: var(--gold-bright);
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
}

.video-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: var(--light-green);
}

.video-thumb-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--deep-green), var(--mid-green));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-bright);
  font-size: 2.5rem;
}

.video-info { padding: 1rem 1.25rem 1.25rem; }

.video-info h4 {
  font-size: .95rem;
  margin-bottom: .4rem;
  color: var(--deep-green);
}

.video-info p {
  font-size: .82rem;
  color: var(--text-muted);
  margin: 0;
}

/* ── Breadcrumb ── */
.breadcrumb {
  font-size: .78rem;
  font-family: sans-serif;
  color: rgba(253,246,227,.6);
  padding: .75rem 0 1rem;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 0;
}

.breadcrumb a { color: rgba(253,246,227,.7); }
.breadcrumb a:hover { color: var(--gold-bright); text-decoration: none; }
.breadcrumb span { color: var(--gold-bright); margin: 0 .4rem; }

/* ── Search bar ── */
.search-bar {
  display: flex;
  max-width: 500px;
  margin: 0 auto 2.5rem;
}

.search-bar input {
  flex: 1;
  padding: .65rem 1rem;
  background: var(--warm-white);
  border: 1px solid var(--border);
  border-right: none;
  color: var(--text-body);
  font-size: .9rem;
  border-radius: 3px 0 0 3px;
  outline: none;
  font-family: Georgia, serif;
}

.search-bar input::placeholder { color: var(--text-muted); }
.search-bar input:focus { border-color: var(--gold-bright); }

.search-bar button {
  padding: .65rem 1.2rem;
  background: var(--deep-green);
  color: var(--cream);
  border: none;
  cursor: pointer;
  font-weight: bold;
  border-radius: 0 3px 3px 0;
  transition: background .2s;
  font-family: sans-serif;
  letter-spacing: .05em;
}

.search-bar button:hover { background: var(--mid-green); }

/* ── Sidebar layout ── */
.with-sidebar {
  display: grid;
  grid-template-columns: 1fr 270px;
  gap: 2.5rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  align-items: start;
}

.sidebar { position: sticky; top: 90px; }

.sidebar-block {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}

.sidebar-block h4 {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--deep-green);
  margin-bottom: 1rem;
  font-family: sans-serif;
  font-weight: 700;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--light-green);
}

.sidebar-block ul { padding: 0; list-style: none; }
.sidebar-block ul li { border-bottom: 1px solid var(--border); }
.sidebar-block ul li:last-child { border-bottom: none; }
.sidebar-block ul li a {
  display: block;
  padding: .45rem 0;
  font-size: .85rem;
  color: var(--text-body);
}
.sidebar-block ul li a:hover { color: var(--mid-green); text-decoration: none; }

/* ── Tags ── */
.tags { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }

.tag {
  display: inline-block;
  padding: .25rem .75rem;
  background: var(--light-green);
  border: 1px solid var(--border-green);
  color: var(--deep-green);
  font-size: .75rem;
  border-radius: 20px;
  font-family: sans-serif;
  letter-spacing: .06em;
}

/* ── Footer ── */
#site-footer {
  background: var(--footer-bg);
  border-top: 3px solid var(--gold-bright);
  padding: 3rem 1.5rem 2rem;
  text-align: center;
}

.footer-inner { max-width: 1200px; margin: 0 auto; }

.footer-logo {
  font-family: 'Palatino Linotype', Palatino, serif;
  font-size: 1.5rem;
  color: var(--gold-bright);
  margin-bottom: .25rem;
}

.footer-tagline {
  font-size: .75rem;
  color: rgba(253,246,227,.5);
  letter-spacing: .22em;
  text-transform: uppercase;
  margin-bottom: 2rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem 1.5rem;
  margin-bottom: 2rem;
}

.footer-links a {
  font-size: .82rem;
  color: rgba(253,246,227,.65);
  font-family: sans-serif;
}

.footer-links a:hover { color: var(--gold-bright); text-decoration: none; }

.footer-copy {
  font-size: .75rem;
  color: rgba(253,246,227,.35);
  font-family: sans-serif;
}

/* ── Islamic border accent ── */
.islamic-border {
  border-top: 2px solid var(--gold-bright);
  border-bottom: 2px solid var(--gold-bright);
  padding: .35rem 0;
  position: relative;
  margin: 1.5rem 0;
}

.islamic-border::before {
  content: '✦ ✦ ✦';
  display: block;
  text-align: center;
  color: var(--gold-bright);
  font-size: .65rem;
  letter-spacing: .6rem;
}

/* ── Badges ── */
.badge {
  display: inline-block;
  padding: .15rem .6rem;
  font-size: .7rem;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-family: sans-serif;
}

.badge-green { background: var(--light-green); color: var(--deep-green); border: 1px solid var(--border-green); }
.badge-gold  { background: var(--gold-bright); color: #1a1000; font-weight: bold; }

/* ── Utility ── */
.text-center { text-align: center; }
.text-gold   { color: var(--gold); }
.text-green  { color: var(--deep-green); }
.text-muted  { color: var(--text-muted); }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .with-sidebar { grid-template-columns: 1fr; }
  .sidebar { position: static; }
}

@media (max-width: 680px) {
  .header-inner { height: 60px; }
  .site-brand .brand-title { font-size: 1.1rem; }

  .nav-toggle { display: block; }
  .nav-inner {
    display: none;
    flex-direction: column;
    padding: .5rem 1.5rem 1rem;
    background: var(--nav-bg);
  }
  .nav-inner.open { display: flex; }
  .nav-inner a {
    padding: .6rem 0;
    border-bottom: 1px solid rgba(255,255,255,.08);
    border-right: none;
  }

  .hero { padding: 3rem 1.5rem; }
  .cards-grid { grid-template-columns: 1fr; }
  .video-grid { grid-template-columns: 1fr; }
  .footer-links { flex-direction: column; align-items: center; }

  /* Category block images — full width on mobile */
  .category-block .container > div > div:first-child {
    width: 100% !important;
    padding-top: 0 !important;
  }
  .category-block .container > div > div:first-child img {
    width: 100% !important;
    max-width: 100% !important;
    height: 200px !important;
    object-fit: cover;
  }
  .category-block .container > div {
    flex-direction: column !important;
  }

  /* Constrain any remaining fixed-width content */
  .content-wrap table { display: block; overflow-x: auto; }
  pre, code { white-space: pre-wrap; word-break: break-word; }
}

/* ============================================
   ANIMATIONS & TRANSITIONS
   ============================================ */

/* ── Keyframes ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(32px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(.92); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes goldPulse {
  0%, 100% { text-shadow: 0 0 0px transparent; }
  50%       { text-shadow: 0 0 18px rgba(201,162,39,.55); }
}
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}
@keyframes lineGrow {
  from { width: 0; }
  to   { width: 100%; }
}
@keyframes borderGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201,162,39,0); }
  50%       { box-shadow: 0 0 16px 2px rgba(201,162,39,.3); }
}
@keyframes slideInNav {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes dotBounce {
  0%, 100% { transform: scaleY(1); }
  50%       { transform: scaleY(1.5); }
}

/* ── Page entry ── */
body {
  animation: fadeIn .5s ease both;
}

/* ── Header scroll shadow ── */
#site-header {
  transition: box-shadow .3s ease, background .3s ease;
}
#site-header.scrolled {
  box-shadow: 0 4px 24px rgba(0,0,0,.28);
}

/* ── Site brand logo ── */
.site-brand img {
  transition: transform .35s ease, filter .35s ease;
}
.site-brand img:hover {
  transform: scale(1.07) rotate(-1deg);
  filter: brightness(1.1) drop-shadow(0 2px 8px rgba(201,162,39,.4));
}

/* ── Nav links ── */
.nav-inner a {
  position: relative;
  transition: color .25s ease;
}
.nav-inner a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 2px;
  background: var(--gold-bright);
  transition: width .3s ease;
  border-radius: 1px;
}
.nav-inner a:hover::after,
.nav-inner a.active::after { width: 100%; }

/* ── Hero text ── */
.hero h1 {
  animation: fadeInDown .8s ease both;
}
.hero p, .hero .hero-sub {
  animation: fadeInUp .9s .2s ease both;
}
.hero .btn, .hero a[class*="btn"] {
  animation: fadeInUp .9s .4s ease both;
}

/* ── Gold shimmer on h1 in hero ── */
.hero h1 {
  background: linear-gradient(
    90deg,
    var(--gold-bright) 0%,
    #fff8dc 40%,
    var(--gold-bright) 60%,
    #c9a227 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeInDown .8s ease both, shimmer 4s 1s linear infinite;
}

/* ── Page header ── */
.page-header h1 {
  animation: pageTitleIn .85s cubic-bezier(.22,.61,.36,1) both;
}
.page-header .breadcrumb {
  animation: fadeIn .6s .1s ease both;
}
.page-header .page-meta,
.page-header .tags {
  animation: fadeIn .7s .25s ease both;
}

@keyframes pageTitleIn {
  0%   { opacity: 0; transform: translateY(22px) scale(.97); letter-spacing: .12em; }
  60%  { opacity: 1; }
  100% { opacity: 1; transform: translateY(0) scale(1); letter-spacing: normal; }
}

/* ── Scroll-reveal base ── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .65s ease, transform .65s ease;
}
.reveal.from-left  { transform: translateX(-20px); }
.reveal.from-right { transform: translateX(20px); }
.reveal.scale-in   { transform: scale(.94); }

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* Stagger delays for siblings */
.reveal:nth-child(2)  { transition-delay: .08s; }
.reveal:nth-child(3)  { transition-delay: .16s; }
.reveal:nth-child(4)  { transition-delay: .24s; }
.reveal:nth-child(5)  { transition-delay: .32s; }
.reveal:nth-child(6)  { transition-delay: .40s; }
.reveal:nth-child(7)  { transition-delay: .48s; }
.reveal:nth-child(8)  { transition-delay: .56s; }

/* ── Cards ── */
.card {
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 12px 32px rgba(0,0,0,.13);
  border-color: var(--gold-bright);
}

/* ── Buttons ── */
.btn, a.btn, button.btn {
  position: relative;
  overflow: hidden;
  transition: background .25s ease, color .25s ease,
              transform .2s ease, box-shadow .25s ease;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.18);
  transform: translateX(-100%) skewX(-15deg);
  transition: transform .4s ease;
}
.btn:hover::after { transform: translateX(110%) skewX(-15deg); }
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,.18);
}
.btn:active { transform: translateY(0) scale(.97); }

/* ── Images ── */
img:not(.site-brand img):not(.video-thumb) {
  transition: transform .4s ease, filter .4s ease;
}
.card img:hover,
.sidebar-block img:hover {
  transform: scale(1.04);
  filter: brightness(1.05);
}

/* ── Section headings underline animate ── */
h2::after {
  content: '';
  display: block;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--gold-bright), transparent);
  border-radius: 2px;
  margin-top: .35rem;
  transition: width .6s ease;
}
h2.visible::after,
.reveal.visible h2::after { width: 60px; }

/* ── Tags ── */
.tag {
  transition: background .2s ease, color .2s ease, transform .2s ease;
}
.tag:hover {
  background: var(--gold-bright);
  color: var(--deep-green);
  transform: scale(1.08);
}

/* ── Footer ── */
#site-footer {
  animation: fadeInUp .6s ease both;
}
.footer-links a {
  position: relative;
  transition: color .2s ease;
}
.footer-links a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 1px;
  background: var(--gold-bright);
  transition: width .25s ease;
}
.footer-links a:hover::after { width: 100%; }

/* ── Islamic border animated ── */
.islamic-border {
  animation: borderGlow 3s ease-in-out infinite;
}

/* ── Timeline items ── */
.tl-item {
  transition: transform .3s ease, box-shadow .3s ease, border-left-color .3s ease;
}
.tl-item:hover {
  transform: translateX(6px);
}

/* ── Video cards ── */
.video-card {
  transition: transform .3s ease, box-shadow .3s ease;
}
.video-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 28px rgba(0,0,0,.15);
}

/* ── Sidebar blocks ── */
.sidebar-block {
  transition: box-shadow .3s ease;
}
.sidebar-block:hover {
  box-shadow: 0 4px 18px rgba(0,0,0,.1);
}

/* ── Category section titles (Moorish History, Nationality & Law, etc.) ── */
.category-block h2 {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .7s cubic-bezier(.22,.61,.36,1),
              transform .7s cubic-bezier(.22,.61,.36,1);
}
.category-block h2.visible {
  opacity: 1;
  transform: translateY(0);
}
/* Gold underline grows in after title appears */
.category-block h2.visible::after {
  width: 60px;
  transition: width .5s .4s ease;
}

/* Subtitle paragraph under each section title */
.category-block .section-title p {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .6s .2s ease, transform .6s .2s ease;
}
.category-block .section-title p.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Section images slide in from the left */
.category-block img {
  opacity: 0;
  transform: translateX(-16px) scale(.97);
  transition: opacity .75s ease, transform .75s ease;
}
.category-block img.visible {
  opacity: 1;
  transform: translateX(0) scale(1);
}

/* ── Reduce motion for accessibility ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
