/**
 * ==============================================================================
 * بوابة الأنس بالقرآن الفاخرة — نظام الفن الإسلامي والأنيميشن (Arabic Art Gateway)
 * تصميم إسلامي ملكي استثنائي بأقواس أندلسية وزخارف هندسية وفراشة ذهبية متألقة
 * Made with craftsmanship by io-somaya (https://somaya-hassan.pages.dev/)
 * ==============================================================================
 */

/* ==========================================================================
   1. الحاوية الكبرى للبوابة (Portal Gateway Wrapper)
   ========================================================================== */
.portal-gateway {
  position: relative;
  min-height: calc(100vh - 120px);
  padding: 2.5rem 1rem 4rem 1rem;
  border-radius: 28px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 15%, rgba(196, 154, 69, 0.12) 0%, rgba(6, 60, 46, 0.05) 45%, transparent 75%),
              var(--bg-card);
  border: 1px solid var(--border-gold);
  box-shadow: 0 25px 60px -15px var(--qur-emerald-glow),
              0 0 40px rgba(196, 154, 69, 0.08);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  margin-bottom: 2.5rem;
}

[data-theme="dark"] .portal-gateway {
  background: radial-gradient(circle at 50% 15%, rgba(223, 178, 62, 0.14) 0%, rgba(4, 41, 31, 0.5) 50%, #031c15 100%),
              #05251c;
  border-color: rgba(223, 178, 62, 0.35);
  box-shadow: 0 30px 80px -15px rgba(0, 0, 0, 0.7),
              0 0 50px rgba(196, 154, 69, 0.18);
}

[data-theme="parchment"] .portal-gateway {
  background: radial-gradient(circle at 50% 15%, rgba(196, 154, 69, 0.15) 0%, rgba(244, 236, 221, 0.6) 50%, transparent 80%),
              #faf5ea;
  border-color: rgba(196, 154, 69, 0.45);
}

/* ==========================================================================
   2. طبقات الزخرفة الإسلامية الهندسية والأثير الذهبي (Arabesque Background)
   ========================================================================== */
.portal-arabesque-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.07;
  background-image: radial-gradient(var(--qur-gold) 1px, transparent 1px),
                    radial-gradient(var(--qur-emerald) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: 0 0, 16px 16px;
  mask-image: radial-gradient(circle at 50% 40%, black 40%, transparent 85%);
  -webkit-mask-image: radial-gradient(circle at 50% 40%, black 40%, transparent 85%);
}

[data-theme="dark"] .portal-arabesque-layer {
  opacity: 0.13;
}

/* نجوم هندسية إسلامية متحركة في الخلفية */
.portal-ambient-geometry {
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 700px;
  pointer-events: none;
  z-index: 1;
  opacity: 0.08;
  animation: portalSpinSlow 180s linear infinite;
}

[data-theme="dark"] .portal-ambient-geometry {
  opacity: 0.16;
}

@keyframes portalSpinSlow {
  from { transform: translateX(-50%) rotate(0deg); }
  to { transform: translateX(-50%) rotate(360deg); }
}

/* كانفاس ذرات النور والشهب الذهبية */
.portal-particles-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

/* هالات الضوء الأندلسية المتنفسة */
.portal-halo-glow {
  position: absolute;
  top: 5%;
  left: 50%;
  transform: translateX(-50%);
  width: 450px;
  height: 250px;
  background: radial-gradient(ellipse at center, rgba(223, 178, 62, 0.28) 0%, rgba(196, 154, 69, 0.1) 45%, transparent 75%);
  filter: blur(40px);
  pointer-events: none;
  z-index: 1;
  animation: haloBreath 8s ease-in-out infinite alternate;
}

@keyframes haloBreath {
  0% { transform: translateX(-50%) scale(0.9); opacity: 0.7; }
  100% { transform: translateX(-50%) scale(1.15); opacity: 1; }
}

/* المحتوى الأمامي للبوابة */
.portal-content-layer {
  position: relative;
  z-index: 3;
}

/* ==========================================================================
   3. إطار المحراب الأندلسي وزخارف التيجان (Andalusian Mihrab Arch)
   ========================================================================== */
.portal-arch-header {
  position: relative;
  max-width: 900px;
  margin: 0 auto 3rem auto;
  text-align: center;
  padding: 1.5rem 1rem 0 1rem;
}

/* زخرفة تاج المحراب الذهبية المقوسة */
.mihrab-crown-svg {
  display: block;
  margin: 0 auto 1rem auto;
  width: 180px;
  height: 48px;
  filter: drop-shadow(0 2px 8px rgba(196, 154, 69, 0.35));
}

/* البسملة بالخط العربي الملكي والزخرفة */
.portal-bismillah-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  padding: 0.5rem 1.8rem;
  margin-bottom: 1.2rem;
  background: linear-gradient(135deg, rgba(196, 154, 69, 0.12) 0%, rgba(6, 60, 46, 0.08) 100%);
  border: 1px solid var(--border-gold);
  border-radius: 50px;
  box-shadow: 0 4px 15px rgba(196, 154, 69, 0.1);
  backdrop-filter: blur(10px);
}

.portal-bismillah-text {
  font-family: var(--font-quran), 'Amiri Quran', serif;
  font-size: 1.35rem;
  color: var(--text-primary);
  letter-spacing: 0.5px;
  line-height: 1.6;
}

[data-theme="dark"] .portal-bismillah-text {
  color: #fdfaf2;
  text-shadow: 0 0 12px rgba(223, 178, 62, 0.4);
}

.portal-ornament-star {
  color: var(--qur-gold-bright);
  font-size: 0.95rem;
  animation: starPulse 3s ease-in-out infinite;
}

@keyframes starPulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.25); opacity: 1; filter: drop-shadow(0 0 6px #dfb23e); }
}

/* عنوان البوابة الفاخر بتدرج ذهبي */
.portal-main-title {
  font-family: var(--font-heading), 'Alexandria', sans-serif;
  font-weight: 900;
  font-size: clamp(1.85rem, 4.5vw, 3.2rem);
  line-height: 1.25;
  margin-bottom: 0.8rem;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--qur-emerald) 0%, var(--qur-gold-dark) 50%, var(--qur-gold-bright) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 15px rgba(196, 154, 69, 0.25);
  animation: titleGleam 6s ease-in-out infinite alternate;
}

[data-theme="dark"] .portal-main-title {
  background: linear-gradient(135deg, #ffffff 0%, #ffeaa7 30%, #dfb23e 70%, #c49a45 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 30px rgba(223, 178, 62, 0.45);
}

@keyframes titleGleam {
  0% { filter: brightness(1); }
  100% { filter: brightness(1.15) drop-shadow(0 0 10px rgba(223, 178, 62, 0.3)); }
}

/* الوصف الهادئ - بدون تشتت */
.portal-lead-description {
  font-family: var(--font-ui), sans-serif;
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  font-weight: 400;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 1.5rem auto;
  line-height: 1.7;
}

/* شارة الآية القرآنية الملهمة */
.portal-verse-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--qur-emerald-subtle);
  border: 1px dashed var(--qur-emerald-border);
  color: var(--qur-emerald);
  padding: 0.45rem 1.4rem;
  border-radius: 50px;
  font-family: var(--font-quran), 'Amiri', serif;
  font-size: 1.05rem;
  box-shadow: 0 2px 8px rgba(6, 60, 46, 0.05);
}

[data-theme="dark"] .portal-verse-badge {
  background: rgba(6, 60, 46, 0.4);
  border-color: rgba(5, 150, 105, 0.4);
  color: #a7f3d0;
}

/* ==========================================================================
   4. شريط الإجراءات السريعة (Resume Bookmark / Direct Enter / Date)
   ========================================================================== */
.portal-quick-actions-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.8rem;
  padding: 0.75rem 1.2rem;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  border-radius: 50px;
  border: 1px solid var(--border-gold-subtle);
  max-width: 750px;
  margin-left: auto;
  margin-right: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .portal-quick-actions-bar {
  background: rgba(6, 30, 23, 0.7);
  border-color: rgba(196, 154, 69, 0.25);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.portal-action-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.2rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s ease;
  border: none;
}

.portal-action-pill-resume {
  background: var(--qur-gold-gradient);
  color: #03231b;
  box-shadow: 0 4px 14px rgba(196, 154, 69, 0.35);
}

.portal-action-pill-resume:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(196, 154, 69, 0.5);
  color: #000;
}

.portal-action-pill-direct {
  background: var(--qur-emerald);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(6, 60, 46, 0.25);
}

.portal-action-pill-direct:hover {
  background: var(--qur-emerald-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(6, 60, 46, 0.35);
  color: #ffffff;
}

.portal-action-pill-info {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-light);
  cursor: default;
}

/* ==========================================================================
   5. شبكة بطاقات الوجهات الإسلامية (The 6 Arabic Art Destination Cards)
   ========================================================================== */
.portal-destinations-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 0.5rem;
}

@media (max-width: 991px) {
  .portal-destinations-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
  }
}

@media (max-width: 600px) {
  .portal-destinations-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* بطاقة الوجهة الفاخرة المستوحاة من تذهيب المصاحف الأندلسية */
.portal-card {
  position: relative;
  background: var(--bg-card);
  border-radius: 22px;
  padding: 1.8rem 1.6rem;
  border: 1.5px solid var(--border-gold-subtle);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  isolation: isolate;
}

/* أنيميشن الدخول المتتابع للبطاقات */
.portal-card {
  opacity: 0;
  transform: translateY(24px);
  animation: cardEntrance 0.65s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.portal-card:nth-child(1) { animation-delay: 0.08s; }
.portal-card:nth-child(2) { animation-delay: 0.16s; }
.portal-card:nth-child(3) { animation-delay: 0.24s; }
.portal-card:nth-child(4) { animation-delay: 0.32s; }
.portal-card:nth-child(5) { animation-delay: 0.40s; }
.portal-card:nth-child(6) { animation-delay: 0.48s; }

@keyframes cardEntrance {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

[data-theme="dark"] .portal-card {
  background: linear-gradient(180deg, #072a20 0%, #051f18 100%);
  border-color: rgba(196, 154, 69, 0.28);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

[data-theme="parchment"] .portal-card {
  background: #fffdf8;
  border-color: rgba(196, 154, 69, 0.35);
}

/* الزخارف الأركانية الأندلسية (Corner Rosettes) */
.portal-card::before,
.portal-card::after {
  content: '❖';
  position: absolute;
  font-size: 0.7rem;
  color: var(--qur-gold);
  opacity: 0.45;
  transition: all 0.3s ease;
}

.portal-card::before {
  top: 10px;
  right: 12px;
}

.portal-card::after {
  bottom: 10px;
  left: 12px;
}

/* شعاع النور المائل عند التحويم (Shimmer beam) */
.portal-card-shimmer {
  position: absolute;
  top: -100%;
  left: -100%;
  width: 300%;
  height: 300%;
  background: linear-gradient(135deg, transparent 40%, rgba(254, 240, 138, 0.12) 50%, transparent 60%);
  pointer-events: none;
  transform: rotate(35deg);
  transition: all 0.8s ease;
  z-index: 1;
}

/* تأثير التحويم ثلاثي الأبعاد على البطاقة */
.portal-card:hover {
  transform: translateY(-8px) scale(1.015);
  border-color: var(--qur-gold-bright);
  box-shadow: 0 20px 40px -8px rgba(6, 60, 46, 0.15),
              0 0 30px rgba(196, 154, 69, 0.3);
}

[data-theme="dark"] .portal-card:hover {
  box-shadow: 0 22px 50px -10px rgba(0, 0, 0, 0.7),
              0 0 35px rgba(223, 178, 62, 0.35);
  border-color: var(--qur-gold-light);
}

.portal-card:hover .portal-card-shimmer {
  top: 100%;
  left: 100%;
}

.portal-card:hover::before,
.portal-card:hover::after {
  opacity: 1;
  color: var(--qur-gold-bright);
  transform: scale(1.3);
}

/* الميدالية الهندسية الإسلامية الحاملة للأيقونة (Octagram Star Medallion) */
.card-medallion-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.4rem;
  position: relative;
  z-index: 2;
}

.card-medallion {
  width: 62px;
  height: 62px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: linear-gradient(135deg, rgba(196, 154, 69, 0.15) 0%, rgba(6, 60, 46, 0.1) 100%);
  border: 1.5px solid var(--border-gold);
  color: var(--qur-emerald);
  font-size: 1.75rem;
  box-shadow: 0 8px 18px rgba(196, 154, 69, 0.15);
  transition: all 0.35s ease;
}

[data-theme="dark"] .card-medallion {
  color: #dfb23e;
  border-color: rgba(223, 178, 62, 0.45);
  background: linear-gradient(135deg, rgba(223, 178, 62, 0.22) 0%, rgba(6, 60, 46, 0.3) 100%);
}

.portal-card:hover .card-medallion {
  transform: scale(1.1) rotate(6deg);
  background: var(--qur-gold-gradient);
  color: #03231b;
  border-color: #ffeaa7;
  box-shadow: 0 10px 25px rgba(196, 154, 69, 0.45);
}

/* شارة التميز أو المؤشر الرقمي الصغير */
.card-tag-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.85rem;
  border-radius: 50px;
  background: var(--qur-emerald-subtle);
  color: var(--qur-emerald);
  border: 1px solid var(--qur-emerald-border);
  letter-spacing: 0.2px;
}

[data-theme="dark"] .card-tag-pill {
  background: rgba(6, 60, 46, 0.5);
  color: #a7f3d0;
  border-color: rgba(5, 150, 105, 0.4);
}

/* نصوص البطاقة */
.card-content-body {
  position: relative;
  z-index: 2;
  margin-bottom: 1.5rem;
}

.card-title-arabic {
  font-family: var(--font-heading), 'Alexandria', sans-serif;
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--text-primary);
  margin-bottom: 0.6rem;
  line-height: 1.35;
  transition: color 0.25s ease;
}

.portal-card:hover .card-title-arabic {
  color: var(--qur-gold-dark);
}

[data-theme="dark"] .portal-card:hover .card-title-arabic {
  color: var(--qur-gold-bright);
}

.card-desc-arabic {
  font-family: var(--font-ui), sans-serif;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 0.85rem;
  min-height: 2.8rem;
}

/* قائمة المزايا المختصرة في البطاقة */
.card-features-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.card-feature-chip {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-subtle);
  background: rgba(196, 154, 69, 0.08);
  padding: 0.2rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(196, 154, 69, 0.15);
}

[data-theme="dark"] .card-feature-chip {
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  border-color: rgba(255, 255, 255, 0.1);
}

/* زر أو شريط الانتقال في أسفل البطاقة */
.card-action-footer {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px dashed var(--border-light);
}

.card-action-text {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--qur-emerald);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.25s ease;
}

[data-theme="dark"] .card-action-text {
  color: #dfb23e;
}

.card-action-arrow {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--qur-emerald-subtle);
  color: var(--qur-emerald);
  transition: all 0.3s ease;
}

[data-theme="dark"] .card-action-arrow {
  background: rgba(223, 178, 62, 0.18);
  color: #dfb23e;
}

.portal-card:hover .card-action-text {
  color: var(--qur-gold-dark);
  transform: translateX(-4px);
}

[data-theme="dark"] .portal-card:hover .card-action-text {
  color: #ffeaa7;
}

.portal-card:hover .card-action-arrow {
  background: var(--qur-gold-gradient);
  color: #03231b;
  transform: translateX(-6px);
  box-shadow: 0 4px 12px rgba(196, 154, 69, 0.4);
}

/* ==========================================================================
   6. توقيع الفراشة الذهبية الملكية (Made by io-somaya with Golden Butterfly)
   ========================================================================== */
.portal-signature-section {
  position: relative;
  max-width: 750px;
  margin: 3.8rem auto 0.5rem auto;
  text-align: center;
  z-index: 3;
}

/* فاصل زخرفي إسلامي مع جوهرة ذهبية */
.portal-signature-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  margin-bottom: 1.8rem;
}

.portal-signature-divider .divider-line {
  flex: 1;
  max-width: 180px;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--border-gold) 50%, transparent 100%);
}

.portal-signature-divider .divider-gem {
  color: var(--qur-gold-bright);
  font-size: 1.1rem;
  filter: drop-shadow(0 0 6px rgba(223, 178, 62, 0.5));
  animation: starPulse 4s ease-in-out infinite;
}

/* الرابط والشارة الذهبية الفاخرة */
.portal-author-link {
  display: inline-block;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}

.author-badge-inner {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1.6rem 0.7rem 1.4rem;
  border-radius: 50px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.85) 0%, rgba(253, 250, 242, 0.95) 100%);
  border: 1.5px solid #e1bd6d;
  box-shadow: 0 10px 28px -4px rgba(196, 154, 69, 0.3),
              0 0 0 4px rgba(225, 189, 109, 0.12),
              inset 0 1px 2px rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
  transition: all 0.35s ease;
}

[data-theme="dark"] .author-badge-inner {
  background: linear-gradient(135deg, rgba(8, 42, 33, 0.9) 0%, rgba(4, 28, 22, 0.95) 100%);
  border-color: rgba(223, 178, 62, 0.55);
  box-shadow: 0 12px 35px -5px rgba(0, 0, 0, 0.6),
              0 0 25px rgba(223, 178, 62, 0.25),
              0 0 0 3px rgba(223, 178, 62, 0.15);
}

.author-brand-group {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  direction: ltr;
}

.author-sparkle {
  font-size: 1.15rem;
  color: #dfb23e;
  filter: drop-shadow(0 0 6px #ffeaa7);
  animation: starPulse 2.5s infinite;
}

.author-text-prefix {
  font-family: var(--font-ui), 'Alexandria', sans-serif;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

.author-name-highlight {
  font-family: 'Alexandria', 'Cairo', sans-serif;
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: 0.4px;
  background: linear-gradient(135deg, #dfb23e 0%, #c49a45 40%, #e1bd6d 70%, #9e7528 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 2px rgba(196, 154, 69, 0.3));
  position: relative;
}

[data-theme="dark"] .author-name-highlight {
  background: linear-gradient(135deg, #fff9db 0%, #ffe066 30%, #dfb23e 70%, #e1bd6d 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 8px rgba(223, 178, 62, 0.6));
}

/* ==========================================================================
   7. أنيميشن الفراشة الذهبية المرفرفة (The Realistic Golden Fluttering Butterfly)
   ========================================================================== */
.golden-butterfly-anim {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  perspective: 400px;
  margin-left: 0.15rem;
  margin-right: 0.15rem;
}

.butterfly-svg {
  width: 36px;
  height: 36px;
  overflow: visible;
  filter: drop-shadow(0 2px 8px rgba(223, 178, 62, 0.45));
  animation: butterflyFloat 3s ease-in-out infinite alternate;
}

/* رفرفة الجناح الأيسر بتقنية 3D */
.wing-left {
  transform-origin: 32px 34px;
  animation: flapLeft 0.38s ease-in-out infinite alternate;
}

/* رفرفة الجناح الأيمن بتقنية 3D */
.wing-right {
  transform-origin: 32px 34px;
  animation: flapRight 0.38s ease-in-out infinite alternate;
}

@keyframes flapLeft {
  0% {
    transform: rotateY(0deg) rotateZ(0deg);
  }
  100% {
    transform: rotateY(68deg) rotateZ(-6deg);
  }
}

@keyframes flapRight {
  0% {
    transform: rotateY(0deg) rotateZ(0deg);
  }
  100% {
    transform: rotateY(-68deg) rotateZ(6deg);
  }
}

@keyframes butterflyFloat {
  0% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-4px) rotate(3deg);
  }
  100% {
    transform: translateY(-1px) rotate(-3deg);
  }
}

/* شارة زيارة البورتفوليو الخارجية */
.portfolio-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  background: rgba(196, 154, 69, 0.12);
  color: var(--qur-gold-dark);
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid rgba(196, 154, 69, 0.3);
  transition: all 0.25s ease;
  margin-right: 0.4rem;
}

[data-theme="dark"] .portfolio-tag {
  background: rgba(223, 178, 62, 0.18);
  color: #ffeaa7;
  border-color: rgba(223, 178, 62, 0.4);
}

/* تأثير تحويم توقيع المطور الفخم */
.portal-author-link:hover .author-badge-inner {
  transform: translateY(-4px) scale(1.03);
  border-color: #dfb23e;
  box-shadow: 0 16px 36px rgba(196, 154, 69, 0.45),
              0 0 25px rgba(223, 178, 62, 0.35),
              0 0 0 6px rgba(225, 189, 109, 0.2);
}

.portal-author-link:hover .portfolio-tag {
  background: var(--qur-gold-gradient);
  color: #03231b;
  border-color: transparent;
  box-shadow: 0 2px 10px rgba(196, 154, 69, 0.4);
}

.portal-author-link:hover .butterfly-svg {
  filter: drop-shadow(0 0 14px rgba(223, 178, 62, 0.8));
}

.portal-author-link:hover .wing-left {
  animation-duration: 0.2s; /* رفرفة أسرع عند التحويم */
}

.portal-author-link:hover .wing-right {
  animation-duration: 0.2s;
}

/* ==========================================================================
   8. زر العودة للبوابة في الأقسام الأخرى (Back to Portal Floating Pill)
   ========================================================================== */
.back-to-portal-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1.1rem;
  border-radius: 50px;
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  color: var(--qur-gold-dark);
  font-weight: 700;
  font-size: 0.88rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s ease;
  margin-bottom: 1.2rem;
}

[data-theme="dark"] .back-to-portal-btn {
  background: #062a21;
  color: #dfb23e;
  border-color: rgba(223, 178, 62, 0.35);
}

.back-to-portal-btn:hover {
  background: var(--qur-gold-gradient);
  color: #03231b;
  transform: translateX(4px);
  box-shadow: 0 6px 18px rgba(196, 154, 69, 0.3);
}

/* ==========================================================================
   9. تذييل الموقع الملكي (Footer Signature)
   ========================================================================== */
.qurani-site-footer {
  position: relative;
  margin-top: 4rem;
  padding: 3rem 1rem 5rem 1rem;
  border-top: 1px solid var(--border-gold-subtle);
  background: radial-gradient(circle at 50% 0%, rgba(196, 154, 69, 0.08) 0%, transparent 60%);
  text-align: center;
}

[data-theme="dark"] .qurani-site-footer {
  border-top-color: rgba(223, 178, 62, 0.2);
  background: radial-gradient(circle at 50% 0%, rgba(223, 178, 62, 0.1) 0%, transparent 70%);
}

.footer-brand-title {
  font-family: var(--font-heading), 'Alexandria', sans-serif;
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--qur-emerald);
  margin-bottom: 0.4rem;
}

[data-theme="dark"] .footer-brand-title {
  color: #dfb23e;
}

.footer-quote {
  font-family: var(--font-quran), 'Amiri', serif;
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
