/* Custom CSS extracted from inline styles */

/* General */
body {
  background: linear-gradient(rgba(47, 23, 15, 0.65), rgba(47, 23, 15, 0.65)), url('../img/bg3.JPG');
  background-size: cover;
  background-attachment: fixed;
  background-position: center;
}

/* Header */
.site-heading {
  line-height: 1;
}

.site-heading .heading-logo {
  height: 5em;
  width: auto;
  aspect-ratio: 1006 / 1024;
  flex: 0 0 auto;
  display: block;
}

@media (max-width: 1199.98px) {
  .site-heading .heading-logo {
    height: 1.6em;
  }
}

/* Page Sections */
.page-section.cta {
  padding-top: 0;
  padding-bottom: 0;
  margin-top: 0;
  margin-bottom: 0;
  background: transparent !important;
}

/* News */
.news-thumb-wrap {
  position: relative;
  width: 100%;
  height: 220px;
  /* unify visual height */
  background: #f8f9fa;
  /* neutral backdrop for transparent/letterboxed images */
  display: flex;
  align-items: center;
  justify-content: center;
}

.news-thumb {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  /* no cropping */
}

/* Research Projects */
.proj-card {
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: .9rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .04));
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  color: #eef1f6;
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform .2s ease, box-shadow .2s ease;
  cursor: pointer;
}

.proj-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .28);
}

.proj-thumb {
  flex: 0 0 90px;
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: .6rem;
  border: 1px solid rgba(255, 255, 255, .2);
}

.proj-title {
  font-weight: 800;
  font-size: 1.1rem;
}

.proj-bullets ul {
  margin: 0;
}

.admin-actions .btn {
  border-radius: .6rem;
}

/* Modal */
.modal-content {
  background: rgba(15, 17, 23, .92);
  color: #eef1f6;
  border: 1px solid rgba(255, 255, 255, .15);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
}

.modal.modal-fullscreen .modal-body {
  padding: 1rem 1.25rem;
  max-height: calc(100vh - 120px);
  overflow: auto;
}

.modal.modal-fullscreen .row.g-3 {
  --bs-gutter-x: 1rem;
  --bs-gutter-y: 1rem;
}

.figure {
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: .6rem;
  padding: .5rem;
}

.figure img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: .4rem;
  object-fit: cover;
  margin: 0 auto;
}

.figure-caption {
  font-size: .9rem;
  opacity: .85;
}

/* Upload helpers */
.upload-row {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: .5rem;
  padding: .5rem .75rem;
}

.upload-name {
  font-size: .9rem;
  word-break: break-all;
}

/* Chips */
.chip {
  display: inline-block;
  padding: .25rem .5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .2);
  color: #111;
  background: #9eeaf9;
  margin: 0 .25rem .25rem 0;
  font-weight: 600;
}

/* Courses */
.course-card {
  border: 1px solid rgba(255, 255, 255, .20);
  border-radius: .9rem;
  padding: .9rem 1rem;
  margin-bottom: .6rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .04));
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  color: #eef1f6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.course-name {
  font-weight: 700;
  color: white;
}

.course-link {
  word-break: break-word;
  margin-bottom: 0.5em;
}

.course-link a {
  color: rgb(255, 193, 7) !important;
  text-decoration: none;
}

.course-link a:hover {
  text-decoration: underline;
  color: #ffca2c !important;
}


/* Multimedia */
.sidebar-card,
.gallery-card {
  background: rgba(255, 255, 255, .92);
  border-radius: .75rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .15);
  padding: 1rem;
}

.gallery-card {
  min-height: 420px;
}

.mosaic {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: .75rem;
}

.tile {
  position: relative;
  width: 100%;
  aspect-ratio: 1/1;
  overflow: hidden;
  border-radius: .6rem;
  cursor: pointer;
  border: 1px solid rgba(0, 0, 0, .08);
  transition: transform .15s ease, box-shadow .15s ease;
  background: #f7f7f7;
  contain: content;
  content-visibility: auto;
  will-change: transform;
  outline: none;
}

.tile:focus-visible {
  box-shadow: 0 0 0 3px rgba(13, 110, 253, .4);
}

.tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .18);
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tile[data-kind="video"]::after {
  content: "▶";
  position: absolute;
  inset: auto 0 0 0;
  margin: auto;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  line-height: 48px;
  text-align: center;
  border-radius: 999px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-weight: 700;
  font-size: 20px;
}

.tile-badge {
  position: absolute;
  left: .45rem;
  top: .45rem;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: .7rem;
  padding: .1rem .35rem;
  border-radius: .35rem;
}

.tile-admin {
  position: absolute;
  top: .45rem;
  right: .45rem;
  display: flex;
  gap: .25rem;
  opacity: 0;
  transition: opacity .15s;
  z-index: 2;
}

.tile:hover .tile-admin,
.tile:focus-within .tile-admin {
  opacity: 1;
}

.tile-admin .btn {
  padding: .15rem .35rem;
  font-size: .75rem;
  line-height: 1;
}

.pagination-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
}

.thumb-list {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.thumb {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: .5rem;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, .08);
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb .remove-toggle {
  position: absolute;
  right: .25rem;
  top: .25rem;
  background: rgba(0, 0, 0, .6);
  color: #fff;
  border: 0;
  border-radius: .35rem;
  padding: .15rem .35rem;
  font-size: .75rem;
}

.lightbox-img {
  max-height: 70vh;
  object-fit: contain;
}

.video-embed {
  width: 100%;
  aspect-ratio: 16/9;
  border: 0;
  border-radius: .5rem;
}

.lightbox-caption {
  font-size: .95rem;
  color: #444;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid rgba(0, 0, 0, .15);
  border-radius: .5rem;
  overflow: hidden;
}

.segmented input {
  display: none;
}

.segmented label {
  margin: 0;
  padding: .45rem .55rem;
  text-align: center;
  background: #fff;
  cursor: pointer;
  font-weight: 600;
  font-size: .9rem;
  user-select: none;
}

.segmented input:checked+label {
  background: #212529;
  color: #fff;
}

.form-text-muted {
  font-size: .8rem;
  color: #555;
}

@media (prefers-reduced-motion: reduce) {
  .tile {
    transition: none;
  }
}