/* ============================================================
   KTTC Website — Main Stylesheet
   Colors/fonts driven by CSS variables set in includes/header.php
   from Admin > Settings (theme color, font family, font size)
   ============================================================ */

:root {
  --color-primary: #7a1d2c;
  --color-secondary: #f5a623;
  --color-text: #222222;
  --color-muted: #6b6b6b;
  --color-bg-light: #f8f6f4;
  --color-border: #e6e0dc;
  --font-family: 'Poppins', sans-serif;
  --heading-font-family: 'Poppins', sans-serif;
  --menu-font-family: 'Poppins', sans-serif;
  --footer-font-family: 'Poppins', sans-serif;
  --font-size-base: 16px;
  --radius: 8px;
  --shadow: 0 4px 18px rgba(0,0,0,.08);
  --topbar-bg: #241414;
  --topbar-text: #dddddd;
  --menu-bg: #ffffff;
  --menu-text: #222222;
  --menu-hover: #7a1d2c;
  --menu-active-bg: #faf5f3;
  --body-bg: #ffffff;
  --section-alt-bg: #f8f6f4;
  --footer-bg: #1c1414;
  --footer-text: #cfc7c5;
  --footer-heading: #ffffff;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: var(--font-size-base); }
body {
  margin: 0;
  font-family: var(--font-family);
  font-size: 1rem;
  color: var(--color-text);
  line-height: 1.65;
  background: var(--body-bg);
}
img { max-width: 100%; display: block; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-secondary); }
ul { list-style: none; margin: 0; padding: 0; }
h1,h2,h3,h4,h5 { font-family: var(--heading-font-family); line-height: 1.3; margin: 0 0 .6em; color: var(--color-text); }
p { margin: 0 0 1em; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.skip-link { position: absolute; left: -999px; top: 0; background: #fff; padding: 10px; z-index: 999; }
.skip-link:focus { left: 10px; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 4px;
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  font-size: 0.9375rem;
  border: 2px solid var(--color-primary);
  cursor: pointer;
  transition: .2s;
}
.btn:hover { background: transparent; color: var(--color-primary); }
.btn-outline { background: transparent; color: #fff; border-color: #fff; }
.btn-outline:hover { background: #fff; color: var(--color-primary); }
.btn-secondary { background: var(--color-secondary); border-color: var(--color-secondary); color: #222; }
.btn-secondary:hover { background: transparent; color: var(--color-secondary); }
.btn-sm { padding: 7px 16px; font-size: 0.8125rem; }

/* ---------------- Row 1: Top bar (right-aligned only) ---------------- */
.topbar { background: var(--topbar-bg); color: var(--topbar-text); font-size: 0.8125rem; padding: 6px 0; }
.topbar-inner { display: flex; justify-content: flex-end; }
.topbar a, .topbar span { color: var(--topbar-text); }
.topbar-right-only { display: flex; align-items: center; gap: 10px; }
.topbar-right-only a { text-decoration: none; }
.topbar-right-only a:hover { color: var(--color-secondary); }
.topbar-sep { opacity: .4; }
.social-links a { margin: 0 4px; display: inline-block; width: 22px; height: 22px; line-height: 22px; text-align: center; background: rgba(255,255,255,.15); border-radius: 50%; font-size: 0.75rem; }

/* ---------------- Row 2: Logo + College Name | Contact + Social ---------------- */
.site-header { background: var(--menu-bg); box-shadow: var(--shadow); position: relative; z-index: 100; }
.header-top { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; gap: 20px; flex-wrap: nowrap; }
.brand { display: flex; align-items: center; gap: 16px; min-width: 0; flex: 1 1 auto; }
.brand-logo { height: 100px; width: auto; flex-shrink: 0; }
.brand-logo-placeholder { height: 82px; width: 82px; background: var(--color-bg-light); border: 1px dashed var(--color-border); display: flex; align-items: center; justify-content: center; font-size: 0.75rem; color: var(--color-muted); border-radius: 50%; flex-shrink: 0; }
.brand-name { font-weight: 700; color: var(--color-primary); max-width: 100%; line-height: 1.25; font-family: var(--heading-font-family); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.header-contact { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; text-align: right; }
.header-contact-line { color: var(--menu-text); text-decoration: none; white-space: nowrap; font-size: 0.875rem; }
.header-contact-line:hover { color: var(--menu-hover); }
.header-contact .social-links { flex-shrink: 0; white-space: nowrap; }
.header-contact .social-links a { background: var(--color-bg-light); color: var(--menu-text); }
.header-contact .social-links a:hover { background: var(--menu-hover); color: #fff; }

/* ---------------- Row 3: Menu bar ---------------- */
.nav-bar { background: var(--menu-bg); border-top: 3px solid var(--color-border); }
.nav-bar-inner { display: flex; align-items: center; padding: 0 16px; max-width: 1440px; margin: 0 auto; }

.menu-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 6px; }
.menu-toggle span { width: 26px; height: 3px; background: var(--color-primary); border-radius: 2px; }

.main-nav { width: 100%; }
.main-nav .menu { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; font-family: var(--menu-font-family); width: 100%; }
.main-nav .menu-item { position: relative; }
.main-nav > .menu > .menu-item > a { display: block; padding: 8px 5px; font-weight: 500; font-size: 0.875rem; color: var(--menu-text); border-bottom: 3px solid transparent; transition: .2s; white-space: nowrap; }
.main-nav .menu-item:hover > a { color: var(--menu-hover); border-bottom-color: var(--menu-hover); }
.caret { font-size: 0.625rem; margin-left: 3px; }

.submenu { display: none; position: absolute; top: 100%; left: 0; background: var(--menu-bg); min-width: 270px; box-shadow: var(--shadow); border-top: 3px solid var(--menu-hover); padding: 8px 0; z-index: 50; border-radius: 0 0 6px 6px; }
.main-nav .menu-item:hover > .submenu { display: block; }
.submenu .menu-item { position: relative; }
.submenu .menu-item > a { display: block; padding: 11px 20px; font-size: 0.875rem; white-space: nowrap; color: var(--menu-text); border-bottom: none; border-left: 3px solid transparent; }
.submenu .menu-item:hover > a { background: var(--menu-active-bg); color: var(--menu-hover); border-left-color: var(--menu-hover); }
.submenu-3 { top: 0; left: 100%; border-top: none; border-left: 3px solid var(--color-secondary); border-radius: 6px; }

.marquee-bar { background: var(--color-primary); color: #fff; display: flex; align-items: center; font-size: 0.875rem; overflow: hidden; }
.marquee-label { background: var(--color-secondary); color: #222; font-weight: 700; padding: 8px 16px; white-space: nowrap; flex-shrink: 0; }
.marquee-content { padding: 8px 16px; flex: 1; min-width: 0; overflow: hidden; }
.marquee-content a, .marquee-content { color: #fff; }

/* ---------------- Hero Slider ---------------- */
.hero-slider { position: relative; overflow: hidden; height: 520px; background: var(--color-bg-light); }
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .8s ease; background-size: cover; background-position: center; display: flex; align-items: center; }
.hero-slide.active { opacity: 1; z-index: 2; }
.hero-slide::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--overlay-color, #000000);
  opacity: var(--overlay-opacity, .55);
}
.hero-slide-content { position: relative; z-index: 2; max-width: 620px; padding: 0 60px; }
.hero-slide.align-center .container { display: flex; justify-content: center; text-align: center; }
.hero-slide.align-center .hero-slide-content { max-width: 720px; }
.hero-slide.align-right .container { display: flex; justify-content: flex-end; text-align: right; }
.hero-slide-content h2 { font-size: 2.5rem; font-weight: 700; margin-bottom: 16px; }
.hero-slide-content p { font-size: 1.0625rem; margin-bottom: 26px; opacity: .95; }
.hero-dots { position: absolute; bottom: 22px; left: 0; right: 0; display: flex; justify-content: center; gap: 10px; z-index: 5; }
.hero-dot { width: 11px; height: 11px; border-radius: 50%; background: rgba(255,255,255,.5); cursor: pointer; border: 0; }
.hero-dot.active { background: var(--color-secondary); }
.hero-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.2); color: #fff; border: 0; width: 44px; height: 44px; border-radius: 50%; font-size: 1.25rem; cursor: pointer; z-index: 5; }
.hero-nav:hover { background: rgba(255,255,255,.4); }
.hero-prev { left: 20px; }
.hero-next { right: 20px; }
.hero-empty { display: flex; align-items: center; justify-content: center; height: 300px; background: var(--color-bg-light); color: var(--color-muted); }

/* ---------------- Sections ---------------- */
.section { padding: 70px 0; }
.section-alt { background: var(--section-alt-bg); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 44px; }
.section-head h2 { font-size: 2rem; color: var(--color-primary); }
.section-head p { color: var(--color-muted); }

/* ---------------- Welcome ---------------- */
.welcome-block { max-width: 900px; margin: 0 auto; text-align: center; }
.welcome-block h2 { font-size: 1.875rem; color: var(--color-primary); }
.welcome-block p { color: var(--color-muted); font-size: 1.0312rem; }

/* ---------------- Principal's Message + Notices (2-column) ---------------- */
.principal-notices-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: stretch; max-width: 1100px; margin: 0 auto; }
.principal-card { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.principal-card-img { height: 220px; overflow: hidden; background: var(--color-bg-light); }
.principal-card-img img { width: 100%; height: 100%; object-fit: cover; }
.principal-card-body { padding: 22px 24px; flex: 1; }
.principal-card-body h3 { color: var(--color-primary); margin-bottom: 2px; font-size: 1.1875rem; }
.principal-designation { display: inline-block; color: var(--color-primary); font-weight: 600; font-size: 0.8125rem; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 12px; }
.principal-card-body p { color: var(--color-muted); font-size: 0.9062rem; margin: 0; }

/* ---------------- Notices ---------------- */
.notice-box { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.notice-box-head { background: var(--color-primary); color: #fff; padding: 14px 20px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.notice-box-head a { color: #fff; font-size: 0.8125rem; font-weight: 400; }
.notice-list li { border-bottom: 1px solid var(--color-border); }
.notice-list li:last-child { border-bottom: none; }
.notice-list a { display: flex; justify-content: space-between; gap: 12px; padding: 14px 20px; font-size: 0.9062rem; }
.notice-date { color: var(--color-muted); font-size: 0.8125rem; white-space: nowrap; }

/* ---------------- Courses ---------------- */
.course-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 28px; }
.course-card { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .2s; display: flex; flex-direction: column; }
.course-card:hover { transform: translateY(-5px); }
.course-card img { height: 190px; width: 100%; object-fit: cover; background: var(--color-bg-light); }
.course-card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.course-card-body h3 { font-size: 1.125rem; color: var(--color-primary); }
.course-card-body p { color: var(--color-muted); font-size: 0.9062rem; flex: 1; }
.course-meta { display: flex; gap: 14px; font-size: 0.8125rem; color: var(--color-muted); margin-bottom: 14px; flex-wrap: wrap; }
.course-meta span { background: var(--color-bg-light); padding: 4px 10px; border-radius: 20px; }

/* ---------------- Facilities ---------------- */
.facility-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 26px; }
.facility-card { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.facility-card img { height: 170px; object-fit: cover; width: 100%; background: var(--color-bg-light); }
.facility-card-body { padding: 18px 20px; }
.facility-card-body h3 { font-size: 1.0312rem; color: var(--color-primary); margin-bottom: 6px; }
.facility-card-body p { font-size: 0.875rem; color: var(--color-muted); margin: 0; }

/* ---------------- Trustees ---------------- */
.trustee-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 28px; }
.trustee-card { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); text-align: center; }
.trustee-card img { height: 240px; width: 100%; object-fit: cover; background: var(--color-bg-light); }
.trustee-card-body { padding: 20px; }
.trustee-card-body h3 { font-size: 1.125rem; color: var(--color-primary); margin-bottom: 2px; }
.trustee-designation { display: inline-block; color: var(--color-secondary); font-weight: 600; font-size: 0.8125rem; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 10px; }
.trustee-card-body p { font-size: 0.875rem; color: var(--color-muted); margin: 0; text-align: left; }

/* ---------------- Documents / statutory pages ---------------- */
.doc-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 30px; }
.doc-tab { padding: 9px 18px; border-radius: 20px; background: var(--color-bg-light); font-size: 0.875rem; font-weight: 500; border: 1px solid var(--color-border); }
.doc-tab.active, .doc-tab:hover { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.doc-table { width: 100%; border-collapse: collapse; background: #fff; box-shadow: var(--shadow); border-radius: var(--radius); overflow: hidden; }
.doc-table th, .doc-table td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--color-border); font-size: 0.9062rem; }
.doc-table th { background: var(--color-primary); color: #fff; font-weight: 600; }
.doc-table tr:last-child td { border-bottom: none; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 0.75rem; background: var(--color-secondary); color: #222; font-weight: 600; }

/* ---------------- Course-wise Syllabus (on page.php?slug=syllabus) ---------------- */
.syllabus-list { margin-top: 30px; }
.syllabus-course-group { margin-bottom: 32px; }
.syllabus-course-group h3 { color: var(--color-primary); font-size: 1.1875rem; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid var(--color-border); }
.syllabus-course-group .doc-table td { font-size: 0.9062rem; }

/* ---------------- Generic page / content ---------------- */
.page-hero { background: linear-gradient(120deg, var(--color-primary), #4a1119); color: #fff; padding: 60px 0 40px; text-align: center; }
.page-hero h1 { color: #fff; font-size: 2rem; margin: 0; }
.breadcrumb { font-size: 0.8125rem; opacity: .85; margin-top: 8px; }
.breadcrumb a { color: #fff; text-decoration: underline; }
.content-block { max-width: 900px; margin: 50px auto; padding: 0 20px; }
.content-block img { border-radius: var(--radius); margin: 20px 0; }
.content-block h2, .content-block h3 { color: var(--color-primary); }

/* ---------------- Course detail ---------------- */
.course-detail-hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: center; max-width: 1100px; margin: 40px auto; padding: 0 20px; }
.course-detail-hero img { border-radius: var(--radius); box-shadow: var(--shadow); }
.course-info-list { list-style: none; padding: 0; margin: 20px 0; }
.course-info-list li { padding: 8px 0; border-bottom: 1px dashed var(--color-border); font-size: 0.9062rem; }
.course-info-list strong { color: var(--color-primary); display: inline-block; min-width: 130px; }

/* ---------------- Contact ---------------- */
.contact-wrap { display: grid; grid-template-columns: 1fr 1.2fr; gap: 40px; max-width: 1100px; margin: 50px auto; padding: 0 20px; }
.contact-info-card { background: var(--color-bg-light); border-radius: var(--radius); padding: 30px; }
.contact-info-card h3 { color: var(--color-primary); }
.contact-info-card p { margin-bottom: 14px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.875rem; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 11px 14px; border: 1px solid var(--color-border); border-radius: 5px; font-family: var(--font-family); font-size: 0.9062rem;
}
.form-group textarea { min-height: 130px; resize: vertical; }
.alert { padding: 14px 18px; border-radius: 6px; margin-bottom: 20px; font-size: 0.9062rem; }
.alert-success { background: #e6f7ea; color: #146c2e; border: 1px solid #b7e3c4; }
.alert-error { background: #fdecec; color: #a02020; border: 1px solid #f3b9b9; }

/* ---------------- Gallery ---------------- */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.gallery-grid img { height: 180px; width: 100%; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---------------- Footer ---------------- */
.site-footer { background: var(--footer-bg); color: var(--footer-text); margin-top: 40px; font-family: var(--footer-font-family); }
.footer-top { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1fr; gap: 30px; padding: 60px 20px 40px; }
.footer-col h4 { color: var(--footer-heading); font-size: 1rem; margin-bottom: 18px; position: relative; padding-bottom: 10px; }
.footer-col h4::after { content: ""; position: absolute; left: 0; bottom: 0; width: 36px; height: 3px; background: var(--color-secondary); }
.footer-col ul li { margin-bottom: 10px; }
.footer-col a { color: var(--footer-text); font-size: 0.875rem; }
.footer-col a:hover { color: var(--color-secondary); }
.footer-about p { font-size: 0.875rem; margin-bottom: 8px; color: var(--footer-text); }
.footer-about a { color: var(--footer-text); }
.footer-social-links { display: inline-flex; gap: 6px; margin-top: 10px; }
.footer-social-links a { background: rgba(255,255,255,.12); color: var(--footer-text); }
.footer-social-links a:hover { background: var(--color-secondary); color: #222; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 18px 0; text-align: center; font-size: 0.8125rem; color: var(--footer-text); }

.scroll-top { position: fixed; bottom: 24px; right: 24px; width: 44px; height: 44px; border-radius: 50%; background: var(--color-primary); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .3s; z-index: 200; }
.scroll-top.show { opacity: 1; pointer-events: auto; }

/* ---------------- Apply Now Modal ---------------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(20,10,10,.6); display: none; align-items: center; justify-content: center; z-index: 1000; padding: 20px; }
.modal-overlay.show { display: flex; }
.modal-box { background: #fff; border-radius: var(--radius); max-width: 480px; width: 100%; max-height: 90vh; overflow-y: auto; padding: 32px; position: relative; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal-close { position: absolute; top: 14px; right: 16px; background: none; border: none; font-size: 1.625rem; line-height: 1; cursor: pointer; color: var(--color-muted); }
.modal-close:hover { color: var(--color-primary); }
.modal-box h3 { color: var(--color-primary); font-size: 1.375rem; margin-bottom: 6px; }
.modal-intro { color: var(--color-muted); font-size: 0.875rem; margin-bottom: 20px; }
.btn-block { width: 100%; }

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

@media (max-width: 991px) {
  .menu-toggle { display: flex; }
  .main-nav { position: absolute; top: 100%; left: 0; right: 0; background: var(--menu-bg); box-shadow: var(--shadow); max-height: 0; overflow: auto; transition: max-height .3s ease; }
  .main-nav.open { max-height: 80vh; }
  .main-nav .menu { flex-direction: column; align-items: stretch; padding: 10px 0; }
  .submenu, .submenu-3 { position: static; box-shadow: none; display: none; border-top: none; padding-left: 16px; }
  .menu-item.open > .submenu { display: block; }
  .header-top { flex-wrap: wrap; justify-content: center; text-align: center; }
  .brand { flex-shrink: 0; }
  .brand-name { white-space: normal; max-width: 100%; }
  .header-contact { align-items: center; }
  .main-nav .menu { justify-content: flex-start; }
  .nav-bar-inner { position: relative; padding: 10px 20px; max-width: none; }
  .hero-slider { height: 420px; }
  .hero-slide-content { padding: 0 30px; }
  .hero-slide-content h2 { font-size: 1.75rem; }
  .course-detail-hero, .contact-wrap { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .principal-notices-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .footer-top { grid-template-columns: 1fr; }
  .hero-slider { height: 380px; }
  .brand-logo { height: 60px; }
  .brand-logo-placeholder { height: 60px; width: 60px; }
  .brand-name { font-size: 1.15rem !important; max-width: 220px; }
  .header-contact { align-items: center; }
  .modal-box { padding: 24px 20px; }
}

/* ---------------- Alumni Registration Form ---------------- */
.alumni-form-wrap { max-width: 800px; margin: 30px 0 0; }
.alumni-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 24px; }
@media (max-width: 640px) { .alumni-form-grid { grid-template-columns: 1fr; } }

.principal-card .principal-designation { color: var(--color-primary) !important; }