/* ============================================================
   new_gemini.css — Academic website stylesheet
   Shashank Vatedka / IIT Hyderabad
   Aesthetic: Classic well-typeset book
   Fonts: Cormorant Garamond (display/headings) +
          EB Garamond (body) + Spectral (nav/labels)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600&family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&family=Spectral:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&display=swap');

/* ── CSS variables ─────────────────────────────────────────── */
:root {
  --page:        #f7f3ec;
  --page-dark:   #ede7da;
  --ink:         #1c1811;
  --ink-soft:    #3a3328;
  --ink-faint:   #6b6055;
  --rule:        #c8bfb0;
  --rule-dark:   #9e9080;
  --red:         #8b2020;
  --red-muted:   #a84040;
  --link:        #3d2b6b;
  --link-hover:  #8b2020;
  --max-width:   780px;
}

/* ── Reset & base ──────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  /* EB Garamond has a small x-height so we compensate with a
     larger base — 20px gives a comfortable reading size while
     keeping the classical proportions intact                   */
  font-size: 20px;
  scroll-behavior: smooth;
}

body {
  font-family: 'EB Garamond', Garamond, 'Times New Roman', serif;
  font-weight: 400;
  color: var(--ink);
  background-color: var(--page);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ── Navigation ─────────────────────────────────────────────── */
.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 3rem;
  background-color: var(--page);
  border-bottom: 1px solid var(--rule-dark);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 0 0 var(--rule);
}

.topnav-left {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  font-weight: 600;
  font-style: italic;
  color: var(--ink) !important;
  text-decoration: none;
  letter-spacing: 0.01em;
  white-space: nowrap;
  flex-shrink: 0;
}

.topnav-right {
  display: flex;
  align-items: center;
}

.topnav-right a {
  font-family: 'Spectral', serif;
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-faint) !important;
  text-decoration: none;
  padding: 0.3rem 0.95rem;
  border-right: 1px solid var(--rule);
  transition: color 0.15s ease;
  line-height: 1;
}

.topnav-right a:first-child {
  border-left: 1px solid var(--rule);
}

.topnav-right a:hover {
  color: var(--red) !important;
}

hr.solid {
  display: none;
}

/* ── Page layout ─────────────────────────────────────────────── */
#content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 2rem 6rem;
}

/* ── Page title ─────────────────────────────────────────────── */
h1.title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.3rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
  text-align: center;
  letter-spacing: 0.03em;
  margin-bottom: 0.4rem;
}

h1.title::after {
  content: '❧';
  display: block;
  font-size: 1.2rem;
  color: var(--red);
  text-align: center;
  margin: 0.6rem auto 2.2rem;
}

/* ── Section headings ────────────────────────────────────────── */
h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: left;
  margin-top: 3rem;
  margin-bottom: 1.2rem;
  /* clear: both ensures h2 always spans the full column width,
     even when the profile photo float is still active on the
     home page — fixes the off-centre Announcements heading    */
  clear: both;
}

/* ── Sub-section headings ────────────────────────────────────── */
h3 {
  font-family: 'Spectral', serif;
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

/* ── Category labels: PhD / MTech / BTech (h5) ───────────────── */
h5 {
  font-family: 'Spectral', serif;
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red-muted);
  margin-top: 1.8rem;
  margin-bottom: 0.65rem;
  padding-left: 1rem;
  position: relative;
}

h5::before {
  content: '§';
  position: absolute;
  left: 0;
  color: var(--rule-dark);
  font-size: 0.85rem;
  line-height: 1;
  top: 0.05rem;
}

.outline-2 {
  margin-bottom: 0.5rem;
}

/* ── Body text ───────────────────────────────────────────────── */
p {
  margin-bottom: 1.1rem;
  color: var(--ink-soft);
  font-size: 1rem;
  max-width: 100%;
  text-align: justify;
  hyphens: auto;
}

/* ── Links ───────────────────────────────────────────────────── */
a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

a:hover {
  color: var(--link-hover);
  border-bottom-color: var(--link-hover);
}

/* ── Bullet lists ────────────────────────────────────────────── */
ul.org-ul,
ol.org-ol {
  padding-left: 0;
  list-style: none;
  margin-bottom: 0.5rem;
}

ul.org-ul > li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.55rem;
  font-size: 1rem;
  color: var(--ink-soft);
  line-height: 1.6;
}

ul.org-ul > li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--rule-dark);
}

/* ── Publication lists ───────────────────────────────────────── */
ol.org-ol {
  counter-reset: pub-counter;
  border-top: 1px solid var(--rule);
}

ol.org-ol > li {
  counter-increment: pub-counter;
  position: relative;
  padding: 0.9rem 0.5rem 0.9rem 2.8rem;
  font-size: 1rem;
  color: var(--ink-soft);
  line-height: 1.75;
  border-bottom: 1px solid var(--rule);
}

ol.org-ol > li::before {
  content: counter(pub-counter) '.';
  position: absolute;
  left: 0.4rem;
  top: 0.9rem;
  font-family: 'EB Garamond', serif;
  font-size: 0.85rem;
  color: var(--ink-faint);
  font-style: italic;
  min-width: 1.8rem;
  text-align: right;
}

ol.org-ol > li i,
ol.org-ol > li em {
  font-style: italic;
  color: var(--ink);
}

ol.org-ol > li br + i,
ol.org-ol > li br + em {
  font-style: italic;
  color: var(--red-muted);
  font-size: 0.93rem;
}

/* ── Profile photo ───────────────────────────────────────────── */
#content .figure {
  float: right;
  margin: 0.3rem 0 1.5rem 2.5rem;
  shape-outside: margin-box;
}

#content .figure img {
  width: 165px;
  display: block;
  border: 1px solid var(--rule-dark);
  outline: 4px solid var(--page);
  outline-offset: -7px;
  box-shadow: 0 2px 8px rgba(28,24,17,0.15);
}

/* ── Announcements list ──────────────────────────────────────── */
#outline-container-orgad0da6d ul.org-ul > li {
  margin-bottom: 0.8rem;
}

#outline-container-orgad0da6d ul.org-ul > li::before {
  content: '›';
  color: var(--red);
  font-size: 1.2rem;
  line-height: 1.5;
}

/* ── Bold/strong ─────────────────────────────────────────────── */
b, strong {
  font-weight: 600;
  color: var(--ink);
}

/* ── Disclaimer / epigraph (publications page) ───────────────── */
#content > p:first-of-type {
  font-style: italic;
  font-size: 0.88rem;
  color: var(--ink-faint);
  text-align: center;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 0.65rem 1.5rem;
  margin-bottom: 2rem;
  max-width: 100%;
  hyphens: none;
}

/* ── Contact block ───────────────────────────────────────────── */
#outline-container-org2d6412f p {
  font-family: 'Spectral', serif;
  font-size: 0.88rem;
  color: var(--ink-soft);
  line-height: 2;
  text-align: left;
  hyphens: none;
  background: var(--page-dark);
  border: 1px solid var(--rule);
  padding: 1.2rem 1.6rem;
  max-width: 420px;
  margin: 0 auto;
}

/* ── Alumni / section dividers ───────────────────────────────── */
#outline-container-orgf2a311d,
#outline-container-orgdc55808 {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule-dark);
  position: relative;
}

#outline-container-orgf2a311d::before,
#outline-container-orgdc55808::before {
  content: '* * *';
  display: block;
  position: absolute;
  top: -0.75rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--page);
  padding: 0 1rem;
  font-size: 0.8rem;
  color: var(--rule-dark);
  letter-spacing: 0.3em;
}

/* ── Postamble ───────────────────────────────────────────────── */
#postamble {
  font-family: 'Spectral', serif;
  font-size: 0.78rem;
  font-style: italic;
  color: var(--ink-faint);
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--rule);
  margin-top: 4rem;
}

/* ── Section numbers (1. 2. 3. …) ────────────────────────────── */
.section-number-2,
.section-number-3 {
  color: var(--red-muted);
  font-weight: 600;
  margin-right: 0.35em;
  /* the heading is uppercase + letter-spaced; nudge the number so
     it doesn't inherit the wide tracking and look detached        */
  letter-spacing: 0;
}

/* ── Table of Contents ───────────────────────────────────────── */
#table-of-contents {
  max-width: 34rem;
  margin: 0 auto 3rem;
}

#table-of-contents h2 {
  /* sits right under the title, so it needs less top room than a
     regular section heading                                       */
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  font-size: 0.82rem;
}

#text-table-of-contents ul {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}

#text-table-of-contents ul ul {
  border-top: none;
  margin-left: 1.4rem;
}

#text-table-of-contents li {
  margin: 0;
  padding: 0;
  border-bottom: 1px solid var(--rule);
}

#text-table-of-contents li::before {
  content: none;
}

#text-table-of-contents a {
  display: block;
  padding: 0.55rem 0.9rem;
  font-family: 'Spectral', serif;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
  border-bottom: none;
  transition: background-color 0.15s ease, color 0.15s ease,
              padding-left 0.15s ease;
}

#text-table-of-contents a:hover {
  background-color: var(--page-dark);
  color: var(--red);
  padding-left: 1.2rem;
}

/* ── Tables ──────────────────────────────────────────────────── */
/* The org exporter emits HTML border / rules / frame attributes
   (e.g. border="2" rules="groups" frame="hsides").  We override
   them entirely and rebuild a clean, book-style "booktabs" rule
   set: a heavy rule top and bottom, hairlines between rows.       */
#content table {
  border-collapse: collapse;
  border-spacing: 0;
  width: auto;
  max-width: 100%;
  margin: 1.6rem auto 2rem;
  font-family: 'Spectral', serif;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--ink-soft);
  border: none;
  border-top: 2px solid var(--ink-soft);
  border-bottom: 2px solid var(--ink-soft);
}

#content table caption {
  font-family: 'Spectral', serif;
  font-size: 0.8rem;
  font-style: italic;
  color: var(--ink-faint);
  padding-bottom: 0.6rem;
}

/* org emits rules="groups" + a <colgroup>, which paints vertical
   1px borders around the column group — neutralise every grouping
   element so only our horizontal rules remain                     */
#content table colgroup,
#content table col,
#content table thead,
#content table tbody,
#content table tfoot,
#content table tr {
  border: none;
}

#content table td,
#content table th {
  border: none;
  padding: 0.5rem 1.4rem;
  vertical-align: top;
}

/* hairline between body rows */
#content table tbody tr + tr td {
  border-top: 1px solid var(--rule);
}

/* header row, when present */
#content table thead th {
  font-weight: 600;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.74rem;
  border-bottom: 1.5px solid var(--rule-dark);
}

/* lead column reads as a label in the key/value + grade tables */
#content table td:first-child {
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
}

#content table a {
  /* keep links readable against the lighter table type */
  color: var(--link);
}

/* ── MathJax ─────────────────────────────────────────────────── */
.MathJax {
  font-size: 1em !important;
}

/* ================================================================
   PHOTO GALLERY — 2+1 mosaic with CSS-only click-to-zoom
   ================================================================

   HTML structure expected in group.html:

     <span id="photos"></span>   ← dismissal anchor (place just
                                   before the .photo-plates div)

     <div class="photo-plates">
       <a href="#img-1" class="plate plate--wide">
         <img src="../files/group1.jpeg" alt="Group, 2024">
       </a>
       <a href="#img-2" class="plate">
         <img src="../files/group2.jpeg" alt="Group, 2023">
       </a>
       <a href="#img-3" class="plate">
         <img src="../files/group3.jpg" alt="Group, 2022">
       </a>

       <a href="#photos" class="lightbox" id="img-1">
         <img src="../files/group1.jpeg" alt="Group, 2024">
       </a>
       <a href="#photos" class="lightbox" id="img-2">
         <img src="../files/group2.jpeg" alt="Group, 2023">
       </a>
       <a href="#photos" class="lightbox" id="img-3">
         <img src="../files/group3.jpg" alt="Group, 2022">
       </a>
     </div>

   How it works:
   - .plate links point to #img-N, which targets a .lightbox
   - .lightbox is display:none by default; :target makes it flex
   - clicking the lightbox follows href="#photos", clearing :target
   - href="#photos" targets the <span> just above, so the page
     stays roughly in position rather than jumping to the top
   ================================================================ */

/* ── Mosaic grid ─────────────────────────────────────────────── */
.photo-plates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 7px;
  margin: 2.5rem 0 2rem;
  /* lightbox overlays are position:fixed so they don't affect
     the grid layout                                            */
}

/* Thumbnail plate links */
.plate {
  display: block;
  overflow: hidden;
  border: none;
  cursor: zoom-in;
  /* remove link underline behaviour */
  border-bottom: none !important;
}

.plate:hover {
  border-bottom: none !important;
}

/* First plate spans both columns — the "hero" slot */
.plate--wide {
  grid-column: 1 / 3;
}

.plate img {
  width: 100%;
  display: block;
  object-fit: cover;
  object-position: center top;
  /* Engraving-style inset border */
  border: 1px solid var(--rule-dark);
  outline: 5px solid var(--page);
  outline-offset: -9px;
  box-shadow: 0 2px 8px rgba(28,24,17,0.12);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

/* Hero photo — tall */
.plate--wide img {
  height: 300px;
}

/* Pair of smaller photos below */
.plate:not(.plate--wide) img {
  height: 190px;
}

.plate:hover img {
  box-shadow: 0 5px 18px rgba(28,24,17,0.22);
  transform: scale(1.015);
}

/* ── CSS-only lightbox ───────────────────────────────────────── */
.lightbox {
  /* Hidden by default */
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(22, 18, 10, 0.88);
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  /* Override link styles */
  border-bottom: none !important;
}

/* Shown when this element is the URL target */
.lightbox:target {
  display: flex;
}

.lightbox img {
  max-width: min(90vw, 1100px);
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  /* Plate border carried through to full-size view */
  border: 1px solid var(--rule-dark);
  outline: 6px solid rgba(247, 243, 236, 0.12);
  outline-offset: -10px;
  box-shadow: 0 12px 60px rgba(0,0,0,0.55);
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 680px) {
  .topnav {
    flex-direction: column;
    padding: 0.8rem 1.2rem;
    gap: 0.6rem;
    position: static;
  }

  .topnav-right {
    justify-content: center;
  }

  .topnav-right a {
    font-size: 0.62rem;
    padding: 0.3rem 0.55rem;
  }

  #content {
    padding: 2.5rem 1.3rem 4rem;
  }

  h1.title {
    font-size: 1.9rem;
  }

  #content .figure {
    float: none;
    margin: 0 0 1.5rem 0;
    text-align: center;
  }

  #content .figure img {
    margin: 0 auto;
  }

  #content table td,
  #content table th {
    padding: 0.45rem 0.8rem;
  }

  #content table {
    font-size: 0.85rem;
  }

  /* On narrow screens collapse mosaic to single column */
  .photo-plates {
    grid-template-columns: 1fr;
  }

  .plate--wide {
    grid-column: 1;
  }

  .plate--wide img,
  .plate:not(.plate--wide) img {
    height: 220px;
  }
}

@media (max-width: 420px) {
  html { font-size: 18px; }
  h1.title { font-size: 1.65rem; }
}
