/* =========================================================
   Scientific Students – legacy content styles
   Loaded only on pages converted from the old table-based site
   ($page['legacy'] = true). Makes old markup responsive.
   ========================================================= */
.legacy { font-size: 1rem; line-height: 1.65; overflow-wrap: anywhere; display: flow-root; }
.legacy #main { width: auto; }
.legacy img, .legacy embed, .legacy object, .legacy video { max-width: 100%; height: auto; }
.legacy iframe { max-width: 100%; border: 0; }
.legacy table { max-width: 100%; border-collapse: collapse; }
.legacy table.lt { width: auto; }
.legacy table.lt.full { width: 100%; }
.legacy td, .legacy th { vertical-align: top; }
.legacy [style*="width"] { max-width: 100%; }
/* page-specific legacy CSS (solar.css, circuit.css, common.css, inline <style>) uses fixed px widths */
.legacy div, .legacy ul, .legacy ol, .legacy li, .legacy p, .legacy form, .legacy section,
.legacy fieldset, .legacy span, .legacy center, .legacy marquee { max-width: 100%; box-sizing: border-box; }
.legacy input, .legacy select, .legacy textarea { max-width: 100%; }
.legacy .ml-wide { margin-left: var(--ml); }
@media (max-width: 991.98px) { .legacy .ml-wide { margin-left: 0; } }
.legacy .table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 1rem; }
.legacy .table-wrap > table { min-width: 100%; }
.legacy table.data td, .legacy table.data th { padding: .4rem .6rem; }
.legacy .ratio { margin: 0 auto 1rem; max-width: 760px; border-radius: .75rem; overflow: hidden; }
.legacy p { margin-bottom: 1rem; }
.legacy ul, .legacy ol { padding-left: 1.4rem; }
.legacy a { text-decoration: none; }
.legacy a:hover { text-decoration: underline; }
/* old small-print helper classes -> readable sizes */
.legacy .hometext, .legacy .profiletext, .legacy .homeservices, .legacy .bgtext1, .legacy .bgtext,
.legacy .text, .legacy .text1, .legacy .add, .legacy .fldi, .legacy .liveMatch, .legacy .liveMatch1,
.legacy .liveMatch2, .legacy .pgallery, .legacy .servicestext, .legacy .grigtext { font-size: 1rem !important; line-height: 1.65 !important; }
.legacy .innerhead, .legacy .boxhead, .legacy .boxhead1, .legacy .boxhead2 { color: var(--navy); font-family: "Poppins", sans-serif; }
.legacy .rightboxhead { background: var(--navy) !important; color: #fff; border-radius: .6rem .6rem 0 0; padding: .5rem .9rem; height: auto !important; font-family: "Poppins", sans-serif; }
.legacy .homeservices { background: #fff !important; border: 1px solid var(--line); border-top: 0; height: auto !important; padding: .5rem; }
.legacy [class*="bg"] { height: auto; }
.legacy .homebtn { display: inline-block; background: var(--blue); color: #fff; padding: .35rem 1rem; border-radius: 999px; text-decoration: none; }
.legacy div[align="justify"], .legacy td[align="justify"] { text-align: justify; hyphens: auto; }
/* legacy tab widget (righttab1.js) */
.legacy .liveMatch { background: var(--navy) !important; border-radius: .6rem; border: 0 !important; overflow: hidden; }
.legacy .liveMatch > ul, .legacy .liveMatch1 > ul, .legacy .liveMatch2 > ul { display: flex; flex-wrap: wrap; padding: .4rem .4rem 0 !important; margin: 0; }
.legacy .liveMatch > ul > li, .legacy .liveMatch1 > ul > li, .legacy .liveMatch2 > ul > li { height: auto !important; padding: .45rem .8rem !important; border: 0 !important; border-radius: .5rem .5rem 0 0; color: #fff; }
.legacy .liveMatch > ul > li.sel, .legacy .liveMatch1 > ul > li.sel, .legacy .liveMatch2 > ul > li.sel { background: #fff !important; color: var(--navy) !important; }
.legacy .liveMatch > ul > li.sel a, .legacy .liveMatch1 > ul > li.sel a { color: var(--orange) !important; }
.legacy .liveMatchBox, .legacy .liveMatch > div { color: var(--ink); }
/* tab content spans the full width (some old tab containers also carry Bootstrap's "nav" class, which made them flex rows) */
.legacy .liveMatch.nav, .legacy .liveMatch1.nav, .legacy .liveMatch2.nav { display: block; }
.legacy .liveMatch > div, .legacy .liveMatch1 > div, .legacy .liveMatch2 > div { width: 100%; }
.legacy .liveMatch > br.clear, .legacy .liveMatch1 > br.clear, .legacy .liveMatch2 > br.clear { display: none; }
/* tab bars stay on one line: compact on desktop, scroll sideways where they still don't fit (phones) */
.legacy .liveMatch > ul, .legacy .liveMatch1 > ul, .legacy .liveMatch2 > ul { flex-wrap: nowrap !important; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.legacy .liveMatch > ul > li, .legacy .liveMatch1 > ul > li, .legacy .liveMatch2 > ul > li {
  flex: 1 0 auto; float: none; white-space: nowrap; text-align: center;
  padding: .4rem .55rem !important; font-size: .82rem !important; letter-spacing: .01em;
}
.legacy .liveMatch1 > ul > li > a { padding: .35rem .2rem; line-height: 1.5; }

/* legacy forms */
.legacy input[type="text"], .legacy input[type="email"], .legacy input[type="tel"], .legacy input[type="password"],
.legacy input:not([type]), .legacy select, .legacy textarea {
  border: 1px solid #cbd5e1; border-radius: .5rem; padding: .45rem .65rem; font-size: 1rem; background: #fff; width: 100%; max-width: 420px;
}
.legacy input:focus, .legacy select:focus, .legacy textarea:focus { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 .2rem rgba(37,99,235,.15); }
.legacy input[type="submit"], .legacy input[type="reset"], .legacy input[type="button"], .legacy form button {
  background: var(--blue); color: #fff; border: 0; border-radius: 999px; padding: .5rem 1.4rem; font-weight: 600; cursor: pointer;
}
.legacy input[type="reset"] { background: #e2e8f0; color: var(--ink); }
.legacy form table td { padding: .3rem .4rem; }
.legacy .liveMatchBox { padding: 1rem !important; }
/* carousels converted from old slider / glider */
.legacy .carousel { border-radius: 1rem; overflow: hidden; margin-bottom: 1.25rem; box-shadow: var(--shadow); }
.legacy .carousel-caption { left: 0; right: 0; bottom: 0; padding: 2.5rem 1rem 1rem; background: linear-gradient(transparent, rgba(0,0,0,.75)); }
.legacy .carousel-caption a { color: #ffd27a; }
.legacy .glide-carousel { background: var(--sky); box-shadow: none; padding: 1rem 2.5rem 2.5rem; }
.legacy .glide-carousel .carousel-control-prev, .legacy .glide-carousel .carousel-control-next { width: 2.5rem; filter: invert(1) grayscale(1); }
.legacy .glide-carousel .carousel-indicators { margin-bottom: .5rem; filter: invert(1) grayscale(1); }

/* ----- Phone: stack layout tables ----- */
@media (max-width: 767.98px) {
  .legacy table:not(.data), .legacy table:not(.data) td, .legacy table:not(.data) th { width: auto !important; min-width: 0 !important; }
  .legacy table:not(.data) { max-width: 100% !important; }
  .legacy table:not(.data) td, .legacy table:not(.data) th { max-width: calc(100vw - 2rem); }
  .legacy table.lt, .legacy table.lt > tbody, .legacy table.lt > tbody > tr, .legacy table.lt > tr,
  .legacy table.lt.stack > tbody > tr > td, .legacy table.lt.stack > tr > td { display: block; width: 100% !important; }
  .legacy table.lt.stack > tbody > tr > td.sp, .legacy table.lt.stack > tr > td.sp { display: none; }
  .legacy table.lt.stack > tbody > tr > td, .legacy table.lt.stack > tr > td { padding: 0 0 .75rem !important; text-align: left; }
  .legacy table.lt.stack > tbody > tr > td[align="center"], .legacy table.lt.stack > tbody > tr > td > div[align="center"] { text-align: center; }
  .legacy div[align="justify"], .legacy td[align="justify"] { text-align: left; }
  /* scientists.html gallery (css/profile.css uses long #id chains) */
  .legacy #main #full #content #block #thumb, .legacy #main #full #content #block #bio,
  .legacy #main #full #content #block #fullsize, .legacy #main #full #content #photoset {
    float: none; width: auto; height: auto; padding-left: 0; margin: 0 0 1rem;
  }
  .legacy #overflow.bio { height: auto; }
}


/* tables that hold an old tab block take the full width, so the tab block doesn't resize with each tab's content */
.legacy table:has(.liveMatch, .liveMatch1, .liveMatch2) { width: 100% !important; }

/* Circuit Lab button columns (Projects List tab, Online Store): each button on one line on wide screens;
   the column takes the width of its longest label and the text column beside it gives up that space */
.legacy td.circ-but1 a { overflow-wrap: normal; word-break: normal; } /* never split a word inside a button */
@media (min-width: 1200px) {
  .legacy td.circ-but1:has(a + a) { width: 1%; }
  .legacy td.circ-but1:has(a + a) a { white-space: nowrap; }
}

/* Button rows on the Circuit Lab (circ-but1) and Solar Lab (solar-but1) pages: one-line labels, compact text;
   when a row doesn't fit, whole buttons move to the next row instead of a label breaking in two */
.legacy table:has(> tbody > tr > td:is(.circ-but1, .solar-but1) + td.sp + td:is(.circ-but1, .solar-but1)),
.legacy table:has(> tbody > tr > td:is(.circ-but1, .solar-but1) + td.sp + td:is(.circ-but1, .solar-but1)) > tbody { display: block; width: 100% !important; }
.legacy tr:has(> td:is(.circ-but1, .solar-but1) + td.sp + td:is(.circ-but1, .solar-but1)) { display: flex !important; flex-wrap: wrap; justify-content: center; gap: .35rem; }
.legacy tr:has(> td:is(.circ-but1, .solar-but1) + td.sp + td:is(.circ-but1, .solar-but1)) > td.sp { display: none !important; }
.legacy tr:has(> td:is(.circ-but1, .solar-but1) + td.sp + td:is(.circ-but1, .solar-but1)) > td:is(.circ-but1, .solar-but1) { display: block !important; width: auto !important; padding: 0 !important; flex: 0 0 auto; }
.legacy tr:has(> td:is(.circ-but1, .solar-but1) + td.sp + td:is(.circ-but1, .solar-but1)) > td:is(.circ-but1, .solar-but1) a { white-space: nowrap; font-size: .72rem; padding: 5px 8px; letter-spacing: 0; overflow-wrap: normal; word-break: normal; }

/* Sub-page menus on the Atal Tinkering Lab and My God Father pages (old menu.css is no longer loaded):
   one row of one-line buttons, matching the Circuit Lab / Solar Lab button rows */
.legacy .godfather1 { margin-bottom: 1.5rem !important; }
.legacy .godfather1 ul { list-style: none; margin: 0; padding: 0 !important; display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem; }
.legacy .godfather1 li { float: none; margin: 0; max-width: none; }
.legacy .godfather1 li a { display: block; white-space: nowrap; background: #003783 !important; color: #fff !important; font-size: .74rem !important;
  font-weight: 700; line-height: 1.4; padding: 6px 9px !important; margin: 0; border-radius: 7px; text-decoration: none !important; transition: background .2s; }
.legacy .godfather1 li a:hover, .legacy .godfather1 li a.current, .legacy .godfather1 li a.active { background: #da0b4e !important; }

/* Video / photo cards (Solar Lab and Circuit Lab pages): 2 per row at any width or zoom, 1 per row on phones
   (old solar.css / circuit.css used fixed 540px items in a 1100px box) */
.legacy .cir-container { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; width: 100%; max-width: 100%; margin: 1.25rem 0; clear: both; align-items: start; }
.legacy .cir-item { width: auto; margin: 0; display: flex; flex-direction: column; background: #e8f2fe; border-radius: .6rem; overflow: hidden; }
.legacy .cir-item > a { display: flex; flex-direction: column; flex: 1 1 auto; text-decoration: none; }
.legacy .cir-item > a.cir-more { flex: 0 0 auto; flex-direction: row; align-items: center; gap: .4rem; padding: .5rem .75rem; border-top: 1px solid #cddcf3;
  font-weight: 600; font-size: .92rem; color: #da0b4e; background: #f4f8ff; }
.legacy .cir-item > a.cir-more:hover { background: #fff; }
.legacy .cir-heading { font-family: "Poppins", sans-serif; font-weight: 700; font-size: 1.2rem; color: #010183; margin: 1.75rem 0 0; }
.legacy .cir-item img { width: 100%; height: auto; padding: 0; }
.legacy .cir-item a > br { display: none; }
.legacy .cir-item b { display: block; padding: .55rem .75rem .65rem; line-height: 1.4; }
@media (max-width: 575.98px) { .legacy .cir-container { grid-template-columns: 1fr; } }

/* Solar Lab button rows (Solar Lab and its sub-pages): 1rem text, tight padding so the row stays compact */
.legacy tr:has(> td.solar-but1 + td.sp + td.solar-but1) { gap: .25rem !important; }
.legacy tr:has(> td.solar-but1 + td.sp + td.solar-but1) > td.solar-but1 > a { font-size: 1rem !important; padding: 7px 6px !important; letter-spacing: -.015em !important; }

/* Floated images beside text: always stack (never sit side by side) and never take more than half the width,
   so the text column keeps the same shape at every browser zoom level (wider screens / zoomed out) */
.legacy [style*="float:right"], .legacy [style*="float: right"] { clear: right; max-width: 50%; }
.legacy [style*="float:left"], .legacy [style*="float: left"] { clear: left; max-width: 50%; }
.legacy [style*="float:right"] img, .legacy [style*="float: right"] img,
.legacy [style*="float:left"] img, .legacy [style*="float: left"] img { max-width: 100%; height: auto; }
@media (max-width: 767.98px) {
  .legacy [style*="float:right"], .legacy [style*="float: right"],
  .legacy [style*="float:left"], .legacy [style*="float: left"] { float: none !important; max-width: 100%; margin: 0 0 1rem !important; }
}

/* Photo + caption links (<a><img><br><b>caption</b></a>): the caption wraps at the photo's width,
   so the text lines up exactly under the image instead of running past it */
.legacy a:has(> img + br + b) { display: inline-block; max-width: 100%; vertical-align: top; }
.legacy a:has(> img + br + b) > img { display: block; }
.legacy a:has(> img + br + b) > br { display: none; }
.legacy a:has(> img + br + b) > b { display: block; width: 0; min-width: 100%; margin-top: .4rem; line-height: 1.45; }
