@import "./styles.css";


:root{
    --h-title-color:#3948d2;
}

.header {
    border-bottom: solid 2px var(--bs-blue);
    z-index: 10000;
}

.bg-bottom {
    background-color: var(--h-title-color);
}

.top-section {
    position: relative;
    padding: 10rem 0;
    background-position: center;
    background-size: cover;
    height: 25rem;
}

.top-section h2 {
    font-weight: 400;
}

.top-section .top-section-content {
    position: relative;
    z-index: 1;
}

.top-section:before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

section header h2{
    font-family: "Kanit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji" !important;
    color: var(--h-title-color);
    font-size: 2.3rem;
    line-height: 4rem;
}

section .main-body{
    font-size: 1.3rem;
    font-weight: 200;
    line-height: 2.4rem;
}


.bg-gradient-primary-to-secondary-light {
    background: linear-gradient(45deg, #fcfcfc, #ffffff) !important;
}

.bg-gradient-primary-to-secondary-gray {
    background: linear-gradient(45deg, #f0f0f0, #f1f1f1) !important;
}

#home-md > p:nth-of-type(2),
#home-md > p:nth-of-type(3) {
    max-width: 72rem;
    text-align: justify;
}

#home-md a,
.publication-details a {
    color: var(--bs-blue);
    text-decoration: none;
}

#home-md a:hover,
.publication-details a:hover {
    text-decoration: underline;
}

.news-list {
    min-height: 3rem;
}

.news-list p {
    display: grid;
    grid-template-columns: 5.75rem minmax(0, 1fr);
    column-gap: 1rem;
    align-items: start;
    margin-bottom: 0.85rem;
}

.news-list time {
    color: #343a40;
    font-weight: 700;
    white-space: nowrap;
}

.news-list p > span {
    min-width: 0;
}

.news-placeholder {
    color: #6c757d;
    font-style: italic;
}

.language-switcher {
    display: flex;
    align-items: center;
    padding: 0.25rem 0;
}

.language-select {
    min-width: 6.7rem;
    padding: 0.42rem 2rem 0.42rem 0.75rem;
    color: #212529;
    background-color: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(33, 37, 41, 0.22);
    border-radius: 999px;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
}

.language-select:focus {
    border-color: var(--bs-blue);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.18);
}

.language-select:disabled {
    cursor: wait;
    opacity: 0.7;
}

@media screen and (max-width: 991px) {
    .language-switcher {
        padding: 0.5rem 0 0.8rem;
    }
}

@media screen and (max-width: 575px) {
    .news-list p {
        grid-template-columns: 4.9rem minmax(0, 1fr);
        column-gap: 0.65rem;
    }
}

.publication-list {
    display: grid;
    gap: 1.4rem;
    margin-top: 1rem;
}

.publication-card {
    display: grid;
    grid-template-columns: minmax(240px, 32%) minmax(0, 1fr);
    gap: 1.5rem;
    align-items: center;
    padding: 1.2rem;
    border: 1px solid rgba(33, 37, 41, 0.12);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.07);
}

.publication-figure {
    display: block;
    overflow: hidden;
    border-radius: 8px;
    background: #f7f8fa;
}

.publication-figure img {
    display: block;
    width: 100%;
    aspect-ratio: 12 / 7;
    object-fit: contain;
    transition: transform 0.25s ease;
}

.publication-figure:hover img {
    transform: scale(1.02);
}

.publication-details h3 {
    margin: 0 0 0.7rem;
    color: #212529;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    font-weight: 700;
    line-height: 1.35;
}

.publication-details p {
    margin: 0.35rem 0;
    font-size: 1rem;
    line-height: 1.55;
}

.publication-authors {
    color: #343a40;
}

.publication-venue {
    color: #495057;
}

.publication-links a {
    display: inline-block;
    margin-top: 0.25rem;
    padding: 0.22rem 0.7rem;
    border: 1px solid var(--bs-blue);
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
}

@media screen and (max-width: 767px) {
    .publication-card {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .publication-figure {
        max-width: 38rem;
        margin: 0 auto;
    }
}



.on-top {
    position: relative;
    z-index: 10000;
}

.top-bg {
    background-position: center;
    background-size: fill;
    width: 100%;
    height: 100%;
}

.top-bg::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
}


#avatar {
    position: relative;
    height: 0;
    top:min(-65px,max(-100px,calc(-1*100vw/12)));
    max-width: 55em;
    margin: 0 1.5rem 0 0;
    float: right;
    z-index: 9000;
}

#avatar img {
    height: max(130px,min(200px,calc(100vw/6)));
    box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.2);
}

@media screen and (max-width: 991px) {
    #avatar {
        margin: 0;
    }
}

.media-wrapper {
  overflow: hidden;
  width: 100%;
  position: relative;
}

.media-track {
  display: flex;
  gap: 20px;
  animation: scroll 25s linear infinite;
}

.media-track:hover {
  animation-play-state: paused;
}

.media-track img {
  height: 300px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.media-track img:hover {
  transform: scale(1.05);
}

@keyframes scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.media-video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 2vw, 20px);
  width: 100%;
  margin-top: 1rem;
}

.media-video-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border-radius: 12px;
  background: #000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.media-video {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: contain;
  background: #000;
  cursor: pointer;
}

.media-video-sound {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  padding: 0.45rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  color: #fff;
  background: rgba(0, 0, 0, 0.68);
  font-size: clamp(0.65rem, 1.2vw, 0.9rem);
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: opacity 0.2s ease, background 0.2s ease;
}

.media-video-sound:hover,
.media-video-sound:focus-visible {
  background: rgba(0, 0, 0, 0.9);
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.media-video-card.is-audible .media-video-sound {
  opacity: 0;
  pointer-events: none;
}

@media screen and (max-width: 575px) {
  .media-video-grid {
    gap: 6px;
  }

  .media-video-card {
    border-radius: 8px;
  }

  .media-video-sound {
    bottom: 8px;
    padding: 0.35rem 0.45rem;
  }
}
