html {
    font-size: 14px;
    text-rendering: optimizeLegibility;
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, Segoe UI, Oxygen,
        Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
    font-size: 13px;
    line-height: 1.5;
    color: #333;
}

a {
    color: inherit;
    text-decoration: none;
}

.highlighter {
    background-color: #afe0fa;
}

.main-content {
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    width: 60vw;
    margin: 30px 0;
    padding-bottom: 60px;
}

.headers {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    padding: 20px 30px;
}

.headers .descriptions {
    width: 60%;
}

.headers .profile {
    width: 28%;
}

.headers .descriptions p {
    font-size: 1.2rem;
    font-weight: 600;
    text-align: justify; 
}

.headers h1 {
    font-weight: 800;
    font-size: 3rem;
    display: inline-block;
    position: relative;
    z-index: 1;
    align-self: flex-start;
    padding: 0;
    margin: 0;
}

.headers h1::after {
    content:' ';
    display:block;
    height: 20px;
    width: 100%;
    position: relative;
    top: -30px;
    /* background-color: #ffedd8; */
    z-index: -1;
}

body {
    background: linear-gradient(135deg, #eef6f8 0%, #e1f8f4 100%);
    background-attachment: fixed;
}

.profile {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.profile img {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 15px;
}

.social-and-cv {
    padding: 0 30px;
    margin-bottom: 10px;
}

.social-links {
    width: 100%;
    margin: 20px auto; 
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}


.social-links img {
    width: 30px;
    height: 30px;
}

.button-type {
    font-size: 1.1rem;
    text-decoration: none;
    color: #333;
    border: 2px solid #333;
    padding: 5px 10px;
    border-radius: 5px;
    margin-left: 5px;
    cursor: pointer;
}

.social-links img {
    width: 30px;
    height: 30px;
}

.button-type {
    font-size: 1.1rem;
    text-decoration: none;
    color: #333;
    border: 2px solid #333;
    padding: 5px 10px;
    border-radius: 5px;
    margin: 5px 0 5px 5px; 
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.button-type:hover {
    background-color: #333;
    color: white;
}

.cta {
    display: flex;
    justify-content: start;
    flex-wrap: wrap;
}

.cta a {
    margin-right: 8px;
}


@media only screen and (max-width: 600px) {
    .main-content {
        width: 90%;
    }

    .headers {
        flex-direction: column-reverse;
        align-items: center;
        justify-content: space-between;
    }

    .headers .descriptions {
        width: 100%;
    }

    .headers .descriptions p {
    font-size: 1.4rem;
    font-weight: 800;
    text-align: justify; 
}

    .headers .profile {
        width: 100%;
        flex-direction: column;
        align-items: center;
    }

.social-links {
    width: 100%;
    justify-content: space-between;
}

    .profile img {
        width: 100%;
        aspect-ratio: 1;
        border-radius: 10px;
    }

    .cta {
        width: 100%;
        display: flex;
        justify-content: space-between;
        flex-wrap: wrap;
    }
}



.announcements {
    padding: 20px 0;
    min-height: fit-content;
}

.announcements h2 {
    margin: 0;
    padding: 0;
    margin-left: 20px;
}

.announcements::before,
.section-title {
    display: inline-block;
    font-weight: 800;
    font-size: 2rem;
    padding: 5px 12px;
    border-radius: 8px;
    /* margin-left: 30px; */
    margin-bottom: 10px;
}


.update-title {
    font-weight: 800;
    font-size: larger;
    padding: 7px 10px;
    border-radius: 8px 8px 0 0;
    margin: 0;
}

.announcements .updates {
    border-radius: 8px;
    max-height: 40vh;
    padding: 10px 20px;
    overflow-y: scroll;
    scrollbar-width: thin;
}

.update-item {
    border-bottom: 2px solid #8686867b;
    margin-bottom: 5px;
}

.update-item-date {
    font-size: medium;
}

.update-item-description {
    color: #333;
    font-size: larger;
    font-weight: 600;
    margin-left: 20px;
}

.education-experience,
.awards-honors {
    padding: 20px 0;
    min-height: fit-content;
}

.announcements .section-title {
    position: relative;
    left: 30px;
    font-weight: 800;
    font-size: 2rem;
    padding: 7px 10px;
    border-radius: 8px 8px 0 0;
    margin-bottom: 0;
}

.education-experience .section-title {
    position: relative;
    left: 30px;
    font-weight: 800;
    font-size: 2rem;
    padding: 7px 10px;
    border-radius: 8px 8px 0 0;
    margin-bottom: 0;
}

.awards-honors .section-title {
    position: relative;
    left: 30px;
    font-weight: 800;
    font-size: 2rem;
    padding: 7px 10px;
    border-radius: 8px 8px 0 0;
    margin-bottom: 0;
}
.education-experience .updates {
    border-radius: 8px;
    max-height: 40vh;
    padding: 10px 20px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.awards-honors .updates {
    /* background-color: #f2f5d4; */
    border-radius: 8px;
    max-height: 40vh;
    padding: 10px 20px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.education-experience .update-item,
.awards-honors .update-item {
    border-bottom: 2px solid #8686867b;
    margin-bottom: 5px;
}



.publications {
    margin: 30px 0;
    margin-bottom: 50px;
}

.tab-header {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px 30px;
}

.tab-toggle {
    background-color: #fafcfbd0;
    color: #333;
    font-weight: bold;
    border: 2px solid #333;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s ease-in-out;
}

.tab-toggle:hover {
    background-color: #bdf0e3ec;
}

.tab-toggle.active {
    background-color: #bdf0e3ec;
    border-color: #333;
}

.tab-content {
    display: none;
}

.tab-content.active-tab {
    display: block;
}

.publications::before {
    content: "";
}


.publication-holder {
    max-height: 80vh;
    overflow-y: scroll;
    scrollbar-width: thin;
    border-radius: 10px;
}

.publication-item {
    height: fit-content;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 10px;
    display: flex;
    justify-content: start;
    align-items: start;
}

.publication-item img {
    max-width: 250px;
    min-width: 250px;
    border-radius: 1px;
    /* border-color: #333; */
}

.publication-description {
    margin: 0 20px;
}

.publication-description .title {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
}

.publication-description .collaborators {
    font-size: 1.3rem;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
}

.publication-description .collaborators a {
    margin-right: 10px;
    text-decoration: underline;
}

.publication-description .project-links {
    display: flex;
    justify-content: start;
    flex-wrap: wrap;
}

.publication-description .project-links a {
    margin-right: 10px;
}

.bibtex {
    padding: 15px;
    background-color: #ffffff;
    border-radius: 10px;
}

.site-footer {
    text-align: center;
    font-size: 1rem;
    color: #222121;
    margin-top: 20px;
    padding: 10px 0;
}

@media only screen and (max-width: 600px) {

    .publication-item {
        height: fit-content;
        padding: 20px;
        margin-bottom: 20px;
        border-radius: 0px;
        flex-direction: column;
        align-items: center;

    }

    .publication-item img {
        max-width: 100px;
        aspect-ratio: 1.4;
        border-radius: 10px;
    }

    .publication-description {
        margin: 0 10px;
    }

    .contact-social {
    flex-wrap: wrap;
    justify-content: flex-start;
}

.contact-inline {
    flex-direction: column;
    align-items: flex-start;
}
}

.tabs-inline-header {
    position: relative;
    left: 30px;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    font-family: 'Raleway', sans-serif;
    font-size: 2rem;
    font-weight: 800;
}

.tab-button {
    background-color: transparent;
    border: none;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    cursor: pointer;
    color: #333;
    padding: 7px 10px;
    border-radius: 8px 8px 0 0;
    transition: background-color 0.2s ease;
}

.tab-button:hover {
    background-color: #fafcfbd0;
}

.tab-button.active {
    background-color: #fafcfbd0;
    color: #000;
    text-decoration: none;
}

.tab-content {
    display: none;
}

.tab-content.active-tab {
    display: block;
}

.contact-card .section-title {
    position: relative;
    left: 30px;
    font-weight: 800;
    font-size: 2rem;
    padding: 7px 10px;
    border-radius: 8px 8px 0 0;
    margin-bottom: 0;
}

.contact-card .updates {
    border-radius: 8px;
    max-height: fit-content;
    padding: 10px 20px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.contact-card .update-item {
    border-bottom: 2px solid #8686867b;
    margin-bottom: 5px;
}

.contact-social {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap; 
    align-items: center;
    gap: 15px;
    margin-top: 5px;
}

.contact-social a {
    display: inline-block;
}

.contact-social img {
    width: 30px;
    height: 30px;
}


.icon-inline {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-right: 8px;
}

.contact-card .section-title {
    background-color: transparent;
    padding-left: 0;
    margin-left: 0;
}

.contact-card .updates {
    background-color: transparent;
    border-radius: 0;
    padding: 10px 0;
}

.contact-card .update-item {
    border: none;
    margin-bottom: 10px;
}

.contact-inline {
    display: flex;
    align-items: center;
    gap: 30px; 
    flex-wrap: wrap;
    padding: 10px 0;
}

.contact-email a {
    font-size: 1.8rem;
    font-weight: 500;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.contact-email img.icon-inline {
    width: 30px;
    height: 30px;
}

.contact-social {
    display: flex;
    gap: 15px;
    align-items: center;
}

.contact-social img {
    width: 30px;
    height: 30px;
}


.frosted-glass {
    background-color: #ffffffe8; /* semi-transparent white */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px); /* for Safari */
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.section {
    margin: 20px 0; /* Adjust the spacing as needed */
}


/* Research Interests */
.research-interests .section-title {
  position: relative;
  left: 30px;
  font-weight: 800;
  font-size: 2rem;
  padding: 7px 10px;
  border-radius: 8px 8px 0 0;
  margin-bottom: 0;
}

.ri-grid {
  display: grid;
  gap: 16px;
  padding: 10px 20px;
  grid-template-columns: repeat(3, 1fr); /* max 3 on desktop */
}

/* Tablet: 2 per row */
@media (max-width: 1024px) {
  .ri-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile: 1 per row */
@media (max-width: 600px) {
  .ri-grid {
    grid-template-columns: 1fr;
  }
}

.ri-card {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ri-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.10);
}

.ri-card img {
  width: 100%;
  aspect-ratio: 3 / 2;     /* consistent tile size */
  object-fit: cover;
  display: block;
}

.ri-caption {
  font-weight: 700;
  font-size: 2rem;
  padding: 10px 12px 6px 12px;
}

.ri-desc {
  font-size: 1.5rem;
  color: #333;
  line-height: 2;
  padding: 0 12px;          /* collapsed padding (no bottom) */
  max-height: 0;            /* hidden by default */
  overflow: hidden;
  transition: max-height 0.28s ease, padding 0.28s ease;
}

/* Expand on hover (desktop/mouse) */
.ri-card:hover .ri-desc {
  max-height: 240px;        /* adjust as needed */
  padding: 8px 12px 12px 12px;
}

/* Expand when toggled (mobile/touch) */
.ri-card.expand .ri-desc {
  max-height: 240px;
  padding: 8px 12px 12px 12px;
}

/* Keyboard focus accessibility */
.ri-card:focus-visible {
  outline: 3px solid #afe0fa;
  outline-offset: 3px;
  border-radius: 12px;
}

/* ===== Research Interests: Rowed layout with 90/10 expand ===== */

/* Grid now holds rows of up to 3 cards */
.ri-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 10px 20px;
}

/* Each row is a grid: 3 columns by default */
.ri-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  min-height: 240px; /* ensures room to stack when expanded */
}

/* Desktop: expanded row transforms into 9/1 columns and two stacked rows */
.ri-row.has-expanded {
  grid-template-columns: 9fr 1fr;   /* 90% / 10% width */
  grid-template-rows: 1fr 1fr;      /* stack small tiles */
}

/* Expanded card occupies the big 90% area */
.ri-card.is-expanded {
  grid-column: 1 / 2;  /* first column */
  grid-row: 1 / 3;     /* span two rows */
}

/* The two siblings occupy 10% column, stacked */
.ri-card.stack-top {
  grid-column: 2 / 3;
  grid-row: 1 / 2;
}
.ri-card.stack-bottom {
  grid-column: 2 / 3;
  grid-row: 2 / 3;
}

/* Base card (kept from earlier suggestions; safe defaults) */
.ri-card {
  position: relative;                 /* for overlay panel */
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-height: 220px;
}
.ri-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.10);
}

.ri-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Frosted description overlay (hidden until expanded) */
.ri-desc-panel {
  position: absolute;
  inset: 12px; /* top/right/bottom/left = 12px */
  background-color: rgba(255,255,255,0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 14px;
  padding: 14px 16px;
  display: none;            /* only visible when expanded */
  overflow: auto;
}

.ri-card.is-expanded .ri-desc-panel {
  display: block;
}

/* Optional caption (kept compact) */
.ri-caption {
  position: absolute;
  left: 10px;
  bottom: 10px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 10px;
  padding: 6px 10px;
  font-weight: 700;
  font-size: 1rem;
}

/* Make the stacked (10%) tiles visually smaller without breaking layout */
.ri-row.has-expanded .ri-card.stack-top img,
.ri-row.has-expanded .ri-card.stack-bottom img {
  object-position: center;
}

/* Accessibility focus */
.ri-card:focus-visible {
  outline: 3px solid #afe0fa;
  outline-offset: 3px;
  border-radius: 12px;
}

/* ===== Responsive ===== */

/* Tablet: 2 per row; disable 90/10 split (just expand inline) */
@media (max-width: 1024px) {
  .ri-row { grid-template-columns: repeat(2, 1fr); min-height: unset; }
  .ri-row.has-expanded { grid-template-columns: repeat(2, 1fr); grid-template-rows: auto; }
  .ri-card.is-expanded { grid-column: auto; grid-row: auto; }
  .ri-card.stack-top, .ri-card.stack-bottom { grid-column: auto; grid-row: auto; }
  .ri-desc-panel { inset: 8px; }
}

/* Mobile: 1 per row; expand to full width */
@media (max-width: 600px) {
  .ri-row { grid-template-columns: 1fr; }
  .ri-row.has-expanded { grid-template-columns: 1fr; grid-template-rows: auto; }
}

/* === Research Interests: Accessibility + Full-width default tiles === */

/* Increase default tile size and ensure tracks fill the section width */
.research-interests { --ri-tile-height: 300px; }  /* tweak height here */
.ri-grid { width: 100%; } /* make sure grid spans the section */

.ri-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)); /* 3 equal tracks, full width */
  gap: 16px;
  min-height: var(--ri-tile-height);
}

/* 90/10 expanded state stays the same */
.ri-row.has-expanded {
  grid-template-columns: 5fr 4fr;   /* 50% / 40% */
  grid-template-rows: 1fr 1fr;      /* stack small tiles */
}

/* Cards span their track and have a strong default height */
.ri-card {
  position: relative;
  min-height: var(--ri-tile-height);
  width: 100%;
}

/* Images fill the card area by default */
.ri-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Frosted description panel (already present) gets a close button */
.ri-desc-panel {
  position: absolute;
  inset: 12px;
  background-color: rgba(255,255,255,0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 14px;
  padding: 14px 16px 16px 16px;
  display: none;
  overflow: auto;
}

/* Tiny "X" close button */
.ri-close {
  position: absolute;
  top: 10px;
  right: 10px;
  height: 28px;
  width: 28px;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 9999px;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
  font-size: 18px;
  line-height: 26px;
  text-align: center;
  padding: 0;
  color: #333;
  box-shadow: 0 1px 6px rgba(0,0,0,0.08);
}
.ri-close:hover { box-shadow: 0 2px 10px rgba(0,0,0,0.12); }
.ri-close:focus-visible {
  outline: 3px solid #afe0fa;
  outline-offset: 2px;
}

/* Expanded state shows the panel */
.ri-card.is-expanded .ri-desc-panel { display: block; }

/* Stacked siblings in the 40% column (keep as-is) */
.ri-card.stack-top   { grid-column: 2 / 3; grid-row: 1 / 2; }
.ri-card.stack-bottom{ grid-column: 2 / 3; grid-row: 2 / 3; }
.ri-card.is-expanded { grid-column: 1 / 2; grid-row: 1 / 3; }

/* Tablet (2-up) / Mobile (1-up) – disable 90/10 split; tiles still full width */
@media (max-width: 1024px) {
  .ri-row { grid-template-columns: repeat(2, minmax(0, 1fr)); min-height: var(--ri-tile-height); }
  .ri-row.has-expanded { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto; }
  .ri-card.is-expanded, .ri-card.stack-top, .ri-card.stack-bottom { grid-column: auto; grid-row: auto; }
  .ri-desc-panel { inset: 10px; }
}
@media (max-width: 600px) {
  .ri-row { grid-template-columns: 1fr; }
  .ri-row.has-expanded { grid-template-columns: 1fr; grid-template-rows: auto; }
}


/* ==== Research Interests – uniform padding & alignment overrides ==== */
.research-interests {
  --ri-gap: 16px;       /* gutter between tiles */
  --ri-pad: 20px;       /* section inner padding (matches frosted-glass) */
  --ri-tile-height: 300px;
}

/* Ensure the section's padding is the single source of truth */
.research-interests.frosted-glass {
  padding: var(--ri-pad);
}

/* Grid wrapper: no extra padding; rows handle layout */
.research-interests .ri-grid {
  display: flex;
  flex-direction: column;
  gap: var(--ri-gap);
  padding: 0;  /* keep tiles evenly inset from the section edge */
  width: 100%;
}

/* Each row: 3 equal tracks by default, stretched for uniform alignment */
.research-interests .ri-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--ri-gap);
  align-items: stretch;   /* uniform vertical alignment */
  justify-items: stretch; /* uniform horizontal alignment */
  min-height: var(--ri-tile-height);
}

/* Expanded state: true 90/10 split + vertical stacking of the narrow column */
.research-interests .ri-row.has-expanded {
  grid-template-columns: 5fr 4fr; /* 50% / 40% */
  grid-template-rows: 1fr 1fr;    /* stack two small tiles */
}

/* Expanded card spans the 90% area; siblings stack in the 10% column */
.research-interests .ri-card.is-expanded { grid-column: 1 / 2; grid-row: 1 / 3; }
.research-interests .ri-card.stack-top   { grid-column: 2 / 3; grid-row: 1 / 2; }
.research-interests .ri-card.stack-bottom{ grid-column: 2 / 3; grid-row: 2 / 3; }

/* Cards fill their tracks and maintain consistent height */
.research-interests .ri-card {
  position: relative;
  min-height: var(--ri-tile-height);
  width: 100%;
}

/* Images stretch to fill for perfect horizontal alignment */
.research-interests .ri-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Frosted description panel respects the same inner gutter as the grid gap */
.research-interests .ri-desc-panel {
  position: absolute;
  inset: var(--ri-gap); /* same padding as tile gutter -> visually even */
  background-color: rgba(255,255,255,0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 14px;
  padding: 14px 16px 16px 16px;
  display: none;
  overflow: auto;
}

/* Keep the tiny “×” button */
.research-interests .ri-close {
  position: absolute;
  top: 10px;
  right: 10px;
  height: 28px;
  width: 28px;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 9999px;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
  font-size: 18px;
  line-height: 26px;
  text-align: center;
  padding: 0;
  color: #333;
  box-shadow: 0 1px 6px rgba(0,0,0,0.08);
}
.research-interests .ri-card.is-expanded .ri-desc-panel { display: block; }

/* Tablet/Mobile: keep uniform padding, disable 90/10 while preserving alignment */
@media (max-width: 1024px) {
  .research-interests .ri-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: var(--ri-tile-height);
  }
  .research-interests .ri-row.has-expanded {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto;
  }
  .research-interests .ri-card.is-expanded,
  .research-interests .ri-card.stack-top,
  .research-interests .ri-card.stack-bottom {
    grid-column: auto;
    grid-row: auto;
  }
  .research-interests .ri-desc-panel { inset: var(--ri-gap); }
}
@media (max-width: 600px) {
  .research-interests .ri-row { grid-template-columns: 1fr; }
  .research-interests .ri-row.has-expanded { grid-template-columns: 1fr; grid-template-rows: auto; }
}

/* ==== Research Interests – uniform padding & alignment overrides ==== */
.research-interests {
  --ri-gap: 16px;       /* gutter between tiles */
  --ri-pad: 20px;       /* section inner padding (matches frosted-glass) */
  --ri-tile-height: 300px;
}

/* Ensure the section's padding is the single source of truth */
.research-interests.frosted-glass {
  padding: var(--ri-pad);
}

/* Grid wrapper: no extra padding; rows handle layout */
.research-interests .ri-grid {
  display: flex;
  flex-direction: column;
  gap: var(--ri-gap);
  padding: 0;  /* keep tiles evenly inset from the section edge */
  width: 100%;
}

/* Each row: 3 equal tracks by default, stretched for uniform alignment */
.research-interests .ri-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--ri-gap);
  align-items: stretch;   /* uniform vertical alignment */
  justify-items: stretch; /* uniform horizontal alignment */
  min-height: var(--ri-tile-height);
}

/* Expanded state: true 90/10 split + vertical stacking of the narrow column */
.research-interests .ri-row.has-expanded {
  grid-template-columns: 5fr 4fr; /* 50% / 40% */
  grid-template-rows: 1fr 1fr;    /* stack two small tiles */
}

/* Expanded card spans the 50% area; siblings stack in the 40% column */
.research-interests .ri-card.is-expanded { grid-column: 1 / 2; grid-row: 1 / 3; }
.research-interests .ri-card.stack-top   { grid-column: 2 / 3; grid-row: 1 / 2; }
.research-interests .ri-card.stack-bottom{ grid-column: 2 / 3; grid-row: 2 / 3; }

/* Cards fill their tracks and maintain consistent height */
.research-interests .ri-card {
  position: relative;
  min-height: var(--ri-tile-height);
  width: 100%;
}

/* Images stretch to fill for perfect horizontal alignment */
.research-interests .ri-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Frosted description panel respects the same inner gutter as the grid gap */
.research-interests .ri-desc-panel {
  position: absolute;
  inset: var(--ri-gap); /* same padding as tile gutter -> visually even */
  background-color: rgba(255,255,255,0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 14px;
  padding: 14px 16px 16px 16px;
  display: none;
  overflow: auto;
}

/* Keep the tiny “×” button */
.research-interests .ri-close {
  position: absolute;
  top: 10px;
  right: 10px;
  height: 28px;
  width: 28px;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 9999px;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
  font-size: 18px;
  line-height: 26px;
  text-align: center;
  padding: 0;
  color: #333;
  box-shadow: 0 1px 6px rgba(0,0,0,0.08);
}
.research-interests .ri-card.is-expanded .ri-desc-panel { display: block; }

/* Tablet/Mobile: keep uniform padding, disable 90/10 while preserving alignment */
@media (max-width: 1024px) {
  .research-interests .ri-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: var(--ri-tile-height);
  }
  .research-interests .ri-row.has-expanded {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto;
  }
  .research-interests .ri-card.is-expanded,
  .research-interests .ri-card.stack-top,
  .research-interests .ri-card.stack-bottom {
    grid-column: auto;
    grid-row: auto;
  }
  .research-interests .ri-desc-panel { inset: var(--ri-gap); }
}
@media (max-width: 600px) {
  .research-interests .ri-row { grid-template-columns: 1fr; }
  .research-interests .ri-row.has-expanded { grid-template-columns: 1fr; grid-template-rows: auto; }
}

/* --- Research Interests: fixed height in collapsed state --- */
.research-interests {
  transition: height 0.25s ease;
}

/* When no card is expanded, keep the section at its default measured height */
.research-interests.fixed-height {
  height: var(--ri-default-height, auto);
  overflow: hidden; /* avoid tiny layout jitter from row gaps */
}


/* Research Interests: description styling */
.research-interests .ri-desc-panel ul {
  margin: 0;
  padding-left: 20px; /* indent for bullets */
  list-style-type: disc;
  text-align: justify;
}

.research-interests .ri-desc-panel li {
  margin-bottom: 8px;
  line-height: 1.5;
}
