@import url('/assets/css/mobile-browser-fixes.css?v=2026050404');

.seo-internal-links {
  margin: 28px auto;
  padding: 22px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(30, 64, 175, 0.88));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 36px rgba(2, 8, 23, 0.18);
  color: #f8fafc;
}

.seo-internal-links h2,
.seo-internal-links h3 {
  margin: 0 0 10px;
  color: #fff7d6;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  line-height: 1.5;
}

.seo-internal-links p {
  margin: 0 0 16px;
  color: #e2e8f0;
  line-height: 1.9;
}

.seo-internal-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.seo-internal-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #ffffff;
  text-decoration: none;
  font-weight: 800;
  line-height: 1.6;
  text-align: center;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.seo-internal-link:hover,
.seo-internal-link:focus {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.28);
  outline: none;
}

@media (max-width: 640px) {
  .seo-internal-links {
    padding: 18px;
    border-radius: 18px;
  }

  .seo-internal-links-grid {
    grid-template-columns: 1fr;
  }
}

/* YL_HOME_STRAY_TEXT_CLEANUP_START
   يخفي أي نص منفرد مثل \n أو n/ يظهر بين أقسام الصفحة الرئيسية في الجوال دون التأثير على الأقسام نفسها. */
@media (max-width: 760px) {
  main.page-shell:has(#home-hero) {
    font-size: 0 !important;
  }

  main.page-shell:has(#home-hero) > section,
  main.page-shell:has(#home-hero) > div,
  main.page-shell:has(#home-hero) > footer {
    font-size: 11.3px !important;
  }
}
/* YL_HOME_STRAY_TEXT_CLEANUP_END */

/* YL_FINAL_MOBILE_EXPLANATION_HERO_LINKS_START
   قاعدة نهائية داخل هذا الملف نفسه حتى لا تتغلب عليها قاعدة الجوال القديمة التي تجعل الشبكة عموداً واحداً. */
@media screen and (max-width: 760px), screen and (hover: none), screen and (pointer: coarse), screen and (any-pointer: coarse), screen and (max-device-width: 1180px) {
  html body main.page-shell > section.hero.hero-modern:first-child .hero-content > .seo-internal-links-grid,
  html body.posts-page main.page-shell > section.hero.hero-modern:first-child .hero-content > .seo-internal-links-grid,
  html body.library-page main.page-shell > section.hero.hero-modern:first-child .hero-content > .seo-internal-links-grid,
  html body.library-detail-page main.page-shell > section.hero.hero-modern:first-child .hero-content > .seo-internal-links-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: auto !important;
    grid-auto-flow: row !important;
    gap: 6px !important;
    width: 100% !important;
    max-width: 100% !important;
    align-items: stretch !important;
  }

  html body main.page-shell > section.hero.hero-modern:first-child .hero-content > .seo-internal-links-grid > a,
  html body.posts-page main.page-shell > section.hero.hero-modern:first-child .hero-content > .seo-internal-links-grid > a,
  html body.library-page main.page-shell > section.hero.hero-modern:first-child .hero-content > .seo-internal-links-grid > a,
  html body.library-detail-page main.page-shell > section.hero.hero-modern:first-child .hero-content > .seo-internal-links-grid > a {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 32px !important;
    padding: 5px 4px !important;
    border-radius: 9px !important;
    font-size: clamp(7px, 1.8vw, 10px) !important;
    line-height: 1.2 !important;
    text-align: center !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
  }
}
/* YL_FINAL_MOBILE_EXPLANATION_HERO_LINKS_END */
