
:root {
  --adabi-bg: #f8f4ec;
  --adabi-surface: #fffdf9;
  --adabi-surface-2: #f4ede2;
  --adabi-dark: #2f241c;
  --adabi-text: #5b4a3f;
  --adabi-muted: #806d60;
  --adabi-gold: #b28a52;
  --adabi-red: #7a3b2e;
  --adabi-red-deep: #633024;
  --adabi-border: rgba(178, 138, 82, 0.22);
  --shadow-sm: 0 8px 24px rgba(47, 36, 28, 0.07);
  --shadow-md: 0 18px 45px rgba(47, 36, 28, 0.1);
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

html { scroll-behavior: smooth; }
body.front-site {
  font-family: "Bahij Palatino Sans Arabic", "BahijPalatinoSansArabic-Regular", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(178,138,82,0.08), transparent 25%),
    linear-gradient(180deg, #fbf8f2 0%, #f4ede2 100%);
  color: var(--adabi-text);
  line-height: 1.8;
}
a { color: inherit; text-decoration: none; }
a:hover { color: inherit; }
img { max-width: 100%; }
main#app.page-shell { min-height: calc(100vh - 220px); padding: 104px 0 32px; }
.container[dir="rtl"], [dir="rtl"] { text-align: right; }
.form-label { color: var(--adabi-dark); font-weight: 700; margin-bottom: 8px; }
.form-control, .form-select {
  min-height: 50px;
  border-radius: 14px;
  border: 1px solid var(--adabi-border);
  background: #fff;
  color: var(--adabi-dark);
  box-shadow: none;
}
.form-control::placeholder { color: #9a8879; }
.form-control:focus, .form-select:focus {
  border-color: var(--adabi-gold);
  box-shadow: 0 0 0 0.18rem rgba(178,138,82,0.12);
}
.input-icon-group { position: relative; }
.input-icon-group i {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  color: var(--adabi-gold); z-index: 2; font-size: .95rem;
}
.input-icon-group .form-control, .input-icon-group .form-select { padding-right: 42px; }

.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 1000;
  padding: 14px 0;
  backdrop-filter: blur(12px);
  background: rgba(248,244,236,.78);
  border-bottom: 1px solid rgba(122,59,46,.08);
}
.site-nav {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 12px 18px; border-radius: 20px; background: rgba(255,253,249,.88);
  border: 1px solid var(--adabi-border); box-shadow: var(--shadow-sm);
}
.brand-mark { display: inline-flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark img {
  width: 48px; height: 48px; object-fit: contain; border-radius: 14px;
  background: linear-gradient(135deg, rgba(122,59,46,.08), rgba(178,138,82,.12)); padding: 6px;
}
.brand-mark strong { display: block; color: var(--adabi-dark); font-size: 1.1rem; }
.brand-mark span { display: block; color: var(--adabi-muted); font-size: .86rem; }
.site-menu { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.site-menu a {
  color: var(--adabi-text); padding: 10px 14px; border-radius: 999px; font-weight: 700; transition: .2s ease;
}
.site-menu a:hover, .site-menu a.active { background: rgba(122,59,46,.09); color: var(--adabi-red); }
.site-actions { display: flex; align-items: center; gap: 10px; }
.nav-toggle {
  display: none; border: 0; background: var(--adabi-surface-2); color: var(--adabi-red);
  width: 44px; height: 44px; border-radius: 12px;
}

.btn-gradient, .btn-blog, .btn-outline-soft, .btn-outline-secondary, .btn-soft-gold {
  border: none; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 12px 22px; font-weight: 700; transition: .2s ease;
}
.btn-gradient, .btn-blog {
  color: #fff; background: linear-gradient(135deg, var(--adabi-red), #9a5b42);
  box-shadow: 0 10px 24px rgba(122,59,46,.16);
}
.btn-gradient:hover, .btn-blog:hover { color: #fff; transform: translateY(-2px); }
.btn-outline-soft, .btn-outline-secondary {
  background: #fff; color: var(--adabi-dark); border: 1px solid var(--adabi-border);
}
.btn-outline-soft:hover, .btn-outline-secondary:hover {
  background: var(--adabi-surface-2); color: var(--adabi-red); transform: translateY(-1px);
}

.section-header {
  display: flex; align-items: center; gap: 12px; margin: 28px 0 16px; color: var(--adabi-dark);
}
.section-header.compact { margin: 0 0 12px; }
.section-header i {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%;
  background: rgba(178,138,82,.12); color: var(--adabi-gold);
}
.section-header h2, .section-header h3, .section-header h4 { margin: 0; font-weight: 800; }

.hero-wrapper, .search-elegant, .century-card, .blog-card, .detail-card, .info-card, .category-card, .folk-item, .video-card, .poetry-card, .soft-panel {
  background: var(--adabi-surface);
  border: 1px solid var(--adabi-border);
  box-shadow: var(--shadow-sm);
}
.hero-wrapper {
  position: relative; overflow: hidden; border-radius: 34px; padding: 56px 22px 72px; margin-bottom: 0;
}
.hero-lite {
  background: linear-gradient(180deg, rgba(122,59,46,.96), rgba(99,48,36,.92)); color: #fff;
}
.hero-pattern {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle at 85% 20%, rgba(255,255,255,.16), transparent 18%),
    radial-gradient(circle at 10% 80%, rgba(255,255,255,.08), transparent 20%),
    linear-gradient(0deg, rgba(255,255,255,.04), rgba(255,255,255,.04));
}
.hero-content { position: relative; z-index: 1; }
.narrow-content { max-width: 760px; margin: 0 auto; }
.logo-circle {
  width: 104px; height: 104px; margin: 0 auto 16px; border-radius: 32px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.25);
  display: grid; place-items: center; padding: 16px;
}
.hero-kicker {
  display: inline-block; padding: 6px 14px; border-radius: 999px; background: rgba(255,255,255,.12);
  font-size: .92rem; margin-bottom: 12px;
}
.hero-title { font-size: clamp(2.2rem, 4vw, 3.5rem); font-weight: 800; margin: 0; }
.hero-lead { max-width: 620px; margin: 14px auto 0; color: rgba(255,255,255,.88); font-size: 1.04rem; }
.search-panel { border-radius: 28px; padding: 24px; }
.search-panel-overlap { margin: -36px auto 20px; position: relative; z-index: 2; }

.quick-stats-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; margin: 22px 0 8px;
}
.quick-stat {
  padding: 18px; border-radius: 20px; background: rgba(255,253,249,.76); border: 1px solid var(--adabi-border);
  text-align: center; box-shadow: var(--shadow-sm);
}
.quick-stat strong { display: block; color: var(--adabi-red); font-size: 1.5rem; line-height: 1.2; }
.quick-stat span { color: var(--adabi-muted); font-size: .95rem; }

.poets-scroll.simple-scroll {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px;
}
.poet-grid, .folk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 18px; }
.poet-grid-wide { grid-template-columns: repeat(auto-fit, minmax(138px, 1fr)); }
.poet-card-soft {
  background: linear-gradient(180deg, #fffdf9 0%, #f7f0e6 100%);
  border: 1px solid var(--adabi-border); border-radius: 22px; padding: 18px 12px; text-align: center;
  transition: transform .2s ease, box-shadow .2s ease;
}
.poet-card-soft:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.avatar {
  width: 98px; height: 98px; object-fit: cover; border-radius: 50%; border: 3px solid rgba(178,138,82,.18);
  box-shadow: 0 8px 18px rgba(122,59,46,.12);
}
.name-badge, .poet-card .name {
  display: inline-block; margin-top: 12px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--adabi-dark); font-weight: 700; padding: 8px 12px; border-radius: 999px; background: rgba(122,59,46,.08);
}
.century-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.chip {
  padding: 10px 16px; border-radius: 999px; background: #fff; color: var(--adabi-dark);
  border: 1px solid var(--adabi-border); font-weight: 700; transition: .2s ease;
}
.chip:hover { color: var(--adabi-red); background: rgba(122,59,46,.06); }
.century-card { padding: 22px; border-radius: 28px; margin-bottom: 22px; }
.century-card-soft { background: linear-gradient(180deg, rgba(255,253,249,.98), rgba(244,237,226,.9)); }
.century-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.century-title { font-weight: 800; color: var(--adabi-dark); }
.text-link { color: var(--adabi-red); font-weight: 700; }
.text-link:hover { color: var(--adabi-red-deep); }
.folk-item { border-radius: 20px; overflow: hidden; }
.folk-link {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px; color: var(--adabi-dark); font-weight: 700;
}
.folk-link-start { display: inline-flex; align-items: center; gap: 10px; }
.folk-icon, .folk-arrow { color: var(--adabi-gold); }

.blog-card, .info-card, .detail-card, .category-card, .video-card, .poetry-card {
  border-radius: 24px; overflow: hidden;
}
.blog-content, .card-body { padding: 22px; }
.blog-image, .rounded-cover { width: 100%; object-fit: cover; border-radius: 18px; }
.alert-info {
  background: #fff8ef; border: 1px solid var(--adabi-border); color: var(--adabi-dark); border-radius: 18px;
}
.pagination { gap: 8px; }
.page-link {
  border-radius: 999px !important; border: 1px solid var(--adabi-border); color: var(--adabi-dark); background: #fff;
}
.page-item.active .page-link, .page-link:hover { background: var(--adabi-red); border-color: var(--adabi-red); color: #fff; }

.bottom-nav {
  position: sticky; bottom: 12px; z-index: 40; display: flex; justify-content: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 12px; margin: 28px auto 0; width: fit-content; max-width: 100%;
  background: rgba(255,253,249,.93); border: 1px solid var(--adabi-border); border-radius: 999px;
  box-shadow: var(--shadow-sm); backdrop-filter: blur(10px);
}
.bottom-nav .nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 72px;
  color: var(--adabi-text); padding: 10px 14px; border-radius: 999px; transition: .2s ease;
}
.bottom-nav .nav-item.active, .bottom-nav .nav-item:hover { background: var(--adabi-red); color: #fff; }

.site-footer { color: var(--adabi-dark); }
.historical-surface {
  background: rgba(255,253,249,.92); border: 1px solid var(--adabi-border); border-radius: 30px;
}
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-brand img {
  width: 56px; height: 56px; object-fit: contain; padding: 8px; border-radius: 18px;
  background: linear-gradient(135deg, rgba(122,59,46,.1), rgba(178,138,82,.15));
}
.footer-brand h5 { color: var(--adabi-dark); font-weight: 800; margin-bottom: 6px; }
.footer-brand p { color: var(--adabi-muted); }
.footer-socials { display: flex; flex-wrap: wrap; gap: 10px; }
.footer-socials a {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(122,59,46,.08); color: var(--adabi-red);
}
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links h6 { color: var(--adabi-dark); font-weight: 800; margin-bottom: 6px; }
.footer-links a { color: var(--adabi-text); }
.footer-links a:hover { color: var(--adabi-red); }
.footer-search { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.footer-mini-links { display: flex; flex-wrap: wrap; gap: 8px; }
.footer-mini-links a {
  padding: 7px 12px; border-radius: 999px; background: rgba(122,59,46,.07); color: var(--adabi-dark); font-size: .92rem;
}
.footer-bottom {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--adabi-border);
  color: var(--adabi-muted);
}

.select2-container--bootstrap-5 .select2-selection {
  min-height: 50px !important; border-radius: 14px !important; border-color: var(--adabi-border) !important;
  padding-right: 34px !important; background-color: #fff !important;
}
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
  line-height: 48px !important; color: var(--adabi-dark) !important;
}
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow {
  left: 12px !important; right: auto !important; height: 48px !important;
}
.select2-container--bootstrap-5 .select2-dropdown { border-color: var(--adabi-border) !important; }

@media (max-width: 991px) {
  .site-nav { flex-wrap: wrap; }
  .nav-toggle { display: inline-grid; place-items: center; }
  .site-menu {
    display: none; width: 100%; padding-top: 8px; border-top: 1px solid var(--adabi-border);
  }
  .site-menu.open { display: flex; }
  .site-actions { width: 100%; justify-content: flex-end; }
}

@media (max-width: 767px) {
  main#app.page-shell { padding-top: 96px; }
  .hero-wrapper { padding: 34px 16px 58px; border-radius: 26px; }
  .search-panel { padding: 18px; }
  .search-panel-overlap { margin-top: -24px; }
  .quick-stats-grid { grid-template-columns: 1fr; }
  .poet-grid, .folk-grid, .poets-scroll.simple-scroll { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .avatar { width: 86px; height: 86px; }
  .century-card, .blog-content, .card-body { padding: 18px; }
  .century-heading-row, .footer-bottom, .footer-search { grid-template-columns: 1fr; display: grid; }
  .footer-search { display: grid; }
  .site-actions { justify-content: stretch; }
  .site-actions a { flex: 1; }
  .bottom-nav { width: calc(100% - 12px); border-radius: 22px; gap: 8px; }
  .bottom-nav .nav-item { min-width: 0; flex: 1; }
}

/* Font Awesome 4 compatibility for newer icon classes */
.fas, .far, .fab {
  display: inline-block;
  font: normal normal normal 14px/1 FontAwesome;
  font-size: inherit;
  text-rendering: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.fa-calendar-alt:before { content: "\f073"; }
.fa-book-open:before { content: "\f02d"; }
.fa-feather-alt:before, .fa-feather:before { content: "\f06c"; }
.fa-blog:before { content: "\f02d"; }
.fa-images:before { content: "\f03e"; }
.fa-donate:before, .fa-hand-holding-heart:before { content: "\f004"; }
.fa-shield-alt:before { content: "\f132"; }
.fa-linkedin-in:before { content: "\f0e1"; }
.fa-telegram-plane:before { content: "\f2c6"; }
.fa-times:before { content: "\f00d"; }


/* Final mobile polish */
body.front-site { overflow-x: hidden; }
main#app.page-shell { overflow-x: clip; }
.container { max-width: 1180px; }
.site-nav, .hero-wrapper, .search-panel, .century-card, .historical-surface, .blog-card, .detail-card, .info-card, .category-card, .video-card, .poetry-card {
  width: 100%;
}
.site-menu a, .site-actions a, .bottom-nav .nav-item { -webkit-tap-highlight-color: transparent; }

@media (max-width: 1199px) {
  .site-menu { gap: 4px; }
  .site-menu a { padding: 9px 12px; font-size: .95rem; }
  .site-actions a { padding-inline: 18px; }
}

@media (max-width: 991px) {
  .site-header { padding: 10px 0; }
  .site-nav {
    gap: 12px;
    padding: 12px;
    border-radius: 18px;
  }
  .brand-mark { flex: 1; }
  .brand-mark img { width: 44px; height: 44px; }
  .brand-mark strong { font-size: 1rem; }
  .brand-mark span { font-size: .82rem; }
  .nav-toggle { order: 3; }
  .site-actions {
    order: 4;
    width: 100%;
    display: none;
    padding-top: 10px;
    border-top: 1px solid var(--adabi-border);
  }
  .site-menu {
    order: 5;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  .site-menu a {
    width: 100%;
    text-align: right;
    border-radius: 14px;
    padding: 12px 14px;
  }
  .site-menu.open,
  .site-menu.open + .site-actions,
  .site-actions.open {
    display: flex;
  }
  .site-actions a {
    flex: 1;
    text-align: center;
    min-height: 46px;
  }
}

@media (max-width: 767px) {
  body.front-site { font-size: 15px; }
  main#app.page-shell {
    padding-top: 92px;
    padding-bottom: 90px;
  }
  .container {
    padding-left: 12px;
    padding-right: 12px;
  }
  .site-nav {
    padding: 10px;
    border-radius: 16px;
  }
  .brand-mark { gap: 10px; }
  .brand-mark img {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }
  .brand-mark strong { font-size: .98rem; }
  .brand-mark span { font-size: .78rem; }
  .nav-toggle {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }
  .hero-wrapper {
    padding: 28px 14px 54px;
    border-radius: 22px;
  }
  .logo-circle {
    width: 82px;
    height: 82px;
    border-radius: 24px;
    padding: 12px;
    margin-bottom: 14px;
  }
  .hero-kicker { font-size: .82rem; }
  .hero-title { font-size: 1.9rem; }
  .hero-lead {
    font-size: .95rem;
    line-height: 1.9;
  }
  .search-panel {
    padding: 16px;
    border-radius: 22px;
  }
  .search-panel-overlap {
    margin-top: -20px;
    margin-bottom: 14px;
  }
  .section-header {
    gap: 10px;
    margin: 22px 0 14px;
  }
  .section-header i {
    width: 38px;
    height: 38px;
    font-size: .95rem;
  }
  .section-header h2,
  .section-header h3,
  .section-header h4 { font-size: 1.06rem; }
  .quick-stats-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 16px;
  }
  .quick-stat {
    padding: 14px 12px;
    border-radius: 16px;
  }
  .quick-stat strong { font-size: 1.25rem; }
  .poet-grid,
  .folk-grid,
  .poets-scroll.simple-scroll {
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 12px;
  }
  .poet-card-soft {
    border-radius: 18px;
    padding: 14px 8px;
  }
  .avatar {
    width: 78px;
    height: 78px;
  }
  .name-badge,
  .poet-card .name {
    margin-top: 10px;
    padding: 7px 10px;
    font-size: .88rem;
  }
  .century-card,
  .blog-content,
  .card-body,
  .historical-surface {
    padding: 16px;
    border-radius: 20px;
  }
  .century-heading-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 14px;
  }
  .century-chips {
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .century-chips::-webkit-scrollbar { display: none; }
  .chip {
    white-space: nowrap;
    padding: 9px 14px;
    font-size: .9rem;
  }
  .folk-link {
    padding: 14px;
    font-size: .95rem;
  }
  .footer-top > [class*="col-"] { margin-bottom: 4px; }
  .footer-brand {
    align-items: flex-start;
    gap: 12px;
  }
  .footer-brand img {
    width: 50px;
    height: 50px;
  }
  .footer-socials { gap: 8px; }
  .footer-socials a {
    width: 38px;
    height: 38px;
  }
  .footer-search {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .footer-search .btn-gradient {
    width: 100%;
  }
  .footer-bottom {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    text-align: center;
  }
  .bottom-nav {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
    margin: 0;
    padding: 8px;
    gap: 6px;
    border-radius: 18px;
  }
  .bottom-nav .nav-item {
    font-size: .82rem;
    padding: 9px 8px;
    min-width: 0;
  }
  .bottom-nav .nav-item i { font-size: 1rem; }
  .select2-container {
    width: 100% !important;
    max-width: 100%;
  }
  .select2-container--bootstrap-5 .select2-selection {
    min-height: 48px !important;
  }
}

@media (max-width: 480px) {
  main#app.page-shell { padding-top: 88px; }
  .hero-title { font-size: 1.65rem; }
  .hero-lead { font-size: .9rem; }
  .poet-grid,
  .folk-grid,
  .poets-scroll.simple-scroll {
    grid-template-columns: 1fr 1fr;
  }
  .avatar {
    width: 72px;
    height: 72px;
  }
  .name-badge,
  .poet-card .name {
    font-size: .82rem;
  }
  .bottom-nav .nav-item span { font-size: .76rem; }
}
