/* PCET – home.css: HOME PAGE ONLY (index.php, load after main.css) · sections styled by id, fonts come from main.css variables */


/* ---------- FLYER (#flyer) – campus photos change behind fixed text ---------- */
#flyer { --flyer-gold: #ffb81c; --flyer-navy: #0b1f4d; position: relative; height: clamp(480px, 75vh, 760px); overflow: hidden; background: var(--flyer-navy); }
#flyer .carousel, #flyer .carousel-inner { position: absolute; inset: 0; }
#flyer .carousel-item { height: 100%; }
#flyer .carousel-item > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 55%; transform: scale(1.02); animation: flyerZoom 14s ease-out forwards; }   /* slow zoom */
#flyer .carousel::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(ellipse at center, rgba(0, 0, 0, .45) 0%, rgba(0, 0, 0, .75) 70%), linear-gradient(0deg, rgba(0, 0, 0, .55), rgba(0, 0, 0, .15)); }   /* dark overlay */
#flyer > .container { position: relative; z-index: 2; }

/* Top line: gold capitals between thin lines */
#flyer p:first-child { display: inline-flex; align-items: center; gap: 14px; color: var(--flyer-gold); font-family: var(--pcet-display-font); font-stretch: 100%; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; font-size: clamp(.8rem, 1.2vw, 2rem); margin-bottom: 1rem; text-shadow: 0 1px 8px rgba(0, 0, 0, .35); }
#flyer p:first-child::before, #flyer p:first-child::after { content: ""; width: 40px; height: 1px; background: var(--flyer-gold); }

/* Tagline */
#flyer p:first-child + p { font-family: var(--pcet-ui-font); font-weight: 500; font-size: clamp(1rem, 1.6vw, 1.25rem); letter-spacing: .02em; color: rgba(255, 255, 255, .92); margin: 0 0 .9rem; text-shadow: 0 1px 10px rgba(0, 0, 0, .45); }

/* Headline – "Nursery To PHD" in gold on one line */
#flyer h1 { font-family: var(--pcet-display-font); font-weight: 800; font-stretch: 100%; text-transform: uppercase; font-size: clamp(1.8rem, 3.6vw, 3rem); line-height: 1.05; letter-spacing: .01em; color: #fff; margin: 0 0 1rem; text-shadow: 0 2px 18px rgba(0, 10, 40, .35); }
#flyer h1 em { font-style: normal; font-weight: 900; color: var(--flyer-gold); white-space: nowrap; }

/* Programmes separated by gold dots */
#flyer h1 + p { font-family: var(--pcet-ui-font); color: rgba(255, 255, 255, .88); font-size: 1rem; line-height: 1.65; letter-spacing: .02em; margin: 0 auto 2rem; }
#flyer h1 + p span { white-space: nowrap; }
#flyer h1 + p span + span::before { content: "·"; color: var(--flyer-gold); font-weight: 700; margin: 0 .55em 0 .2em; }
#flyer h1 + p br + span::before { content: none; }

/* Buttons */
#flyer .btn { font-family: var(--pcet-ui-font); font-weight: 700; font-size: 1.0625rem; border-radius: 50rem; padding: .85rem 1.85rem; min-width: 12rem; margin: .375rem; }
#flyer .btn:focus-visible { outline: 3px solid var(--flyer-gold); outline-offset: 2px; box-shadow: none; }
#flyer .btn-warning { --bs-btn-color: #ffd166; --bs-btn-bg: var(--flyer-navy); --bs-btn-border-color: var(--flyer-gold); --bs-btn-hover-color: var(--flyer-navy); --bs-btn-hover-bg: var(--flyer-gold); --bs-btn-hover-border-color: var(--flyer-gold); --bs-btn-active-color: var(--flyer-navy); --bs-btn-active-bg: #f5a60f; --bs-btn-active-border-color: #f5a60f; border-width: 2px; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); transition: background .25s, color .25s, transform .2s; }   /* Admission Enquiry */
#flyer .btn-warning:hover { transform: translateY(-1px); }
#flyer .btn-outline-light { border-width: 1.5px; background: rgba(255, 255, 255, .08); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }   /* Explore Institutes */
#flyer .btn-outline-light:hover, #flyer .btn-outline-light:active { background: #fff; border-color: #fff; color: #000; }

/* Text rises in once on page load */
#flyer .col-12 > * { animation: flyerUp .8s cubic-bezier(.2, .7, .2, 1) both; }
#flyer h1 { animation-delay: .12s; }
#flyer h1 + p { animation-delay: .24s; }
#flyer .btn { animation-delay: .36s; }
@keyframes flyerZoom { from { transform: scale(1.02); } to { transform: scale(1.1); } }
@keyframes flyerUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }


/* ---------- HIGHLIGHTS (#highlights) – tiles; number counts up once + bar fills when the tile comes into view ---------- */
#highlights { --hl-gold: #ffb81c; --hl-navy: #0b1f4d; background: #fff; padding: 50px 0; }
#highlights .col > div { position: relative; height: 100%; overflow: hidden; background: #fff; border: 1px solid #e3e9f1; border-radius: 14px; padding: 30px 18px 26px; text-align: center; box-shadow: 0 6px 18px rgba(11, 31, 77, .05); transition: transform .25s, box-shadow .25s; }
#highlights .col > div:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(11, 31, 77, .12); }
#highlights .col > div::before { content: ""; position: absolute; top: 0; left: 50%; width: 46px; height: 6px; margin-left: -23px; background: var(--hl-gold); transform: skewX(-14deg); border-radius: 0 0 3px 3px; }   /* slanted gold tab */
#highlights .col > div::after { content: ""; position: absolute; left: 0; bottom: 0; height: 4px; width: calc(var(--p, 100) * 1%); background: linear-gradient(90deg, var(--hl-navy), var(--hl-gold)); }   /* bar, --p = 0–100 */
#highlights .col > div > div { font-family: var(--pcet-display-font); font-weight: 900; font-size: clamp(1.8rem, 2.6vw, 2.4rem); line-height: 1.1; color: var(--hl-navy); white-space: nowrap; font-variant-numeric: tabular-nums; }
#highlights .col > div > p { font-family: var(--pcet-ui-font); font-size: 18.5px; font-weight: 500; line-height: 1.4; color: #4a5a6e; margin: 8px 0 0; }

/* Count-up: number from style="--to" (index.php), shown as thousands , last 3 digits (up to 999,999); home.js adds data-count / data-run */
@property --n { syntax: "<integer>"; inherits: false; initial-value: 0; }   /* number shown now */
@property --k { syntax: "<integer>"; inherits: false; initial-value: 0; }   /* thousands */
@property --c { syntax: "<integer>"; inherits: false; initial-value: 0; }   /* 1 = show comma */
@property --r { syntax: "<integer>"; inherits: false; initial-value: 0; }   /* last 3 digits */
@property --p { syntax: "<number>"; inherits: false; initial-value: 100; }  /* bar % */
@counter-style hl-none  { system: cyclic; symbols: ""; }
@counter-style hl-k     { system: extends decimal; range: 1 infinite; fallback: hl-none; }
@counter-style hl-comma { system: cyclic; symbols: ","; range: 1 1; fallback: hl-none; }
@counter-style hl-pad3  { system: extends decimal; pad: 3 "0"; range: 0 infinite; fallback: hl-none; }
@counter-style hl-plain { system: extends decimal; range: 0 infinite; fallback: hl-none; }
#highlights .col > div > div > span + span {
  --n: var(--to);
  --k: calc(var(--n) / 1000 - .5);
  --c: min(var(--k), 1);
  --r: calc(var(--n) - var(--k) * 1000);
  counter-reset: hlk var(--k) hlc var(--c) hlp calc(var(--r) * var(--c) + var(--c) - 1) hlq calc(var(--r) * (1 - var(--c)) - var(--c));
}
#highlights .col > div > div > span + span::before { content: counter(hlk, hl-k) counter(hlc, hl-comma) counter(hlp, hl-pad3) counter(hlq, hl-plain); }
@keyframes hlCount { from { --n: 0; } to { --n: var(--to); } }
@keyframes hlBar { from { --p: 0; } to { --p: 100; } }
/* 2.2s = counting time · 110ms = delay between tiles in a row (--i from index.php) */
#highlights[data-count] .col > div { animation: hlBar 2.2s cubic-bezier(.25, 1, .5, 1) calc(var(--i, 0) * 110ms) both paused; }
#highlights[data-count] .col > div > div > span + span { animation: hlCount 2.2s cubic-bezier(.25, 1, .5, 1) calc(var(--i, 0) * 110ms) both paused; }
#highlights[data-count] .col > div[data-run], #highlights[data-count] .col > div[data-run] > div > span + span { animation-play-state: running; }


/* ---------- SECTION HEADINGS (.index-h2) – add class="index-h2" to any new section's h2 ---------- */
.index-h2 { font-family: var(--pcet-heading-font); font-weight: 800; font-size: 1.9rem; line-height: 1.15; letter-spacing: -.01em; color: var(--pcet-navy-deep); margin-bottom: .9rem; }
.index-h2::after { content: ""; display: block; width: 64px; height: 4px; margin: 10px auto 0; border-radius: 3px; background: #ffb81c; }


/* ---------- ABOUT (#about) – text left, video right; clicking the video opens it in a pop-up ---------- */
#about { --ab-accent: #ffb81c; background: #fff; padding: 35px 0; overflow-x: clip; }
#about .col-lg-6:last-child { position: relative; isolation: isolate; }
#about .col-lg-6:last-child::before { content: ""; position: absolute; z-index: -1; right: -6px; top: -30px; width: 180px; height: 140px; background: radial-gradient(var(--ab-accent) 2.4px, transparent 2.6px) 0 0 / 18px 18px; }   /* dot pattern */
#aboutVideo { position: relative; border-radius: 24px; overflow: hidden; background: #000; box-shadow: 0 26px 56px rgba(11, 31, 77, .22); transition: transform .3s, box-shadow .3s; }
#aboutVideo:hover { transform: translateY(-4px); box-shadow: 0 32px 64px rgba(11, 31, 77, .28); }
#aboutVideo iframe { display: block; }
#aboutVideo button { position: absolute; inset: 0; width: 100%; padding: 0; border: 0; background: transparent; cursor: pointer; }   /* invisible button over the video */
#aboutVideo button:focus-visible { outline: 3px solid var(--ab-accent); outline-offset: -6px; }

/* Video pop-up */
#aboutPopup { --bs-modal-bg: transparent; --bs-modal-border-width: 0; }
#aboutPopup .modal-content { border-radius: 14px; overflow: hidden; background: #000; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
#aboutPopup iframe { border: 0; }
#aboutPopup .btn-close { position: fixed; top: 22px; right: 26px; z-index: 2; width: 1.4em; height: 1.4em; opacity: .85; }
#aboutPopup .btn-close:hover { opacity: 1; }
.modal-backdrop.show { opacity: .85; }


/* ---------- INSTITUTES (#institutes) – whole card is a link; hover: lift, photo zoom, blue bar ---------- */
#institutes { --in-blue: #136ad5; --in-blue-soft: #e7f0fc; --in-navy: #223a58; background: rgba(11, 31, 77, .045); padding: 35px 0; }
#institutes article { display: flex; flex-direction: column; overflow: hidden; background: #fff; border-radius: 15px; box-shadow: 0 10px 30px rgba(0, 0, 0, .08); transition: transform .3s, box-shadow .3s; }
#institutes article:hover, #institutes article:has(a:focus-visible) { transform: translateY(-6px); box-shadow: 0 18px 40px rgba(0, 0, 0, .12); }

/* Photo + badges */
#institutes article > div:first-child { position: relative; overflow: hidden; }
#institutes article > div:first-child img { display: block; width: 100%; height: 220px; object-fit: cover; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
#institutes article:hover > div:first-child img { transform: scale(1.07); }
#institutes article > div:first-child span { position: absolute; top: 14px; border-radius: 50rem; font-family: var(--pcet-ui-font); font-size: 12px; font-weight: 700; }
#institutes article > div:first-child span:nth-of-type(1) { left: 14px; padding: 5px 12px; background: var(--in-blue); color: #fff; text-transform: uppercase; letter-spacing: .03em; }
#institutes article > div:first-child span:nth-of-type(2) { right: 14px; padding: 8px 14px; background: var(--in-navy); color: #fff; font-size: 13px; }

/* Tags + name */
#institutes article > div:last-child { flex: 1; padding: 22px 24px 26px; }
#institutes article > div:last-child > div:first-child { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
#institutes article > div:last-child > div:first-child span { font-family: var(--pcet-ui-font); font-size: 12px; font-weight: 500; padding: 4px 11px; border-radius: 50rem; background: var(--in-blue-soft); color: var(--in-blue); }
#institutes article > div:last-child > div:first-child span + span { background: #eceff3; color: var(--in-navy); }
#institutes h3 { font-size: 1.3rem; font-weight: 700; line-height: 1.3; margin: 0; }
#institutes h3 a { color: var(--in-navy); text-decoration: none; transition: color .2s; }
#institutes article:hover h3 a { color: var(--in-blue); }
#institutes h3 a:focus-visible { outline: none; }
#institutes article:has(a:focus-visible) { outline: 3px solid var(--in-blue); outline-offset: 3px; }   /* keyboard only */
#institutes article::after { content: ""; position: absolute; z-index: 2; pointer-events: none; left: 0; bottom: 0; height: 4px; width: 100%; background: var(--in-blue); transform: scaleX(0); transform-origin: left; transition: transform .4s cubic-bezier(.65, 0, .35, 1); }   /* blue bar */
#institutes article:hover::after, #institutes article:has(a:focus-visible)::after { transform: scaleX(1); }


/* ---------- AWARDS (#awards) – certificate cards in a one-row slider (4 / 2 / 1 visible) ---------- */
#awards { --aw-gold: #ffb81c; --aw-navy: #0b1f4d; background: rgba(11, 31, 77, .045); padding: 35px 0; }
#awards article { height: 100%; background: #fff; padding: 10px; border-radius: 6px; box-shadow: 0 14px 34px rgba(11, 31, 77, .1); }
#awards article > div { height: 100%; border: 2px solid var(--aw-gold); outline: 1px solid rgba(255, 184, 28, .5); outline-offset: -8px; padding: 30px 22px 26px; text-align: center; }   /* double gold frame */
#awards article img { display: block; width: 100%; max-width: 170px; height: 100px; object-fit: contain; margin: 0 auto 18px; }   /* same-size logo box */
#awards h3 { display: flex; flex-direction: column; gap: 14px; min-height: calc(2.5em + 15px); font-size: 1.2rem; font-weight: 800; line-height: 1.25; color: var(--aw-navy); margin: 0 0 14px; }   /* always 2 lines tall */
#awards h3::after { content: ""; display: block; flex-shrink: 0; width: 110px; height: 1px; margin: auto auto 0; background: linear-gradient(90deg, transparent, var(--aw-gold), transparent); }
#awards article p { font-size: 14px; line-height: 1.7; color: #5a6776; margin: 0 0 6px; }

/* Slider row: snaps card by card, hidden scrollbar */
#awardsSlider { position: relative; }
#awardsSlider > .row { overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; overscroll-behavior-x: contain; padding: 8px 0 34px; scrollbar-width: none; }
#awardsSlider > .row::-webkit-scrollbar { display: none; }
#awardsSlider > .row:focus-visible { outline: 2px solid var(--aw-gold); outline-offset: 4px; border-radius: 6px; }
#awardsSlider > .row > * { scroll-snap-align: start; }

/* ‹ › buttons */
#awardsSlider > button { position: absolute; top: calc(50% - 13px); z-index: 2; width: 44px; height: 44px; display: grid; place-items: center; padding: 0 0 4px; border: 1px solid currentColor; border-radius: 50%; background: transparent; color: inherit; font-size: 30px; line-height: 1; transform: translateY(-50%); }
#awardsSlider > button:first-child { left: -64px; }
#awardsSlider > button:last-child { right: -64px; }
#awardsSlider > button:disabled { opacity: .3; cursor: default; }
#awardsSlider[data-all-fit] > button { display: none; }   /* all fit → no arrows */


/* ---------- STUDENT LIFE (#student-life) – flip cards (CSS): hover on desktop, tap on phones, Tab on keyboard ---------- */
#student-life { background: #fff; padding: 35px 0; }
#student-life article { height: 280px; perspective: 1200px; cursor: pointer; outline: none; }
#student-life article > div { backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: transform .6s cubic-bezier(.4, .2, .2, 1); }
#student-life article > div:first-child { transform: rotateY(0deg); }
#student-life article > div:first-child h3 { background: linear-gradient(transparent, rgba(11, 31, 77, .9)); }
#student-life article > div:last-child { transform: rotateY(180deg); background: #fff; border: 1px solid #e3e9f1; border-left: 5px solid #136ad5; box-shadow: 0 14px 30px rgba(11, 31, 77, .12); }
#student-life article > div:last-child h3 { color: #136ad5; }
#student-life article > div:last-child p { color: #5a6776; }
#student-life article > div:last-child a.btn { --bs-btn-bg: #136ad5; --bs-btn-border-color: #136ad5; --bs-btn-color: #fff; --bs-btn-hover-bg: #0f58b3; --bs-btn-hover-border-color: #0f58b3; --bs-btn-hover-color: #fff; --bs-btn-active-bg: #0f58b3; --bs-btn-active-border-color: #0f58b3; --bs-btn-active-color: #fff; }
#student-life article:focus-visible > div:first-child, #student-life article:has(:focus-visible) > div:first-child { transform: rotateY(-180deg); }   /* keyboard */
#student-life article:focus-visible > div:last-child, #student-life article:has(:focus-visible) > div:last-child { transform: rotateY(0deg); }
@media (hover: hover) {   /* mouse */
  #student-life article:hover > div:first-child { transform: rotateY(-180deg); }
  #student-life article:hover > div:last-child { transform: rotateY(0deg); }
}
@media (hover: none) {    /* touch: tap = focus = flipped; tap elsewhere = back */
  #student-life article:focus-within > div:first-child { transform: rotateY(-180deg); }
  #student-life article:focus-within > div:last-child { transform: rotateY(0deg); }
}
#student-life article:focus-visible > div { outline: 3px solid #ffb81c; outline-offset: 3px; }


/* ---------- MEDIA QUERIES ---------- */

/* Desktop (≥1200px): flyer text below the hanging crest */
@media (min-width: 1200px) {
  #flyer > .container { padding-top: 60px; }
}

/* Below 1500px: ‹ › centred under the awards slider */
@media (max-width: 1499.98px) {
  #awardsSlider { padding-bottom: 52px; }
  #awardsSlider > button { top: auto; bottom: 0; transform: none; }
  #awardsSlider > button:first-child { left: calc(50% - 54px); }
  #awardsSlider > button:last-child { right: calc(50% - 54px); }
  #awardsSlider[data-all-fit] { padding-bottom: 0; }
}

/* Laptops (992–1399px): award titles can take 3 lines */
@media (min-width: 992px) and (max-width: 1399.98px) {
  #awards h3 { min-height: calc(3.75em + 15px); }
}

/* Tablets & phones (<992px) */
@media (max-width: 991.98px) {
  #institutes, #awards, #student-life, #about { padding: 44px 0; }
  #about .col-lg-6:last-child { margin-top: 20px; }
  #about .col-lg-6:last-child::before { right: 0; top: -24px; width: 120px; height: 90px; }
}

/* Phones & small tablets (<768px): programmes become chips */
@media (max-width: 767.98px) {
  #flyer h1 + p { font-size: .88rem; }
  #flyer h1 + p br { display: none; }
  #flyer h1 + p span::before { content: none !important; }
  #flyer h1 + p span { display: inline-block; margin: 3px 2px; padding: 2px 10px; border: 1px solid rgba(255, 255, 255, .25); border-radius: 50rem; background: rgba(255, 255, 255, .06); }
}

/* Phones (<576px) */
@media (max-width: 575.98px) {
  #flyer { height: auto; min-height: 560px; padding: 40px 0; display: flex; align-items: center; }
  #flyer > .container { height: auto !important; }
  #flyer p:first-child { letter-spacing: .06em; font-size: .72rem; gap: 8px; }
  #flyer p:first-child::before, #flyer p:first-child::after { width: 20px; }
  #flyer p:first-child + p { font-size: .95rem; }
  #flyer h1 { font-size: 1.45rem; }
  #flyer .btn { display: block; width: 100%; max-width: 20rem; margin: .5rem auto 0; }

  #highlights { padding: 56px 0; }
  #highlights .col > div { padding: 24px 12px 20px; }
  #highlights .col > div > div { font-size: 1.5rem; }
  #highlights .col > div > p { font-size: 12.5px; }

  #institutes article > div:first-child img { height: 200px; }
}

/* Less motion */
@media (prefers-reduced-motion: reduce) {
  #aboutVideo, #highlights .col > div, #institutes article, #institutes article *, #institutes article::after, #student-life article > div { transition: none; }
  #flyer .carousel-item > img, #flyer .col-12 > * { animation: none !important; }
}