/* ==========================================================
   Office of the Dean (Students), IIT Hyderabad — stylesheet
   ========================================================== */

/* Colours taken from the IIT Hyderabad logo */
:root {
  --iith-blue: #2e3192;
  --iith-orange: #f15a29;
  --iith-orange-2: #f5821f;
  --iith-amber: #f9a61e;
  --iith-yellow: #ffcc08;
  --logo-stripe: linear-gradient(90deg, var(--iith-yellow), var(--iith-amber), var(--iith-orange-2), var(--iith-orange), var(--iith-orange-2), var(--iith-amber), var(--iith-yellow));

  --bg: #fbfaf8;
  --surface: #ffffff;
  --text: #1c1d33;
  --muted: #5b5d72;
  --border: #e7e4ec;
  --primary: var(--iith-blue);        /* headings, buttons, links */
  --on-primary: #ffffff;
  --accent: #c8431a;                  /* logo orange, darkened for readable text */
  --accent-line: var(--iith-orange);  /* borders, highlights */
  --accent-soft: #fff0e8;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(46, 49, 146, 0.08);
  --max: 1160px;
}

:root[data-theme="dark"] {
  --bg: #11121f;
  --surface: #1b1c2e;
  --text: #ecedf5;
  --muted: #a0a2b8;
  --border: #2d2f48;
  --primary: #9da0f2;
  --on-primary: #11121f;
  --accent: #ff8a5c;
  --accent-line: #ff7a45;
  --accent-soft: #3a2119;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.25s, color 0.25s;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1, h2, h3 {
  line-height: 1.2;
  margin: 0 0 0.5em;
}

h1, h2 {
  color: var(--primary);
}

h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.9rem); letter-spacing: -0.01em; }
h3 { font-size: 1.05rem; }

p { margin: 0 0 1em; }

.muted { color: var(--muted); }

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header / navigation ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

/* Thin stripe in the logo's yellow–orange colours */
.site-header::before,
.site-footer::before {
  content: "";
  display: block;
  height: 4px;
  background: var(--logo-stripe);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text);
  line-height: 1.2;
}

.logo:hover {
  text-decoration: none;
}

.logo-img {
  height: 56px;
  width: auto;
  border-radius: 6px;
}

/* The logo artwork is on white, so keep it on a white chip in dark mode */
:root[data-theme="dark"] .logo-img {
  background: #fff;
  padding: 4px 6px;
}

.logo-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
}

.logo strong {
  display: block;
  font-size: 1.02rem;
  color: var(--primary);
}

.logo small {
  color: var(--muted);
  font-size: 0.8rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: block;
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 500;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
  background: var(--accent-soft);
  text-decoration: none;
}

.nav-links a.active {
  box-shadow: inset 0 -3px 0 var(--accent-line);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 1.1rem;
}

.menu-toggle {
  display: none;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  padding: 11px 20px;
  border-radius: 10px;
  font-weight: 600;
  border: 1px solid transparent;
  font-size: 0.98rem;
  transition: transform 0.15s, background 0.2s;
}

.btn:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
}

.btn-primary:hover {
  box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 5px var(--accent-line);
}

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn-disabled {
  background: var(--bg);
  color: var(--muted);
  border: 1px dashed var(--border);
  cursor: default;
}

.btn-disabled:hover {
  transform: none;
}

/* ---------- Hero ---------- */

.hero {
  padding: 72px 0 48px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 48px;
  align-items: center;
}

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.lead {
  font-size: 1.12rem;
  color: var(--muted);
  max-width: 40em;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.page-hero {
  padding: 56px 0 24px;
  text-align: center;
}

.page-hero .lead {
  margin: 0 auto;
}

.breadcrumb {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 18px;
}

/* ---------- Sections & cards ---------- */

.section {
  padding: 48px 0;
}

.section-head {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 32px;
}

.section-head p {
  color: var(--muted);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px;
  align-items: center;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}

a.card {
  color: inherit;
  transition: transform 0.2s, border-color 0.2s;
}

a.card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-line);
  text-decoration: none;
}

.card .icon {
  width: 48px;
  height: 48px;
  margin-bottom: 14px;
}

.card p {
  color: var(--muted);
  margin: 0;
}

.checklist {
  list-style: none;
  padding: 0;
  margin: 0;
}

.checklist li {
  padding: 8px 0 8px 28px;
  position: relative;
  border-bottom: 1px solid var(--border);
}

.checklist li:last-child {
  border-bottom: none;
}

.checklist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

/* ---------- Dean message (home) ---------- */

.message {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 32px;
  align-items: center;
}

.message .photo {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--surface);
  box-shadow: var(--shadow);
}

.message .signature {
  font-weight: 700;
  color: var(--text);
  margin-top: 12px;
}

/* ---------- Organisation chart ---------- */

.org {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.org-dean {
  text-align: center;
  background: var(--surface);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  padding: 28px 40px;
  box-shadow: var(--shadow);
}

.org-dean .photo {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 14px;
  border: 4px solid var(--accent-soft);
}

.org-dean h2 {
  color: var(--primary);
  margin-bottom: 4px;
}

.org-dean p {
  margin: 0;
  color: var(--muted);
}

.org-connector {
  width: 2px;
  height: 40px;
  background: var(--primary);
}

.org-tier {
  width: 100%;
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  padding: 28px 24px 24px;
  position: relative;
}

.org-tier-label {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg);
  padding: 0 12px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

.org-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.org-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 16px;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: transform 0.2s, border-color 0.2s;
}

.org-card:hover,
.org-card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--accent-line);
  text-decoration: none;
}

.org-card .photo {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 14px;
  border: 3px solid var(--accent-soft);
  transition: border-color 0.2s;
}

.org-card:hover .photo {
  border-color: var(--accent-line);
}

.org-role {
  font-weight: 700;
  color: var(--accent);
}

.org-name {
  font-weight: 600;
  margin-top: 2px;
}

.org-desc {
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 4px;
}

/* Office of the Dean (Students): staff cards are not links */
.org-staff:hover {
  transform: none;
  border-color: var(--border);
}

.org-staff:hover .photo {
  border-color: var(--accent-soft);
}

.org-staff .org-role {
  font-weight: 500;
  font-size: 0.92rem;
  color: var(--muted);
}

.org-email {
  font-size: 0.85rem;
  margin-top: 6px;
  overflow-wrap: anywhere;
}

.org-hint {
  text-align: center;
  color: var(--muted);
  margin-top: 20px;
  font-size: 0.92rem;
}

/* ---------- Office page ---------- */

.office-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 28px;
  align-items: start;
}

.head-card {
  text-align: center;
}

.head-card .photo {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 16px;
  border: 4px solid var(--accent-soft);
}

.head-card h2 {
  margin-bottom: 4px;
}

.head-card .designation {
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 12px;
}

.head-card .btn {
  margin-top: 8px;
}

.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr));
  gap: 20px;
}

.person {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 16px;
  text-align: center;
  box-shadow: var(--shadow);
}

.person .photo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 12px;
}

.person h3 {
  margin-bottom: 2px;
}

.person p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------- Committees ---------- */

.committee-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: 20px;
}

.committee-card {
  display: flex;
  flex-direction: column;
}

.committee-card p {
  flex: 1;
}

.committee-card .more {
  margin-top: 16px;
  font-weight: 600;
  color: var(--accent);
}

.person-role {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.helpline {
  background: #9f1d1d;
  color: #fff;
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  box-shadow: var(--shadow);
}

.helpline h2 {
  margin-bottom: 20px;
}

.helpline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.helpline-item {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 16px;
}

.helpline-label {
  display: block;
  font-size: 0.9rem;
  opacity: 0.9;
  margin-bottom: 4px;
}

.helpline-item strong {
  font-size: 1.35rem;
  word-break: break-word;
}

.helpline a:not(.btn) {
  color: #fff;
}

.helpline .btn {
  background: #fff;
  color: #9f1d1d;
}

.policy h3 {
  margin-top: 28px;
  color: var(--primary);
}

.policy .lead {
  max-width: none;
}

.doc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.doc {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.doc:last-child {
  border-bottom: none;
}

.doc-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.doc-info {
  flex: 1;
  min-width: 0;
}

.doc-info strong {
  display: block;
}

.doc-info span {
  color: var(--muted);
  font-size: 0.9rem;
}

.doc-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .doc {
    flex-wrap: wrap;
  }

  .doc-actions {
    width: 100%;
  }

  .doc-actions .btn {
    flex: 1;
    text-align: center;
  }
}

/* ---------- Facilities ---------- */

.facility-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.facility-cover {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
}

.facility-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 22px;
}

.facility-body p {
  flex: 1;
}

.facility-card .more {
  margin-top: 14px;
  font-weight: 600;
  color: var(--accent);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: 20px;
}

.gallery.single {
  grid-template-columns: minmax(0, 760px);
  justify-content: center;
}

.gallery figure {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.gallery img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.gallery figcaption {
  padding: 10px 14px;
  font-size: 0.9rem;
  color: var(--muted);
}

.link-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.link-list .btn {
  text-align: left;
}

/* ---------- Recreation ---------- */

.rounded {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.event-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 24px 0 0;
}

.event-facts div {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent-line);
  border-radius: 10px;
  padding: 12px 14px;
}

.event-facts dt {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.event-facts dd {
  margin: 2px 0 0;
  font-weight: 600;
  color: var(--primary);
}

.poster-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
}

.poster {
  margin: 0;
}

.poster-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
  cursor: zoom-in;
  box-shadow: var(--shadow);
  transition: transform 0.2s, border-color 0.2s;
}

.poster-btn:hover,
.poster-btn:focus-visible {
  transform: translateY(-4px);
  border-color: var(--accent-line);
}

.poster-btn img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

.poster figcaption {
  padding: 8px 2px 0;
  font-size: 0.9rem;
}

.poster figcaption strong {
  display: block;
}

.poster figcaption span {
  color: var(--muted);
  font-size: 0.85rem;
}

.lightbox {
  border: none;
  padding: 0;
  background: transparent;
  max-width: min(92vw, 520px);
  overflow: visible;
}

.lightbox::backdrop {
  background: rgba(10, 10, 25, 0.8);
}

.lightbox figure {
  margin: 0;
}

.lightbox img {
  width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
}

.lightbox figcaption {
  color: #fff;
  text-align: center;
  padding-top: 10px;
}

.lightbox-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #fff;
  color: #1c1d33;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.movie-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 6px solid var(--accent-line);
  border-radius: var(--radius);
  padding: 22px 26px;
  box-shadow: var(--shadow);
}

.movie-banner h2 {
  margin: 0 0 4px;
  font-size: 1.3rem;
}

.movie-banner p {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 960px) {
  .poster-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  .poster-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .event-facts {
    grid-template-columns: 1fr;
  }
}

/* ---------- Event calendar ---------- */

.btn-sm {
  padding: 7px 12px;
  font-size: 0.88rem;
  border-radius: 8px;
}

.calendar-layout {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 24px;
  align-items: start;
}

.cal-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.cal-head h3 {
  flex: 1;
  margin: 0;
  font-size: 1.25rem;
  color: var(--primary);
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.cal-weekday {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  padding: 4px 0;
}

.cal-day {
  min-height: 88px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s, background 0.15s;
}

.cal-day:hover {
  border-color: var(--accent-line);
}

.cal-num {
  font-weight: 600;
  font-size: 0.9rem;
}

.cal-day.today .cal-num {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--iith-orange);
  color: #fff;
}

.cal-day.selected {
  border: 2px solid var(--primary);
  background: var(--surface);
}

.cal-chips {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.cal-chip {
  display: block;
  font-size: 0.72rem;
  line-height: 1.3;
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--primary);
  color: var(--on-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-chip.recurring {
  background: var(--accent-soft);
  color: var(--accent);
}

.cal-more {
  font-size: 0.72rem;
  color: var(--muted);
}

.cal-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 14px;
  font-size: 0.85rem;
  color: var(--muted);
}

.cal-legend span::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: -1px;
  background: var(--primary);
}

.cal-legend .legend-recurring::before {
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
}

.cal-legend .legend-today::before {
  border-radius: 50%;
  background: var(--iith-orange);
}

.cal-panel h3 {
  color: var(--primary);
  font-size: 1.1rem;
}

.event-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.event-item:last-child {
  border-bottom: none;
}

.event-date {
  flex-shrink: 0;
  width: 54px;
  text-align: center;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  align-self: flex-start;
}

.event-date span {
  display: block;
  background: var(--iith-orange);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 0;
}

.event-date strong {
  display: block;
  font-size: 1.3rem;
  color: var(--primary);
  padding: 2px 0 4px;
}

.event-info {
  min-width: 0;
}

.event-info h4 {
  margin: 0 0 2px;
  font-size: 1rem;
}

.event-info p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.event-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.upcoming-title {
  margin-top: 28px;
}

.event-facts-4 {
  grid-template-columns: repeat(4, 1fr);
  margin: 0;
}

/* Event photos & videos (links to Google Drive) */

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(160px, 100%), 1fr));
  gap: 16px;
  margin-top: 20px;
}

.media-item {
  display: block;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
  transition: transform 0.2s, border-color 0.2s;
}

.media-item:hover {
  transform: translateY(-3px);
  border-color: var(--accent-line);
  text-decoration: none;
}

.media-thumb {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  background: var(--accent-soft);
}

.media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-thumb.video::after {
  content: "▶";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 1.1rem;
}

.media-title {
  display: block;
  padding: 8px 10px;
  font-size: 0.9rem;
}

@media (max-width: 960px) {
  .calendar-layout {
    grid-template-columns: 1fr;
  }

  .event-facts-4 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .cal-grid {
    gap: 3px;
  }

  .cal-day {
    min-height: 48px;
    align-items: center;
    padding: 4px 2px;
  }

  /* On phones, show a dot instead of event titles */
  .cal-chips {
    display: none;
  }

  .cal-day.has-events::after {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--iith-orange);
  }

  .event-facts-4 {
    grid-template-columns: 1fr;
  }
}

.other-title {
  font-size: 1.2rem;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- Contact ---------- */

.contact-info {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}

.contact-info li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
}

.contact-info img {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  margin-top: 2px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

th {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

/* ---------- CTA banner ---------- */

.cta {
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  padding: 44px 32px;
  text-align: center;
}

:root[data-theme="dark"] .cta {
  background: var(--iith-blue);
}

.cta h2,
.helpline h2 {
  color: #fff;
}

.cta p {
  opacity: 0.9;
}

.cta .btn {
  background: #fff;
  color: #1c2230;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 0 0 28px;
  margin-top: 40px;
  color: var(--muted);
  font-size: 0.92rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-inner p {
  margin: 0;
}

.footer-links {
  display: flex;
  gap: 18px;
}

.footer-links a {
  color: var(--muted);
}

/* ---------- Scroll reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

.site-footer::before {
  margin-bottom: 28px;
}

/* ==========================================================
   Mobile & responsive
   ========================================================== */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  overflow-x: clip; /* safety net against sideways scrolling; keeps the sticky header working */
  -webkit-tap-highlight-color: transparent;
}

img {
  height: auto;
}

/* Long emails / links should wrap instead of widening the page */
td,
.helpline-item strong,
.contact-info span,
.head-card p,
.event-info h4 {
  overflow-wrap: anywhere;
}

.footer-links {
  flex-wrap: wrap;
}

/* Hover lift effects only on devices that can hover (not on touch screens) */
@media (hover: none) {
  .btn:hover,
  a.card:hover,
  .org-card:hover,
  .poster-btn:hover,
  .media-item:hover {
    transform: none;
  }
}

/* ---------- Tablet / small laptop: collapse the menu ---------- */
@media (max-width: 1140px) {
  .menu-toggle {
    display: grid;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px 16px 18px;
    max-height: calc(100vh - 80px);
    max-height: calc(100dvh - 80px);
    overflow-y: auto;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 12px 24px rgba(20, 20, 60, 0.12);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 13px 14px; /* comfortable tap targets */
    font-size: 1.02rem;
  }

  .nav-links a.active {
    box-shadow: inset 4px 0 0 var(--accent-line);
  }
}

/* ---------- Tablet ---------- */
@media (max-width: 960px) {
  .hero-grid,
  .grid-2,
  .office-grid {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    gap: 28px;
  }

  .hero-grid > img {
    max-width: 480px;
    margin: 0 auto;
  }

  .grid-4,
  .org-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .section {
    padding: 36px 0;
  }
}

/* ---------- Phones ---------- */
@media (max-width: 720px) {
  .container {
    padding: 0 16px;
  }

  .nav {
    height: 64px;
  }

  .nav-links {
    max-height: calc(100vh - 68px);
    max-height: calc(100dvh - 68px);
  }

  .logo {
    gap: 10px;
  }

  .logo small,
  .logo-divider {
    display: none;
  }

  .logo-img {
    height: 42px;
  }

  .logo strong {
    font-size: 0.95rem;
  }

  .icon-btn {
    width: 44px;
    height: 44px;
  }

  .hero {
    padding: 32px 0 16px;
  }

  .page-hero {
    padding: 32px 0 12px;
  }

  .lead {
    font-size: 1.02rem;
  }

  .section {
    padding: 28px 0;
  }

  .section-head {
    margin-bottom: 22px;
  }

  .card {
    padding: 20px 18px;
  }

  .facility-card {
    padding: 0;
  }

  .hero-actions .btn {
    flex: 1 1 auto;
    text-align: center;
  }

  /* Home: Dean's message */
  .message {
    grid-template-columns: 1fr;
    gap: 18px;
    text-align: center;
  }

  .message .photo {
    width: 140px;
    height: 140px;
    margin: 0 auto;
  }

  /* Organisation chart */
  .org-dean {
    width: 100%;
    padding: 22px 18px;
  }

  .org-dean .photo {
    width: 120px;
    height: 120px;
  }

  .org-tier {
    padding: 26px 12px 14px;
  }

  .org-grid {
    gap: 12px;
  }

  .org-card {
    padding: 16px 10px;
  }

  .org-card .photo {
    width: 80px;
    height: 80px;
  }

  .org-desc {
    display: none; /* keep cards short; details are on the office page */
  }

  /* Office & committee pages */
  .head-card .photo {
    width: 140px;
    height: 140px;
  }

  .people-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .person {
    padding: 16px 10px;
  }

  .person .photo {
    width: 76px;
    height: 76px;
  }

  .person h3 {
    font-size: 0.95rem;
  }

  .pager {
    flex-direction: column;
  }

  .pager .btn,
  .head-card .btn,
  .link-list .btn {
    width: 100%;
    text-align: center;
  }

  .button-row .btn {
    flex: 1 1 auto;
    text-align: center;
    font-size: 0.9rem;
  }

  .helpline {
    padding: 22px 16px;
  }

  .helpline .btn {
    display: block;
    width: 100%;
  }

  /* Contact table becomes stacked cards */
  .table-wrap table,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap td {
    display: block;
    width: 100%;
  }

  .table-wrap thead {
    display: none;
  }

  .table-wrap tr {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
  }

  .table-wrap td {
    padding: 2px 0;
    border: none;
  }

  .table-wrap td:first-child {
    font-weight: 700;
  }

  /* Recreation */
  .movie-banner {
    padding: 18px;
  }

  .movie-banner h2 {
    font-size: 1.1rem;
  }

  .movie-banner .btn {
    width: 100%;
    text-align: center;
  }

  .lightbox-close {
    top: 8px;
    right: 8px;
  }

  /* Event calendar */
  .cal-head {
    gap: 6px;
  }

  .cal-head h3 {
    font-size: 1.05rem;
  }

  .cal-weekday {
    font-size: 0.7rem;
  }

  .cal-legend {
    gap: 10px;
    font-size: 0.8rem;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .footer-links {
    justify-content: center;
    gap: 6px 16px;
  }
}

/* ---------- Very small phones ---------- */
@media (max-width: 380px) {
  .logo strong {
    display: none; /* the IITH logo alone fits better */
  }

  .grid-4 {
    grid-template-columns: 1fr;
  }

  .people-grid {
    gap: 8px;
  }

  .event-item {
    gap: 10px;
  }

  .event-date {
    width: 46px;
  }
}
/* Anchored sections shouldn't hide under the sticky header */
[id] {
  scroll-margin-top: 96px;
}

/* Helpline numbers/emails: easy to tap, and the email fits on small phones */
.helpline-item a {
  display: inline-block;
  padding: 6px 4px;
  min-height: 44px;
}

@media (max-width: 720px) {
  .helpline-item strong {
    font-size: 1.15rem;
  }
}

@media (max-width: 380px) {
  .helpline-item strong {
    font-size: 1rem;
  }
}
/* ---------- Visitor counter (footer) ---------- */
.visitor-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.88rem;
}

.visitor-count::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--iith-orange);
}

.visitor-count strong {
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

.visitor-count[hidden] {
  display: none;
}
/* ---------- Home page slideshow ---------- */
.slider {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.slider-viewport {
  position: relative;
  overflow: hidden;
  background: #1a1c5c;
}

.slider-track {
  display: flex;
  transition: transform 0.6s ease;
}

.slide {
  position: relative;
  flex: 0 0 100%;
  margin: 0;
}

.slide a {
  display: block;
  color: inherit;
}

.slide img {
  width: 100%;
  aspect-ratio: 8 / 3;
  max-height: 520px;
  object-fit: cover;
}

.slide figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 36px 24px 16px;
  color: #fff;
  font-weight: 600;
  font-size: 1.1rem;
  text-align: center;
  background: linear-gradient(transparent, rgba(10, 12, 40, 0.75));
}

.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  color: var(--iith-blue);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.slider-arrow:hover {
  background: #fff;
}

.slider-arrow.prev {
  left: 16px;
}

.slider-arrow.next {
  right: 16px;
}

.slider-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding-top: 12px;
}

.slider-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}

/* Each dot has a 28px tap area; the visible dot is drawn inside it */
.slider-dot {
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.slider-dot::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--border);
  border: 1px solid var(--muted);
  transition: width 0.25s, background 0.25s;
}

.slider-dot:hover::before {
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

.slider-dot.active::before {
  width: 24px;
  background: var(--iith-orange);
  border-color: var(--iith-orange);
}

.slider-pause {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--primary);
  font-size: 0.7rem;
  cursor: pointer;
  flex-shrink: 0;
}

.slider :focus-visible {
  outline: 3px solid var(--iith-orange);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .slider-track {
    transition: none;
  }
}

@media (max-width: 720px) {
  .slide img {
    aspect-ratio: 16 / 9;
  }

  .slide figcaption {
    font-size: 0.95rem;
    padding: 28px 14px 10px;
  }

  .slider-arrow {
    width: 36px;
    height: 36px;
    font-size: 1.3rem;
  }

  .slider-arrow.prev {
    left: 8px;
  }

  .slider-arrow.next {
    right: 8px;
  }

  .slider-dots {
    gap: 0;
  }

  .slider-dot {
    width: 24px;
    height: 32px;
  }
}
/* ---------- Food outlets (Dining Facilities) ---------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.outlet-search {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 560px;
  margin: 0 auto 24px;
}

.outlet-search input {
  flex: 1;
  min-width: 0;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 1rem; /* 16px+ stops iPhones zooming in on focus */
}

.outlet-search input:focus {
  outline: 2px solid var(--primary);
  border-color: transparent;
}

#outlet-count {
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.outlet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(270px, 100%), 1fr));
  gap: 20px;
}

.outlet {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.outlet[hidden] {
  display: none;
}

.outlet-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--accent-soft);
}

.outlet-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 16px 18px 18px;
}

.outlet-type {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.outlet h3 {
  margin-bottom: 4px;
  font-size: 1.1rem;
  color: var(--primary);
}

.outlet-loc {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.outlet-loc::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 5px;
  vertical-align: -2px;
  background: url("../assets/icons/location.svg") center / contain no-repeat;
}

.outlet-contact {
  font-size: 0.92rem;
  margin-bottom: 14px;
}

.outlet-contact a {
  display: inline-block;
  padding: 4px 0;
  font-weight: 600;
}

.outlet-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.outlet-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.outlet-links .btn {
  text-align: center;
  white-space: nowrap;
}

.outlet-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  width: 96px;
  text-align: center;
  font-size: 0.72rem;
  line-height: 1.2;
  color: var(--muted);
}

a.outlet-qr:hover {
  text-decoration: none;
  color: var(--primary);
}

.outlet-qr img {
  width: 88px;
  height: 88px;
  padding: 4px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.2s;
}

a.outlet-qr:hover img {
  border-color: var(--accent-line);
}

.outlet-qr.none img {
  opacity: 0.6;
}

.outlet-empty {
  text-align: center;
}

@media (max-width: 720px) {
  .outlet-grid {
    gap: 14px;
  }
}
/* ---------- Social media links (footer) ---------- */
.social-links {
  display: flex;
  gap: 10px;
}

.social {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--primary);
  transition: color 0.2s, border-color 0.2s, transform 0.2s;
}

.social svg {
  width: 20px;
  height: 20px;
}

.social:hover,
.social:focus-visible {
  transform: translateY(-2px);
  text-decoration: none;
}

.social.youtube:hover { color: #ff0000; border-color: #ff0000; }
.social.facebook:hover { color: #1877f2; border-color: #1877f2; }
.social.instagram:hover { color: #d62976; border-color: #d62976; }

@media (max-width: 720px) {
  .social-links {
    justify-content: center;
  }

  .social {
    width: 44px;
    height: 44px;
  }
}
/* Footer on larger screens: two tidy rows
   row 1: copyright ............ social icons
   row 2: footer links ......... visitor count */
@media (min-width: 721px) {
  .footer-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 14px 24px;
  }

  .footer-inner > p:first-child { grid-column: 1; grid-row: 1; }
  .footer-inner .social-links   { grid-column: 2; grid-row: 1; justify-self: end; }
  .footer-inner .footer-links   { grid-column: 1; grid-row: 2; }
  .footer-inner .visitor-count  { grid-column: 2; grid-row: 2; justify-self: end; }
}
.social.x:hover { color: var(--text); border-color: var(--text); }
.social.linkedin:hover { color: #0a66c2; border-color: #0a66c2; }
