/*
Theme Name: Tariqa Qadiriyya Razikiya
Theme URI: https://localhost:8080/
Author: Local Dev
Description: WordPress theme for The Qadiriyya Razikiya Sufi Order (الطريقة القادرية الرازقية)
Version: 5.9.5
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 8.1
Text Domain: kasnazan-clone
*/

/* ═══════════════════════════════════════════════════════════════════════
   1. CSS VARIABLES (matched to kasnazan.com)
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  --kas-bg: #001915;
  --kas-bg-dark: #001b16;
  --kas-accent: #f2ab41;
  --kas-accent-dark: #d19b21;
  --kas-accent-hover: #dd9120;
  --kas-heading-gold: #d9b460;
  --kas-footer-bg: #121212;
  --kas-text: #ffffff;
  --kas-text-muted: #a8a8a8;
  --kas-nav-text: #a3a8d6;
  --kas-card-border: #dcb013;
  --kas-gradient-end: #032E27;
  --kas-btn-primary: #0095eb;
  --kas-btn-primary-hover: #007cc3;
  --kas-container: 1100px;
  --kas-footer-text: #737373;
  --kas-footer-link: #808080;
  --kas-footer-link-hover: #f2ab41;
  --kas-shadow: 6px 6px 9px rgba(0,0,0,0.2);
  --kas-shadow-deep: 12px 12px 50px rgba(0,0,0,0.4);
  --kas-font: "Noto Kufi Arabic", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ═══════════════════════════════════════════════════════════════════════
   2. CSS RESET & BASE
   ═══════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body, h1, h2, h3, h4, h5, h6, p, ul, ol, figure, blockquote { margin: 0; padding: 0; }
img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
input, textarea, select { font: inherit; }

/* ═══════════════════════════════════════════════════════════════════════
   3. TYPOGRAPHY (matched to kasnazan.com sizes)
   ═══════════════════════════════════════════════════════════════════════ */

body {
  font-family: var(--kas-font);
  font-size: 16px;
  font-weight: 400;
  line-height: 26px;
  color: var(--kas-text);
  background: var(--kas-bg);
}

h1 { font-size: 70px; font-weight: 600; line-height: 70px; margin-bottom: 0.5em; color: var(--kas-heading-gold); }
h2 { font-size: 55px; font-weight: 600; line-height: 60px; margin-bottom: 0.5em; color: var(--kas-heading-gold); }
h3 { font-size: 36px; font-weight: 600; line-height: 46px; margin-bottom: 0.5em; }
h4 { font-size: 24px; font-weight: 500; line-height: 34px; margin-bottom: 0.5em; }
h5 { font-size: 18px; font-weight: 600; line-height: 1.4; }
h6 { font-size: 16px; font-weight: 600; line-height: 1.4; }

p { margin-bottom: 1.2em; }
strong { font-weight: 700; }

/* ═══════════════════════════════════════════════════════════════════════
   4. RTL & DIRECTION
   ═══════════════════════════════════════════════════════════════════════ */

body { direction: rtl; text-align: right; }

/* ═══════════════════════════════════════════════════════════════════════
   5. LAYOUT
   ═══════════════════════════════════════════════════════════════════════ */

.kas-container {
  max-width: var(--kas-container);
  margin-left: auto;
  margin-right: auto;
  padding-left: 15px;
  padding-right: 15px;
}

.kas-section {
  padding: 50px 0 60px;
  background-color: var(--kas-bg);
  background-image: url('assets/images/sides1.png');
  background-position: center center;
  background-repeat: no-repeat;
  background-size: contain;
  position: relative;
}

.kas-section-title {
  text-align: center;
  color: var(--kas-heading-gold);
  font-size: 30px;
  font-weight: 600;
  margin-bottom: 35px;
  padding-bottom: 15px;
  position: relative;
}

/* Gold underline beneath section titles */
.kas-section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--kas-accent);
  margin: 12px auto 0;
  border-radius: 2px;
}

.kas-spacer { display: block; }

.kas-two-col {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
}

.kas-two-col > .kas-col {
  flex: 1 1 45%;
  min-width: 280px;
}

.kas-two-col-centered {
  justify-content: center;
  align-items: center;
}

.kas-img-responsive {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

/* Gold horizontal rule separator */
hr.kas-separator {
  border: none;
  height: 2px;
  background: var(--kas-accent);
  max-width: 120px;
  margin: 0 auto;
  opacity: 0.6;
}

/* ═══════════════════════════════════════════════════════════════════════
   6. HEADER (horizontal layout matching kasnazan.com)
   ═══════════════════════════════════════════════════════════════════════ */

.kas-header {
  position: sticky;
  top: 0;
  z-index: 9999;
  background: var(--kas-bg-dark);
  transition: all 0.3s ease;
}

.kas-header.kas-sticky {
  box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.1);
  background: rgba(0, 27, 22, 0.97);
}

.kas-topbar {
  padding: 0;
}

.kas-topbar .kas-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* Logo */
.kas-logo {
  text-align: center;
  padding: 15px 0 5px;
}

.kas-logo a { display: inline-block; }

.kas-logo-img,
.kas-logo .custom-logo {
  max-height: 100px;
  width: auto;
  transition: max-height 0.3s ease;
}

.kas-sticky .kas-logo-img,
.kas-sticky .kas-logo .custom-logo {
  max-height: 50px;
}

.kas-sticky .kas-logo {
  padding: 8px 0 2px;
}

/* Navigation */
.kas-nav {
  width: 100%;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.kas-menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0;
  margin: 0;
  padding: 0;
}

.kas-menu > li { position: relative; }

.kas-menu > li > a {
  display: block;
  padding: 0 12px;
  line-height: 60px;
  font-size: 14px;
  font-weight: 500;
  color: var(--kas-nav-text);
  transition: color 0.3s ease;
  white-space: nowrap;
  position: relative;
}

/* Active/hover gold underline indicator */
.kas-menu > li > a::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: var(--kas-accent);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.kas-menu > li > a:hover,
.kas-menu > li.current-menu-item > a,
.kas-menu > li.current_page_item > a,
.kas-menu > li.current-menu-ancestor > a {
  color: var(--kas-accent);
}

.kas-menu > li > a:hover::after,
.kas-menu > li.current-menu-item > a::after,
.kas-menu > li.current_page_item > a::after {
  transform: scaleX(1);
}

/* Dropdowns */
.kas-menu .sub-menu {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 240px;
  background: var(--kas-bg-dark);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
  border-top: 3px solid var(--kas-accent);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  padding: 5px 0;
}

.kas-menu > li:hover > .sub-menu,
.kas-menu > li.sub-open > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.kas-menu .sub-menu li a {
  display: block;
  padding: 10px 20px;
  font-size: 14px;
  color: var(--kas-nav-text);
  transition: all 0.3s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.kas-menu .sub-menu li:last-child a {
  border-bottom: none;
}

.kas-menu .sub-menu li a:hover {
  color: var(--kas-accent);
  background: rgba(255, 255, 255, 0.05);
  padding-right: 25px;
}

/* Caret indicators on items that have children */
.kas-menu > li.menu-item-has-children > a > span::after {
  content: ' ▾';
  font-size: 0.8em;
  margin-right: 4px;
  opacity: 0.7;
}
.kas-menu .sub-menu .menu-item-has-children > a::after {
  content: '◂';
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8em;
  opacity: 0.6;
}
.kas-menu .sub-menu .menu-item-has-children > a {
  position: relative;
}

/* Second-level (nested) sub-menu — flies out to the LEFT in RTL */
.kas-menu .sub-menu .sub-menu {
  position: absolute;
  top: 0;
  right: 100%;
  left: auto;
  min-width: 220px;
  background: var(--kas-bg-dark);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 5px 0;
  list-style: none;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateX(10px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
  z-index: 1001;
  pointer-events: none;
}
.kas-menu .sub-menu li:hover > .sub-menu,
.kas-menu .sub-menu li.sub-open > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  pointer-events: auto;
}

/* Mobile Toggle */
.kas-nav-toggle { display: none; }

.kas-hamburger {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 26px;
  height: 20px;
  position: relative;
}

.kas-hamburger span {
  display: block;
  height: 2px;
  background: var(--kas-accent);
  border-radius: 2px;
  transition: all 0.3s ease;
  position: absolute;
  width: 100%;
  left: 0;
}

.kas-hamburger span:nth-child(1) { top: 0; }
.kas-hamburger span:nth-child(2) { top: 9px; }
.kas-hamburger span:nth-child(3) { bottom: 0; }

/* X animation when menu is open */
.kas-mobile-menu-open .kas-hamburger span:nth-child(1) {
  transform: rotate(45deg);
  top: 9px;
}

.kas-mobile-menu-open .kas-hamburger span:nth-child(2) {
  opacity: 0;
}

.kas-mobile-menu-open .kas-hamburger span:nth-child(3) {
  transform: rotate(-45deg);
  bottom: 9px;
}

/* ═══════════════════════════════════════════════════════════════════════
   7. HERO SECTION
   ═══════════════════════════════════════════════════════════════════════ */

.kas-hero { padding: 0; background: none; }

.kas-hero-bg {
  position: relative;
  min-height: 65vh;
  background-size: auto 80%;
  background-position: center center;
  background-repeat: no-repeat;
  background-color: #001915;
  border-radius: 20px;
  margin: 20px 5% 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kas-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,25,21,0.0) 0%, rgba(0,25,21,0.15) 100%);
  z-index: 1;
}

.kas-hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 25px;
  padding: 40px;
}

.kas-hero-logo {
  width: 320px;
  max-width: 70%;
  height: auto;
  filter: drop-shadow(0 4px 20px rgba(0,0,0,0.3));
}

.kas-hero-title-img {
  width: 480px;
  max-width: 85%;
  height: auto;
  filter: drop-shadow(0 2px 10px rgba(0,0,0,0.4));
}

.kas-scroll-down {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--kas-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--kas-bg);
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(242, 171, 65, 0.4);
}

.kas-scroll-down:hover {
  background: var(--kas-accent-hover);
  transform: translateX(-50%) translateY(-3px);
  box-shadow: 0 6px 20px rgba(242, 171, 65, 0.5);
}

.kas-scroll-down svg { width: 20px; height: 20px; }

/* ═══════════════════════════════════════════════════════════════════════
   8. HOMEPAGE SECTIONS
   ═══════════════════════════════════════════════════════════════════════ */

/* Call to World intro */
.kas-section-intro {
  padding-top: 70px;
  padding-bottom: 70px;
}

.kas-section-intro .kas-col:first-child { text-align: center; }

.kas-section-intro .text-gold {
  color: var(--kas-accent);
  font-size: 1.1rem;
}

.kas-section-intro h1 {
  font-size: 70px;
  color: var(--kas-text);
  margin-bottom: 20px;
}

.kas-section-intro h4 {
  color: var(--kas-accent);
  font-size: 24px;
  margin-bottom: 5px;
}

.kas-section-intro .kas-col-text p {
  font-size: 16px;
  line-height: 32px;
  color: var(--kas-text-muted);
  text-align: justify;
}

/* Sheikhs */
.kas-section-sheikhs {
  padding-top: 30px;
  padding-bottom: 50px;
}

.kas-sheikh-card {
  display: block;
  text-align: center;
}

.kas-sheikh-img-wrap {
  position: relative;
  display: inline-block;
  border-radius: 15px;
  overflow: hidden;
  border: 2px solid var(--kas-accent);
  box-shadow: var(--kas-shadow);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  max-width: 300px;
  margin: 0 auto;
}

.kas-sheikh-img-wrap:hover {
  transform: translateY(-5px);
  box-shadow: var(--kas-shadow-deep);
}

.kas-sheikh-img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.4s ease;
}

.kas-sheikh-img-wrap:hover .kas-sheikh-img {
  transform: scale(1.03);
}

.kas-sheikh-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 25, 21, 0.9));
  padding: 30px 15px 15px;
  text-align: center;
}

.kas-sheikh-name {
  color: var(--kas-accent);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.6;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* News */
.kas-section-news {
  background-color: var(--kas-bg);
  padding-top: 50px;
}

/* Social */
.kas-section-social {
  padding-top: 50px;
}

.kas-social-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.kas-social-card {
  background: rgba(255, 255, 255, 0.97);
  color: #333;
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: var(--kas-shadow);
}

.kas-social-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--kas-shadow-deep);
}

.kas-social-card-header {
  padding: 15px;
  border-bottom: 1px solid #eee;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.kas-social-card-body {
  padding: 15px;
  font-size: 0.9rem;
  min-height: 80px;
}

.kas-social-card-footer {
  padding: 10px 15px;
  border-top: 1px solid #eee;
  text-align: left;
}

/* Books / Library Grid */
.kas-section-books {
  padding-top: 50px;
}

.kas-books-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 100%;
  margin: 0 auto;
}

.kas-book-item a {
  display: block;
  text-align: center;
  transition: transform 0.3s ease;
}

.kas-book-item a:hover { transform: translateY(-5px); }

.kas-book-cover {
  background: linear-gradient(180deg, var(--kas-bg) 0%, var(--kas-gradient-end) 100%);
  border: 2px solid var(--kas-accent);
  border-radius: 15px;
  aspect-ratio: 3/4;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  box-shadow: var(--kas-shadow);
  transition: box-shadow 0.3s ease;
}

.kas-book-item a:hover .kas-book-cover {
  box-shadow: var(--kas-shadow-deep);
}

.kas-book-placeholder {
  color: var(--kas-accent);
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  padding: 20px;
}

.kas-book-title {
  color: var(--kas-accent);
  font-size: 0.9rem;
  font-weight: 500;
}

/* Videos */
.kas-section-divider {
  padding: 40px 0;
  background: var(--kas-bg);
  background-image: none;
}

.kas-geometric-divider {
  margin: 0 auto;
  max-width: 120px;
  opacity: 0.7;
}

.kas-section-videos {
  padding-top: 50px;
}

.kas-video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.kas-video-embed { position: relative; }

.kas-video-placeholder {
  aspect-ratio: 16/9;
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid var(--kas-accent);
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--kas-shadow);
}

.kas-video-placeholder:hover {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: var(--kas-shadow-deep);
}

/* Video Card (library page) */
.kas-video-card {
  border-radius: 20px;
  overflow: hidden;
  border: 2px solid var(--kas-accent);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: var(--kas-shadow);
}

.kas-video-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--kas-shadow-deep);
}

.kas-video-card-inner {
  background: linear-gradient(180deg, var(--kas-bg) 80%, var(--kas-gradient-end) 100%);
  height: 100%;
}

.kas-video-card-thumb {
  position: relative;
  overflow: hidden;
}

.kas-video-card-thumb img {
  width: 100%;
  height: auto;
  display: block;
}

.kas-play-icon-old {
  display: none;
}

/* Filter tabs */
.kas-filter-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.kas-filter-tabs .kas-btn-sm {
  background: rgba(255, 255, 255, 0.08);
  color: var(--kas-nav-text);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.kas-filter-tabs .kas-btn-sm:hover,
.kas-filter-tabs .kas-filter-active {
  background: var(--kas-accent);
  color: var(--kas-bg);
  border-color: var(--kas-accent);
}

/* Logos */
.kas-section-logos {
  padding-top: 50px;
}

.kas-logos-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 30px;
  flex-wrap: wrap;
}

.kas-logo-item {
  width: 80px;
  height: 80px;
  background: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  box-shadow: var(--kas-shadow);
  transition: transform 0.3s ease;
}

.kas-logo-item:hover {
  transform: scale(1.1);
}

.kas-logo-item img {
  max-width: 60px;
  max-height: 60px;
  object-fit: contain;
}

/* CTA Banner */
.kas-section-cta-wrap {
  padding: 0 0 60px;
  background: var(--kas-bg);
  background-image: none;
}

.kas-cta-banner {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  padding: 100px 80px;
  background-size: cover;
  background-position: top center;
  background-repeat: no-repeat;
}

.kas-cta-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 25, 21, 0.75);
}

.kas-cta-content {
  position: relative;
  z-index: 2;
  text-align: center;
  font-size: 1.2rem;
  line-height: 2.2;
  color: var(--kas-text);
}

/* ═══════════════════════════════════════════════════════════════════════
   9. POST CARDS (with default shadows like kasnazan.com)
   ═══════════════════════════════════════════════════════════════════════ */

.kas-card {
  border-radius: 20px;
  overflow: hidden;
  border: 2px solid var(--kas-accent);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: var(--kas-shadow);
}

.kas-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--kas-shadow-deep);
}

.kas-card-inner {
  background: linear-gradient(180deg, var(--kas-bg) 80%, var(--kas-gradient-end) 100%);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.kas-card-thumb {
  position: relative;
  padding-bottom: 75%;
  overflow: hidden;
}

/* News carousel cards use portrait ratio */
.kas-carousel-slide .kas-card-thumb {
  padding-bottom: 120%;
}

.kas-card-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 18px 18px 0 0;
  transition: transform 0.4s ease;
}

.kas-card:hover .kas-card-thumb img {
  transform: scale(1.05);
}

.kas-card-thumb-placeholder {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.05);
}

.kas-card-link {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.kas-card-body {
  padding: 18px 15px;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kas-card-title {
  font-size: 15px;
  line-height: 25px;
  text-align: center;
  margin: 0;
}

.kas-card-title a {
  color: var(--kas-accent);
  transition: color 0.3s ease;
}

.kas-card-title a:hover { color: #E39D00; }

/* ═══════════════════════════════════════════════════════════════════════
   10. NEWS CAROUSEL
   ═══════════════════════════════════════════════════════════════════════ */

.kas-carousel {
  position: relative;
  overflow: hidden;
  padding: 0 45px;
}

.kas-carousel-track {
  display: flex;
  gap: 15px;
  transition: transform 0.4s ease;
}

.kas-carousel-slide {
  flex: 0 0 calc((100% - 30px) / 3);
  min-width: 0;
}

.kas-carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--kas-accent);
  color: var(--kas-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 3px 10px rgba(0,0,0,0.3);
}

.kas-carousel-btn:hover {
  background: var(--kas-accent-hover);
  box-shadow: 0 5px 15px rgba(0,0,0,0.4);
}

.kas-carousel-prev { left: 0; }
.kas-carousel-next { right: 0; }

/* ═══════════════════════════════════════════════════════════════════════
   11. BUTTONS (blue primary like kasnazan.com, gold for outline/accent)
   ═══════════════════════════════════════════════════════════════════════ */

.kas-btn {
  display: inline-block;
  background: var(--kas-accent);
  color: var(--kas-bg);
  font-weight: 500;
  padding: 12px 20px;
  border-radius: 0;
  font-size: 14px;
  transition: all 0.3s ease;
  text-align: center;
  border: none;
  cursor: pointer;
  letter-spacing: 0.5px;
}

.kas-btn:hover {
  background: var(--kas-btn-primary-hover);
  color: #fff;
}

.kas-btn-primary {
  background: var(--kas-btn-primary);
  color: #fff;
}

.kas-btn-primary:hover {
  background: var(--kas-btn-primary-hover);
}

.kas-btn-outline {
  background: transparent;
  border: 2px solid var(--kas-accent);
  color: var(--kas-accent);
}

.kas-btn-outline:hover {
  background: var(--kas-accent);
  color: var(--kas-bg);
}

.kas-btn-sm { padding: 8px 20px; font-size: 13px; }

.kas-btn-block { display: block; width: 100%; }

/* ═══════════════════════════════════════════════════════════════════════
   12. SUBHEADER (Inner Pages - matching kasnazan.com)
   ═══════════════════════════════════════════════════════════════════════ */

.kas-subheader {
  background: var(--kas-bg-dark);
  padding: 30px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.kas-subheader-title {
  font-size: 30px;
  line-height: 35px;
  font-weight: 400;
  font-style: italic;
  letter-spacing: 1px;
  margin-bottom: 8px;
  color: var(--kas-heading-gold);
}

.kas-breadcrumbs {
  font-size: 13px;
  color: rgba(217, 180, 96, 0.6);
}

.kas-breadcrumbs a {
  color: rgba(217, 180, 96, 0.6);
  transition: color 0.3s ease;
}

.kas-breadcrumbs a:hover { color: var(--kas-heading-gold); }

.kas-breadcrumbs .separator { margin: 0 8px; }

/* ═══════════════════════════════════════════════════════════════════════
   13. INNER PAGE CONTENT
   ═══════════════════════════════════════════════════════════════════════ */

.kas-content-wrap {
  padding: 50px 0 70px;
  background: var(--kas-bg);
}

.kas-article {
  max-width: 900px;
  margin: 0 auto;
}

.kas-article p {
  margin-bottom: 1.2em;
  line-height: 30px;
  color: var(--kas-text-muted);
}

.kas-article a {
  color: var(--kas-accent);
  transition: color 0.3s ease;
}

.kas-article a:hover { text-decoration: underline; }

.kas-article h2 {
  font-size: 28px;
  color: var(--kas-heading-gold);
  margin-top: 30px;
  margin-bottom: 15px;
}

.kas-article h3 {
  font-size: 22px;
  color: var(--kas-accent);
  margin-top: 25px;
  margin-bottom: 12px;
}

.kas-article ul,
.kas-article ol {
  padding-right: 25px;
  margin-bottom: 1.2em;
}

.kas-article ul {
  list-style: disc;
}

.kas-article ol {
  list-style: decimal;
}

.kas-article li {
  padding: 4px 0;
  color: var(--kas-text-muted);
  line-height: 28px;
}

.kas-article blockquote {
  border-right: 4px solid var(--kas-accent);
  padding: 15px 25px;
  margin: 20px 0;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--kas-text-muted);
}

.kas-article strong {
  color: var(--kas-text);
}

.kas-article img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin-bottom: 20px;
}

.kas-featured-img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  margin-bottom: 30px;
  box-shadow: var(--kas-shadow);
}

.kas-post-meta {
  font-size: 13px;
  color: var(--kas-text-muted);
  margin-bottom: 20px;
}

.kas-post-nav {
  display: flex;
  justify-content: space-between;
  padding-top: 40px;
  margin-top: 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.kas-post-nav a {
  color: var(--kas-accent);
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.kas-post-nav a:hover {
  color: var(--kas-accent-hover);
}

/* ═══════════════════════════════════════════════════════════════════════
   14. BLOG GRID
   ═══════════════════════════════════════════════════════════════════════ */

.kas-grid {
  display: grid;
  gap: 20px;
}

.kas-grid-2 { grid-template-columns: repeat(2, 1fr); }
.kas-grid-3 { grid-template-columns: repeat(3, 1fr); }
.kas-grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ═══════════════════════════════════════════════════════════════════════
   15. FOOTER (matching kasnazan.com colors)
   ═══════════════════════════════════════════════════════════════════════ */

.kas-footer {
  background: var(--kas-footer-bg);
  border-top: 3px solid var(--kas-accent);
}

.kas-footer-widgets { padding: 70px 0; }

.kas-footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
}

/* Hardcoded footer link list styling */
.kas-footer-links li a {
  color: var(--kas-footer-link, #a8a8a8);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.25s ease, padding 0.25s ease;
  display: inline-block;
}
.kas-footer-links li a:hover {
  color: var(--kas-accent);
  padding-right: 6px;
}

.kas-footer-copy-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

@media (max-width: 949px) {
  .kas-footer-grid { grid-template-columns: repeat(2, 1fr); gap: 30px; }
}
@media (max-width: 539px) {
  .kas-footer-grid { grid-template-columns: 1fr; gap: 25px; }
}

.kas-widget-title {
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--kas-accent);
  position: relative;
}

.kas-widget {
  color: var(--kas-footer-text);
  font-size: 14px;
  line-height: 24px;
}

.kas-widget p {
  color: var(--kas-footer-text);
}

.kas-widget a {
  color: var(--kas-footer-link);
  transition: color 0.3s ease;
}

.kas-widget a:hover {
  color: var(--kas-footer-link-hover);
  text-decoration: underline;
}

.kas-widget ul { padding: 0; }

.kas-widget li {
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.kas-widget li:last-child {
  border-bottom: none;
}

/* WordPress widget titles */
.kas-footer-col .widget-title,
.kas-footer-col .wp-block-heading,
.kas-footer-col h2 {
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--kas-accent);
}

.kas-footer-col .textwidget {
  color: var(--kas-footer-text);
  font-size: 14px;
  line-height: 24px;
}

.kas-footer-col .textwidget a {
  color: var(--kas-footer-link);
}

.kas-footer-col .textwidget a:hover {
  color: var(--kas-footer-link-hover);
}

.kas-footer-copy {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 20px 0;
}

.kas-footer-copy-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.kas-copyright {
  font-size: 13px;
  color: var(--kas-footer-text);
  margin: 0;
}

.kas-footer-menu {
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0;
}

.kas-footer-menu a {
  font-size: 13px;
  color: var(--kas-footer-text);
  transition: all 0.3s ease;
}

.kas-footer-menu a:hover {
  color: var(--kas-accent);
}

/* ═══════════════════════════════════════════════════════════════════════
   16. FORMS
   ═══════════════════════════════════════════════════════════════════════ */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="date"],
textarea,
select {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--kas-text);
  padding: 12px 18px;
  border-radius: 0;
  width: 100%;
  transition: border-color 0.3s ease, background 0.3s ease;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--kas-accent);
  background: rgba(255, 255, 255, 0.1);
}

::placeholder { color: rgba(255, 255, 255, 0.4); }

/* ═══════════════════════════════════════════════════════════════════════
   17. WOOCOMMERCE OVERRIDES
   ═══════════════════════════════════════════════════════════════════════ */

.woocommerce ul.products li.product {
  background: linear-gradient(180deg, var(--kas-bg) 80%, var(--kas-gradient-end) 100%);
  border: 2px solid var(--kas-accent);
  border-radius: 20px;
  padding: 15px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: var(--kas-shadow);
}

.woocommerce ul.products li.product:hover {
  transform: translateY(-5px);
  box-shadow: var(--kas-shadow-deep);
}

.woocommerce ul.products li.product .price {
  color: var(--kas-accent) !important;
  font-size: 1.1rem;
}

.woocommerce ul.products li.product .button,
.woocommerce a.button,
.woocommerce button.button {
  background: var(--kas-accent) !important;
  color: var(--kas-bg) !important;
  border-radius: 5px !important;
  border: none !important;
  font-family: var(--kas-font) !important;
}

.woocommerce ul.products li.product .button:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover {
  background: var(--kas-btn-primary-hover) !important;
  color: #fff !important;
}

.woocommerce .star-rating span::before { color: var(--kas-accent); }

.woocommerce-page .kas-content-wrap { padding: 50px 0 70px; }

/* ═══════════════════════════════════════════════════════════════════════
   18. ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════ */

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}

.kas-animate { opacity: 0; }

.kas-animate.kas-visible {
  animation-duration: 0.8s;
  animation-fill-mode: both;
}

.kas-animate-up.kas-visible { animation-name: fadeInUp; }
.kas-animate-right.kas-visible { animation-name: fadeInRight; }
.kas-animate-left.kas-visible { animation-name: fadeInLeft; }

/* ═══════════════════════════════════════════════════════════════════════
   19. RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════ */

@media (max-width: 1200px) {
  .kas-container { padding-left: 20px; padding-right: 20px; }
  .kas-hero-bg { margin: 0 3%; }
  .kas-cta-banner { padding: 60px 40px; }
  .kas-books-grid { grid-template-columns: repeat(2, 1fr); }
  .kas-library-slide { flex: 0 0 calc((100% - 15px) / 2); }
}

@media (max-width: 949px) {
  /* Mobile nav toggle */
  .kas-nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 100;
  }

  .kas-topbar .kas-container { position: relative; }

  /* Mobile menu - full overlay style matching kasnazan.com */
  .kas-menu {
    display: none;
    flex-direction: column;
    width: 100%;
    background: var(--kas-bg-dark);
    padding: 0;
    border-top: 1px solid rgba(242, 171, 65, 0.15);
  }

  .kas-mobile-menu-open .kas-menu { display: flex; }

  .kas-menu > li > a {
    padding: 15px 20px;
    text-align: right;
    border-bottom: 1px solid rgba(242, 171, 65, 0.12);
    color: var(--kas-accent);
    font-size: 16px;
    font-weight: 500;
  }

  .kas-menu > li > a::after { display: none; }

  .kas-menu > li:first-child > a {
    border-top: none;
  }

  /* Parent items with children - show "+" indicator */
  .kas-menu > li.menu-item-has-children > a {
    position: relative;
  }

  .kas-menu > li.menu-item-has-children > a::before {
    content: '+';
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    font-weight: 400;
    color: var(--kas-accent);
    transition: transform 0.3s ease;
  }

  .kas-menu > li.menu-item-has-children.sub-open > a::before {
    content: '−';
  }

  /* Mobile submenus */
  .kas-menu .sub-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    display: none;
    border-top: none;
    padding: 0;
    background: rgba(0, 25, 21, 0.5);
  }

  .kas-menu > li.sub-open > .sub-menu { display: block; }

  .kas-menu .sub-menu li a {
    padding: 12px 35px 12px 20px;
    color: var(--kas-accent);
    font-size: 15px;
    border-bottom: 1px solid rgba(242, 171, 65, 0.08);
  }

  .kas-menu .sub-menu li:last-child a {
    border-bottom: none;
  }

  /* Hero */
  .kas-hero-bg { min-height: 550px; margin: 0 2%; }
  .kas-hero-logo { width: 240px; }
  .kas-hero-title-img { width: 350px; }

  /* Carousel */
  .kas-carousel-slide { flex: 0 0 calc((100% - 15px) / 2); }
  .kas-library-slide { flex: 0 0 calc((100% - 15px) / 2); }

  /* Sections */
  .kas-section { padding: 40px 0 50px; }
  .kas-section-intro { padding: 50px 0; }

  /* Sheikhs responsive */
  .kas-sheikh-img-wrap { max-width: 250px; }
  .kas-sheikh-name { font-size: 12px; }

  /* Orgs responsive */
  .kas-orgs-grid { grid-template-columns: 1fr; max-width: 400px; }
  .kas-org-card { padding: 25px 20px; }
}

@media (max-width: 767px) {
  h1 { font-size: 36px; }
  h2 { font-size: 30px; }
  h3 { font-size: 24px; }

  .kas-hero-bg { min-height: 400px; margin: 0; border-radius: 0; }
  .kas-hero-logo { width: 180px; }
  .kas-hero-title-img { width: 280px; }

  .kas-section { padding: 30px 0 40px; }
  .kas-section-title { font-size: 22px; }

  .kas-two-col { flex-direction: column; gap: 20px; }
  .kas-two-col > .kas-col { flex: 1 1 100%; }

  .kas-sheikh-img { max-width: 200px; }

  .kas-social-grid { grid-template-columns: 1fr; }
  .kas-books-grid { grid-template-columns: repeat(2, 1fr); gap: 15px; }
  .kas-video-grid { grid-template-columns: 1fr; }
  .kas-library-slide { flex: 0 0 100%; }
  .kas-orgs-grid { grid-template-columns: 1fr; }
  .kas-audio-embed { max-width: 100%; }

  .kas-grid-3, .kas-grid-4 { grid-template-columns: 1fr; }
  .kas-grid-2 { grid-template-columns: 1fr; }

  .kas-carousel-slide { flex: 0 0 100%; }
  .kas-carousel { padding: 0 35px; }

  .kas-footer-grid { grid-template-columns: 1fr; gap: 30px; }
  .kas-footer-copy-inner { flex-direction: column; text-align: center; }
  .kas-footer-menu { justify-content: center; }

  .kas-cta-banner { padding: 40px 20px; border-radius: 10px; }
  .kas-cta-content { font-size: 1rem; }

  .kas-subheader-title { font-size: 18px; line-height: 22px; }
}

@media (max-width: 480px) {
  h1 { font-size: 28px; }

  .kas-hero-bg { min-height: 350px; }
  .kas-hero-logo { width: 150px; }
  .kas-hero-title-img { width: 220px; }
  .kas-hero-content { padding: 20px; }

  .kas-scroll-down { width: 40px; height: 40px; }

  .kas-cta-banner { padding: 30px 15px; }
  .kas-cta-content { font-size: 0.85rem; }

  .kas-carousel-btn { width: 30px; height: 30px; }
}

/* ═══════════════════════════════════════════════════════════════════════
   20. UTILITY CLASSES
   ═══════════════════════════════════════════════════════════════════════ */

.text-center { text-align: center; }
.text-gold { color: var(--kas-accent); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 2rem; }
.hidden { display: none !important; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ═══════════════════════════════════════════════════════════════════════
   21. WORDPRESS ADMIN BAR FIX
   ═══════════════════════════════════════════════════════════════════════ */

body.admin-bar .kas-header { top: 32px; }

@media (max-width: 782px) {
  body.admin-bar .kas-header { top: 46px; }
}

/* ═══════════════════════════════════════════════════════════════════════
   22. PAGINATION
   ═══════════════════════════════════════════════════════════════════════ */

.nav-links {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding-top: 30px;
}

.nav-links a,
.nav-links span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: 5px;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.nav-links a {
  background: rgba(255, 255, 255, 0.08);
  color: var(--kas-text);
}

.nav-links a:hover {
  background: var(--kas-accent);
  color: var(--kas-bg);
}

.nav-links .current {
  background: var(--kas-accent);
  color: var(--kas-bg);
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════════
   23. SEARCH FORM
   ═══════════════════════════════════════════════════════════════════════ */

.search-form {
  display: flex;
  gap: 10px;
  max-width: 500px;
  margin: 0 auto 30px;
}

.search-form .search-field {
  flex: 1;
}

.search-form .search-submit {
  background: var(--kas-accent);
  color: var(--kas-bg);
  border: none;
  padding: 12px 24px;
  border-radius: 0;
  cursor: pointer;
  font-family: var(--kas-font);
  font-weight: 500;
  transition: background 0.3s ease;
}

.search-form .search-submit:hover {
  background: var(--kas-accent-hover);
}

/* ═══════════════════════════════════════════════════════════════════════
   24. SELECTION & SCROLLBAR
   ═══════════════════════════════════════════════════════════════════════ */

::selection {
  background: var(--kas-accent);
  color: var(--kas-bg);
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--kas-bg-dark);
}

::-webkit-scrollbar-thumb {
  background: var(--kas-accent);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--kas-accent-hover);
}

/* ═══════════════════════════════════════════════════════════════════════
   25. ORGANIZATIONS SECTION (المنظمات)
   ═══════════════════════════════════════════════════════════════════════ */

.kas-section-orgs {
  padding-top: 30px;
  padding-bottom: 60px;
}

.kas-orgs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
  max-width: 800px;
  margin: 0 auto;
}

.kas-org-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: linear-gradient(180deg, rgba(0, 27, 22, 0.95) 0%, rgba(3, 46, 39, 0.9) 100%);
  border: 2px solid var(--kas-accent);
  border-radius: 20px;
  padding: 35px 25px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: var(--kas-shadow);
}

.kas-org-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--kas-shadow-deep);
}

.kas-org-logo-wrap {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 20px;
  border: 2px solid rgba(242, 171, 65, 0.3);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
}

.kas-org-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px;
}

.kas-org-name {
  color: var(--kas-accent);
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
  line-height: 1.5;
}

.kas-org-desc {
  color: var(--kas-text-muted);
  font-size: 14px;
  line-height: 24px;
  margin: 0;
}

/* ═══════════════════════════════════════════════════════════════════════
   26. LIBRARY CAROUSEL CARDS (المكتبة - image-based)
   ═══════════════════════════════════════════════════════════════════════ */

.kas-library-slide {
  flex: 0 0 calc((100% - 30px) / 3);
}

.kas-library-card {
  display: block;
  text-align: center;
  transition: transform 0.3s ease;
}

.kas-library-card:hover {
  transform: translateY(-5px);
}

.kas-library-img-wrap {
  border: 2px solid var(--kas-accent);
  border-radius: 15px;
  overflow: hidden;
  aspect-ratio: 3/4;
  box-shadow: var(--kas-shadow);
  transition: box-shadow 0.3s ease;
  margin-bottom: 12px;
}

.kas-library-card:hover .kas-library-img-wrap {
  box-shadow: var(--kas-shadow-deep);
}

.kas-library-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.kas-library-card:hover .kas-library-img-wrap img {
  transform: scale(1.05);
}

.kas-library-title {
  color: var(--kas-accent);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  margin: 0;
}

/* ═══════════════════════════════════════════════════════════════════════
   27. VIDEO CARDS WITH THUMBNAILS (مكتبة الفيديو)
   ═══════════════════════════════════════════════════════════════════════ */

.kas-video-card-thumb {
  position: relative;
  overflow: hidden;
}

.kas-video-card-thumb a {
  display: block;
  position: relative;
}

.kas-video-card-thumb img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16/9;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.kas-video-card:hover .kas-video-card-thumb img {
  transform: scale(1.05);
}

.kas-play-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  color: var(--kas-accent);
  transition: all 0.3s ease;
}

.kas-video-card-thumb:hover .kas-play-icon {
  background: rgba(0, 0, 0, 0.5);
}

.kas-video-card-body {
  padding: 15px;
}

.kas-video-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
  margin-bottom: 8px;
}

.kas-video-title a {
  color: var(--kas-accent);
  transition: color 0.3s ease;
}

.kas-video-title a:hover {
  color: var(--kas-accent-hover);
}

.kas-video-date {
  display: block;
  font-size: 12px;
  color: var(--kas-text-muted);
}

/* ═══════════════════════════════════════════════════════════════════════
   28. AUDIO SECTION (المكتبة الصوتية - Spotify)
   ═══════════════════════════════════════════════════════════════════════ */

.kas-section-audio {
  padding-top: 50px;
  padding-bottom: 60px;
}

.kas-audio-embed {
  max-width: 800px;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--kas-shadow-deep);
}

.kas-audio-embed iframe {
  display: block;
}

/* ═══════════════════════════════════════════════════════════════════════
   29. DECORATIVE GOLD CORNER ORNAMENTS
   ═══════════════════════════════════════════════════════════════════════ */

.kas-section-sheikhs,
.kas-section-news,
.kas-section-books,
.kas-section-videos,
.kas-section-orgs {
  position: relative;
}

.kas-section-sheikhs::before,
.kas-section-sheikhs::after,
.kas-section-news::before,
.kas-section-news::after {
  content: '';
  position: absolute;
  width: 60px;
  height: 60px;
  border-color: var(--kas-accent);
  border-style: solid;
  opacity: 0.2;
  pointer-events: none;
}

.kas-section-sheikhs::before,
.kas-section-news::before {
  top: 20px;
  right: 20px;
  border-width: 3px 3px 0 0;
}

.kas-section-sheikhs::after,
.kas-section-news::after {
  bottom: 20px;
  left: 20px;
  border-width: 0 0 3px 3px;
}

/* ════════════════════════════════════════════════════════════════════════
   MOBILE POLISH & ANIMATIONS (v5.9)
   Animated hamburger, slide-in drawer, scroll-lock, smart sticky header,
   touch-friendly tap targets, smooth motion, prefers-reduced-motion.
   ════════════════════════════════════════════════════════════════════════ */

html { scroll-behavior: smooth; }
* { -webkit-tap-highlight-color: transparent; }
body.kas-mobile-menu-open { position: fixed; left: 0; right: 0; overflow: hidden; width: 100%; }

/* Desktop vs mobile nav visibility */
.kas-nav-desktop { display: block; width: 100%; text-align: center; border-top: 1px solid rgba(255, 255, 255, 0.07); }
@media (min-width: 950px) {
  /* Hide the mobile drawer entirely on desktop */
  .kas-nav { display: none !important; }
}
@media (max-width: 949px) {
  /* Hide the desktop menu wrapper on mobile */
  .kas-nav-desktop { display: none !important; }
}

/* Header is sticky (in flow), with smooth elevation + auto-hide on scroll-down */
.kas-header {
  /* keeps the original sticky behaviour but enhances styling and motion */
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(0, 25, 21, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s ease,
              background-color 0.3s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.kas-header.kas-sticky {
  background: rgba(0, 25, 21, 0.97);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}
.kas-header.kas-header-hidden { transform: translateY(-100%); }

/* Hamburger smoothing — relies on existing X animation rules earlier in this file */
.kas-hamburger span {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.3s ease,
              top 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Backdrop when drawer is open */
body.kas-mobile-menu-open::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 998;
  animation: kas-fade-in 0.3s ease forwards;
}
@keyframes kas-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Subtle button press feedback */
.kas-btn, .kas-btn-sm {
  transition: transform 0.2s ease, background-color 0.25s ease, box-shadow 0.25s ease;
  -webkit-touch-callout: none;
  user-select: none;
}
.kas-btn:active, .kas-btn-sm:active { transform: scale(0.96); }

/* ═══ Mobile breakpoint: 949px ═══ */
@media (max-width: 949px) {

  .kas-nav-toggle {
    display: flex;
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    z-index: 1001;
    width: 48px;
    height: 48px;
    background: rgba(242, 171, 65, 0.08);
    border: 1px solid rgba(242, 171, 65, 0.25);
    border-radius: 8px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: background 0.25s ease, border-color 0.25s ease;
  }
  .kas-nav-toggle:hover,
  .kas-nav-toggle:active {
    background: rgba(242, 171, 65, 0.18);
    border-color: rgba(242, 171, 65, 0.5);
  }
  body.kas-mobile-menu-open .kas-nav-toggle {
    background: transparent;
    border-color: transparent;
  }

  .kas-nav {
    display: block !important;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    height: 100vh;
    height: 100dvh; /* dynamic viewport on iOS Safari */
    width: min(85vw, 360px);
    max-width: 100%;
    background: linear-gradient(180deg, #001915 0%, #001b16 100%);
    border-left: 1px solid rgba(242, 171, 65, 0.2);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    z-index: 999;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    transform: translateX(100%);
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 80px 0 30px;
    border-top: none;
  }
  body.kas-mobile-menu-open .kas-nav { transform: translateX(0); }

  /* Defensive: ALL items in the drawer must be visible no matter what */
  .kas-nav > .kas-menu {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    gap: 0 !important;
    flex-wrap: nowrap !important;
  }
  .kas-nav > .kas-menu > li {
    display: block !important;
    width: 100% !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    max-height: none !important;
    margin: 0 !important;
    list-style: none !important;
  }
  .kas-nav > .kas-menu > li > a {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: #fff !important;
  }

  .kas-menu { flex-direction: column; align-items: stretch; width: 100%; padding: 0; }
  .kas-menu > li {
    position: static;
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }
  .kas-menu > li:last-child { border-bottom: none; }
  .kas-menu > li > a {
    padding: 16px 25px;
    line-height: 1.4;
    font-size: 16px;
    color: #fff;
    display: block;
  }
  .kas-menu > li > a:hover,
  .kas-menu > li > a:active {
    background: rgba(242, 171, 65, 0.08);
    color: var(--kas-accent);
  }
  .kas-menu > li > a::after { display: none; }

  /* Sub-menu chevron */
  .kas-menu > li.menu-item-has-children > a > span::after {
    content: '';
    display: inline-block;
    width: 9px;
    height: 9px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    margin-right: 10px;
    opacity: 0.6;
    transition: transform 0.3s ease, opacity 0.25s ease;
    vertical-align: middle;
  }
  .kas-menu > li.menu-item-has-children.sub-open > a > span::after {
    transform: rotate(-135deg) translateY(2px);
    opacity: 1;
    color: var(--kas-accent);
  }

  /* Mobile sub-menu = accordion */
  .kas-menu .sub-menu {
    position: static;
    transform: none;
    visibility: visible;
    opacity: 1;
    background: rgba(0, 0, 0, 0.25);
    border: none;
    border-radius: 0;
    min-width: 0;
    width: 100%;
    padding: 0;
    margin: 0;
    pointer-events: auto;
    box-shadow: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .kas-menu > li.sub-open > .sub-menu { max-height: 800px; }
  .kas-menu .sub-menu li a {
    padding: 12px 40px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  }
  .kas-menu .sub-menu li:last-child a { border-bottom: none; }
  .kas-menu .sub-menu li a:hover,
  .kas-menu .sub-menu li a:active {
    background: rgba(242, 171, 65, 0.1);
    color: var(--kas-accent);
    padding-right: 45px;
  }
  .kas-menu .sub-menu .sub-menu { display: none; }

  .kas-logo { text-align: center; padding: 8px 0 6px; }
  .kas-logo a { display: inline-block; }
  /* Higher specificity to override the original .kas-logo-img { max-height: 100px } */
  .kas-logo-img,
  .kas-logo .custom-logo,
  .kas-logo img {
    max-height: 56px !important;
    width: auto !important;
  }
  /* When sticky, shrink even more */
  .kas-sticky .kas-logo-img,
  .kas-sticky .kas-logo .custom-logo,
  .kas-sticky .kas-logo img {
    max-height: 44px !important;
  }

  /* Kill the legacy "+" indicator (replaced by chevron earlier in mobile rules) */
  .kas-menu > li.menu-item-has-children > a::before,
  .kas-menu > li.menu-item-has-children.sub-open > a::before {
    content: none !important;
    display: none !important;
  }

  .kas-hero-bg {
    min-height: 50vh;
    background-size: auto 65%;
    margin: 10px 3% 0;
  }

  .kas-container { padding: 0 20px; }
  .kas-section { padding: 50px 0; }
  .kas-section-intro { padding: 40px 0 !important; }

  .kas-two-col { flex-direction: column; gap: 25px; }
  .kas-two-col > .kas-col { flex: 1 1 100%; width: 100%; max-width: 100%; }

  .kas-sheikh-img-wrap { max-width: 280px; margin: 0 auto; }

  .kas-btn, .kas-btn-sm {
    min-height: 44px;
    padding: 12px 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .kas-cta-banner { padding: 50px 25px; min-height: auto; }
  .kas-cta-content p { font-size: 1rem; line-height: 1.7; }

  .kas-section-intro article { font-size: 1rem !important; line-height: 1.95 !important; }
  .kas-section-intro article h2 { font-size: 1.25rem !important; }

  .kas-footer-widgets { padding: 40px 0 20px; }
  .kas-footer-copy-inner { flex-direction: column; text-align: center; gap: 15px; }
  .kas-footer-social { justify-content: center; }
}

/* ═══ Smaller phones: 480px and under ═══ */
@media (max-width: 480px) {
  .kas-container { padding: 0 15px; }
  .kas-hero-bg {
    min-height: 45vh;
    background-size: auto 60%;
    margin: 5px 2% 0;
    border-radius: 12px;
  }
  .kas-section-title { font-size: 1.5rem !important; line-height: 1.4; }
  .kas-section-intro h1 { font-size: 1.75rem !important; line-height: 1.4; }
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
  .kas-terms-grid > a, .kas-orgs-grid > a { padding: 18px 15px; }
  .kas-pdf-embed iframe { height: 500px; }
  .kas-section { padding: 35px 0; }
  .kas-section-intro { padding: 30px 0 !important; }
  .kas-menu .sub-menu li a { padding: 11px 30px; font-size: 13px; }
}

/* Touch-first feedback (mobile/tablet without mouse) */
@media (hover: none) {
  .kas-sheikh-card:hover .kas-sheikh-img-wrap,
  .kas-card:hover { transform: none; }
  .kas-sheikh-card:active .kas-sheikh-img-wrap,
  .kas-card:active {
    transform: scale(0.98);
    transition: transform 0.15s ease;
  }
}

/* Respect users who prefer no motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .kas-animate { opacity: 1 !important; transform: none !important; }
}

/* Better focus rings for keyboard users */
:focus-visible {
  outline: 2px solid var(--kas-accent);
  outline-offset: 3px;
  border-radius: 4px;
}
:focus:not(:focus-visible) { outline: none; }

/* Page-load reveal */
body { animation: kas-body-in 0.5s ease forwards; }
@keyframes kas-body-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
