/* ==========================================================================
   Faculty Multisite — Design System
   CSS custom properties --faculty-primary / --faculty-secondary are injected
   per-faculty via the {% faculty_css_vars %} template tag.
   ========================================================================== */

:root {
  --faculty-primary: #1a5276;
  --faculty-secondary: #2c3e50;
  --faculty-light: color-mix(in srgb, var(--faculty-primary) 10%, #fff);
  --nnu-gold: #c5a54e;
  --body-bg: #f8f9fa;
}

/* --- Typography --------------------------------------------------------- */
html[lang="ar"], html[lang="ar"] body { font-family: "Cairo", sans-serif; }
html[lang="en"], html[lang="en"] body { font-family: "Inter", sans-serif; }
body { min-height: 100vh; display: flex; flex-direction: column; background: var(--body-bg); color: #212529; }
main { flex: 1; }
a { color: var(--faculty-primary); }
a:hover { color: var(--faculty-secondary); }

/* --- Top Bar ------------------------------------------------------------ */
.top-bar { background: var(--faculty-secondary); font-size: .8rem; padding: .35rem 0; }
.top-bar a { color: rgba(255,255,255,.85); text-decoration: none; }
.top-bar a:hover { color: #fff; }

/* --- Navbar ------------------------------------------------------------- */
.faculty-navbar { background: var(--faculty-primary) !important; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.faculty-navbar .navbar-brand { font-weight: 700; letter-spacing: -.02em; }
.faculty-navbar .nav-link { font-weight: 500; font-size: .95rem; padding: .65rem .85rem !important; }
.faculty-navbar .nav-link:hover,
.faculty-navbar .nav-link:focus { background: rgba(255,255,255,.1); border-radius: .375rem; }
.faculty-navbar .nav-link.active { background: rgba(255,255,255,.15); border-radius: .375rem; }
.faculty-navbar .dropdown-menu { border: none; box-shadow: 0 .5rem 1.5rem rgba(0,0,0,.15); border-radius: .5rem; padding: .5rem 0; min-width: 14rem; }
.faculty-navbar .dropdown-item { padding: .5rem 1rem; font-size: .9rem; }
.faculty-navbar .dropdown-item:hover { background: var(--faculty-light); }
.lang-switch { font-size: .85rem; font-weight: 600; opacity: .85; }
.lang-switch:hover { opacity: 1; }

/* An-Najah university logos (static/logos/logo_{en,ar}.png) */
.uni-logo { object-fit: contain; object-position: left center; flex-shrink: 0; }
html[lang="ar"] .uni-logo--header { object-position: right center; }
.uni-logo--header {
  max-height: 44px; width: auto; max-width: min(200px, 42vw);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .15));
}
.uni-logo--footer { max-height: 48px; width: auto; max-width: 220px; }
.uni-logo-footer-wrap {
  background: rgba(255, 255, 255, .12);
  border-radius: .5rem;
  padding: .35rem .5rem;
}
.uni-logo--badge { object-position: center; }

/* --- Hero (homepage built-in) ------------------------------------------- */
.hero-section {
  position: relative;
  overflow: hidden;
  min-height: 22rem;
  padding: 4.5rem 0 4rem;
  color: #fff;
  background: linear-gradient(135deg, var(--faculty-primary), var(--faculty-secondary));
}
/* Full-bleed media from {% placeholder "hero_image" %} (django CMS Picture/Image) */
.hero-section__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-section__media .cms-placeholder,
.hero-section__media > *:not(style) {
  height: 100%;
  min-height: 22rem;
}
.hero-section__media figure {
  margin: 0;
  height: 100%;
  min-height: 22rem;
}
.hero-section__media > a {
  display: block;
  height: 100%;
  min-height: 22rem;
}
.hero-section__media img,
.hero-section__media picture,
.hero-section__media picture img {
  width: 100%;
  height: 100%;
  min-height: 22rem;
  object-fit: cover;
  display: block;
}
/* Tint over photo so white heading stays readable */
.hero-section__veil {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--faculty-primary) 78%, transparent),
    color-mix(in srgb, var(--faculty-secondary) 80%, transparent)
  );
  pointer-events: none;
}
.hero-section:has(.hero-section__media img) .hero-section__veil,
.hero-section:has(.hero-section__media picture) .hero-section__veil {
  display: block;
}
.hero-section::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0L60 30L30 60L0 30z' fill='%23fff' fill-opacity='.03'/%3E%3C/svg%3E") repeat;
  pointer-events: none;
}
.hero-section .hero-section__inner,
.hero-section .container.hero-section__inner {
  position: relative;
  z-index: 3;
}
.hero-section h1 { font-weight: 700; font-size: clamp(1.8rem, 4vw, 2.75rem); }
.hero-section .lead { font-size: clamp(1rem, 2vw, 1.25rem); opacity: .9; max-width: 640px; }

/* --- Quick-links bar ---------------------------------------------------- */
.quick-links { background: #fff; border-radius: .75rem; box-shadow: 0 2px 12px rgba(0,0,0,.08); margin-top: -2.5rem; position: relative; z-index: 2; }
.quick-link-item { text-align: center; padding: 1.25rem .75rem; color: var(--faculty-primary); text-decoration: none; font-weight: 500; font-size: .9rem; border-radius: .5rem; transition: background .15s; }
.quick-link-item:hover { background: var(--faculty-light); color: var(--faculty-primary); }
.quick-link-item i { font-size: 1.75rem; display: block; margin-bottom: .4rem; }

/* --- Section headings --------------------------------------------------- */
.section-heading {
  font-weight: 700; font-size: 1.5rem; margin-bottom: .5rem;
  padding-bottom: .75rem; position: relative;
}
.section-heading::after {
  content: ""; position: absolute; bottom: 0; left: 0;
  width: 50px; height: 3px; background: var(--faculty-primary); border-radius: 2px;
}
[dir="rtl"] .section-heading::after { left: auto; right: 0; }

.section-heading-centered {
  font-weight: 700; font-size: 1.5rem;
  padding-bottom: .75rem; display: inline-block; position: relative;
}
.section-heading-centered::after {
  content: ""; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 50px; height: 3px; background: var(--faculty-primary); border-radius: 2px;
}
.text-white .section-heading-centered::after,
.bg-faculty-primary .section-heading-centered::after,
.bg-faculty-secondary .section-heading-centered::after,
.bg-dark .section-heading-centered::after { background: rgba(255,255,255,.6); }
.text-white .section-heading::after,
.bg-faculty-primary .section-heading::after,
.bg-faculty-secondary .section-heading::after { background: rgba(255,255,255,.6); }

.section-subtitle { color: #6c757d; font-size: 1.05rem; max-width: 600px; margin-top: .5rem; }
.text-center .section-subtitle,
.section-header .section-subtitle { margin-left: auto; margin-right: auto; }
.text-white .section-subtitle { color: rgba(255,255,255,.7); }

/* --- Cards -------------------------------------------------------------- */
.card { border: none; border-radius: .75rem; box-shadow: 0 1px 3px rgba(0,0,0,.06); transition: transform .2s ease, box-shadow .2s ease; overflow: hidden; }
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.1); }

/* --- Buttons ------------------------------------------------------------ */
.btn-faculty { background: var(--faculty-primary); border-color: var(--faculty-primary); color: #fff; border-radius: .5rem; font-weight: 500; padding: .5rem 1.25rem; }
.btn-faculty:hover, .btn-faculty:focus { background: var(--faculty-secondary); border-color: var(--faculty-secondary); color: #fff; }
.btn-outline-faculty { border: 2px solid var(--faculty-primary); color: var(--faculty-primary); background: transparent; border-radius: .5rem; font-weight: 500; padding: .5rem 1.25rem; }
.btn-outline-faculty:hover { background: var(--faculty-primary); color: #fff; }

/* --- Utility colors ----------------------------------------------------- */
.bg-faculty-primary { background-color: var(--faculty-primary) !important; }
.bg-faculty-secondary { background-color: var(--faculty-secondary) !important; }
.bg-faculty-light { background-color: var(--faculty-light) !important; }
.text-faculty-primary { color: var(--faculty-primary) !important; }

/* --- Breadcrumbs -------------------------------------------------------- */
.breadcrumb { background: none; padding: 0; font-size: .875rem; }
.breadcrumb-item a { text-decoration: none; }

/* --- Sidebar ------------------------------------------------------------ */
.sidebar-wrap { background: #fff; border-radius: .75rem; padding: 1.25rem; box-shadow: 0 1px 4px rgba(0,0,0,.05); }

/* --- Footer ------------------------------------------------------------- */
.faculty-footer { background: var(--faculty-secondary) !important; color: rgba(255,255,255,.9); font-size: .9rem; }
.faculty-footer h5, .faculty-footer h6 { color: #fff; font-weight: 600; }
.faculty-footer a { color: rgba(255,255,255,.8); text-decoration: none; }
.faculty-footer a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.15); padding-top: 1.25rem; margin-top: 2rem; font-size: .8rem; color: rgba(255,255,255,.6); }
.footer-bottom a { color: rgba(255,255,255,.6); }
.footer-bottom a:hover { color: #fff; }

/* --- Pagination --------------------------------------------------------- */
.pagination .page-link { border-radius: .375rem; margin: 0 2px; }
.pagination .page-item.active .page-link { background: var(--faculty-primary); border-color: var(--faculty-primary); }

/* --- CMS Toolbar -------------------------------------------------------- */
html.cms-toolbar-expanded { margin-top: 46px !important; }

/* ==========================================================================
   Plugin Styles
   ========================================================================== */

/* --- Section plugin ----------------------------------------------------- */
.plugin-section { position: relative; }
.section-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,.55); z-index: 0;
}
.section-overlay + .container,
.section-overlay + .container-fluid,
.section-overlay + .container-lg { position: relative; z-index: 1; }
.plugin-section > .container,
.plugin-section > .container-fluid,
.plugin-section > .container-lg { position: relative; z-index: 1; }

.section-padding-lg { padding-top: 5rem !important; padding-bottom: 5rem !important; }
.section-padding-xl { padding-top: 7rem !important; padding-bottom: 7rem !important; }

/* --- Hero Banner plugin ------------------------------------------------- */
.plugin-hero { position: relative; color: #fff; overflow: hidden; display: flex; align-items: center; }
.hero-sm { min-height: 300px; padding: 3rem 0; }
.hero-md { min-height: 450px; padding: 4rem 0; }
.hero-lg { min-height: 600px; padding: 5rem 0; }
.hero-fullscreen { min-height: 100vh; padding: 5rem 0; }
.hero-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.45); z-index: 0; }
.plugin-hero > .container { position: relative; z-index: 1; }
.plugin-hero .hero-overlay ~ .container { position: relative; z-index: 1; }

/* --- Heading plugin ----------------------------------------------------- */
.plugin-heading { margin-bottom: 1.5rem; }
.heading-icon-circle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--faculty-light); color: var(--faculty-primary); font-size: 1.4rem;
}

/* --- Spacer plugin ------------------------------------------------------ */
.spacer-xs { height: 8px; }
.spacer-sm { height: 16px; }
.spacer-md { height: 32px; }
.spacer-lg { height: 64px; }
.spacer-xl { height: 96px; }
.spacer-divider { border: none; border-top: 1px solid #dee2e6; margin: 0; opacity: .5; }

/* --- Icon Box plugin ---------------------------------------------------- */
.icon-circle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--faculty-light); color: var(--faculty-primary); font-size: 1.5rem;
  transition: background .2s, color .2s;
}
.icon-circle-lg { width: 72px; height: 72px; font-size: 1.75rem; }
.icon-box:hover .icon-circle { background: var(--faculty-primary); color: #fff; }
.icon-box-stacked { padding: 1.5rem 1rem; }
.icon-box-horizontal { padding: 1.25rem 0; }
.icon-box-minimal { padding: .75rem 0; }

/* --- CTA plugin --------------------------------------------------------- */
.plugin-cta { position: relative; overflow: hidden; }
.plugin-cta::before {
  content: ""; position: absolute; top: -50%; right: -10%;
  width: 300px; height: 300px; border-radius: 50%;
  background: rgba(255,255,255,.06); pointer-events: none;
}

/* --- Person Card plugin ------------------------------------------------- */
.person-photo { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; border: 3px solid var(--faculty-light); transition: border-color .2s; }
.person-card:hover .person-photo { border-color: var(--faculty-primary); }
.person-photo-placeholder {
  width: 120px; height: 120px; border-radius: 50%; background: var(--faculty-light);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 2.5rem; color: var(--faculty-primary);
}
.person-social {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--faculty-light); color: var(--faculty-primary);
  text-decoration: none; font-size: .9rem; transition: background .2s, color .2s;
}
.person-social:hover { background: var(--faculty-primary); color: #fff; }

/* --- Testimonial plugin ------------------------------------------------- */
.plugin-testimonial {
  background: #fff; border-radius: .75rem; padding: 2rem; position: relative;
  box-shadow: 0 1px 6px rgba(0,0,0,.06); border-left: 4px solid var(--faculty-primary);
}
[dir="rtl"] .plugin-testimonial { border-left: none; border-right: 4px solid var(--faculty-primary); }
.testimonial-quote-mark { font-size: 2.5rem; color: var(--faculty-light); line-height: 1; margin-bottom: .5rem; }
.testimonial-photo { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }

/* --- Embed plugin ------------------------------------------------------- */
.plugin-embed iframe { border: 0; }

/* --- Counter / Stats ---------------------------------------------------- */
.stat-card { text-align: center; padding: 2rem 1rem; }
.stat-card .stat-number { font-size: 2.5rem; font-weight: 700; color: var(--faculty-primary); line-height: 1.2; }
.stat-card .stat-label { color: #6c757d; font-size: .875rem; margin-top: .25rem; }

/* --- Timeline plugin ---------------------------------------------------- */
.timeline-vertical .timeline-item { position: relative; padding-left: 2.5rem; }
.timeline-vertical .timeline-item::before {
  content: ""; position: absolute; left: 18px; top: 0; bottom: -1.5rem;
  width: 2px; background: var(--faculty-light);
}
[dir="rtl"] .timeline-vertical .timeline-item { padding-left: 0; padding-right: 2.5rem; }
[dir="rtl"] .timeline-vertical .timeline-item::before { left: auto; right: 18px; }

/* --- Links Box plugin --------------------------------------------------- */
.links-box { overflow: hidden; }

/* --- Contact Info plugin ------------------------------------------------ */
.contact-info { background: #fff; border-radius: .75rem; padding: 2rem; box-shadow: 0 1px 4px rgba(0,0,0,.05); }

/* --- Stats Container plugin --------------------------------------------- */
.stats-container { position: relative; }
.stats-container .stat-card { padding: 1.5rem .75rem; }
.stats-container .stat-card .stat-number { color: inherit; }
.stats-container.bg-faculty-primary .stat-card .stat-number,
.stats-container.bg-faculty-secondary .stat-card .stat-number,
.stats-container.bg-dark .stat-card .stat-number { color: #fff; }
.stats-container.bg-white .stat-card .stat-number,
.stats-container.bg-faculty-light .stat-card .stat-number { color: var(--faculty-primary); }

/* --- Image Card plugin -------------------------------------------------- */
.plugin-image-card { transition: transform .2s, box-shadow .2s; }
.plugin-image-card:hover { transform: translateY(-4px); box-shadow: 0 10px 30px rgba(0,0,0,.12) !important; }
.plugin-image-card--horizontal .row { min-height: 200px; }
.plugin-image-card--overlay .card-img-overlay { transition: background .3s; }
.plugin-image-card--overlay:hover .card-img-overlay { background: linear-gradient(0deg,rgba(0,0,0,.8) 0%,rgba(0,0,0,.25) 60%); }

/* --- Accordion plugin --------------------------------------------------- */
.accordion-button:not(.collapsed) { background: var(--faculty-light); color: var(--faculty-primary); }
.accordion-button:focus { box-shadow: 0 0 0 .15rem rgba(var(--faculty-primary), .2); }

/* --- Tabs plugin -------------------------------------------------------- */
.plugin-tabs .nav-tabs .nav-link.active,
.plugin-tabs .nav-pills .nav-link.active { background: var(--faculty-primary); color: #fff; border-color: var(--faculty-primary); }
.plugin-tabs .nav-tabs .nav-link { color: var(--faculty-primary); }
.plugin-tabs .nav-pills .nav-link { color: var(--faculty-primary); }
.plugin-tabs .nav-tabs .nav-link:hover:not(.active) { border-color: var(--faculty-light) var(--faculty-light) #dee2e6; }

/* --- Gallery plugin ----------------------------------------------------- */
.plugin-gallery .gallery-item img { width: 100%; height: 220px; object-fit: cover; cursor: pointer; transition: transform .3s, box-shadow .3s; border-radius: .5rem; }
.plugin-gallery .gallery-item:hover img { transform: scale(1.03); box-shadow: 0 8px 25px rgba(0,0,0,.15); }
.plugin-gallery--masonry { columns: auto; column-gap: 1rem; }
.plugin-gallery--masonry .gallery-item { break-inside: avoid; margin-bottom: 1rem; }
.plugin-gallery--masonry .gallery-item img { height: auto; }

/* --- Alert plugin ------------------------------------------------------- */
.alert.alert-primary { background-color: var(--faculty-light); border-color: var(--faculty-primary); color: var(--faculty-primary); }

/* ==========================================================================
   RTL Overrides
   ========================================================================== */
[dir="rtl"] .icon-box-horizontal { text-align: right; }
[dir="rtl"] .icon-box-horizontal .d-flex { flex-direction: row-reverse; }

[dir="rtl"] .plugin-cta::before { right: auto; left: -10%; }

[dir="rtl"] .plugin-image-card--horizontal .col-md-5 { order: 2; }
[dir="rtl"] .plugin-image-card--horizontal .col-md-7 { order: 1; }

[dir="rtl"] .accordion-button::after { margin-left: 0; margin-right: auto; }

[dir="rtl"] .plugin-tabs.d-flex .nav-pills.flex-column { margin-right: 0; margin-left: 1rem; margin-right: 0 !important; }

[dir="rtl"] .alert .me-2 { margin-right: 0 !important; margin-left: .5rem !important; }
[dir="rtl"] .alert .btn-close { left: 0; right: auto; }

[dir="rtl"] .quick-link-item { direction: rtl; }

[dir="rtl"] .timeline-vertical .timeline-item { padding-left: 0; padding-right: 2.5rem; }
[dir="rtl"] .timeline-vertical .timeline-item::before { left: auto; right: 18px; }

[dir="rtl"] .plugin-hero .lead { margin-left: 0; }
[dir="rtl"] .plugin-hero .text-end { text-align: start !important; }

[dir="rtl"] .footer-bottom { text-align: right; }

/* ==========================================================================
   Print
   ========================================================================== */
@media print {
  .top-bar, .faculty-navbar, .faculty-footer, .cms-toolbar { display: none !important; }
  body { background: #fff; }
}
