/* ============================================================
   Government Polytechnic, Indri -- Site Theme
   Palette: Deep institutional navy + warm amber/saffron accent
   (typical Indian govt. technical-education look, not a generic
   "AI blue" gradient theme).
   ============================================================ */

:root {
  --navy-950: #0a2540;
  --navy-900: #0d3b66;
  --navy-800: #123a5e;
  --navy-700: #1a4d7a;
  --amber-500: #f2a71b;
  --amber-600: #d98c0a;
  --amber-100: #fdf1d9;
  --maroon-600: #a3282f;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --text: #1e2a37;
  --muted: #5b6b7c;
  --border: #e3e9f0;
  --radius: 10px;
  --shadow-sm: 0 2px 8px rgba(13, 59, 102, 0.08);
  --shadow-md: 0 8px 24px rgba(13, 59, 102, 0.14);
  --transition: 0.25s ease;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}
h1, h2, h3, h4 { color: var(--navy-900); margin: 0 0 12px; font-weight: 700; }
section { padding: 64px 0; }

/* ---------- Top utility bar ---------- */
.topbar {
  background: var(--navy-950);
  color: #cfe0f0;
  font-size: 13px;
}
.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 20px;
  flex-wrap: wrap;
  gap: 6px;
}
.topbar-contact span { margin-right: 18px; }
.topbar-links a { margin-left: 14px; opacity: 0.9; transition: opacity var(--transition); }
.topbar-links a:hover { opacity: 1; text-decoration: underline; }

/* ---------- Header / nav ---------- */
.site-header {
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
}
.brand { display: flex; align-items: center; gap: 12px; }
/* Height-only sizing (no fixed width) so a wide banner logo keeps its own
   aspect ratio instead of being squeezed into a square box. */
.brand-logo { height: 60px; width: auto; max-width: 340px; transition: transform var(--transition); }
.brand:hover .brand-logo { transform: scale(1.03); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 26px;
  color: var(--navy-900);
  cursor: pointer;
}

.main-nav { display: flex; align-items: center; gap: 0; flex-wrap: nowrap; }
.main-nav > a, .nav-dropdown-toggle {
  position: relative;
  display: inline-block;
  padding: 10px 10px;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--navy-800);
  cursor: pointer;
  transition: color var(--transition);
  white-space: nowrap;
}
.main-nav > a::after, .nav-dropdown-toggle::after {
  content: "";
  position: absolute;
  left: 10px; right: 10px; bottom: 4px;
  height: 2px;
  background: var(--amber-500);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}
.main-nav > a:hover, .main-nav > a.active,
.nav-dropdown-toggle:hover, .nav-dropdown-toggle.active { color: var(--amber-600); }
.main-nav > a:hover::after, .main-nav > a.active::after,
.nav-dropdown-toggle:hover::after, .nav-dropdown-toggle.active::after { transform: scaleX(1); }

/* ---------- Dropdown / flyout menus ---------- */
.nav-dropdown { position: relative; }
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 240px;
  background: var(--surface);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  padding: 8px 0;
  z-index: 60;
}
.nav-dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu a, .dropdown-item > span {
  display: block;
  padding: 9px 18px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--navy-800);
  white-space: nowrap;
  cursor: pointer;
}
.dropdown-menu a:hover, .dropdown-item:hover > span { background: var(--amber-100); color: var(--amber-600); }
.dropdown-item.has-flyout { position: relative; }
.dropdown-item.has-flyout > span::after { content: ""; }
.flyout-menu {
  display: none;
  position: absolute;
  top: 0;
  left: 100%;
  min-width: 220px;
  background: var(--surface);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  padding: 8px 0;
}
.dropdown-item.has-flyout:hover .flyout-menu { display: block; }

/* ---------- Notice ticker ---------- */
.notice-ticker {
  background: var(--maroon-600);
  color: #fff;
  overflow: hidden;
}
.notice-ticker-inner { display: flex; align-items: center; padding: 8px 20px; gap: 16px; }
.notice-ticker-label {
  background: var(--amber-500);
  color: var(--navy-950);
  font-weight: 700;
  font-size: 12.5px;
  padding: 4px 10px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}
.notice-ticker-track { overflow: hidden; flex: 1; }
.notice-ticker-content {
  display: inline-flex;
  gap: 60px;
  white-space: nowrap;
  animation: ticker 28s linear infinite;
  padding-left: 100%;
}
.notice-ticker-content a { color: #fff; font-size: 13.5px; }
.notice-ticker:hover .notice-ticker-content { animation-play-state: paused; }
@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

/* ---------- Hero slider (React mounts into #hero-slider) ---------- */
.hero-slider {
  position: relative;
  width: 100%;
  height: 480px;
  overflow: hidden;
  background: var(--navy-950);
}
.hero-slider .slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 1.1s ease, transform 6s ease;
}
.hero-slider .slide.active {
  opacity: 1;
  transform: scale(1);
  z-index: 1;
}
.hero-slider .slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-slider .dots {
  position: absolute;
  bottom: 18px;
  left: 0; right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  z-index: 2;
}
.hero-slider .dots button {
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: background var(--transition), transform var(--transition);
}
.hero-slider .dots button.active { background: var(--amber-500); border-color: var(--amber-500); transform: scale(1.2); }
.hero-slider .arrow {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  background: rgba(10, 37, 64, 0.45);
  color: #fff;
  border: none;
  width: 42px; height: 42px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  z-index: 2;
  transition: background var(--transition);
}
.hero-slider .arrow:hover { background: var(--amber-600); }
.hero-slider .arrow.prev { left: 16px; }
.hero-slider .arrow.next { right: 16px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 12px 26px;
  background: linear-gradient(135deg, var(--amber-500), var(--amber-600));
  color: var(--navy-950);
  font-weight: 700;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-outline {
  background: transparent;
  border: 2px solid var(--navy-800);
  color: var(--navy-800);
}
.btn-outline:hover { background: var(--navy-800); color: #fff; }

/* ---------- Reveal-on-scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* ---------- Section: intro / welcome ---------- */
.section-title { text-align: center; margin-bottom: 40px; }
.section-title span { color: var(--amber-600); text-transform: uppercase; font-size: 13px; font-weight: 700; letter-spacing: 1.5px; }
.section-title h2 { font-size: 30px; margin-top: 6px; }
.section-title::after {
  content: "";
  display: block;
  width: 60px; height: 4px;
  background: var(--amber-500);
  margin: 14px auto 0;
  border-radius: 2px;
}

.intro-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center; }
.intro-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow-md); }

/* ---------- Stats counters ---------- */
.stats-bar {
  background: var(--navy-900);
  color: #fff;
  padding: 40px 0;
}
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; gap: 20px; }
.stats-grid .num { font-size: 36px; font-weight: 800; color: var(--amber-500); }
.stats-grid .label { font-size: 14px; opacity: 0.85; }

/* ---------- Cards: courses / faculty / gallery ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 24px; }
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 26px 22px;
  box-shadow: var(--shadow-sm);
  border-top: 4px solid var(--amber-500);
  transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.card .icon {
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  background: var(--amber-100);
  border-radius: 50%;
  color: var(--navy-800);
  font-size: 24px;
  margin-bottom: 14px;
}
.card h3 { font-size: 17px; }
.card p { color: var(--muted); font-size: 14px; }
.card .meta { margin-top: 10px; font-size: 12.5px; color: var(--amber-600); font-weight: 700; }

.faculty-card { text-align: center; }
.faculty-card img { width: 100px; height: 100px; border-radius: 50%; margin: 0 auto 14px; border: 3px solid var(--amber-500); }
.faculty-card h3 { font-size: 16px; margin-bottom: 2px; }
.faculty-card .designation { color: var(--amber-600); font-weight: 700; font-size: 13px; }
.faculty-card .department { color: var(--muted); font-size: 13px; }

.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.gallery-item { position: relative; overflow: hidden; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.gallery-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; transition: transform 0.5s ease; }
.gallery-item:hover img { transform: scale(1.12); }
.gallery-caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(transparent, rgba(10,37,64,0.85));
  color: #fff; padding: 30px 14px 12px; font-size: 13px;
  transform: translateY(100%);
  transition: transform var(--transition);
}
.gallery-item:hover .gallery-caption { transform: translateY(0); }

/* ---------- Principal message ---------- */
.principal-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 32px;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 30px;
  align-items: center;
}
.principal-card img { border-radius: 50%; border: 4px solid var(--amber-500); }
.principal-card blockquote { font-style: italic; color: var(--text); margin: 0 0 14px; }

/* ---------- Notice board table ---------- */
.notice-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.notice-table th, .notice-table td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--border); }
.notice-table th { background: var(--navy-900); color: #fff; }
.notice-table tr:hover td { background: var(--amber-100); }

/* ---------- Forms ---------- */
.form-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 30px;
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.8;
}
.form-card a { color: var(--navy-700); text-decoration: underline; }
.form-card a:hover { color: var(--amber-600); }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none;
  border-color: var(--amber-500);
  box-shadow: 0 0 0 3px rgba(242, 167, 27, 0.25);
}
.alert { padding: 14px 18px; border-radius: 6px; margin-bottom: 18px; font-size: 14px; }
.alert-success { background: #e5f6ea; color: #1c7a3d; border: 1px solid #b8e6c4; }
.alert-error { background: #fdecea; color: var(--maroon-600); border: 1px solid #f5c2bd; }

/* ---------- Map + contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.contact-info-card { background: var(--navy-900); color: #fff; border-radius: var(--radius); padding: 30px; }
.contact-info-card h3 { color: #fff; }
.contact-info-card .row { margin-bottom: 16px; display: flex; gap: 12px; align-items: flex-start; }
.contact-info-card .row .ic { color: var(--amber-500); font-size: 18px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-950); color: #cfe0f0; margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 30px; padding: 50px 20px; }
.footer-col h4 { color: #fff; font-size: 15px; margin-bottom: 14px; }
.footer-col a, .footer-col p { display: block; color: #b9c9d9; font-size: 13.5px; margin-bottom: 8px; transition: color var(--transition); }
.footer-col a:hover { color: var(--amber-500); }
.footer-logo { height: 46px; width: auto; max-width: 220px; margin-bottom: 10px; }
.footer-col h3 { color: #fff; font-size: 16px; }
.footer-social { display: flex; gap: 10px; margin-top: 12px; }
.footer-social a {
  width: 34px; height: 34px;
  border: 1px solid #33507a;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.footer-social a:hover { background: var(--amber-500); color: var(--navy-950); border-color: var(--amber-500); }
.footer-bottom { border-top: 1px solid #1c3a5e; padding: 16px 0; text-align: center; font-size: 12.5px; color: #92a6bb; }

/* ---------- Page banner (inner pages) ---------- */
.page-banner {
  background: linear-gradient(120deg, var(--navy-950), var(--navy-800));
  color: #fff;
  padding: 50px 0;
  text-align: center;
}
.page-banner h1 { color: #fff; font-size: 30px; margin-bottom: 8px; }
.page-banner p { color: #cfe0f0; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .intro-grid, .contact-grid { grid-template-columns: 1fr; }
  .principal-card { grid-template-columns: 1fr; text-align: center; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
/* 11 top-level items is wide -- switch to the hamburger menu well before
   items start wrapping/crowding, not just on phone-sized screens. */
@media (max-width: 1180px) {
  .nav-toggle { display: block; }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--surface);
    flex-direction: column;
    align-items: stretch;
    box-shadow: var(--shadow-md);
    padding: 10px 0;
    max-height: 80vh;
    overflow-y: auto;
  }
  .main-nav.open { display: flex; }
  .main-nav > a, .nav-dropdown-toggle { padding: 12px 20px; }
  /* On mobile there's no hover, so render every dropdown/flyout as an
     always-expanded, indented sub-list instead of hidden-until-hover. */
  .dropdown-menu, .flyout-menu {
    display: block !important;
    position: static !important;
    box-shadow: none;
    min-width: 0;
    padding-left: 16px;
    border-left: 2px solid var(--border);
    margin: 0 20px 6px;
  }
  .dropdown-menu a, .dropdown-item > span, .flyout-menu a { padding: 8px 10px; }
}
@media (max-width: 760px) {
  .topbar-contact span:nth-child(3) { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-slider { height: 300px; }
}
