/* Alkhayre Heritage — Desert Bronze & Arabian Turquoise Cultural Almanac RTL Stylesheet */
:root {
  --ak-bronze: #78350F;
  --ak-teal: #0F766E;
  --ak-ivory: #FDFBF7;
  --ak-clay: #F5EFE6;
  --ak-ink: #291D14;
  --ak-muted: #6B5749;
  --ak-border: #E5D7C3;
  --ak-display: 'Noto Naskh Arabic', Georgia, serif;
  --ak-body: 'Almarai', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { font-size: 16px; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--ak-body);
  background: var(--ak-ivory);
  color: var(--ak-ink);
  line-height: 1.75;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--ak-teal); }
img { max-width: 100%; height: auto; display: block; }

.ak-container { width: min(1220px, 100% - 32px); margin-inline: auto; }
.ak-narrow { width: min(860px, 100% - 32px); margin-inline: auto; }
.ak-sr-only, .ak-skip-link { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* Centered Crest Symmetrical Header */
.ak-header {
  background: #FFFFFF;
  border-bottom: 3px double var(--ak-bronze);
  position: sticky;
  top: 0;
  z-index: 1200;
}
body.admin-bar .ak-header { top: 32px; }
.ak-sym-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  min-height: 74px;
}
.ak-sym-side { display: flex; align-items: center; gap: 14px; font-weight: 700; font-size: 14px; }
.ak-sym-side a.is-active, .ak-sym-side a:hover { color: var(--ak-teal); }
.ak-emblem-center { display: inline-flex; align-items: center; gap: 10px; justify-content: center; text-align: center; }
.ak-logo-img { width: auto; max-width: 138px; height: 34px; object-fit: contain; }
.ak-crest {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--ak-bronze); color: #FDFBF7; font-size: 20px;
}
.ak-emblem-center span { display: flex; flex-direction: column; }
.ak-emblem-center strong { font-family: var(--ak-display); font-size: 1.35rem; color: var(--ak-bronze); line-height: 1.1; }
.ak-emblem-center small { font-size: 11px; color: var(--ak-muted); }

.ak-sym-end { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.ak-tools { display: flex; gap: 6px; }
.ak-tool-btn {
  width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid var(--ak-border); background: var(--ak-clay);
  display: inline-grid; place-items: center; cursor: pointer;
}
.ak-search-strip { background: var(--ak-clay); border-top: 1px solid var(--ak-border); padding-block: 12px; }
.ak-search-form { display: flex; gap: 8px; }
.ak-search-form input { flex: 1; padding: 10px 14px; border: 1px solid var(--ak-bronze); border-radius: 8px; background: #fff; font-family: inherit; }
.ak-search-form button { padding: 10px 20px; background: var(--ak-teal); color: #fff; border: 0; border-radius: 8px; font-family: inherit; font-weight: 700; cursor: pointer; }

/* Drawer */
.ak-drawer { position: fixed; inset: 0; z-index: 4000; pointer-events: none; opacity: 0; transition: opacity 0.2s; }
.ak-drawer.is-open { pointer-events: auto; opacity: 1; }
.ak-drawer-backdrop { position: absolute; inset: 0; background: rgba(41,29,20,0.5); }
.ak-drawer-sheet {
  position: relative; width: min(340px, 88vw); height: 100%;
  background: var(--ak-ivory); border-left: 2px solid var(--ak-bronze);
  padding: 20px; overflow-y: auto;
}
body.admin-bar .ak-drawer-sheet { padding-top: 52px; }
.ak-drawer-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 12px; border-bottom: 2px solid var(--ak-bronze); margin-bottom: 12px; }
.ak-close-btn { border: 1px solid var(--ak-border); background: var(--ak-clay); width: 32px; height: 32px; border-radius: 8px; cursor: pointer; }
.ak-drawer-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ak-drawer-list a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 12px; background: #fff; border: 1px solid var(--ak-border); border-radius: 8px; font-weight: 700; font-size: 13.5px;
}
.ak-drawer-list em { font-style: normal; color: var(--ak-teal); font-size: 12px; }
.ak-drawer-foot { display: flex; gap: 8px; margin-top: 16px; }
.ak-drawer-foot a { flex: 1; text-align: center; padding: 9px; border-radius: 8px; background: var(--ak-bronze); color: #fff; font-weight: 700; font-size: 13px; }

/* Hero + Cultural Index + Timeline */
.ak-hero-band { padding-block: 28px; }
.ak-hero-card {
  display: grid; grid-template-columns: 1fr 1.15fr; gap: 24px; align-items: center;
  background: var(--ak-clay); border: 1px solid var(--ak-border); border-radius: 18px;
  padding: clamp(18px, 3vw, 32px);
}
.ak-badge {
  display: inline-block;
  background: #FEF3C7; color: var(--ak-bronze); border: 1px solid #FDE68A;
  padding: 4px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
}
.ak-hero-copy h1 { font-family: var(--ak-display); font-size: clamp(1.6rem, 3vw, 2.3rem); line-height: 1.35; margin: 12px 0; color: var(--ak-bronze); }
.ak-hero-copy p { margin: 0 0 18px; color: var(--ak-muted); }
.ak-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.ak-btn-teal, .ak-btn-bronze {
  display: inline-block; padding: 10px 20px; border-radius: 10px; font-family: inherit; font-weight: 700; font-size: 14px; border: 0; cursor: pointer;
}
.ak-btn-teal { background: var(--ak-teal); color: #fff; }
.ak-btn-bronze { background: var(--ak-bronze); color: #fff; }

.ak-lead-frame { background: #fff; border: 1px solid var(--ak-border); border-radius: 14px; overflow: hidden; }
.ak-lead-media { display: block; aspect-ratio: 16 / 10; overflow: hidden; }
.ak-lead-img, .ak-time-img, .ak-card-img, .ak-single-img { width: 100%; height: 100%; object-fit: cover; }
.ak-lead-cap { padding: 14px 18px; }
.ak-lead-cap h2 { font-family: var(--ak-display); margin: 6px 0 0; font-size: 1.25rem; line-height: 1.4; }
.ak-teal-pill { display: inline-block; background: #CCFBF1; color: var(--ak-teal); padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }

.ak-arch-fallback {
  width: 100%; height: 100%; background: linear-gradient(135deg, var(--ak-bronze), var(--ak-teal));
  color: #fff; display: grid; place-items: center; padding: 20px; text-align: center;
}
.ak-arch-fallback span { font-size: 26px; }

/* Diwans Index */
.ak-diwans-band { padding-block: 22px; }
.ak-sec-head { margin-bottom: 16px; }
.ak-kicker { color: var(--ak-teal); font-weight: 700; font-size: 13px; }
.ak-sec-head h2 { margin: 2px 0 0; font-family: var(--ak-display); font-size: 1.6rem; color: var(--ak-bronze); }
.ak-diwans-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.ak-diwan-tile {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--ak-border); border-radius: 10px;
  padding: 10px 12px; font-size: 13.5px;
}
.ak-diwan-tile span { color: var(--ak-bronze); }
.ak-diwan-tile em { margin-right: auto; font-style: normal; font-size: 12px; color: var(--ak-teal); font-weight: 700; }
.ak-diwan-tile:hover { border-color: var(--ak-teal); background: var(--ak-clay); }

/* Chronological Timeline Feed */
.ak-timeline-band { padding-block: 28px; }
.ak-timeline { position: relative; border-right: 3px solid var(--ak-teal); padding-right: 26px; display: grid; gap: 22px; }
.ak-time-node { position: relative; display: grid; gap: 8px; }
.ak-time-marker { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; color: var(--ak-bronze); }
.ak-dot { position: absolute; right: -34px; width: 13px; height: 13px; border-radius: 50%; background: var(--ak-teal); border: 2px solid var(--ak-ivory); }
.ak-time-card {
  display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 18px; align-items: center;
  background: #fff; border: 1px solid var(--ak-border); border-radius: 14px; overflow: hidden; padding: 14px;
}
.ak-time-media { display: block; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; }
.ak-time-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ak-muted); margin-bottom: 6px; }
.ak-time-body h3 { font-family: var(--ak-display); margin: 0 0 6px; font-size: 1.2rem; line-height: 1.4; }
.ak-time-body p { margin: 0; font-size: 14px; color: var(--ak-muted); }

/* Single Post + Sticky Glossary */
.ak-single-head { background: var(--ak-clay); border-bottom: 1px solid var(--ak-border); padding-block: 28px; margin-bottom: 24px; }
.ak-crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--ak-muted); margin-bottom: 8px; }
.ak-single-head h1 { font-family: var(--ak-display); margin: 0 0 10px; font-size: clamp(1.6rem, 3vw, 2.3rem); line-height: 1.35; color: var(--ak-bronze); }
.ak-byline { font-size: 13.5px; color: var(--ak-muted); display: flex; flex-wrap: wrap; gap: 8px; }
.ak-single-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 22px; align-items: start; }
.ak-parchment-card { background: #fff; border: 1px solid var(--ak-border); border-radius: 14px; padding: clamp(18px, 3vw, 28px); }
.ak-single-media { margin: 0 0 20px; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; }
.ak-prose { font-size: 17px; line-height: 1.85; }
.ak-related-split { margin-top: 28px; padding-top: 20px; border-top: 2px solid var(--ak-clay); }
.ak-related-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ak-rel-item { background: var(--ak-clay); padding: 14px; border-radius: 10px; display: grid; gap: 4px; font-weight: 700; }
.ak-rel-item time { font-size: 12px; color: var(--ak-muted); font-weight: 400; }

.ak-glossary-aside { position: sticky; top: 90px; }
.ak-glossary-box { background: #fff; border: 1px solid var(--ak-border); border-top: 3px solid var(--ak-teal); border-radius: 12px; padding: 18px; }
.ak-glossary-box h2 { font-family: var(--ak-display); margin: 0 0 12px; font-size: 1.2rem; color: var(--ak-bronze); }
.ak-glossary-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ak-glossary-list a { display: flex; justify-content: space-between; padding: 7px 10px; background: var(--ak-ivory); border-radius: 8px; font-size: 13.5px; font-weight: 700; }
.ak-glossary-list em { font-style: normal; color: var(--ak-teal); font-size: 12px; }

/* Archives, About & Contact */
.ak-archive-hero { background: var(--ak-clay); border-bottom: 1px solid var(--ak-border); padding-block: 26px; }
.ak-archive-hero h1 { font-family: var(--ak-display); margin: 8px 0; font-size: clamp(1.5rem, 2.8vw, 2.2rem); color: var(--ak-bronze); }
.ak-diwans-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.ak-diwans-bar a { padding: 5px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--ak-border); font-size: 13px; font-weight: 700; }
.ak-diwans-bar a.is-active, .ak-diwans-bar a:hover { background: var(--ak-teal); border-color: var(--ak-teal); color: #fff; }
.ak-archive-body, .ak-page-wrap, .ak-about-wrap, .ak-contact-wrap { padding-block: 28px; }
.ak-cards-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.ak-card { background: #fff; border: 1px solid var(--ak-border); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.ak-card-media { display: block; aspect-ratio: 16 / 10; overflow: hidden; }
.ak-card-body { padding: 14px 16px; display: grid; gap: 8px; }
.ak-card-body h2 { font-family: var(--ak-display); margin: 0; font-size: 1.1rem; line-height: 1.4; }
.ak-card-body p { margin: 0; font-size: 13.5px; color: var(--ak-muted); }
.ak-pager .nav-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.ak-pager .page-numbers { padding: 7px 14px; border-radius: 8px; background: #fff; border: 1px solid var(--ak-border); font-weight: 700; }
.ak-pager .page-numbers.current { background: var(--ak-teal); color: #fff; border-color: var(--ak-teal); }
.ak-empty-box { background: #fff; border: 1px solid var(--ak-border); border-radius: 14px; padding: 28px; text-align: center; }

.ak-about-parchment { background: var(--ak-clay); border: 1px solid var(--ak-border); border-radius: 16px; padding: 26px; margin-bottom: 22px; }
.ak-about-parchment h1 { font-family: var(--ak-display); color: var(--ak-bronze); margin: 10px 0; }
.ak-values-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
.ak-value-box { background: #fff; border: 1px solid var(--ak-border); border-radius: 12px; padding: 18px; }
.ak-value-box span { font-family: var(--ak-display); font-size: 1.4rem; color: var(--ak-teal); font-weight: 700; }

.ak-contact-grid { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 22px; align-items: start; }
.ak-majlis-card { background: var(--ak-clay); border: 1px solid var(--ak-border); border-radius: 14px; padding: 24px; display: grid; gap: 12px; }
.ak-majlis-card h1 { font-family: var(--ak-display); margin: 4px 0; color: var(--ak-bronze); }
.ak-majlis-details { display: grid; gap: 10px; }
.ak-majlis-details small { display: block; color: var(--ak-muted); }
.ak-alert { padding: 12px; border-radius: 8px; margin-bottom: 12px; font-weight: 700; }
.ak-alert.is-success { background: #ECFDF5; color: #065F46; border: 1px solid #059669; }
.ak-alert.is-error { background: #FEF2F2; color: #991B1B; border: 1px solid #DC2626; }
.ak-hp { display: none; }
.ak-form-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ak-field { display: grid; gap: 6px; margin-bottom: 12px; }
.ak-field label { font-weight: 700; font-size: 14px; }
.ak-field input, .ak-field textarea { padding: 10px 12px; border: 1px solid var(--ak-border); border-radius: 8px; font-family: inherit; background: var(--ak-ivory); }

/* Footer */
.ak-footer { background: var(--ak-bronze); color: #FDFBF7; padding-top: 30px; margin-top: 30px; }
.ak-footer-grid { display: grid; grid-template-columns: 1.1fr 0.8fr 1.6fr; gap: 22px; padding-bottom: 22px; border-bottom: 1px solid rgba(255,255,255,0.18); }
.ak-footer h2 { font-family: var(--ak-display); margin: 0 0 8px; }
.ak-footer h3 { margin: 0 0 10px; font-size: 1rem; color: #FDE68A; }
.ak-footer-meta { display: grid; gap: 5px; font-size: 13.5px; margin-top: 10px; }
.ak-footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.ak-footer-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ak-footer-tags a { padding: 4px 10px; border-radius: 6px; background: rgba(255,255,255,0.12); font-size: 12.5px; }
.ak-footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding-block: 14px; font-size: 13px; color: #FDE68A; }

@media (max-width: 960px) {
  .ak-sym-side { display: none; }
  .ak-sym-bar { grid-template-columns: 1fr auto; }
  .ak-hero-card, .ak-single-layout, .ak-contact-grid, .ak-footer-grid { grid-template-columns: minmax(0, 1fr); }
  .ak-cards-3, .ak-values-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .ak-time-card, .ak-cards-3, .ak-values-4, .ak-form-2, .ak-related-2 { grid-template-columns: minmax(0, 1fr); }
}
