/* M.P. Rai Degree College — site styles */
:root {
  --red: #c40000;
  --red-deep: #8b0000;
  --red-soft: #f8e8e8;
  --ink: #1a1512;
  --ink-muted: #5c534c;
  --paper: #f7f3ef;
  --paper-warm: #efe8e0;
  --white: #ffffff;
  --line: rgba(26, 21, 18, 0.12);
  --shadow: 0 12px 40px rgba(26, 21, 18, 0.12);
  --font-display: "Libre Baskerville", Georgia, "Times New Roman", serif;
  --font-body: "Source Sans 3", "Source Sans Pro", "Segoe UI", sans-serif;
  --max: 1120px;
  --header-h: 4.5rem;
  --strip-h: 2.25rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  background-image:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(196, 0, 0, 0.06), transparent),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(139, 0, 0, 0.05), transparent),
    linear-gradient(180deg, var(--paper) 0%, var(--paper-warm) 100%);
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--red);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--red-deep);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
  margin: 0 0 0.6em;
}

p {
  margin: 0 0 1em;
}

ul {
  margin: 0 0 1em;
  padding-left: 1.25em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* —— Admission strip —— */
.admission-strip {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--strip-h);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: var(--red);
  color: var(--white);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admission-strip a {
  color: var(--white);
  text-decoration: underline;
}

/* —— Header —— */
.site-header {
  position: sticky;
  top: var(--strip-h);
  z-index: 90;
  background: rgba(247, 243, 239, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.65rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--ink);
  min-width: 0;
}

.brand:hover {
  color: var(--ink);
}

.brand img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--red);
  line-height: 1.2;
}

.brand-hindi {
  font-size: 0.72rem;
  color: var(--ink-muted);
  line-height: 1.2;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.4rem 0.65rem;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--ink);
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 1.15rem;
  align-items: center;
}

.site-nav a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.92rem;
  position: relative;
  padding: 0.2rem 0;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}

.site-nav a:hover::after,
.site-nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

.site-nav a[aria-current="page"] {
  color: var(--red);
}

/* —— Layout —— */
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.section {
  padding: 3.5rem 0;
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin-bottom: 0.35em;
}

.section-lead {
  color: var(--ink-muted);
  max-width: 40rem;
  margin-bottom: 2rem;
  font-size: 1.05rem;
}

.page-hero {
  padding: 2.5rem 0 1rem;
}

.page-hero h1 {
  font-size: clamp(1.85rem, 4vw, 2.6rem);
  color: var(--red);
  margin-bottom: 0.35em;
}

.page-hero p {
  color: var(--ink-muted);
  max-width: 36rem;
  font-size: 1.1rem;
}

/* —— Buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.75rem 1.4rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 4px;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.25s var(--ease);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--red);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--red-deep);
  color: var(--white);
}

.btn-ghost {
  background: transparent;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.65);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
}

.btn-outline {
  background: transparent;
  color: var(--red);
  border-color: var(--red);
}

.btn-outline:hover {
  background: var(--red);
  color: var(--white);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* —— Home hero —— */
.hero {
  position: relative;
  min-height: calc(100vh - var(--strip-h) - var(--header-h));
  min-height: min(100dvh - var(--strip-h) - var(--header-h), 52rem);
  display: flex;
  align-items: flex-end;
  color: var(--white);
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-slides {
  position: absolute;
  inset: 0;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1s var(--ease);
  pointer-events: none;
}

.hero-slide.is-active {
  opacity: 1;
  pointer-events: auto;
  z-index: 1;
}

.hero-slide.is-active img {
  animation: heroZoom 7s var(--ease) forwards;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  transform: scale(1.06);
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(26, 21, 18, 0.35) 0%, rgba(26, 21, 18, 0.55) 40%, rgba(26, 21, 18, 0.88) 100%),
    linear-gradient(90deg, rgba(139, 0, 0, 0.25), transparent 55%);
}

.hero-controls {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0 1.25rem;
}

.hero-nav {
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(26, 21, 18, 0.35);
  color: var(--white);
  font-size: 1.5rem;
  line-height: 1;
  border-radius: 2px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease);
}

.hero-nav:hover {
  background: rgba(196, 0, 0, 0.85);
  border-color: var(--red);
}

.hero-dots {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

.hero-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: background 0.25s, transform 0.25s var(--ease);
}

.hero-dot.is-active {
  background: var(--white);
  transform: scale(1.25);
}

.hero-dot:hover {
  background: rgba(255, 255, 255, 0.75);
}

.hero-content {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 3.5rem 0 5.5rem;
  opacity: 0;
  transform: translateY(1.25rem);
  animation: heroRise 0.9s 0.15s var(--ease) forwards;
}

.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4.5vw, 3rem);
  font-weight: 700;
  color: var(--white);
  margin: 0 0 0.35rem;
  letter-spacing: 0.01em;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}

.hero-hindi {
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  opacity: 0.9;
  margin: 0 0 1.25rem;
  font-weight: 500;
}

.hero-headline {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.5vw, 1.55rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffd4d4;
  margin: 0 0 0.5rem;
}

.hero-support {
  font-size: 1.05rem;
  max-width: 28rem;
  opacity: 0.92;
  margin: 0;
  line-height: 1.5;
}

@keyframes heroZoom {
  to { transform: scale(1); }
}

@keyframes heroRise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* —— Faculty strips —— */
.faculty-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.faculty-block {
  padding: 1.5rem 0;
  border-top: 3px solid var(--red);
}

.faculty-block h3 {
  font-size: 1.25rem;
  margin-bottom: 0.25em;
}

.faculty-block .hi {
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin-bottom: 0.85em;
}

.faculty-block ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.faculty-block li {
  font-size: 0.88rem;
  background: var(--white);
  border: 1px solid var(--line);
  padding: 0.25rem 0.65rem;
  border-radius: 2px;
}

/* —— Feature / facility rows —— */
.feature-list {
  display: grid;
  gap: 2.5rem;
}

.feature-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 2rem;
  align-items: center;
}

.feature-row:nth-child(even) {
  direction: rtl;
}

.feature-row:nth-child(even) > * {
  direction: ltr;
}

.feature-row figure {
  margin: 0;
  overflow: hidden;
  border-radius: 2px;
  box-shadow: var(--shadow);
  aspect-ratio: 4 / 3;
}

.feature-row img {
  width: 100%;
  height: 118%;
  max-width: none;
  object-fit: cover;
  object-position: center 12%;
  transition: transform 0.7s var(--ease);
}

.feature-row:hover img {
  transform: scale(1.03);
}

.feature-row h3 {
  font-size: 1.45rem;
}

.feature-row p:last-child {
  margin-bottom: 0;
  color: var(--ink-muted);
}

/* —— Notice bar —— */
.notice {
  background: var(--ink);
  color: var(--white);
  padding: 1.5rem 0;
}

.notice-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.notice p {
  margin: 0;
  max-width: 40rem;
}

.notice strong {
  color: #ffc9c9;
}

/* —— Split content —— */
.split {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

.split figure {
  margin: 0;
  overflow: hidden;
  border-radius: 2px;
  box-shadow: var(--shadow);
}

.split img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  max-height: 28rem;
}

.prose h2 {
  margin-top: 1.75rem;
}

.prose h2:first-child {
  margin-top: 0;
}

.pdf-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  font-weight: 700;
}

/* —— Academics —— */
.degree-note {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--red-deep);
  background: var(--red-soft);
  padding: 0.35rem 0.75rem;
  margin-bottom: 1.5rem;
  border-radius: 2px;
}

.acad-section {
  margin-bottom: 3rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--line);
}

.acad-section:last-child {
  border-bottom: 0;
  margin-bottom: 0;
}

.acad-head {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1.5rem;
  align-items: start;
  margin-bottom: 1.25rem;
}

.acad-head figure {
  margin: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 2px;
  box-shadow: var(--shadow);
}

.acad-head img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.subject-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.5rem;
}

.subject-grid li {
  background: var(--white);
  border-left: 3px solid var(--red);
  padding: 0.65rem 0.85rem;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 1px 0 var(--line);
}

/* —— Forms —— */
.form {
  display: grid;
  gap: 1rem;
  max-width: 32rem;
}

.form label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.form input,
.form select,
.form textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
  color: var(--ink);
}

.form input:focus,
.form select:focus,
.form textarea:focus {
  outline: 2px solid var(--red);
  outline-offset: 1px;
}

.form textarea {
  min-height: 8rem;
  resize: vertical;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 2.5rem;
}

.contact-details {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}

.contact-details li {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.contact-details strong {
  display: block;
  font-family: var(--font-display);
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.contact-details a {
  text-decoration: none;
  font-weight: 600;
}

.map-frame {
  margin-top: 1.5rem;
  border: 0;
  width: 100%;
  height: 280px;
  border-radius: 2px;
  box-shadow: var(--shadow);
  filter: grayscale(0.15);
}

/* —— Gallery —— */
.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
}

.gallery-filters button {
  font-family: var(--font-body);
  font-weight: 650;
  font-size: 0.88rem;
  padding: 0.45rem 0.95rem;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.gallery-filters button:hover,
.gallery-filters button.is-active {
  background: var(--red);
  border-color: var(--red);
  color: var(--white);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}

.gallery-item {
  margin: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 2px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  animation: galleryIn 0.55s var(--ease) forwards;
  background: var(--ink);
}

.gallery-item.is-hidden {
  display: none;
}

.gallery-item img {
  width: 100%;
  height: 118%;
  max-width: none;
  object-fit: cover;
  object-position: center 15%;
  transition: transform 0.55s var(--ease), opacity 0.3s;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

@keyframes galleryIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* —— Lightbox —— */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(14, 10, 8, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.lightbox.is-open {
  display: flex;
}

.lightbox img {
  max-width: min(92vw, 1000px);
  max-height: 88vh;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: var(--white);
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 2px;
}

/* —— Admissions cards —— */
.perk-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin: 2rem 0;
}

.perk {
  padding: 1.25rem 0;
  border-top: 2px solid var(--red);
}

.perk h3 {
  font-size: 1.1rem;
}

.perk p {
  color: var(--ink-muted);
  margin: 0;
  font-size: 0.95rem;
}

.phone-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: baseline;
  margin: 1.5rem 0;
  padding: 1.25rem;
  background: var(--white);
  border: 1px solid var(--line);
}

.phone-cta a {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  text-decoration: none;
}

/* —— Footer —— */
.site-footer {
  background: var(--ink);
  color: rgba(255, 255, 255, 0.82);
  padding: 2.75rem 0 1.5rem;
  margin-top: 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.site-footer h3 {
  color: var(--white);
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.site-footer a {
  color: #ffc9c9;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.footer-brand {
  font-family: var(--font-display);
  color: var(--white);
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.footer-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-nav li {
  margin-bottom: 0.4rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 1.25rem;
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
}

/* —— Reveal on scroll —— */
.reveal {
  opacity: 0;
  transform: translateY(1rem);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* —— Responsive —— */
@media (max-width: 900px) {
  .faculty-grid,
  .perk-grid,
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .feature-row,
  .feature-row:nth-child(even),
  .split,
  .contact-grid,
  .acad-head,
  .footer-grid {
    grid-template-columns: 1fr;
    direction: ltr;
  }

  .acad-head figure {
    max-width: 360px;
  }
}

@media (max-width: 720px) {
  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 0.75rem 1.25rem 1.25rem;
  }

  .site-nav.is-open {
    display: block;
  }

  .site-nav ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
  }

  .brand-hindi {
    display: none;
  }

  .faculty-grid,
  .perk-grid,
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 70vh;
  }

  .header-inner {
    position: relative;
  }

  .admission-strip {
    font-size: 0.75rem;
    padding: 0 0.5rem;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .hero-content,
  .gallery-item,
  .reveal {
    opacity: 1;
    transform: none;
  }

  .hero-slide,
  .hero-slide.is-active img {
    animation: none !important;
    transition: none !important;
  }

  .hero-media img {
    transform: none;
  }
}
