/* Shared finishing layer: readable controls, clear hierarchy and compact navigation. */
:root { --ui-focus: #956719; }
body { padding-bottom: var(--footer-height, 100px); }
html { scroll-padding-bottom: calc(var(--footer-height, 100px) + 16px); }
html[lang="ar"] body > footer { position: fixed; inset: auto 0 0; width: 100%; z-index: 100; box-shadow: 0 -4px 18px #00000012; }
html { scroll-padding-top: 24px; }
*, *::before, *::after { box-sizing: border-box; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--ui-focus); outline-offset: 4px; }
.skip-link { position: fixed; top: -100px; inset-inline-start: 16px; z-index: 2000; background: #fff; color: #760d11; padding: 12px 20px; border: 2px solid; border-radius: 10px; }
.skip-link:focus { top: 12px; }
.library-header { border-radius: 14px; box-shadow: none; }
.library-header .header-inner { min-height: 76px; }
.university-hero .hero-grid { min-height: 440px; padding-block: 32px; gap: 48px; grid-template-columns: 1.5fr 1fr; }
html[lang="ar"] .university-hero .hero-copy h1 { font-size: clamp(30px,3.4vw,46px); margin-bottom: 12px; }
.university-hero .hero-intro { font-size: 17px; margin-bottom: 22px; }
.university-seal-panel { max-width: 310px; padding: 26px 20px; box-shadow: none; }
.university-seal { width: 160px; height: 160px; }
.university-seal-panel p { font-size: 26px; }
.hero-search { max-width: 620px; margin-bottom: 14px; text-align: start; }
.hero-search label { display: block; color: #f2e4b0; font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.hero-search > div { display: flex; background: #fff; padding: 6px; gap: 8px; border-radius: 12px; box-shadow: 0 8px 24px #0002; }
.hero-search input { min-width: 0; flex: 1; border: 0; border-radius: 7px; padding: 12px; background: white; color: #243438; font: inherit; font-size: 16px; }
.hero-search input::placeholder { color: #697276; }
.hero-search button { background: #a11216; color: #fff; border: 0; border-radius: 8px; padding: 10px 20px; font: inherit; font-weight: 700; white-space: nowrap; }
.hero-search button:hover { background: #760d11; }
.university-hero-actions .university-secondary { border: 0; background: transparent; padding: 8px 0; margin-inline-end: 20px; font-size: 15px; }
.university-hero .hero-caption { margin-top: 10px; }
.strip-inner { padding-block: 16px; }
.subjects-section { padding-block: 36px; }
.section-heading { margin-bottom: 22px; }
.catalog-search { border-radius: 12px; box-shadow: none; align-items: end; }
.catalog-search input, .catalog-search select { min-height: 44px; font-size: 16px; }
.catalog-search label { font-size: 14px; }
.catalog-card { border-radius: 12px; box-shadow: none; display: flex; flex-direction: column; transition: border-color .18s, box-shadow .18s; }
.catalog-card:hover, .catalog-card:focus-within { border-color: #b7a278; box-shadow: 0 8px 24px #1f2f330c; }
.catalog-card h3 { line-height: 1.6; }
.catalog-card .card-meta { margin-top: auto; font-size: 14px; }
.book-author { font-size: 15px; }
.cover-link { padding: 24px 30px; border-radius: 8px; }
.catalog-pagination a { min-height: 44px; display: inline-flex; align-items: center; }
.catalog-load { text-align: center; padding-block: 28px 8px; min-height: 70px; }
.catalog-load p { color: var(--cordoba-muted); font-size: 16px; margin: 12px 0 0; }
.catalog-load [aria-disabled="true"] { opacity: .6; cursor: progress; }
.book-detail .detail-copy h1 { overflow-wrap: anywhere; }
html[lang="ar"] body:not(.library-page) { background: #f5f5f2; }
body:not(.library-page) > header { margin: 0; }
body:not(.library-page) > header .navbar { border-radius: 0; box-shadow: none; margin-bottom: 0 !important; padding: 12px 20px; }
body > .container { padding-inline: 24px; }
.admin-shell { gap: 28px; padding-top: 28px; grid-template-columns: 208px minmax(0,1fr); align-items: start; }
.admin-sidebar { position: sticky; top: 24px; padding: 24px 16px; border-radius: 16px; }
.admin-brand { margin-bottom: 26px; }
.admin-sidebar nav a { border-radius: 9px; border-inline-start: 3px solid transparent; }
.admin-sidebar nav a.selected { border-inline-start-color: #e0cd7c; background: #ffffff20; font-weight: 800; }
.admin-note { margin-top: 40px; }
.admin-content { padding-top: 4px; }
.admin-heading { margin-bottom: 24px; }
.admin-heading h1 { font-size: clamp(26px,2.5vw,34px); margin-bottom: 6px; }
.admin-heading p { font-size: 16px; }
.admin-back { color: #760d11; font-size: 15px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.admin-stats { grid-template-columns: repeat(3,minmax(0,1fr)); }
.admin-stats.library-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
.admin-stat { padding: 22px; border-radius: 12px; gap: 6px; }
.admin-stat strong { font-size: 42px; line-height: 1.5; }
.admin-panel, .admin-table-wrap { border-radius: 12px; }
.admin-filters { padding: 18px; border: 1px solid var(--cordoba-border); border-radius: 12px; background: #fff; align-items: end; }
.admin-filters > div:first-child { min-width: 180px; }
.admin-content .btn { border-radius: 8px; min-height: 44px; font-weight: 600; }
.admin-content .btn-sm { min-height: 36px; }
.admin-content .form-control, .admin-content .form-select { min-height: 46px; border-radius: 8px; border-color: #cdd3d1; font-size: 16px; }
.admin-content .form-label { font-size: 16px; margin-bottom: 7px; }
.admin-content textarea { resize: vertical; }
.admin-table-wrap tbody tr:hover { background: #faf8f2; }
.admin-table-wrap td { font-size: 16px; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; white-space: nowrap; }
.status-badge::before { content: ''; width: 6px; height: 6px; background: currentColor; border-radius: 50%; }
.editor-grid { display: grid; grid-template-columns: minmax(0,1fr) 260px; gap: 22px; align-items: start; }
.editor-fields { display: grid; gap: 20px; min-width: 0; }
.editor-fields .admin-panel { min-width: 0; padding: 24px; }
.editor-legend { float: left; width: 100%; font-size: 19px; font-weight: 800; margin-bottom: 14px; }
.editor-legend + * { clear: both; }
.editor-fields .admin-panel > p + div { margin-top: 0; }
.editor-legend > span { color: #a11216; font-size: 14px; margin-inline-end: 8px; }
.editor-legend small, .cover-editor h2 small { color: #697578; font-size: 14px; font-weight: 400; margin-inline-start: 8px; }
.admin-panel .editor-hint { margin-bottom: 18px; font-size: 14px; }
.cover-editor { padding: 20px; }
.cover-editor h2 { font-size: 19px; font-weight: 800; }
.upload-preview { aspect-ratio: 3/4; border: 1px dashed #c5b894; border-radius: 10px; background: #faf7ee; display: grid; place-items: center; padding: 14px; overflow: hidden; margin-block: 18px; }
.upload-preview img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.upload-preview [data-cover-empty] { text-align: center; }
.upload-preview [data-cover-empty] > span { display: block; font-size: 54px; color: #a3946c; line-height: 1.3; margin-bottom: 16px; }
.upload-preview strong { font-size: 16px; }
.upload-preview p { font-size: 14px; margin-top: 8px; }
.upload-label { font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.cover-editor .form-control { font-size: 14px; padding: 8px; }
.cover-editor .upload-help { font-size: 14px; line-height: 1.9; margin-top: 12px; overflow-wrap: anywhere; }
.editor-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--cordoba-border); padding: 16px 22px; margin-top: 22px; border-radius: 12px; }
.editor-actions > span { font-size: 15px; color: #526a6d; }
.editor-actions > div { display: flex; gap: 10px; }
.editor-validation.validation-summary-valid { display: none; }
.editor-validation.validation-summary-errors { padding: 16px; margin-bottom: 20px; background: #fff0ed; border-radius: 10px; }
.editor-validation ul { margin: 0; }
[hidden] { display: none !important; }
@media (max-width:1100px) {
    .editor-grid { grid-template-columns: minmax(0,1fr); }
    .cover-editor { display: grid; grid-template-columns: 150px minmax(0,1fr); gap: 0 20px; }
    .cover-editor h2 { grid-column: 1/-1; }
    .upload-preview { grid-row: 2/8; margin: 8px 0 0; }
    .admin-shell { grid-template-columns: 180px minmax(0,1fr); gap: 20px; }
    .admin-stat { padding: 16px; }
    .admin-stat small { font-size: 13px; }
    .book-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px; }
}
@media (max-width:800px) {
    .university-hero .hero-grid { grid-template-columns: minmax(0,1fr); min-height: 0; padding-block: 30px; }
    .university-hero .hero-copy { padding: 0; }
    .university-seal-panel { display: none; }
    .university-hero .hero-intro, .hero-search { max-width: 100%; }
    .admin-stats, .admin-stats.library-stats { grid-template-columns: 1fr; }
    .admin-stat { display: grid; grid-template-columns: 1fr auto; align-items: center; }
    .admin-stat strong { grid-column: 2; grid-row: 1/3; }
    .book-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width:700px) {
    body > .container { padding-inline: 16px; }
    .admin-shell { grid-template-columns: 1fr; padding-top: 16px; gap: 16px; }
    .admin-sidebar { position: static; padding: 8px; border-radius: 12px; }
    .admin-sidebar nav { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0,1fr); gap: 2px; }
    .admin-sidebar nav a { text-align: center; padding: 10px 3px; font-size: 14px; border-inline-start: 0; }
    .admin-heading { flex-direction: row; flex-wrap: wrap; gap: 12px; }
    .admin-heading > .btn { width: 100%; }
    .admin-filters { flex-wrap: wrap; gap: 12px; }
    .admin-filters > div:first-child { flex-basis: 100%; }
    .admin-filters > div:nth-child(2) { flex: 1; }
    .admin-table-wrap th, .admin-table-wrap td { padding: 14px 12px; }
    .admin-table-wrap { scrollbar-width: thin; }
    .editor-fields .admin-panel { padding: 20px; }
}
@media (max-width:560px) {
    .library-header .header-inner { padding-block: 12px; }
    .library-nav { justify-content: space-between; }
    .library-nav > a { font-size: 14px; min-height: 40px; }
    .university-hero .hero-copy { text-align: start; }
    .university-kicker { margin-inline: 0; }
    html[lang="ar"] .university-hero .hero-copy h1 { font-size: 32px; }
    .hero-search input { font-size: 15px; padding-inline: 8px; }
    .hero-search button { padding-inline: 16px; }
    .university-hero-actions, .university-hero .hero-caption { justify-content: start; }
    .hero-caption { font-size: 13px; }
    .strip-inner { font-size: 13px; }
    .section-heading h2 { font-size: 27px; }
    .subject-chip { font-size: 15px; min-height: 44px; }
    .catalog-search { gap: 12px; }
    .catalog-search .library-button { min-height: 44px; }
    .cover-link { padding: 14px; }
    .catalog-card h3 { font-size: 18px; }
    .cover-editor { grid-template-columns: 110px minmax(0,1fr); gap: 0 14px; padding: 16px; }
    .upload-preview { padding: 8px; }
    .upload-preview strong { font-size: 14px; }
    .upload-preview p { display: none; }
    .editor-actions { flex-wrap: wrap; padding: 16px; }
    .editor-actions > div { width: 100%; }
    .editor-actions .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { .catalog-card { transition: none; } }

/* Keep the persistent footer compact, including on phones. */
body > .library-footer { padding-block: 10px; }
.library-footer .footer-inner { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px 20px; }
.library-footer .university-footer-brand { align-items: center; gap: 10px; }
.library-footer .university-footer-brand > img { width: 36px; height: 36px; }
html[lang="ar"] .library-footer .footer-name { font-size: 17px; }
.library-footer .university-footer-brand p { display: none; }
.library-footer .footer-links { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px 18px; font-size: 14px; }
@media (max-width:560px) {
    .library-footer .footer-inner { justify-content: center; }
    .library-footer .footer-links { justify-content: center; font-size: 13px; gap: 6px 12px; }
}

/* Slightly larger shared text, including styles inherited from the base theme. */
html { font-size: 18px; }
body { font-size: 16px; }
.library-nav > a, .library-button, .subject-chip, .book-author,
.detail-facts dd, .detail-keywords, .catalog-pagination { font-size: 15px; }
html[lang="ar"] .library-logo { font-size: 21px; }
html[lang="ar"] .library-logo small,
html[lang="ar"] .card-category { font-size: 13px; }
html[lang="ar"] .eyebrow, html[lang="ar"] .admin-eyebrow,
html[lang="ar"] .strip-note { font-size: 14px; }
.book-description, .about-section p:not(.eyebrow) { font-size: 16px; }
.catalog-card h3 { font-size: 22px; }
.detail-facts dt, .detail-keywords > span,
.admin-table-wrap th, .admin-stat small, .admin-note,
.admin-content .btn-sm, .footer-links small { font-size: 14px; }
@media (max-width: 560px) {
    html { font-size: 16px; }
    .library-nav > a { font-size: 14px; }
    .catalog-card h3 { font-size: 18px; }
    body > .library-footer { padding-block: 5px; }
    .library-footer .footer-inner { gap: 4px 10px; }
    .library-footer .university-footer-brand { gap: 7px; }
    .library-footer .university-footer-brand > img { width: 26px; height: 26px; }
    html[lang="ar"] .library-footer .footer-name { font-size: 13px; }
    .library-footer .footer-links { gap: 3px 8px; font-size: 11px; line-height: 1.4; }
    .library-footer .footer-links small { font-size: 10px; }
    body:not(.library-page) > .footer { line-height: 40px; font-size: 13px; }
}
