/*
Theme Name: Alzanki Heritage
Theme URI: https://alzanki.me/
Author: Built for the Alzanki Family
Author URI: https://alzanki.me/
Description: قالب عربي أنيق مصمّم لتوثيق تاريخ وإرث أسرة الزنكي في الكويت. An elegant, fully RTL Arabic heritage theme focused on readability, refined typography, and clean SEO-friendly markup.
Version: 1.0.8
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: alzanki-heritage
Tags: rtl-language-support, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, blog
*/

/* ==========================================================================
   1. Design Tokens
   ========================================================================== */
:root {
  /* Heritage palette — warm ivory, deep emerald, antique gold */
  --bg:          #FBF7EF;   /* warm ivory page */
  --surface:     #FFFFFF;   /* cards */
  --surface-2:   #F3ECDE;   /* sand panel */
  --ink:         #2B2620;   /* warm near-black text */
  --ink-soft:    #5A5247;   /* secondary text */
  --primary:     #14463B;   /* deep emerald / petrol */
  --primary-deep:#0E322B;
  --gold:        #B5893B;   /* antique gold accent */
  --gold-soft:   #D8B871;
  --line:        #E4DAC6;   /* hairline borders */
  --shadow:      0 18px 40px -24px rgba(20, 70, 59, .35);

  --maxw: 1180px;
  --readw: 900px;          /* comfortable reading measure for Arabic prose */
  --radius: 14px;

  --font-display: "Reem Kufi", "Amiri", serif;
  --font-body:    "Tajawal", "IBM Plex Sans Arabic", system-ui, sans-serif;

  --step: clamp(1rem, .95rem + .25vw, 1.18rem);
}

/* ==========================================================================
   2. Reset & Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step);
  line-height: 1.95;            /* generous for Arabic readability */
  font-feature-settings: "liga" 1, "calt" 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  /* subtle geometric heritage texture */
  background-image:
    radial-gradient(circle at 1px 1px, rgba(20,70,59,.04) 1px, transparent 0);
  background-size: 22px 22px;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--gold); }

/* IMPORTANT: never letter-space Arabic — it breaks letter joining */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--primary-deep);
  line-height: 1.4;
  font-weight: 700;
  margin: 0 0 .6em;
  letter-spacing: 0;
}
h1 { font-size: clamp(1.9rem, 1.4rem + 2.4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.1rem); }
h3 { font-size: clamp(1.25rem, 1.1rem + .7vw, 1.5rem); }
p  { margin: 0 0 1.2em; }

::selection { background: var(--gold-soft); color: var(--primary-deep); }

/* ==========================================================================
   3. Layout helpers
   ========================================================================== */
.wrap { width: min(var(--maxw), 92%); margin-inline: auto; }
.section { padding-block: clamp(3rem, 6vw, 5.5rem); }
.eyebrow {
  font-family: var(--font-display);
  color: var(--gold);
  font-size: .95rem;
  display: inline-flex; align-items: center; gap: .6rem;
  margin-bottom: .7rem;
}
.eyebrow::before { content: ""; width: 34px; height: 2px; background: var(--gold); display: inline-block; }

/* decorative gold rule */
.rule { border: 0; height: 1px; background: var(--line); margin: 2.5rem 0; }
.rule-ornament { text-align: center; margin: 3rem 0; color: var(--gold); }
.rule-ornament::before { content: "✦ ✦ ✦"; letter-spacing: .8rem; font-size: .9rem; }

/* ==========================================================================
   4. Header / Navigation
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header__bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-block: .9rem;
}
.brand { display: flex; align-items: center; gap: .8rem; }
.brand img { width: 52px; height: 52px; border-radius: 50%; box-shadow: 0 0 0 1px var(--line); }
.brand__name { font-family: var(--font-display); font-size: 1.3rem; color: var(--primary-deep); font-weight: 700; }
.brand__tag { font-size: .8rem; color: var(--ink-soft); margin-top: -2px; }

.main-nav ul { list-style: none; display: flex; gap: .3rem; margin: 0; padding: 0; flex-wrap: wrap; }
.main-nav a {
  display: block; padding: .5rem .9rem; border-radius: 999px;
  color: var(--ink); font-weight: 500; font-size: .98rem;
  position: relative;
}
.main-nav a:hover,
.main-nav .current-menu-item > a { color: var(--primary-deep); background: var(--surface-2); }
.main-nav .sub-menu {
  position: absolute; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: .4rem; min-width: 220px; box-shadow: var(--shadow);
  display: none; flex-direction: column; margin-top: .4rem;
}
.main-nav li:hover > .sub-menu { display: flex; }

.nav-toggle {
  display: none; background: var(--primary); color: #fff; border: 0;
  width: 46px; height: 46px; border-radius: 12px; cursor: pointer;
  font-size: 1.3rem; align-items: center; justify-content: center;
}

/* ==========================================================================
   5. Hero
   ========================================================================== */
.hero { position: relative; overflow: hidden; background: linear-gradient(180deg, var(--primary), var(--primary-deep)); }
.hero__media { position: absolute; inset: 0; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; }
.hero__media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(14,50,43,.35), rgba(14,50,43,.85));
}
.hero__inner {
  position: relative; z-index: 2;
  padding-block: clamp(5rem, 14vw, 9rem);
  color: #fff; max-width: 760px;
}
.hero h1 { color: #fff; margin-bottom: .4em; }
.hero p { color: #F1E8D6; font-size: clamp(1.05rem, 1rem + .5vw, 1.3rem); }
.hero .eyebrow { color: var(--gold-soft); }
.hero .eyebrow::before { background: var(--gold-soft); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-display); font-weight: 500; font-size: 1rem;
  padding: .85rem 1.6rem; border-radius: 999px; cursor: pointer;
  border: 1px solid transparent; transition: transform .2s ease, background .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--gold); color: var(--primary-deep); }
.btn--primary:hover { background: var(--gold-soft); color: var(--primary-deep); }
.btn--ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.btn--ghost:hover { background: rgba(255,255,255,.12); color:#fff; }
.btn-row { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.6rem; }

/* ==========================================================================
   6. Intro / About band
   ========================================================================== */
.band { background: var(--primary); color: #F4ECDC; }
.band h2 { color: #fff; }
.band .eyebrow { color: var(--gold-soft); }
.band .eyebrow::before { background: var(--gold-soft); }
.band p { color: #E4DAC6; max-width: var(--readw); }

/* ==========================================================================
   7. Gallery / cards grid
   ========================================================================== */
.grid {
  display: grid; gap: 1.6rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: transform .25s ease, box-shadow .25s ease;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 26px 50px -24px rgba(20,70,59,.45); }
.card__media { aspect-ratio: 4/3; overflow: hidden; background: var(--surface-2); }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card:hover .card__media img { transform: scale(1.05); }
.card__body { padding: 1.2rem 1.3rem 1.4rem; }
.card__body h3 { margin-bottom: .4rem; }
.card__meta { font-size: .85rem; color: var(--gold); margin-bottom: .5rem; }
.card__excerpt { color: var(--ink-soft); font-size: .96rem; line-height: 1.8; }

/* ==========================================================================
   8. Single / Page content — reading experience
   ========================================================================== */
.page-hero {
  background: var(--surface-2); border-bottom: 1px solid var(--line);
  padding-block: clamp(2.5rem, 6vw, 4rem); text-align: center;
}
.breadcrumbs { font-size: .85rem; color: var(--ink-soft); margin-bottom: .8rem; }
.breadcrumbs a { color: var(--gold); }

.entry { width: min(var(--readw), 92%); margin-inline: auto; padding-block: clamp(2.5rem, 6vw, 4rem); }
.entry__content { font-size: 1.12rem; line-height: 2.05; }
.entry__content h2 { margin-top: 2.2rem; }
.entry__content h3 { margin-top: 1.8rem; }
.entry__content img { border-radius: var(--radius); margin: 1.8rem auto; box-shadow: var(--shadow); }
.entry__content figure { margin: 1.8rem 0; }
.entry__content figcaption { text-align: center; color: var(--ink-soft); font-size: .9rem; margin-top: .6rem; }
.entry__content blockquote {
  border-inline-start: 4px solid var(--gold); background: var(--surface-2);
  margin: 1.8rem 0; padding: 1.2rem 1.6rem; border-radius: 0 var(--radius) var(--radius) 0;
  font-family: var(--font-display); color: var(--primary-deep); font-size: 1.15rem;
}
.entry__content ul, .entry__content ol { padding-inline-start: 1.4rem; }
.entry__content li { margin-bottom: .5rem; }
.entry__content a { border-bottom: 1px solid var(--gold-soft); }

/* ==========================================================================
   9. Footer
   ========================================================================== */
.site-footer { background: var(--primary-deep); color: #D9CFBC; padding-block: 3rem 2rem; margin-top: 3rem; }
.site-footer a { color: var(--gold-soft); }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: 1.4fr 1fr 1fr; }
.footer-brand__name { font-family: var(--font-display); font-size: 1.3rem; color: #fff; }
.footer-widgets h4 { color: #fff; font-size: 1.05rem; margin-bottom: .8rem; }
.footer-widgets ul { list-style: none; margin: 0; padding: 0; }
.footer-widgets li { margin-bottom: .5rem; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.12); margin-top: 2.2rem; padding-top: 1.4rem;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: .8rem;
  font-size: .85rem; color: #A99F8C;
}
.social-row { display: flex; gap: .8rem; }
.social-row a {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.08); color:#fff;
}
.social-row a:hover { background: var(--gold); color: var(--primary-deep); }

/* ==========================================================================
   10. Pagination / misc
   ========================================================================== */
.pagination { display: flex; gap: .5rem; justify-content: center; margin-top: 2.5rem; flex-wrap: wrap; }
.pagination .page-numbers {
  padding: .55rem .95rem; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink);
}
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }

.search-form { display: flex; gap: .5rem; }
.search-form input[type="search"] {
  flex: 1; padding: .7rem 1rem; border: 1px solid var(--line); border-radius: 10px;
  font-family: var(--font-body); font-size: 1rem; background: var(--surface);
}
.search-form button { border: 0; }

.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ==========================================================================
   11. Reveal animation (progressive enhancement)
   ========================================================================== */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ==========================================================================
   12. Responsive
   ========================================================================== */
@media (max-width: 880px) {
  .footer-grid { grid-template-columns: 1fr; }
  .nav-toggle { display: inline-flex; }
  .main-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 1rem 4%; box-shadow: var(--shadow);
    visibility: hidden; opacity: 0; transform: translateY(-8px);
    transition: opacity .25s ease, transform .25s ease, visibility .25s;
  }
  .main-nav.is-open { visibility: visible; opacity: 1; transform: none; }
  .main-nav ul { flex-direction: column; gap: .2rem; }
  .main-nav .sub-menu { position: static; box-shadow: none; border: 0; padding-inline-start: 1rem; display: flex; }
}
