/* Public library presentation. Legacy article markup and backend forms are retained. */
.library-page {
  --library-ink: #17332e;
  --library-green: #204d42;
  --library-paper: #f7f7f0;
  --library-muted: #65716b;
  --library-border: #dce1d6;
  margin: 0;
  background: var(--library-paper);
  color: var(--library-ink);
  font-family: Tahoma, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.9;
  direction: rtl;
  -webkit-font-smoothing: antialiased;
}
.library-page *, .library-page *::before, .library-page *::after { box-sizing: border-box; }
.library-page .container { width: min(1200px, calc(100% - 64px)); padding-inline: 0; margin-inline: auto; }
.library-header-inner::before, .library-header-inner::after,
.library-search-inner::before, .library-search-inner::after,
.library-shell::before, .library-shell::after { content: none; display: none; }
.library-page p { font-family: inherit !important; }
.library-page a { color: var(--library-green); text-decoration: none; text-shadow: none; }
.library-page a:hover { text-decoration: underline; text-underline-offset: 5px; }
.library-page a:focus-visible, .library-page button:focus-visible, .library-page input:focus-visible, .library-page textarea:focus-visible, .library-page summary:focus-visible { outline: 3px solid #987740; outline-offset: 4px; }
.library-page img { max-width: 100%; height: auto; }
.library-page svg { display: block; max-width: 100%; }
.library-page h1, .library-page h2, .library-page h3 { color: var(--library-ink); line-height: 1.7; overflow-wrap: anywhere; }
.library-page .library-visually-hidden { position: absolute; width: 1px; height: 1px; min-width: 0; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.library-skip-link { position: absolute; top: 10px; right: 20px; z-index: 1100; padding: 12px 20px; background: #17332e; color: white !important; border-radius: 8px; transform: translateY(-180%); }
.library-skip-link:focus { transform: translateY(0); }
.library-header { background: var(--library-paper); border-bottom: 1px solid var(--library-border); }
.library-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 32px; min-height: 104px; padding-block: 20px; }
.library-brand { display: flex; align-items: center; gap: 13px; color: var(--library-ink) !important; flex-shrink: 0; }
.library-brand:hover { text-decoration: none !important; }
.library-brand-mark { width: 46px; height: 46px; display: grid; place-items: center; background: var(--library-ink); color: #e7efdf; border-radius: 11px; }
.library-brand-mark svg { width: 30px; height: 30px; }
.library-brand-name { display: block; font-size: 21px; line-height: 1.5; }
.library-brand-tagline { display: block; font-size: 11px; color: var(--library-muted); margin-top: 3px; }
.library-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 23px; font-size: 13px; }
.library-nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--library-ink); }
.library-nav-current { border-bottom: 2px solid var(--library-green); }
.library-search { background: #eff2e8; border-bottom: 1px solid var(--library-border); }
.library-search-inner { display: flex; justify-content: space-between; align-items: center; gap: 30px; padding-block: 30px; }
.library-search-copy p { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.7; }
.library-search-copy .library-eyebrow { font-size: 11px; font-weight: 400; color: #698453; margin-bottom: 5px; }
.library-search-form { flex: 0 1 510px; min-width: 0; }
.library-search-control { display: flex; align-items: stretch; padding: 6px; background: white; border: 1px solid #c5cebc; border-radius: 9px; }
.library-page .library-search-control .form-control { min-width: 0; flex: 1; border: 0; padding: 10px 15px; height: 46px; background: transparent; box-shadow: none; font-size: 14px; }
.library-button { font: inherit; cursor: pointer; border: 1px solid transparent; border-radius: 6px; min-height: 45px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 10px 20px; font-size: 13px; line-height: 1.7; }
.library-button-primary { background: var(--library-ink); color: white; }
.library-button-primary:hover { background: #315349; }
.library-shell { display: grid; grid-template-columns: minmax(0, 1fr) 292px; grid-template-areas: "content sidebar"; gap: 30px; align-items: start; padding-block: 40px; }
.library-main { grid-area: content; min-width: 0; }
.library-sidebar { grid-area: sidebar; min-width: 0; }
.library-menu { border: 1px solid var(--library-border); border-radius: 10px; overflow: hidden; background: #fff; }
.library-menu > summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 58px; padding: 14px 19px; background: #edf1e6; cursor: pointer; font-size: 13px; font-weight: 700; list-style: none; }
.library-menu > summary::-webkit-details-marker { display: none; }
.library-menu > summary .fa { margin-left: 6px; color: #6d8658; }
.library-menu-indicator { font: 22px/1 Arial, sans-serif; transition: transform .15s ease; }
.library-menu[open] .library-menu-indicator { transform: rotate(180deg); }
.library-menu-content { padding: 16px; }
.library-shortcuts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.library-shortcuts a, .library-shortcuts button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 13px 8px; min-height: 78px; border: 1px solid var(--library-border); border-radius: 7px; background: #fafbf6; color: var(--library-ink); font: inherit; font-size: 11px; line-height: 1.7; text-align: center; cursor: pointer; overflow-wrap: anywhere; }
.library-shortcuts .fa { font-size: 21px; color: #698453; }
.library-shortcuts a:hover, .library-shortcuts button:hover { border-color: #879d74; background: #eff4e9; text-decoration: none; }
.library-page .panel { background: white; border: 1px solid var(--library-border); border-radius: 11px; box-shadow: none; margin-bottom: 24px; overflow: hidden; }
.library-page .panel-default > .panel-heading, .library-page .panel-warning > .panel-heading { background: #fff; color: var(--library-ink); border-bottom: 1px solid var(--library-border); border-color: var(--library-border); padding: 24px 28px; }
.library-page .panel-title { margin: 0; color: var(--library-ink); line-height: 1.7; }
.library-page h1.panel-title { font-size: clamp(23px, 2.3vw, 31px); font-weight: 700; }
.library-page .panel-title > .fa { margin-left: 7px; color: #789264; font-size: .78em; }
.library-page .panel-body { padding: 28px; }
.library-page .background-fff9e8, .library-page .background-fff9e8 a.list-group-item { background-color: white; }
.library-page .list-group { margin-bottom: 0; }
.library-page a.list-group-item, .library-page .list-group-item:nth-child(even) { color: var(--library-ink); background: white; border: 0; border-bottom: 1px solid #e7ebdf !important; padding: 17px 25px; line-height: 1.9; text-shadow: none; overflow-wrap: anywhere; border-radius: 0; }
.library-page a.list-group-item .fa { color: #80946f; margin-left: 7px; font-size: 12px; }
.library-page a.list-group-item:hover, .library-page a.list-group-item:focus, .library-page .more-last-link .list-group-item:last-child:hover { color: var(--library-ink) !important; background: #f0f4e8 !important; text-shadow: none; text-decoration: none; }
.library-page a.list-group-item:last-child { border-bottom: 0 !important; }
.library-page .article-list-link { display: flex; flex-direction: column; gap: 5px; }
.library-page .article-list-title { display: block; }
.library-page .article-date { display: block; color: var(--library-muted); font-size: 11px; font-weight: 400; line-height: 1.8; margin: 0; }
.library-page .list-group-item h6 { display: block; float: none !important; color: var(--library-muted) !important; font-size: 11px !important; margin-block: 6px !important; }
.library-page .btn-more, .library-page .more-btn { display: block; float: none; position: static; text-align: center; background: #edf2e5 !important; color: var(--library-green) !important; padding: 13px 20px; border: 0; border-radius: 0; text-shadow: none; font-weight: 400; font-size: 12px; }
.library-sidebar .panel { margin-top: 18px; margin-bottom: 0; border-radius: 8px; }
.library-sidebar .panel-heading { padding: 14px 16px !important; background: #f7f9f1 !important; }
.library-sidebar .panel-title { font-size: 15px; }
.library-sidebar a.list-group-item { font-size: 11px; padding: 12px 15px; line-height: 1.9; }
.library-sidebar .library-menu-content > br { display: none; }
.library-page .article-reader-count { margin-top: 10px; font-size: 11px; color: var(--library-muted); }
.article-breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 10px; margin-bottom: 26px; font-size: 11px; color: var(--library-muted); }
.article-breadcrumbs .fa { color: #8e9e7b; font-size: 10px; }
.article-breadcrumbs a { min-height: 30px; display: inline-flex; align-items: center; gap: 5px; }
.library-page .article-section-title { font-size: 21px; font-weight: 700; margin: 0 0 17px; }
.article-question { padding: 24px; background: #f2f5eb; border: 1px solid #dce5cf; border-radius: 8px; margin-bottom: 30px; }
.library-page .article-divider { border: 0; border-top: 1px solid #dbe2d2; margin: 28px 0; }
.article-prose { font-family: 'Droid Arabic Naskh', Tahoma, Arial, sans-serif; font-size: 19px; line-height: 2.1; overflow-wrap: anywhere; }
.article-prose p, .article-prose li { line-height: 2.1 !important; margin-bottom: 20px; }
.article-prose p span { line-height: inherit !important; }
.article-prose img, .article-prose iframe, .article-prose video, .article-prose object { max-width: 100%; }
.article-prose img { height: auto !important; }
.article-prose pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.article-prose table { max-width: 100%; }
.library-page .related-articles-title, .library-page .article-comments-title { font-size: 20px; font-weight: 700; margin: 0 0 18px; }
.library-page .list-panel { display: block; line-height: 1.9; font-size: 15px; padding-block: 8px; }
.library-page .library-form label { display: block; min-width: 0; margin-bottom: 8px; font-size: 13px; font-weight: 400; }
.library-page .form-control { border: 1px solid #bbc8b1; border-radius: 6px; box-shadow: none; background: #fff; color: var(--library-ink); font-size: 15px; min-height: 46px; padding: 10px 13px; }
.library-page .form-control:focus { border-color: #688555; box-shadow: 0 0 0 3px #76995b20; }
.library-page textarea.form-control { min-height: 145px; resize: vertical; line-height: 1.9; }
.library-page .library-form .form-group { margin-bottom: 21px; }
.library-page input.btn-warning { width: auto; min-width: 160px; min-height: 48px; padding: 11px 24px; background: var(--library-ink); color: white; border: 1px solid var(--library-ink); font-size: 13px; }
.library-page input.btn-warning:hover { background: #315349; }
.library-page .alert { border-radius: 8px; font-size: 14px; line-height: 1.9; }
.library-page .close { float: left; }
.library-page .pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin: 5px 0 24px; padding: 0; }
.library-page .pagination > li { display: block; }
.library-page .pagination > li > a, .library-page .pagination > li > span { border: 1px solid var(--library-border); border-radius: 6px; min-width: 42px; min-height: 42px; float: none; margin: 0; color: var(--library-green); display: grid; place-items: center; padding: 6px 11px; font-size: 13px; }
.library-page .pagination > .active > span, .library-page .pagination > .active > a { background: var(--library-ink); color: white; }
.library-page .library-pagination { text-align: center; }
.library-page .empty-state { padding: 32px 24px; color: var(--library-muted); text-align: center; font-size: 15px; }
.library-page .category-directory { display: grid; gap: 24px; }
.library-page .directory-category-title { font-size: 19px; margin: 0 0 14px; }
.library-page .directory-subtitle { display: block; font-size: 14px; padding-block: 9px; padding-right: 20px; color: var(--library-green); }
.library-page .directory-subitem { padding-right: 40px; font-size: 13px; }
.library-page .directory-category { border-bottom: 1px solid var(--library-border); padding-bottom: 20px; }
.library-page .directory-category:last-child { border-bottom: 0; padding-bottom: 0; }
.library-page #subcats { margin: 0 0 18px !important; display: flex; flex-wrap: wrap; gap: 8px; }
.library-page .subcat { padding: 10px 13px; background: #f0f4e8; border: 1px solid #dce5ce; border-radius: 6px; font-size: 12px; }
.library-page .subcat + div[style="clear:both;"] { display: none; }
.library-page .subcategory-article { padding: 17px 0; border-bottom: 1px solid var(--library-border); }
.library-page .subcategory-article:last-child { border-bottom: 0; }
.library-page .subcategory-article a { display: block; }
.library-page .subcategory-article .article-list-title { color: var(--library-ink); font-size: 15px; }
.library-page .library-results { margin: 0; padding-right: 24px; }
.library-page .library-results li { margin-bottom: 15px; padding-right: 5px; }
.library-page .library-results a { display: block; min-height: 34px; }
.library-collections { padding-bottom: 48px; }
.library-section-heading { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 20px; margin-bottom: 24px; }
.library-section-heading h2 { font-size: 24px; margin: 0; }
.library-section-heading p { color: #698453; font-size: 11px; margin: 0 0 8px; }
.library-text-link { display: inline-flex; align-items: center; min-height: 42px; font-size: 12px; gap: 15px; }
.collection-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.collection-card { background: white; border: 1px solid var(--library-border); border-radius: 10px; overflow: hidden; }
.collection-card > summary { display: flex; justify-content: space-between; align-items: center; gap: 14px; min-height: 94px; padding: 24px; cursor: pointer; list-style: none; font-size: 16px; line-height: 1.9; font-weight: 700; }
.collection-card > summary::-webkit-details-marker { display: none; }
.collection-card > summary .fa { color: #839972; font-size: 17px; }
.collection-card[open] > summary { border-bottom: 1px solid var(--library-border); background: #eef3e6; }
.collection-card[open] > summary > .fa { transform: rotate(180deg); }
.collection-links { max-height: 400px; overflow-y: auto; overscroll-behavior: contain; }
.collection-links .list-group-item { font-size: 12px; padding: 13px 20px !important; }
.library-page .library-question-modal .modal-content { border: 1px solid var(--library-border); border-radius: 12px; }
.library-page .library-question-modal .modal-header { background: #edf2e5; border-radius: 12px 12px 0 0; padding: 20px 24px; }
.library-page .library-question-modal .modal-title { font-size: 21px; }
.library-page .library-question-modal .modal-body { padding: 25px; font-size: 16px; line-height: 2.1; }
.library-page .library-question-modal .modal-body a { text-decoration: underline; }
.library-page .library-question-modal .modal-footer { font-size: 12px; padding: 16px 24px; color: var(--library-muted); text-align: right; }
.library-page #footer.library-footer { margin-top: 20px; background: var(--library-ink); color: #eef4e8; border: 0; padding: 34px 0 0; height: auto; font-size: 12px; }
.library-footer-top { display: flex; justify-content: space-between; align-items: start; gap: 30px; padding-bottom: 27px; }
.library-footer-top strong { font-size: 19px; }
.library-page #footer .library-footer-top p { color: #bfccbb; font-size: 11px; font-weight: 400; margin: 8px 0 0; }
.library-social-links { display: flex; flex-wrap: wrap; gap: 6px 21px; }
.library-page .library-footer a { color: #e5efdd; display: inline-flex; align-items: center; min-height: 40px; gap: 9px; }
.library-footer-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px 25px; border-top: 1px solid #3b5547; padding-block: 18px; }
.library-page #footer .library-footer-bottom p { font-size: 10px; line-height: 1.9; font-weight: 400; color: #bdcdb7; margin: 0; }
.library-footer-bottom > a { font-size: 10px; }

@media (max-width: 1099px) {
  .library-header-inner { gap: 25px; }
  .library-nav { gap: 4px 15px; font-size: 12px; }
  .library-shell { grid-template-columns: minmax(0, 1fr) 258px; gap: 24px; }
  .library-page .panel-body { padding: 24px; }
  .library-page .panel-heading { padding-inline: 24px !important; }
}
@media (max-width: 899px) {
  .library-header-inner { flex-direction: column; align-items: stretch; gap: 13px; padding-block: 19px 12px; }
  .library-brand { align-self: flex-start; }
  .library-nav { gap: 4px 23px; }
  .library-search-inner { gap: 22px; }
  .library-search-copy p { font-size: 18px; }
  .library-search-form { flex-basis: 55%; }
  .library-shell { grid-template-columns: 1fr; grid-template-areas: "sidebar" "content"; gap: 24px; padding-block: 25px; }
  .library-shortcuts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .library-sidebar .panel-title { font-size: 16px; }
  .library-sidebar a.list-group-item { font-size: 13px; }
  .collection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 619px) {
  .library-page { font-size: 15px; }
  .library-page .container { width: calc(100% - 36px); }
  .library-header-inner { padding-block: 17px 10px; gap: 10px; }
  .library-brand-mark { width: 40px; height: 40px; border-radius: 9px; }
  .library-brand-mark svg { width: 27px; height: 27px; }
  .library-brand-name { font-size: 19px; }
  .library-brand-tagline { font-size: 10px; }
  .library-nav { gap: 1px 19px; font-size: 11px; }
  .library-nav a { min-height: 41px; }
  .library-search-inner { flex-direction: column; align-items: stretch; gap: 16px; padding-block: 24px; }
  .library-search-copy p { font-size: 19px; }
  .library-search-copy .library-eyebrow { font-size: 10px; }
  .library-search-form { flex-basis: auto; }
  .library-page .library-search-control .form-control { font-size: 13px; padding-inline: 10px; }
  .library-search-control .library-button { padding-inline: 14px; font-size: 12px; }
  .library-menu > summary { padding: 13px 16px; font-size: 12px; min-height: 52px; }
  .library-menu-content { padding: 13px; }
  .library-shortcuts { gap: 7px; }
  .library-shortcuts a, .library-shortcuts button { font-size: 10px; padding-inline: 6px; }
  .library-page .panel { margin-bottom: 20px; }
  .library-page .panel-heading { padding: 20px !important; }
  .library-page h1.panel-title { font-size: 23px; line-height: 1.9; }
  .library-page .panel-body { padding: 22px 18px; }
  .library-page a.list-group-item { padding: 17px 19px; font-size: 14px; }
  .library-page .article-date { font-size: 10px; }
  .library-page .article-reader-count { font-size: 10px; margin-top: 9px; }
  .article-breadcrumbs { font-size: 10px; gap: 4px 7px; margin-bottom: 22px; }
  .article-question { padding: 19px 16px; }
  .library-page .article-section-title { font-size: 20px; }
  .article-prose { font-size: 18px; line-height: 2.2; }
  .article-prose p, .article-prose li { line-height: 2.2 !important; margin-bottom: 20px; }
  .library-page .related-articles-title, .library-page .article-comments-title { font-size: 19px; line-height: 1.9; }
  .library-page .list-panel { font-size: 14px; }
  .library-page .library-form label { font-size: 12px; }
  .library-page .form-control { font-size: 16px; }
  .library-page .pagination { gap: 6px; }
  .library-page .pagination > li > a, .library-page .pagination > li > span { min-width: 36px; min-height: 40px; padding-inline: 9px; font-size: 12px; }
  .library-page .directory-category-title { font-size: 18px; }
  .library-page .directory-subtitle { padding-right: 13px; font-size: 13px; }
  .library-page .directory-subitem { padding-right: 26px; font-size: 12px; }
  .library-page #subcats { gap: 7px; }
  .library-page .subcat { padding: 9px 11px; font-size: 11px; }
  .library-page .library-collections { padding-bottom: 32px; }
  .library-section-heading { margin-bottom: 20px; gap: 10px; }
  .library-section-heading h2 { font-size: 21px; }
  .collection-grid { grid-template-columns: 1fr; gap: 13px; }
  .collection-card > summary { min-height: 77px; padding: 21px; font-size: 14px; }
  .collection-links .list-group-item { font-size: 12px; }
  .library-page .library-question-modal .modal-title { font-size: 19px; }
  .library-page .library-question-modal .modal-body { font-size: 15px; padding: 21px; }
  .library-footer-top { flex-direction: column; gap: 18px; padding-bottom: 22px; }
  .library-footer-top strong { font-size: 18px; }
  .library-social-links { font-size: 11px; }
  .library-footer-bottom { flex-direction: column; align-items: flex-start; gap: 9px; }
}
@media (max-width: 349px) {
  .library-page .container { width: calc(100% - 28px); }
  .library-nav { column-gap: 13px; }
  .library-shortcuts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .library-page .panel-heading { padding: 18px !important; }
  .library-page .panel-body { padding: 20px 15px; }
  .library-page h1.panel-title { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) {
  .library-page *, .library-page *::before, .library-page *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}
@media print {
  .library-header, .library-search, .library-sidebar, .library-collections, .library-footer, .article-comments, .library-skip-link { display: none !important; }
  .library-page { background: white; color: black; }
  .library-page .container { width: 100%; }
  .library-shell { display: block; padding: 0; }
  .library-page .panel { border: 0; }
  .library-page .article-prose { font-size: 13pt; }
}
