/* Limited to opted-in templates. Avoid changing site navigation, body typography, cards or existing grid algorithms. */
body.alo-on { --alo-gap:clamp(24px,3.7vw,52px); --alo-heading:clamp(1.65rem,3vw,2.9rem); }
body.alo-on.alo-level-1 { --alo-gap:clamp(30px,4.3vw,64px); }
body.alo-on.alo-level-3 { --alo-gap:clamp(18px,2.8vw,40px); }
/* Protect anchor targets and document flow. Reduce excessive blank areas only in primary content. */
body.alo-on main > section:not(.wp-block-cover):not(.has-background),
body.alo-on .site-main > section:not(.wp-block-cover):not(.has-background),
body.alo-on .entry-content > section:not(.wp-block-cover):not(.has-background) {
  margin-block: 0 !important;
  padding-block: var(--alo-gap) !important;
  min-height: 0;
}
body.alo-on main > section + section,
body.alo-on .site-main > section + section { border-top:1px solid rgba(15,57,67,.065); }
body.alo-on :is(.page-header,.entry-header,.archive-header,.blog-header,.hero-content,.drs-hero,.drs-page-hero,.drs-archive-hero,.services-hero,.page-hero) {
  margin-block:0 clamp(12px,2vw,26px) !important;
  padding-block:clamp(16px,3vw,42px) !important;
  min-height:0;
}
body.alo-on :is(.page-header,.entry-header,.archive-header) + :is(.entry-content,.site-content,main) {margin-block-start:0 !important;}
body.alo-on :is(.entry-content,.page-content) > :is(h1,h2,h3,p):first-child {margin-block-start:0;}
body.alo-on :is(.entry-content,.page-content) > p:empty {display:none;}
/* Center the actual heading element AND its constrained layout box. Long titles must wrap. */
body.alo-center-headings :is(.entry-header,.page-header,.archive-header,.blog-header,.drs-hero,.drs-page-hero,.drs-archive-hero,.services-hero,.page-hero) :is(h1,h2,.entry-title,.page-title),
body.alo-center-headings main > section > h1,
body.alo-center-headings main > section > h2,
body.alo-center-headings .site-main > article > header :is(h1,h2),
body.alo-center-headings :is(article,.post,.drs-service-card,.service-card) > :is(h1,h2,h3,h4),
body.alo-center-headings :is(article,.post,.drs-service-card,.service-card) :is(.entry-title,.post-title,.service-title) {
  display:block;
  text-align:center !important;
  margin-inline:auto !important;
  max-width:100%;
  overflow-wrap:anywhere;
  word-break:normal;
  text-wrap:pretty;
}
body.alo-center-headings :is(.entry-header,.page-header,.archive-header,.blog-header,.drs-hero,.drs-page-hero,.drs-archive-hero,.services-hero,.page-hero) h1,
body.alo-center-headings .site-main > article > header h1 {font-size:var(--alo-heading) !important;line-height:1.45 !important;letter-spacing:normal !important;}
body.alo-center-headings :is(article,.post,.drs-service-card,.service-card) :is(h2,h3,h4,.entry-title,.post-title,.service-title) {line-height:1.5 !important;}
@media (max-width: 1024px){body.alo-on{--alo-gap:clamp(22px,3.4vw,38px);}body.alo-on.alo-level-1{--alo-gap:clamp(26px,4vw,48px);}body.alo-on.alo-level-3{--alo-gap:clamp(16px,2.8vw,30px);}}
@media (max-width: 767px){
 body.alo-on{--alo-gap:22px;--alo-heading:clamp(1.5rem,6vw,2rem);}
 body.alo-on.alo-level-1{--alo-gap:28px;}
 body.alo-on.alo-level-3{--alo-gap:16px;}
 body.alo-on :is(.page-header,.entry-header,.archive-header,.blog-header,.hero-content,.drs-hero,.drs-page-hero,.drs-archive-hero,.services-hero,.page-hero){padding-block:16px 22px !important;}
 body.alo-on main > section:not(.wp-block-cover):not(.has-background), body.alo-on .site-main > section:not(.wp-block-cover):not(.has-background), body.alo-on .entry-content > section:not(.wp-block-cover):not(.has-background){padding-block:var(--alo-gap) !important;}
}
@media (prefers-reduced-motion:reduce){body.alo-on * {scroll-behavior:auto !important;}}
/* Homepage catalogue: reuse the actual search form alongside the live counter. */
body.home .hero.alo-search-moved {display:none !important;}
body.home.alo-on .drs-home-theses.alo-catalog-integrated {padding-block:24px !important;}
body.home .drs-home-theses.alo-catalog-integrated > .container {padding:24px !important;min-height:0 !important;}
body.home .alo-catalog-integrated .section-heading {align-items:center !important;gap:16px;min-height:0 !important;margin:0 0 18px !important;padding:0 !important;}
body.home .alo-catalog-integrated .section-heading h2 {margin:0 !important;font-size:clamp(28px,3vw,40px) !important;line-height:1.4 !important;}
body.home .alo-catalog-integrated .section-heading .kicker {margin:0 0 5px !important;line-height:1.5 !important;font-size:16px !important;}
body.home .alo-catalog-integrated .section-heading .text-link {flex-shrink:0;font-size:18px;}
body.home .alo-thesis-tools {display:grid;grid-template-columns:minmax(230px,.65fr) minmax(0,1.7fr);align-items:stretch;gap:22px;margin-bottom:24px;direction:rtl;}
body.home .alo-thesis-tools .thesis-total-counter {display:flex !important;flex-direction:column !important;justify-content:center;align-items:center;gap:5px;width:auto !important;max-width:none !important;min-width:0 !important;margin:0 !important;padding:16px 18px !important;box-sizing:border-box;text-align:center;}
body.home .alo-thesis-tools .thesis-total-counter span {font-size:20px !important;line-height:1.5 !important;white-space:normal;}
body.home .alo-thesis-tools .thesis-total-counter strong {font-size:clamp(34px,3.4vw,46px) !important;line-height:1.2 !important;}
body.home .alo-thesis-tools .alo-catalog-search {display:grid !important;grid-template-columns:minmax(0,1fr) !important;gap:9px !important;width:auto !important;max-width:none !important;min-width:0 !important;margin:0 !important;padding:0 !important;box-shadow:none !important;border:0 !important;background:transparent !important;}
body.home .alo-catalog-search .search-heading {display:flex !important;flex-wrap:wrap;gap:3px 12px;align-items:baseline;margin:0 !important;padding:0 !important;line-height:1.5 !important;}
body.home .alo-catalog-search .search-heading strong {font-size:21px !important;line-height:1.5 !important;}
body.home .alo-catalog-search .search-heading span {font-size:16px !important;line-height:1.5 !important;color:#52656c;}
body.home .alo-catalog-search .library-search {display:flex !important;min-height:60px !important;margin:0 !important;padding:5px !important;gap:8px !important;box-sizing:border-box;}
body.home .alo-catalog-search .library-search input[type=search] {width:100% !important;min-width:0 !important;flex:1;font-size:18px !important;padding:8px 4px !important;height:auto !important;}
body.home .alo-catalog-search .library-search button {flex-shrink:0;min-height:46px !important;height:auto !important;padding:8px 16px !important;font-size:18px !important;line-height:1.4 !important;}
body.home .alo-catalog-search .quick-search {display:flex !important;flex-wrap:wrap;gap:6px 12px;margin:0 !important;padding:0 !important;font-size:16px !important;line-height:1.5 !important;}
@media(max-width:800px){
 body.home .alo-thesis-tools {grid-template-columns:minmax(0,1fr);gap:14px;margin-bottom:18px;}
 body.home .alo-thesis-tools .alo-catalog-search {grid-row:1;}
 body.home .alo-thesis-tools .thesis-total-counter {flex-direction:row !important;justify-content:space-between;gap:12px;padding:12px 16px !important;}
 body.home .alo-thesis-tools .thesis-total-counter strong {font-size:34px !important;}
 body.home .drs-home-theses.alo-catalog-integrated > .container {padding:18px !important;}
}
@media(max-width:480px){
 body.home .alo-catalog-integrated .section-heading {align-items:flex-start !important;gap:8px;flex-wrap:wrap;margin-bottom:14px !important;}
 body.home .alo-catalog-integrated .section-heading h2 {font-size:28px !important;}
 body.home .alo-catalog-search .library-search {flex-wrap:wrap !important;}
 body.home .alo-catalog-search .library-search input[type=search] {flex-basis:calc(100% - 48px);font-size:16px !important;}
 body.home .alo-catalog-search .library-search button {width:100%;justify-content:center;font-size:17px !important;}
 body.home .alo-thesis-tools .thesis-total-counter span {font-size:18px !important;}
 body.home .alo-thesis-tools .thesis-total-counter strong {font-size:32px !important;}
}

/* Approved catalog cleanup, scoped to the home section. */
body.home .drs-home-theses .section-heading > a.text-link[href*="post_type=drs_thesis"],
body.home .drs-home-theses .quick-search {display:none !important;}
body.home .drs-home-theses .alo-latest-heading {justify-content:flex-end;}

body.home.alo-on .drs-home-theses .section-heading.alo-catalog-heading {display:flex !important;flex-direction:column !important;align-items:center !important;justify-content:center !important;text-align:center !important;gap:5px !important; margin-bottom:12px !important;}
body.home.alo-on .drs-home-theses .alo-catalog-heading > div {width:100% !important;text-align:center !important;}
body.home.alo-on .drs-home-theses .alo-catalog-heading h2 {text-align:center !important;margin:0 !important;}
body.home.alo-on .drs-home-theses .alo-catalog-rights-note {font-size:15px !important;line-height:1.8 !important;font-weight:400 !important;text-align:center !important;margin:0 auto !important;max-width:100% !important;color:#334b65 !important;}

/* Shared visual treatment with the existing research service cards. */
html body.anc-campus #main article.thesis-card {background:#fff!important;border:1px solid #bfcfd5!important;border-radius:10px!important;box-shadow:0 5px 18px rgba(19,55,67,.075)!important;padding:16px!important;gap:8px!important;height:auto!important;min-height:0!important;}
html body.anc-campus #main article.thesis-card > h3 {display:flex!important;align-items:center!important;justify-content:center!important;width:100%!important;box-sizing:border-box!important;background:#f4f6fd!important;border:1px solid #dce4f2!important;border-radius:9px!important;padding:8px 12px!important;margin:0!important;}
html body.anc-campus #main article.thesis-card > .thesis-request-link {display:flex!important;align-items:center!important;justify-content:center!important;width:100%!important;box-sizing:border-box!important;background:#2877bd!important;color:#fff!important;border:1px solid #2877bd!important;border-radius:8px!important;padding:8px 12px!important;gap:8px!important;box-shadow:none!important;}
html body.anc-campus #main article.thesis-card > .card-bottom {margin-top:10px!important;}

/* Thesis detail hero: long Arabic/English titles must own a complete row. */
html body.anc-campus.single-drs_thesis #main .page-hero > .container.narrow {display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;align-items:center!important;gap:12px!important;min-width:0!important;box-sizing:border-box!important;padding-block:18px!important;}
html body.anc-campus.single-drs_thesis #main .page-hero .breadcrumbs,
html body.anc-campus.single-drs_thesis #main .page-hero .kicker,
html body.anc-campus.single-drs_thesis #main .page-hero h1 {grid-column:1 / -1!important;min-width:0!important;max-width:100%!important;width:100%!important;margin:0!important;}
html body.anc-campus.single-drs_thesis #main .page-hero h1 {display:block!important;text-align:center!important;white-space:normal!important;overflow-wrap:anywhere!important;word-break:normal!important;line-height:1.65!important;}
html body.anc-campus.single-drs_thesis #main .page-hero .kicker {text-align:center!important;}
html body.anc-campus.single-drs_thesis #main .page-hero .thesis-request-link-hero,
html body.anc-campus.single-drs_thesis #main .page-hero .drs-basket-button,
html body.anc-campus.single-drs_thesis #main .page-hero .drs-basket-view:not([hidden]) {display:flex!important;align-items:center!important;justify-content:center!important;gap:8px!important;min-width:0!important;min-height:46px!important;width:100%!important;max-width:100%!important;box-sizing:border-box!important;padding:10px 16px!important;border:1px solid #2877bd!important;border-radius:8px!important;font-weight:700!important;text-align:center!important;white-space:normal!important;word-break:normal!important;overflow-wrap:normal!important;line-height:1.6!important;text-decoration:none!important;margin:0!important;}
html body.anc-campus.single-drs_thesis #main .page-hero .thesis-request-link-hero {background:#2877bd!important;color:#fff!important;}
html body.anc-campus.single-drs_thesis #main .page-hero .drs-basket-button,
html body.anc-campus.single-drs_thesis #main .page-hero .drs-basket-view:not([hidden]) {background:#eef4fb!important;color:#193f70!important;}
html body.anc-campus.single-drs_thesis #main .page-hero [hidden] {display:none!important;}
html body.anc-campus.single-drs_thesis #main .page-hero svg {flex-shrink:0!important;}
@media(max-width:600px){html body.anc-campus.single-drs_thesis #main .page-hero > .container.narrow {grid-template-columns:minmax(0,1fr)!important;gap:10px!important;}}

html body.anc-campus.single-drs_thesis #main .page-hero .breadcrumbs {grid-row:1!important;}
html body.anc-campus.single-drs_thesis #main .page-hero h1 {grid-row:2!important;}
html body.anc-campus.single-drs_thesis #main .page-hero .thesis-request-link-hero,
html body.anc-campus.single-drs_thesis #main .page-hero .drs-basket-button {grid-row:3!important;}
@media(max-width:600px){html body.anc-campus.single-drs_thesis #main .page-hero .drs-basket-button {grid-row:4!important;}}

html body.anc-campus #main .alo-my-selections {margin:20px auto!important;padding:18px!important;max-width:1280px!important;box-sizing:border-box!important;border:1px solid #bfcfd5!important;border-radius:10px!important;background:#f4f7fc!important;color:#193f70!important;direction:rtl!important;}
html body.anc-campus #main .alo-my-selections summary {cursor:pointer;font-weight:700;font-size:22px;}
html body.anc-campus #main .alo-selection-list li {padding:12px;margin:10px 0;background:#fff;border:1px solid #dce4f2;border-radius:8px;overflow-wrap:anywhere;}
html body.anc-campus #main .alo-selection-list p {margin:0 0 8px;}
html body.anc-campus #main .alo-selection-form {display:flex!important;flex-wrap:wrap!important;gap:12px!important;align-items:end!important;}
html body.anc-campus #main .alo-selection-form label {flex:1 1 260px;}
html body.anc-campus #main .alo-selection-form input[type=email] {display:block;width:100%;box-sizing:border-box;padding:10px;border:1px solid #bfcfd5;border-radius:8px;direction:ltr;background:#fff;color:#193f70;}
html body.anc-campus #main .alo-my-selections button {padding:10px 16px!important;border:1px solid #2877bd!important;border-radius:8px!important;background:#2877bd!important;color:white!important;cursor:pointer!important;font:inherit!important;}
html body.anc-campus #main .alo-my-selections .alo-selection-remove {margin-inline-start:12px!important;background:#eef4fb!important;color:#193f70!important;}
html body.anc-campus #main .alo-my-selections button:disabled {opacity:.5!important;cursor:default!important;}
html body.anc-campus #main .alo-selection-trap {display:none!important;position:absolute!important;left:0!important;width:0!important;height:0!important;}

/* Compact thesis description and related records, across all thesis pages. */
html body.anc-campus.single-drs_thesis #main article.prose>h2:not(:first-child),
html body.anc-campus.single-drs_thesis #main article.prose nav[aria-label="تصفح رسائل التخصص"] h2{
 font-family:Amiri,"Traditional Arabic","Noto Naskh Arabic",serif!important;font-size:24px!important;line-height:1.6!important;font-weight:700!important;color:#28284f!important;margin:20px 0 8px!important;text-align:right!important;
}
html body.anc-campus.single-drs_thesis #main article.prose>h2:not(:first-child)+p,
html body.anc-campus.single-drs_thesis #main article.prose nav[aria-label="تصفح رسائل التخصص"],
html body.anc-campus.single-drs_thesis #main article.prose nav[aria-label="تصفح رسائل التخصص"] p,
html body.anc-campus.single-drs_thesis #main article.prose nav[aria-label="تصفح رسائل التخصص"] li,
html body.anc-campus.single-drs_thesis #main article.prose nav[aria-label="تصفح رسائل التخصص"] a{
 font-family:Amiri,"Traditional Arabic","Noto Naskh Arabic",serif!important;font-size:19px!important;line-height:1.8!important;font-weight:700!important;color:#193b50!important;
}
html body.anc-campus.single-drs_thesis #main article.prose nav[aria-label="تصفح رسائل التخصص"]{border-top:1px solid #d3dce6;padding-top:8px;margin-top:18px;}
html body.anc-campus.single-drs_thesis #main article.prose nav[aria-label="تصفح رسائل التخصص"] p{margin:6px 0!important;}

/* Compact bibliographic details while preserving the Naskh identity. */
html body.anc-campus.single-drs_thesis #main article.prose>h2:first-child{font-family:Amiri,"Traditional Arabic","Noto Naskh Arabic",serif!important;font-size:27px!important;line-height:1.6!important;font-weight:700!important;color:#28284f!important;margin:4px 0 14px!important;}
html body.anc-campus.single-drs_thesis #main article.prose .metadata{padding:10px 20px!important;margin:0!important;border:1px solid #cbd6e3!important;border-radius:10px!important;background:#f7f9fc!important;}
html body.anc-campus.single-drs_thesis #main article.prose .metadata>div{padding:10px 0!important;margin:0!important;min-height:0!important;gap:12px!important;}
html body.anc-campus.single-drs_thesis #main article.prose .metadata dt,
html body.anc-campus.single-drs_thesis #main article.prose .metadata dd{font-family:Amiri,"Traditional Arabic","Noto Naskh Arabic",serif!important;font-size:20px!important;line-height:1.7!important;font-weight:700!important;color:#193b50!important;margin:0!important;overflow-wrap:anywhere;}
@media(max-width:600px){html body.anc-campus.single-drs_thesis #main article.prose>h2:first-child{font-size:24px!important;}html body.anc-campus.single-drs_thesis #main article.prose .metadata{padding:8px 12px!important;}html body.anc-campus.single-drs_thesis #main article.prose .metadata dt,html body.anc-campus.single-drs_thesis #main article.prose .metadata dd{font-size:18px!important;}}
