/* Kulliyatul Huffaz Academic Colleges — homepage */
:root{
  --green:#123d2a;--green-2:#1e5138;--green-3:#2e6747;--gold:#a7832e;--gold-light:#c5a85e;
  --cream:#f8f5ed;--paper:#fffdf8;--ink:#142c22;--muted:#68746c;--line:#e8e1d2;
  --shadow:0 16px 44px rgba(24,48,34,.10);--radius:18px;--max:1240px
}
*{box-sizing:border-box}
html{scroll-behavior:smooth;scroll-padding-top:110px}
body{margin:0;background:var(--paper);color:var(--ink);font-family:"Cairo",sans-serif;line-height:1.85}
img{display:block;max-width:100%}
a{color:inherit;text-decoration:none}
button{font:inherit}
.container{width:min(var(--max),calc(100% - 48px));margin-inline:auto}
.topbar{background:#0d2e20;color:#f8f5ed;font-size:12px}
.topbar-inner{min-height:38px;display:flex;align-items:center;justify-content:space-between;gap:20px}
.top-links,.language-switch{display:flex;align-items:center;gap:18px}
.top-links a{opacity:.9;transition:opacity .2s}.top-links a:hover{opacity:1;color:#e2c675}
.language-switch{gap:9px}.lang-btn{border:0;background:transparent;color:#e7eee8;cursor:pointer;padding:3px 4px;font-size:12px}.lang-btn.active{color:#e5c36a;font-weight:800}
.site-header{position:sticky;top:0;z-index:100;background:rgba(255,253,248,.96);backdrop-filter:blur(14px);border-bottom:1px solid rgba(18,61,42,.08)}
.nav-wrap{min-height:94px;display:flex;align-items:center;justify-content:space-between;gap:24px}
.brand{display:flex;align-items:center;gap:14px;flex-shrink:0}
.brand-logo{width:76px;height:76px;object-fit:contain;border-radius:50%}
.brand-copy{display:flex;flex-direction:column;line-height:1.45}
.brand-copy strong{font-size:clamp(18px,2vw,25px);font-weight:800;color:var(--green)}
.brand-copy small{font-family:"Playfair Display",serif;font-size:10px;letter-spacing:.6px;direction:ltr;text-align:right;color:#4b5e50}
.main-nav{display:flex;align-items:center;gap:clamp(12px,2vw,27px)}
.main-nav a{font-size:13px;font-weight:700;white-space:nowrap;padding:10px 0;position:relative}
.main-nav a:after{content:"";position:absolute;right:0;bottom:0;width:0;height:2px;background:var(--gold);transition:width .25s}
.main-nav a:hover:after,.main-nav a:focus-visible:after{width:100%}
.menu-toggle{display:none;background:none;border:0;padding:10px;cursor:pointer}
.menu-toggle span{display:block;width:25px;height:2px;background:var(--green);margin:5px}
.hero{min-height:520px;position:relative;display:flex;align-items:center;overflow:hidden;background:var(--cream)}
.hero-photo{position:absolute;inset:0;background:url("../images/graduation-blue.jpg") left center/60% 100% no-repeat}
.hero:before{content:"";position:absolute;inset:0;background:linear-gradient(90deg,rgba(251,248,240,.02) 0%,rgba(251,248,240,.08) 34%,rgba(251,248,240,.86) 49%,#fbf8f0 62%,#fbf8f0 100%);z-index:1}
.hero-pattern{position:absolute;inset:0;z-index:2;pointer-events:none;opacity:.23;background-image:radial-gradient(circle at 96% 12%,transparent 0 40px,rgba(167,131,46,.3) 41px 42px,transparent 43px),radial-gradient(circle at 4% 90%,transparent 0 62px,rgba(167,131,46,.24) 63px 64px,transparent 65px)}
.hero-inner{position:relative;z-index:3;display:flex;justify-content:flex-start;padding-block:76px}
.hero-content{max-width:650px;width:56%;margin-right:0}
.eyebrow,.section-kicker{font-size:13px;font-weight:800;letter-spacing:.3px;color:var(--gold);margin:0 0 10px}
.hero h1{font-size:clamp(36px,4.2vw,62px);line-height:1.28;letter-spacing:-1.5px;color:var(--green);margin:0;font-weight:800}
.hero h2{font-size:clamp(23px,2.6vw,37px);line-height:1.5;color:var(--gold);margin:0 0 12px;font-weight:800}
.hero-description{font-size:15px;line-height:2;color:#425147;max-width:590px;margin:0 0 25px}
.hero-actions{display:flex;flex-wrap:wrap;gap:12px}
.button{display:inline-flex;align-items:center;justify-content:center;gap:20px;min-height:48px;padding:10px 24px;border-radius:10px;font-size:13px;font-weight:800;transition:transform .2s,background .2s,border-color .2s;cursor:pointer}
.button:hover{transform:translateY(-2px)}
.button-primary{background:var(--green);color:#fff;border:1px solid var(--green)}
.button-primary:hover{background:var(--green-2)}
.button-outline{border:1px solid #8b9b8e;background:rgba(255,253,248,.7);color:var(--green)}
.button-outline:hover{border-color:var(--green);background:#fff}
.button-icon{font-size:19px;color:var(--gold-light)}
.scroll-cue{position:absolute;z-index:4;bottom:16px;right:50%;transform:translateX(50%);display:flex;align-items:center;gap:8px;color:var(--green);font-size:10px;opacity:.8}
.scroll-cue span:first-child{height:24px;width:14px;border:1px solid var(--gold);border-radius:20px;position:relative}
.scroll-cue span:first-child:after{content:"";position:absolute;width:3px;height:5px;top:4px;left:5px;background:var(--gold);border-radius:4px}
.stats-strip{position:relative;z-index:5;margin-top:-1px;background:rgba(255,253,248,.96);border:1px solid var(--line);border-radius:0 0 16px 16px;box-shadow:0 12px 30px rgba(25,45,31,.05);display:grid;grid-template-columns:repeat(4,1fr);padding:18px 12px}
.stat{display:flex;align-items:center;justify-content:center;gap:14px;border-left:1px solid var(--line);padding:0 10px}
.stat:last-child{border-left:0}.stat-icon{font-size:30px;color:var(--gold);line-height:1}
.stat strong,.stat small{display:block}.stat strong{font-size:24px;line-height:1.3;color:var(--green);font-weight:800}.stat small{font-size:11px;color:var(--muted)}
.section{padding:88px 0}
.about-section{background:linear-gradient(180deg,#fffdf8,#f8f5ed)}
.about-grid{display:grid;grid-template-columns:1fr 1.15fr .9fr;gap:36px;align-items:center}
.about-image-wrap{position:relative;min-height:370px}
.about-image{width:100%;height:390px;object-fit:cover;border-radius:4px 80px 4px 4px;box-shadow:var(--shadow)}
.image-caption{position:absolute;bottom:18px;right:18px;left:18px;background:rgba(18,61,42,.93);color:white;padding:12px 16px;border-radius:8px;font-size:12px;display:flex;align-items:center;gap:10px}
.caption-mark{color:#e2c675;font-size:20px}
.about-copy h2,.section-heading h2,.history-grid h2,.admission-inner h2,.portal-inner h2{font-size:clamp(27px,3vw,38px);line-height:1.45;margin:0 0 18px;color:var(--green);font-weight:800}
.about-copy p:not(.section-kicker){font-size:13px;color:#5c685f;line-height:2.1;margin:0 0 12px}
.text-link{display:inline-flex;gap:16px;align-items:center;color:var(--green);font-size:13px;font-weight:800;margin-top:12px}
.text-link span:last-child{color:var(--gold);font-size:20px;transition:transform .2s}.text-link:hover span:last-child{transform:translateX(-4px)}
.vision-panel{border-right:1px solid var(--line);padding-right:25px;display:grid;gap:22px}
.vision-item{display:flex;gap:13px;align-items:flex-start}
.round-icon{flex:0 0 40px;width:40px;height:40px;border-radius:50%;display:grid;place-items:center;background:#f0e7d0;color:var(--gold);font-size:22px}
.vision-item h3{margin:0 0 4px;color:var(--green);font-size:16px}
.vision-item p{margin:0;color:#657067;font-size:11px;line-height:1.9}
.programs-section{background:#f3efe5}
.section-heading{display:flex;justify-content:space-between;align-items:end;gap:30px;margin-bottom:32px}
.section-heading h2{margin-bottom:0}
.section-heading>p{max-width:450px;font-size:13px;color:var(--muted);line-height:2;margin:0}
.program-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:18px}
.program-card{background:#fffdf8;border:1px solid #e7dfce;border-radius:13px;overflow:hidden;transition:transform .25s,box-shadow .25s}
.program-card:hover{transform:translateY(-5px);box-shadow:var(--shadow)}
.program-card>img{width:100%;height:180px;object-fit:cover}
.program-card-body{padding:20px 19px 22px;position:relative}
.program-number{font-family:"Playfair Display",serif;color:var(--gold);font-size:12px;letter-spacing:1px}
.program-card h3{font-size:17px;color:var(--green);margin:6px 0 9px;line-height:1.5}
.program-card p{font-size:12px;color:var(--muted);line-height:2;min-height:72px;margin:0 0 12px}
.program-link{font-size:11px;color:var(--green);font-weight:800}
.program-link:hover{color:var(--gold)}
.postgraduate-banner{margin-top:28px;padding:28px 32px;background:var(--green);border-radius:14px;color:#fff;display:flex;align-items:center;gap:25px}
.postgrad-mark{flex:0 0 76px;height:76px;border:1px solid rgba(225,199,125,.7);border-radius:50%;display:grid;place-items:center;text-align:center;color:#e4ca7e;font-weight:800;font-size:15px;line-height:1.3}
.postgraduate-banner .section-kicker{color:#e4ca7e;margin-bottom:2px}
.postgraduate-banner h3{font-size:23px;margin:0 0 4px;color:white}
.postgraduate-banner p:not(.section-kicker){font-size:12px;color:#e1e9e1;margin:0;line-height:1.9}
.button-light{margin-right:auto;background:#fffdf8;color:var(--green);white-space:nowrap}
.history-section{background:#fffdf8}
.history-grid{display:grid;grid-template-columns:.9fr 1.1fr;gap:80px}
.history-grid>div:first-child>p:not(.section-kicker){font-size:14px;color:var(--muted);line-height:2.1;max-width:470px}
.timeline{border-right:1px solid #d8c69b;padding-right:28px;display:grid;gap:28px}
.timeline-item{position:relative;display:grid;grid-template-columns:70px 1fr;gap:18px}
.timeline-item:before{content:"";position:absolute;right:-34px;top:7px;width:10px;height:10px;background:var(--gold);border:4px solid #f3ead2;border-radius:50%}
.timeline-date{font-family:"Playfair Display",serif;color:var(--gold);font-size:24px;font-weight:700}
.timeline-item h3{font-size:16px;color:var(--green);margin:0 0 5px}
.timeline-item p{font-size:12px;line-height:2;color:var(--muted);margin:0}
.goals-section{background:var(--cream)}
.goals-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-top:28px}
.goals-grid article{padding:25px 22px;border:1px solid #e6decc;background:rgba(255,253,248,.8);border-radius:12px;min-height:160px}
.goals-grid article span{font-family:"Playfair Display",serif;font-size:28px;color:var(--gold)}
.goals-grid article p{font-size:13px;line-height:2;color:#536056;margin:8px 0 0}
.news-section{background:#fffdf8}
.news-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:22px}
.news-card{border:1px solid var(--line);border-radius:12px;overflow:hidden;background:white;transition:transform .25s}
.news-card:hover{transform:translateY(-4px)}
.news-card>img{width:100%;height:220px;object-fit:cover}
.news-body{padding:20px 22px 24px}
.news-tag{font-size:10px;color:var(--gold);font-weight:800}
.news-body h3{font-size:17px;line-height:1.7;color:var(--green);margin:8px 0}
.news-body p{font-size:12px;line-height:1.9;color:var(--muted);margin:0}
.admission-cta{background:linear-gradient(115deg,#123d2a,#24563a);color:white;padding:55px 0;position:relative;overflow:hidden}
.admission-cta:after{content:"";position:absolute;left:-40px;top:-100px;width:300px;height:300px;border:1px solid rgba(218,194,124,.18);border-radius:50%;box-shadow:0 0 0 25px rgba(218,194,124,.04),0 0 0 55px rgba(218,194,124,.03)}
.admission-inner{display:flex;align-items:center;justify-content:space-between;gap:30px;position:relative;z-index:1}
.admission-inner .section-kicker{color:#e4ca7e}
.admission-inner h2{color:white;margin-bottom:8px;font-size:clamp(25px,3vw,34px)}
.admission-inner p:not(.section-kicker){color:#dce7dd;font-size:13px;margin:0}
.button-gold{background:#c6a653;color:#183b29;white-space:nowrap}
.button-gold:hover{background:#d7bc70}
.portal-section{padding:55px 0;background:#f3efe5}
.portal-inner{display:flex;justify-content:space-between;align-items:center;gap:25px}
.portal-inner h2{margin:0;font-size:28px}.portal-inner p:not(.section-kicker){color:var(--muted);font-size:12px;margin:5px 0 0}
.portal-buttons{display:flex;gap:12px;flex-wrap:wrap}
.site-footer{background:#0d2e20;color:#f7f5ed;padding-top:58px}
.footer-grid{display:grid;grid-template-columns:1.4fr 1fr 1.2fr;gap:55px;padding-bottom:45px}
.footer-brand img{width:82px;height:82px;object-fit:contain;border-radius:50%;margin-bottom:14px;background:white}
.footer-brand h2{font-size:20px;margin:0 0 8px;color:white}
.footer-brand p,.footer-grid>div>p{font-size:12px;color:#c9d6cc;line-height:2}
.footer-grid h3{font-size:14px;color:#e3c779;margin:0 0 16px}
.footer-grid>div>a:not(.brand){display:block;font-size:12px;color:#d6e0d8;margin:9px 0}
.footer-grid a:hover{color:#e3c779}
.footer-bottom{border-top:1px solid rgba(255,255,255,.12);padding:15px 0;color:#b7c7ba;font-size:11px}
.footer-bottom-inner{display:flex;justify-content:space-between;gap:20px}
[dir="ltr"] .brand-copy small{text-align:left}
[dir="ltr"] .hero:before{background:linear-gradient(270deg,rgba(251,248,240,.02) 0%,rgba(251,248,240,.08) 34%,rgba(251,248,240,.86) 49%,#fbf8f0 62%,#fbf8f0 100%)}
[dir="ltr"] .hero-photo{inset:0;background-position:right center;background-size:60% 100%}
[dir="ltr"] .hero-content{margin-left:0;margin-right:auto}
[dir="ltr"] .vision-panel{border-right:0;border-left:1px solid var(--line);padding-right:0;padding-left:25px}
[dir="ltr"] .timeline{border-right:0;border-left:1px solid #d8c69b;padding-right:0;padding-left:28px}
[dir="ltr"] .timeline-item:before{right:auto;left:-34px}
[dir="ltr"] .stat{border-left:0;border-right:1px solid var(--line)}
[dir="ltr"] .stat:last-child{border-right:0}
[dir="ltr"] .postgrad-mark{margin-left:0}
[dir="ltr"] .button-light{margin-right:0;margin-left:auto}

.program-grid-six{grid-template-columns:repeat(3,minmax(0,1fr))}
.program-grid-six .program-card p{min-height:0}
.study-system-section{background:#f8f5ed}
.study-system-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-top:28px}
.study-point{display:flex;align-items:flex-start;gap:16px;background:#fffdf8;border:1px solid #e8e1d2;border-radius:12px;padding:22px 24px;min-height:120px}
.study-point>span{flex:0 0 38px;width:38px;height:38px;display:grid;place-items:center;border-radius:50%;background:#efe6ce;color:#9c7929;font-weight:800}
.study-point p{margin:0;color:#435248;font-size:14px;line-height:2}
.training-block{display:flex;align-items:center;justify-content:space-between;gap:28px;margin-top:26px;padding:30px;background:#123d2a;border-radius:14px;color:#fff}
.training-block .section-kicker{color:#e4ca7e;margin-bottom:3px}
.training-block h3{font-size:23px;color:#fff;margin:0 0 7px}
.training-block p:not(.section-kicker){max-width:720px;color:#e0e9e1;font-size:13px;line-height:2;margin:0}
.training-chips{display:flex;gap:10px;flex-wrap:wrap;flex-shrink:0}
.training-chips span{display:inline-flex;align-items:center;padding:10px 15px;border:1px solid rgba(228,202,126,.6);border-radius:30px;color:#f7e6b3;font-size:12px;font-weight:700;white-space:nowrap}
.achievements-section{background:#fffdf8}
.achievements-grid{display:grid;grid-template-columns:1.4fr .8fr;gap:45px;align-items:center}
.achievements-copy h2{font-size:clamp(28px,3vw,38px);margin:0 0 15px;color:var(--green)}
.achievements-copy>p:last-child{font-size:15px;line-height:2.2;color:#4d5c51;margin:0}
.achievement-highlight{display:grid;grid-template-columns:auto 1fr;gap:5px 15px;align-items:center;padding:24px;background:#f3efe5;border:1px solid #e8e1d2;border-radius:14px}
.achievement-highlight strong{font-family:"Playfair Display",serif;font-size:34px;line-height:1.2;color:var(--gold);grid-row:span 1}
.achievement-highlight span{font-size:12px;color:var(--green);font-weight:700}
.gallery-section{background:#f3efe5}
.college-gallery{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-top:26px}
.college-gallery figure{position:relative;margin:0;overflow:hidden;border-radius:12px;background:#fffdf8;border:1px solid #e4dccb;box-shadow:0 7px 20px rgba(24,48,34,.06)}
.college-gallery img{width:100%;height:205px;object-fit:cover;transition:transform .35s}
.college-gallery figure:hover img{transform:scale(1.04)}
.college-gallery figcaption{padding:11px 13px;color:var(--green);font-size:12px;font-weight:700}

/* Clean responsive layout: one consistent set of breakpoints */

/* Prevent horizontal overflow on narrow screens */
html, body {
  max-width: 100%;
  overflow-x: clip;
}
.container {
  width: min(var(--max), calc(100% - 40px));
}

/* Large desktop */
@media (min-width: 1201px) {
  .hero {
    min-height: 560px;
  }
  .hero-photo {
    inset: 0 42% 0 0;
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
  }
  [dir="ltr"] .hero-photo {
    inset: 0 0 0 42%;
    background-position: center center;
    background-size: cover;
  }
  .hero-content {
    width: 54%;
    max-width: 660px;
  }
  .main-nav {
    gap: clamp(10px, 1.15vw, 20px);
  }
  .main-nav a {
    font-size: clamp(11px, .85vw, 13px);
  }
}

/* Tablet and compact laptop: use hamburger navigation */
@media (min-width: 761px) and (max-width: 1200px) {
  .nav-wrap {
    position: relative;
    min-height: 82px;
    gap: 12px;
  }
  .brand {
    min-width: 0;
    gap: 8px;
  }
  .brand-logo {
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
  }
  .brand-copy strong {
    font-size: clamp(15px, 1.9vw, 21px);
    white-space: normal;
    line-height: 1.35;
  }
  .brand-copy small {
    font-size: 8px;
    letter-spacing: 0;
  }
  .menu-toggle {
    display: block;
    flex: 0 0 auto;
    order: 3;
  }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    width: 100%;
    z-index: 120;
    background: #fffdf8;
    border-top: 1px solid var(--line);
    box-shadow: var(--shadow);
    padding: 10px 20px 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
  }
  .main-nav.open {
    display: flex;
  }
  .main-nav a {
    display: block;
    white-space: normal;
    font-size: 14px;
    padding: 10px 0;
    border-bottom: 1px solid #eee8db;
  }
  .main-nav a:last-child {
    border-bottom: 0;
  }

  /* Keep the graduation photo inside its own left-side panel.
     Do not also shrink the background image to 58% of that panel. */
  .hero {
    min-height: 480px;
  }
  .hero-photo {
    inset: 0 42% 0 0;
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
  }
  .hero:before {
    background: linear-gradient(
      90deg,
      rgba(248,245,237,.02) 0%,
      rgba(248,245,237,.10) 28%,
      rgba(248,245,237,.78) 45%,
      #f8f5ed 60%,
      #f8f5ed 100%
    );
  }
  [dir="ltr"] .hero-photo {
    inset: 0 0 0 42%;
    background-position: center center;
    background-size: cover;
  }
  [dir="ltr"] .hero:before {
    background: linear-gradient(
      270deg,
      rgba(248,245,237,.02) 0%,
      rgba(248,245,237,.10) 28%,
      rgba(248,245,237,.78) 45%,
      #f8f5ed 60%,
      #f8f5ed 100%
    );
  }
  .hero-inner {
    padding-block: 42px;
  }
  .hero-content,
  [dir="rtl"] .hero-content {
    width: 54%;
    max-width: 560px;
    margin-right: 0;
  }
  [dir="ltr"] .hero-content {
    width: 54%;
    margin-left: 0;
    margin-right: auto;
  }
  .hero h1 {
    font-size: clamp(30px, 3.8vw, 46px);
    letter-spacing: 0;
  }
  .hero h2 {
    font-size: clamp(20px, 2.5vw, 29px);
  }
  .hero-description {
    font-size: 13px;
    line-height: 1.9;
  }
  .hero-actions {
    gap: 8px;
  }
  .button {
    padding: 10px 13px;
    gap: 8px;
    font-size: 12px;
  }

  .about-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
  }
  .about-image {
    height: 300px;
  }
  .vision-panel {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    border: 0;
    padding: 18px 0 0;
  }
  [dir="ltr"] .vision-panel {
    border: 0;
    padding-left: 0;
  }

  .program-grid,
  .program-grid-six {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
  .program-card > img {
    height: 190px;
  }
  .study-system-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .training-block {
    align-items: flex-start;
    flex-direction: column;
    padding: 25px;
  }
  .training-chips {
    flex-wrap: wrap;
  }
  .achievements-grid {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, .8fr);
    gap: 24px;
  }
  .college-gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }
  .college-gallery img {
    height: 175px;
  }
  .goals-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .history-grid {
    gap: 35px;
  }
  .section {
    padding: 68px 0;
  }
}

/* Smaller tablets */
@media (min-width: 761px) and (max-width: 900px) {
  .top-links {
    gap: 10px;
  }
  .top-links a {
    font-size: 10px;
  }
  .hero {
    min-height: 440px;
  }
  .hero-inner {
    padding-block: 30px;
  }
  .hero-content,
  [dir="rtl"] .hero-content,
  [dir="ltr"] .hero-content {
    width: 56%;
  }
  .stats-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 10px;
  }
  .stat {
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
  }
  .stat:nth-last-child(-n+2) {
    border-bottom: 0;
  }
  [dir="ltr"] .stat {
    border-right: 1px solid var(--line);
    border-left: 0;
  }
  [dir="ltr"] .stat:nth-child(even) {
    border-right: 0;
  }
  .about-grid {
    grid-template-columns: 1fr;
  }
  .about-image {
    height: 320px;
  }
  .vision-panel {
    grid-template-columns: 1fr;
  }
}

/* Mobile */
@media (max-width: 760px) {
  .container {
    width: min(100% - 32px, var(--max));
  }
  .topbar-inner {
    min-height: 34px;
  }
  .top-links {
    gap: 12px;
  }
  .top-links a {
    font-size: 10px;
  }
  .top-links a:first-child {
    display: none;
  }
  .nav-wrap {
    position: relative;
    min-height: 78px;
    gap: 8px;
  }
  .brand {
    gap: 9px;
    min-width: 0;
  }
  .brand-logo {
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
  }
  .brand-copy strong {
    font-size: 16px;
    line-height: 1.35;
  }
  .brand-copy small {
    font-size: 8px;
  }
  .menu-toggle {
    display: block;
    order: 3;
    flex: 0 0 auto;
  }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    width: 100%;
    z-index: 120;
    background: #fffdf8;
    border-top: 1px solid var(--line);
    box-shadow: var(--shadow);
    padding: 14px 24px 22px;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
  }
  .main-nav.open {
    display: flex;
  }
  .main-nav a {
    font-size: 13px;
    padding: 11px 0;
    border-bottom: 1px solid #eee8db;
    white-space: normal;
  }
  .main-nav a:last-child {
    border-bottom: 0;
  }

  .hero {
    min-height: 650px;
    align-items: flex-end;
  }
  .hero-photo {
    inset: 0 0 40% 0;
    background-position: center 35%;
    background-size: cover;
  }
  .hero:before {
    background: linear-gradient(
      180deg,
      rgba(248,245,237,0) 0%,
      rgba(248,245,237,.05) 28%,
      rgba(248,245,237,.72) 48%,
      rgba(248,245,237,.96) 60%,
      #f8f5ed 75%,
      #f8f5ed 100%
    );
  }
  [dir="ltr"] .hero-photo {
    inset: 0 0 40% 0;
    background-position: center 35%;
    background-size: cover;
  }
  [dir="ltr"] .hero:before {
    background: linear-gradient(
      180deg,
      rgba(248,245,237,0) 0%,
      rgba(248,245,237,.05) 28%,
      rgba(248,245,237,.72) 48%,
      rgba(248,245,237,.96) 60%,
      #f8f5ed 75%,
      #f8f5ed 100%
    );
  }
  .hero-inner {
    padding-block: 235px 58px;
  }
  .hero-content,
  [dir="rtl"] .hero-content,
  [dir="ltr"] .hero-content {
    width: 100%;
    max-width: 100%;
    margin-inline: 0;
  }
  .hero h1 {
    font-size: 36px;
    letter-spacing: -.5px;
  }
  .hero h2 {
    font-size: 24px;
  }
  .hero-description {
    font-size: 13px;
    line-height: 1.9;
  }
  .button {
    min-height: 45px;
    padding: 9px 15px;
    gap: 10px;
    font-size: 12px;
  }
  .stats-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 8px;
    margin-top: 0;
    border-radius: 0 0 12px 12px;
  }
  .stat {
    justify-content: flex-start;
    padding: 12px 10px;
    gap: 10px;
    border: 0;
    border-bottom: 1px solid var(--line);
  }
  .stat:nth-child(odd) {
    border-left: 1px solid var(--line);
  }
  .stat:nth-last-child(-n+2) {
    border-bottom: 0;
  }
  [dir="ltr"] .stat {
    border-left: 0;
    border-right: 0;
  }
  [dir="ltr"] .stat:nth-child(odd) {
    border-right: 1px solid var(--line);
  }
  .stat strong {
    font-size: 20px;
  }
  .stat-icon {
    font-size: 24px;
  }

  .section {
    padding: 58px 0;
  }
  .about-grid {
    grid-template-columns: 1fr;
    gap: 25px;
  }
  .about-image-wrap {
    min-height: 0;
  }
  .about-image {
    height: 280px;
    border-radius: 4px 55px 4px 4px;
  }
  .vision-panel {
    grid-column: auto;
    grid-template-columns: 1fr;
    gap: 20px;
    padding-top: 23px;
    border: 0;
  }
  [dir="ltr"] .vision-panel {
    border: 0;
    padding-left: 0;
  }
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
  .section-heading > p {
    max-width: none;
  }
  .program-grid,
  .program-grid-six {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .program-card > img {
    height: 150px;
  }
  .program-card-body {
    padding: 14px;
  }
  .program-card h3 {
    font-size: 14px;
  }
  .program-card p {
    font-size: 11px;
    min-height: 0;
  }
  .postgraduate-banner {
    padding: 22px;
    gap: 14px;
    flex-wrap: wrap;
  }
  .postgrad-mark {
    width: 60px;
    height: 60px;
    flex-basis: 60px;
    font-size: 12px;
  }
  .postgraduate-banner h3 {
    font-size: 20px;
  }
  .postgraduate-banner > div:nth-child(2) {
    flex: 1;
    min-width: 180px;
  }
  .button-light {
    margin: 0 !important;
    width: 100%;
  }
  .history-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .timeline {
    padding-right: 22px;
  }
  [dir="ltr"] .timeline {
    padding-left: 22px;
  }
  .timeline-item {
    grid-template-columns: 60px minmax(0, 1fr);
    gap: 12px;
  }
  .timeline-item:before {
    right: -28px;
  }
  [dir="ltr"] .timeline-item:before {
    right: auto;
    left: -28px;
  }
  .goals-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .goals-grid article {
    padding: 18px;
    min-height: 0;
  }
  .news-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .news-card > img {
    height: 210px;
  }
  .admission-inner,
  .portal-inner {
    align-items: flex-start;
    flex-direction: column;
  }
  .portal-buttons {
    width: 100%;
  }
  .portal-buttons .button {
    flex: 1;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .footer-bottom-inner {
    flex-direction: column;
    gap: 5px;
  }
  .study-system-grid,
  .achievements-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .training-block {
    padding: 23px;
    align-items: flex-start;
    flex-direction: column;
  }
  .training-chips {
    gap: 8px;
  }
  .training-chips span {
    white-space: normal;
  }
  .college-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
  }
  .college-gallery img {
    height: 155px;
  }
  .achievement-highlight {
    padding: 20px;
  }
}

/* Very small phones */
@media (max-width: 390px) {
  .top-links a:nth-child(2) {
    display: none;
  }
  .brand-copy strong {
    font-size: 14px;
  }
  .brand-copy small {
    font-size: 7px;
  }
  .program-grid,
  .program-grid-six,
  .college-gallery {
    grid-template-columns: 1fr;
  }
  .program-card > img,
  .college-gallery img {
    height: 210px;
  }
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-actions .button {
    width: 100%;
  }
}

/* Accessibility: reduce motion when requested by the device */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

/* ==========================================================
   FINAL CLEAN OVERRIDES
   Keep the graduation image and hero text balanced.
   ========================================================== */

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.container {
  width: min(var(--max), calc(100% - 40px));
  margin-inline: auto;
}

/* Hero layout: Arabic text on the right, graduation photo on the left */
.hero {
  position: relative !important;
  isolation: isolate !important;
  display: flex !important;
  align-items: center !important;
  min-height: 560px !important;
  overflow: hidden !important;
  background: #f8f5ed !important;
}

.hero .hero-photo {
  position: absolute !important;
  inset: 0 42% 0 0 !important;
  width: auto !important;
  height: auto !important;
  z-index: 0 !important;
  background-image: url("../images/graduation-blue.jpg") !important;
  background-repeat: no-repeat !important;
  background-size: cover !important;
  background-position: 22% center !important;
  opacity: 1 !important;
}

/* English mode mirrors the image to the right */
html[dir="ltr"] .hero .hero-photo,
[dir="ltr"] .hero .hero-photo {
  inset: 0 0 0 42% !important;
  background-position: 78% center !important;
}

.hero::before {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  z-index: 1 !important;
  pointer-events: none !important;
  background: linear-gradient(
    90deg,
    rgba(248, 245, 237, 0.02) 0%,
    rgba(248, 245, 237, 0.10) 30%,
    rgba(248, 245, 237, 0.50) 42%,
    rgba(248, 245, 237, 0.90) 56%,
    #f8f5ed 70%,
    #f8f5ed 100%
  ) !important;
}

html[dir="ltr"] .hero::before,
[dir="ltr"] .hero::before {
  background: linear-gradient(
    270deg,
    rgba(248, 245, 237, 0.02) 0%,
    rgba(248, 245, 237, 0.10) 30%,
    rgba(248, 245, 237, 0.50) 42%,
    rgba(248, 245, 237, 0.90) 56%,
    #f8f5ed 70%,
    #f8f5ed 100%
  ) !important;
}

.hero .hero-pattern {
  z-index: 2 !important;
  pointer-events: none !important;
}

/* This centered inner area creates a safe margin from both screen edges */
.hero .hero-inner {
  position: relative !important;
  z-index: 3 !important;
  width: 100% !important;
  max-width: 1560px !important;
  min-height: 560px !important;
  margin-inline: auto !important;
  padding: 54px clamp(36px, 5.5vw, 90px) !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
}

/* Arabic: text stays on the right, with a clear inset from the edge */
.hero .hero-content {
  position: relative !important;
  z-index: 4 !important;
  flex: 0 1 52% !important;
  width: 52% !important;
  max-width: 650px !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 20px 0 !important;
  box-sizing: border-box !important;
  text-align: right !important;
}

html[dir="ltr"] .hero .hero-content,
[dir="ltr"] .hero .hero-content {
  text-align: left !important;
}

.hero .hero h1,
.hero h1 {
  overflow-wrap: anywhere;
}

.hero .hero-description {
  max-width: 100% !important;
}

/* Keep program cards and gallery centered when a row is not full */
.program-grid,
.program-grid-six {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 280px)) !important;
  justify-content: center !important;
  align-items: stretch !important;
  gap: 20px !important;
  width: 100% !important;
  max-width: 1200px !important;
  margin-inline: auto !important;
}

.program-card {
  min-width: 0 !important;
  height: 100% !important;
}

.program-card > img {
  display: block;
  width: 100%;
  height: 190px;
  object-fit: cover;
  object-position: center;
}

.college-gallery {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 270px)) !important;
  justify-content: center !important;
  align-items: stretch !important;
  gap: 18px !important;
  width: 100% !important;
  max-width: 1200px !important;
  margin: 28px auto 0 !important;
}

.college-gallery figure {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 100% !important;
  margin: 0 !important;
  overflow: hidden !important;
}

.college-gallery img {
  display: block !important;
  width: 100% !important;
  height: 190px !important;
  flex: 0 0 190px !important;
  object-fit: cover !important;
  object-position: center !important;
}

.college-gallery figcaption {
  display: flex !important;
  flex: 1 !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 58px !important;
  padding: 12px !important;
  text-align: center !important;
}

/* Tablet and small laptop */
@media (min-width: 761px) and (max-width: 1200px) {
  .hero,
  .hero .hero-inner {
    min-height: 500px !important;
  }

  .hero .hero-photo {
    right: 45% !important;
    background-position: 18% center !important;
  }

  html[dir="ltr"] .hero .hero-photo,
  [dir="ltr"] .hero .hero-photo {
    left: 45% !important;
    right: 0 !important;
    background-position: 82% center !important;
  }

  .hero .hero-inner {
    padding-inline: clamp(28px, 4vw, 55px) !important;
  }

  .hero .hero-content {
    flex-basis: 53% !important;
    width: 53% !important;
  }

  .program-grid,
  .program-grid-six {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 280px)) !important;
  }

  .college-gallery {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 260px)) !important;
  }
}

/* Mobile: image above, text below with even side margins */
@media (max-width: 760px) {
  .hero {
    min-height: 660px !important;
    align-items: flex-end !important;
  }

  .hero .hero-photo,
  html[dir="rtl"] .hero .hero-photo,
  html[dir="ltr"] .hero .hero-photo,
  [dir="rtl"] .hero .hero-photo,
  [dir="ltr"] .hero .hero-photo {
    inset: 0 0 43% 0 !important;
    background-size: cover !important;
    background-position: center 30% !important;
  }

  .hero::before,
  html[dir="ltr"] .hero::before,
  [dir="ltr"] .hero::before {
    background: linear-gradient(
      180deg,
      rgba(248, 245, 237, 0) 0%,
      rgba(248, 245, 237, 0.04) 30%,
      rgba(248, 245, 237, 0.58) 48%,
      rgba(248, 245, 237, 0.94) 62%,
      #f8f5ed 78%,
      #f8f5ed 100%
    ) !important;
  }

  .hero .hero-inner {
    min-height: 660px !important;
    padding: 280px 22px 42px !important;
    align-items: flex-end !important;
  }

  .hero .hero-content,
  html[dir="rtl"] .hero .hero-content,
  html[dir="ltr"] .hero .hero-content,
  [dir="rtl"] .hero .hero-content,
  [dir="ltr"] .hero .hero-content {
    flex: 0 1 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .hero h1 {
    font-size: clamp(30px, 8vw, 38px) !important;
  }

  .hero h2 {
    font-size: clamp(21px, 5.5vw, 26px) !important;
  }

  .hero-description {
    font-size: 13px !important;
    line-height: 1.9 !important;
  }

  .program-grid,
  .program-grid-six {
    grid-template-columns: repeat(2, minmax(0, 280px)) !important;
    gap: 12px !important;
  }

  .program-card > img {
    height: 150px;
  }

  .college-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }

  .college-gallery img {
    height: 155px !important;
    flex-basis: 155px !important;
  }
}

@media (max-width: 420px) {
  .hero .hero-inner {
    padding-inline: 18px !important;
  }

  .program-grid,
  .program-grid-six,
  .college-gallery {
    grid-template-columns: minmax(0, 320px) !important;
    justify-content: center !important;
  }

  .program-card > img {
    height: 200px;
  }

  .college-gallery img {
    height: 210px !important;
    flex-basis: 210px !important;
  }

  .hero-actions {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .hero-actions .button {
    width: 100% !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}


/* FINAL VERIFIED OVERRIDE: keep Arabic hero copy away from the viewport edge */
@media (min-width: 761px) {
  html[dir="rtl"] .hero .hero-inner,
  body[dir="rtl"] .hero .hero-inner {
    width: 100% !important;
    max-width: 1560px !important;
    padding-right: clamp(90px, 8vw, 140px) !important;
    padding-left: clamp(36px, 5vw, 80px) !important;
    margin-right: auto !important;
    margin-left: auto !important;
    box-sizing: border-box !important;
  }
  html[dir="rtl"] .hero .hero-content,
  body[dir="rtl"] .hero .hero-content {
    width: 52% !important;
    max-width: 650px !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
    transform: none !important;
  }
}
