/* ==========================================================================
   Dr Rajasekhara Babu M — site styles
   Palette and type are taken from the original rajababu.org build.
   ========================================================================== */

@font-face {
  font-family: 'Indigo Outline';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/indigo-outline.woff2') format('woff2'),
       url('../fonts/indigo-outline.woff') format('woff');
}

@font-face {
  font-family: 'Archivo Black';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/archivo-black.woff2') format('woff2');
}

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/montserrat.woff2') format('woff2');
}

:root {
  --navy: #283878;
  --navy-deep: #1f2c5f;
  --ink: #1b1b1b;
  --body: #d5d6dc;
  --white: #fff;
  --rule: rgba(255, 255, 255, 0.45);
  --card: #2f4088;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
  --maxw: 1200px;
  --nav-h: 62px;
}

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

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

body {
  margin: 0;
  background: var(--navy);
  color: var(--body);
  font-family: 'Montserrat', arial, sans-serif;
  font-size: 18px;
  line-height: 1.5;
}

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

a { color: inherit; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--white);
  color: var(--ink);
  padding: 10px 16px;
  z-index: 200;
}
.skip-link:focus { left: 8px; top: 8px; }

/* --------------------------------------------------------------- masthead */

.masthead {
  background: var(--navy);
  text-align: center;
  padding: 26px 16px 22px;
}

.masthead a { text-decoration: none; }

.masthead .sitename {
  margin: 0;
  font-family: 'Indigo Outline', arial, sans-serif;
  font-weight: 700;
  font-size: clamp(20px, 4.4vw, 40px);
  letter-spacing: 6px;
  text-transform: uppercase;
  color: var(--white);
  line-height: 1.2;
}

/* -------------------------------------------------------------------- nav */

.navbar {
  background: var(--white);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

.navbar .wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--nav-h);
}

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  padding: 12px;
  margin-right: auto;
  cursor: pointer;
  color: var(--ink);
}
.nav-toggle svg { display: block; }

.nav-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px 8px;
  margin: 0;
  padding: 0;
}

.nav-list > li { position: relative; }

.nav-link,
.nav-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font: 400 13px/1 'Montserrat', arial, sans-serif;
  letter-spacing: 1.86px;
  text-transform: uppercase;
  color: var(--ink);
  background: none;
  border: 0;
  padding: 20px 14px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.nav-link:hover,
.nav-trigger:hover,
.nav-link:focus-visible,
.nav-trigger:focus-visible { color: var(--navy); }

.nav-link[aria-current='page'] { color: var(--navy); font-weight: 700; }

.nav-trigger svg { transition: transform 0.2s ease; }
.nav-trigger[aria-expanded='true'] svg { transform: rotate(180deg); }

.nav-menu {
  list-style: none;
  margin: 0;
  padding: 8px 0;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 260px;
  background: var(--white);
  box-shadow: var(--shadow);
  display: none;
}

.nav-menu.is-open { display: block; }

.nav-menu a {
  display: block;
  padding: 10px 20px;
  font: 400 13px/1.4 'Montserrat', arial, sans-serif;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}

.nav-menu a:hover,
.nav-menu a:focus-visible { background: #f0f1f6; color: var(--navy); }

/* ---------------------------------------------------------------- content */

.hero {
  background: center / cover no-repeat var(--navy);
  min-height: min(62vw, 620px);
}

main { display: block; }

.section { padding: 56px 0; }
.section + .section { padding-top: 0; }

.page-title,
.section-title {
  font-family: 'Archivo Black', arial, sans-serif;
  font-weight: 400;
  text-transform: uppercase;
  color: var(--white);
  text-align: center;
  margin: 0;
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1.25;
  letter-spacing: 0.5px;
}

.rule {
  width: 100px;
  height: 2px;
  background: var(--rule);
  border: 0;
  margin: 22px auto 34px;
}

.subhead {
  font-family: 'Montserrat', arial, sans-serif;
  font-weight: 400;
  font-size: 20px;
  color: var(--white);
  margin: 34px 0 14px;
}

.banner {
  margin: 0 auto 34px;
  max-width: 1240px;
}

.banner.is-narrow { max-width: 820px; }

.banner img { width: 100%; }

/* The source photo is only 286x320; the original site stretches it to the full
   content width, so it is reproduced at the same scale here. */
.portrait {
  margin: 0 0 12px;
}

.portrait img { width: 100%; }

/* rich text ------------------------------------------------------------- */

.rt p { margin: 0 0 18px; }
.rt p:last-child { margin-bottom: 0; }
.rt p.rt-gap { margin: 0 0 18px; min-height: 1px; }
.rt a { color: var(--white); text-decoration: underline; word-break: break-word; }
.rt a:hover { color: #fff; text-decoration: none; }
.rt ul,
.rt ol { margin: 0 0 18px; padding-left: 24px; }
.rt li { margin: 0 0 6px; }
.rt strong { color: var(--white); }
.rt hr { border: 0; border-top: 1px solid var(--rule); margin: 24px 0; }

.rt-list p { margin: 0 0 4px; }
.rt-list p.rt-gap { margin-bottom: 20px; }

/* cards ----------------------------------------------------------------- */

.grid {
  display: grid;
  gap: 32px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.card-media { background: rgba(0, 0, 0, 0.15); }
.card-media img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.card-media.is-portrait img { aspect-ratio: 1 / 1; }

/* Course diagrams are shown whole rather than cropped, as on the original site. */
.card-media.is-natural img { aspect-ratio: auto; object-fit: fill; height: auto; }

.card-body { padding: 24px; flex: 1; }

.card-title {
  font-family: 'Archivo Black', arial, sans-serif;
  font-weight: 400;
  font-size: 18px;
  line-height: 1.35;
  text-transform: uppercase;
  color: var(--white);
  margin: 0 0 14px;
}

.card-eyebrow {
  font-size: 13px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: #a9b0d4;
  margin: 0 0 8px;
}

.card p { margin: 0 0 14px; font-size: 16px; line-height: 1.6; }
.card p:last-child { margin-bottom: 0; }

.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 18px;
}

.btn {
  display: inline-block;
  padding: 11px 22px;
  border: 1px solid var(--white);
  color: var(--white);
  font-size: 13px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  text-decoration: none;
  background: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn:hover,
.btn:focus-visible { background: var(--white); color: var(--navy); }

.link-inline { color: var(--white); text-decoration: underline; font-size: 15px; }

/* course tables --------------------------------------------------------- */

.table-scroll { overflow-x: auto; margin: 0 0 24px; }

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 520px;
  font-size: 16px;
}

th,
td {
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
}

th { color: var(--white); font-weight: 700; background: rgba(0, 0, 0, 0.12); }

/* social ---------------------------------------------------------------- */

.social {
  display: flex;
  justify-content: center;
  gap: 22px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.social a {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  color: var(--white);
}

.social a:hover { background: var(--white); color: var(--navy); }
.social svg { width: 20px; height: 20px; fill: currentColor; }

/* contact --------------------------------------------------------------- */

.contact-grid {
  display: grid;
  gap: 32px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: start;
}

.contact-block a { color: var(--white); }

/* placeholder ----------------------------------------------------------- */

.placeholder {
  border: 1px dashed var(--rule);
  padding: 40px 28px;
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
}

.placeholder p { margin: 0 0 10px; }
.placeholder p:last-child { margin: 0; }
.placeholder .hint { font-size: 15px; color: #a9b0d4; }

/* footer ---------------------------------------------------------------- */

.site-footer {
  background: var(--navy);
  padding: 48px 0 56px;
  text-align: center;
  font-size: 15px;
}

.site-footer hr {
  border: 0;
  border-top: 1px solid var(--rule);
  width: 64px;
  margin: 20px auto;
}

.site-footer p { margin: 0; }

/* --------------------------------------------------------------- mobile */

@media (max-width: 1080px) {
  .navbar .wrap { justify-content: flex-start; }
  .nav-toggle { display: block; }

  .nav-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 0 16px;
    box-shadow: var(--shadow);
    max-height: calc(100vh - var(--nav-h));
    overflow-y: auto;
  }

  .nav-list.is-open { display: flex; }

  .nav-link,
  .nav-trigger { width: 100%; justify-content: space-between; padding: 14px 24px; }

  .nav-menu {
    position: static;
    transform: none;
    box-shadow: none;
    min-width: 0;
    padding: 0 0 8px;
    background: #f7f8fb;
  }

  .nav-menu a { padding: 12px 40px; }
}

@media (max-width: 640px) {
  body { font-size: 17px; }
  .section { padding: 40px 0; }
  .card-body { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
