/*==================== GOOGLE FONTS ====================*/
@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;600;700&display=swap");

/*==================== NOISE TEXTURE SVG ====================*/
@keyframes noise {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-5%, -5%); }
  20% { transform: translate(-10%, 5%); }
  30% { transform: translate(5%, -10%); }
  40% { transform: translate(-5%, 15%); }
  50% { transform: translate(-10%, 5%); }
  60% { transform: translate(15%, 0); }
  70% { transform: translate(0, 10%); }
  80% { transform: translate(-15%, 0); }
  90% { transform: translate(10%, 5%); }
}

/*==================== VARIABLES CSS ====================*/
:root {
    --header-height: 3rem;

    /*========== Colors ==========*/
    --hue-color: 215; /* Blue - academic professional */

    /* HSL color mode */
    --first-color: hsl(var(--hue-color), 70%, 50%);
    --first-color-second: hsl(var(--hue-color), 65%, 48%);
    --first-color-alt: hsl(var(--hue-color), 65%, 42%);
    --first-color-lighter: hsl(var(--hue-color), 85%, 90%);
    --title-color: hsl(var(--hue-color), 15%, 15%);
    --text-color: hsl(var(--hue-color), 10%, 40%);
    --text-color-light: hsl(var(--hue-color), 10%, 60%);
    --input-color: hsl(var(--hue-color), 50%, 96%);
    --body-color: hsl(var(--hue-color), 40%, 97%);
    --container-color: hsl(var(--hue-color), 60%, 98%);
    --scroll-bar-color: hsl(var(--hue-color), 15%, 88%);
    --scroll-thumb-color: hsl(var(--hue-color), 15%, 76%);

    /*========== Font and typography ==========*/
    --body-font: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    --big-font-size: 2.5rem;
    --h1-font-size: 1.75rem;
    --h2-font-size: 1.35rem;
    --h3-font-size: 1.15rem;
    --normal-font-size: .938rem;
    --small-font-size: .813rem;
    --smaller-font-size: .75rem;

    /*========== Font weight ==========*/
    --font-medium: 500;
    --font-semi-bold: 600;

    /*========== Margenes Bottom ==========*/
    --mb-0-25: .25rem;
    --mb-0-5: .5rem;
    --mb-0-75: .75rem;
    --mb-1: 1rem;
    --mb-1-5: 1.5rem;
    --mb-2: 2rem;
    --mb-2-5: 2.5rem;
    --mb-3: 3rem;

    /*========== z index ==========*/
    --z-tooltip: 10;
    --z-fixed: 100;
    --z-modal: 1000;
}

/* Font size for large devices */
@media screen and (min-width: 968px) {
    :root {
        --big-font-size: 3.5rem;
        --h1-font-size: 2.5rem;
        --h2-font-size: 1.75rem;
        --h3-font-size: 1.35rem;
        --normal-font-size: 1rem;
        --small-font-size: .875rem;
        --smaller-font-size: .813rem;
    }
}

/*==================== NOISE OVERLAY ====================*/
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
  opacity: 0.025;
  pointer-events: none;
  z-index: 9999;
  animation: noise 0.65s steps(5) infinite;
}

/*========== Variables Dark theme ==========*/
body.dark-theme {
  --first-color-second: hsl(var(--hue-color), 40%, 12%);
  --title-color: hsl(var(--hue-color), 10%, 92%);
  --text-color: hsl(var(--hue-color), 8%, 70%);
  --text-color-light: hsl(var(--hue-color), 8%, 72%);
  --input-color: hsl(var(--hue-color), 25%, 18%);
  --body-color: hsl(var(--hue-color), 30%, 10%);
  --container-color: hsl(var(--hue-color), 25%, 16%);
  --scroll-bar-color: hsl(var(--hue-color), 10%, 45%);
  --scroll-thumb-color: hsl(var(--hue-color), 10%, 32%);
}

body {
  transition: background-color 0.3s ease, color 0.3s ease;
}

/*==================== BASE ====================*/
* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0 0 var(--header-height) 0;
  font-family: var(--body-font);
  font-size: var(--normal-font-size);
  background-color: var(--body-color);
  color: var(--text-color);
}

h1, h2, h3, h4 {
  color: var(--title-color);
  font-weight: var(--font-semi-bold);
}

ul {
  list-style: none;
}

a {
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
}

/*==================== REUSABLE CSS CLASSES ====================*/
.section {
  padding: 2rem 0 4rem;
}

.section__title {
  font-size: var(--h1-font-size);
  color: var(--title-color);
}

.section__subtitle {
  display: block;
  font-size: var(--small-font-size);
  margin-bottom: var(--mb-3);
}

.section__title, 
.section__subtitle {
  text-align: center;
}

/*==================== LAYOUT ====================*/
.container {
  max-width: 768px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--mb-1-5);
  padding-right: var(--mb-1-5);
}

.grid {
  display: grid;
  gap: 1.5rem;
}

.header {
  width: 100%;
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: var(--z-fixed);
  background-color: var(--body-color);
}

/*==================== NAV ====================*/
.nav {
  max-width: 968px;
  height: var(--header-height);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--title-color);
  font-weight: var(--font-medium);
  font-size: var(--h3-font-size);
}

.nav__logo-img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.nav__logo:hover {
  color: var(--first-color);
}

.nav__toggle {
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--title-color);
}

.nav__toggle:hover {
  color: var(--first-color);
}

/*mobile devices*/
@media screen and (max-width: 767px) {
  .nav__menu {
    position: fixed;
    bottom: -100%;
    left: 0;
    width: 100%;
    background-color: var(--body-color);
    padding: 2rem 1.5rem 4rem;
    box-shadow: 0 -1px 4px rgba(0,0,0,.15);
    border-radius: 1.5rem 1.5rem 0 0;
    transition: bottom 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  }
}

.nav__list {
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.nav__item {
  align-items: center;
}

.nav__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: var(--small-font-size);
  color: var(--title-color);
  font-weight: var(--font-medium);
  cursor: pointer;
}

.nav__link:hover {
  color: var(--first-color);
}

.nav__icon {
  font-size: 1.2rem;
}

.nav__close {
  position: absolute;
  right: 1.3rem;
  bottom: .5rem;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--first-color);
}

.nav__close:hover {
  color: var(--first-color-alt);
}

.show-menu {
  bottom: 0 !important;
}

.active-link {
  color: var(--first-color) !important;
}

.scroll-header {
  box-shadow: 0 -1px 4px rgba(0,0,0,.15);
}

/*==================== HOME ====================*/
.home__container {
  gap: 1rem;
}

.home__content {
  padding-top: 3.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.home__data {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.home__emblem {
  margin-bottom: var(--mb-1-5);
}

.home__emblem-img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 8px 32px hsla(var(--hue-color), 70%, 50%, 0.25);
}

.home__title {
  font-size: var(--big-font-size);
  font-weight: 700;
  color: var(--first-color);
  margin-bottom: var(--mb-0-5);
}

.home__motto {
  font-size: var(--h2-font-size);
  color: var(--title-color);
  font-weight: var(--font-medium);
  margin-bottom: var(--mb-0-75);
  letter-spacing: 0.1em;
}

.home__description {
  margin-bottom: var(--mb-2);
  max-width: 400px;
  line-height: 1.8;
}

.home__scroll {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

.home__scroll-button {
  color: var(--first-color);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.home__scroll-button:hover {
  transform: translateY(0.25rem);
}

.home__scroll-mouse {
  font-size: 2rem;
}

.home__scroll-name {
  font-size: var(--small-font-size);
  color: var(--title-color);
  font-weight: var(--font-medium);
}

.home__scroll-arrow {
  font-size: 1.25rem;
}

/*==================== BUTTONS ====================*/
.button {
  display: inline-block;
  background-color: var(--first-color);
  color: #FFF;
  padding: 0.9rem 2rem;
  border-radius: 2rem;
  font-weight: var(--font-medium);
  transition: background-color 0.3s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.button:hover {
  background-color: var(--first-color-alt);
  transform: translateY(-2px);
}

.button__icon {
  font-size: 1.2rem;
  margin-left: var(--mb-0-5);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.button--flex {
  display: inline-flex;
  align-items: center;
}

.button--small {
  padding: .75rem 1.25rem;
}

/*==================== ABOUT ====================*/
.about__container {
  display: flex;
  justify-content: center;
}

.about__data {
  max-width: 600px;
  width: 100%;
  text-align: center;
}

.about__description {
  text-align: center;
  margin-bottom: var(--mb-2-5);
  line-height: 1.9;
}

.about__info {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  margin-bottom: var(--mb-2-5);
  flex-wrap: wrap;
}

.about__info-item {
  text-align: center;
}

.about__info-title {
  font-size: var(--h2-font-size);
  font-weight: var(--font-semi-bold);
  color: var(--first-color);
}

.about__info-name {
  font-size: var(--smaller-font-size);
  color: var(--text-color-light);
}

.about__info-title, .about__info-name {
  display: block;
  text-align: center;
}

/*==================== NEWS ====================*/
.news__container {
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.news__card {
  border-radius: 0.75rem;
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.news__card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px hsla(var(--hue-color), 60%, 40%, 0.12);
}

.news__card-bg {
  background: linear-gradient(135deg, hsl(var(--hue-color), 60%, 97%) 0%, hsl(var(--hue-color), 40%, 99%) 100%);
  padding: 1.25rem 1.5rem;
  border-radius: 0.75rem;
  border: 1px solid hsl(var(--hue-color), 30%, 90%);
}

.news__meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: var(--mb-0-5);
  color: var(--text-color-light);
  font-size: var(--smaller-font-size);
}

.news__meta-icon {
  font-size: 0.9rem;
  color: var(--first-color);
}

.news__date {
  font-size: var(--smaller-font-size);
}

.news__title {
  font-size: var(--h3-font-size);
  margin-bottom: var(--mb-0-5);
  color: var(--title-color);
}

.news__desc {
  font-size: var(--small-font-size);
  line-height: 1.7;
  color: var(--text-color);
}

/*==================== GALLERY ====================*/
.gallery__container {
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.gallery__card {
  border-radius: 0.75rem;
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery__card:hover {
  transform: translateY(-3px);
}

.gallery__img-wrap {
  position: relative;
  border-radius: 0.75rem;
  overflow: hidden;
}

.gallery__img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery__card:hover .gallery__img {
  transform: scale(1.05);
}

.gallery__overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, hsla(var(--hue-color), 70%, 30%, 0.7));
  padding: 1.5rem 1rem 0.8rem;
  text-align: center;
}

.gallery__label {
  color: #FFF;
  font-weight: var(--font-semi-bold);
  font-size: var(--h3-font-size);
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/*==================== CONTACT ====================*/
.contact__container {
  display: flex;
  justify-content: center;
}

.contact__info {
  max-width: 450px;
  width: 100%;
}

.contact__information {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: var(--mb-2);
  text-align: left;
}

.contact__icon {
  font-size: 1.5rem;
  color: var(--first-color);
  flex-shrink: 0;
}

.contact__title {
  font-size: var(--h3-font-size);
  font-weight: var(--font-medium);
  margin-bottom: 0.15rem;
}

.contact__subtitle {
  font-size: var(--small-font-size);
  color: var(--text-color-light);
}

/*==================== FOOTER ====================*/
.footer {
  padding-top: 2rem;
}

.footer__container {
  row-gap: 2rem;
  text-align: center;
}

.footer__bg {
  background: linear-gradient(135deg, hsl(var(--hue-color), 65%, 45%) 0%, hsl(var(--hue-color), 70%, 38%) 100%);
  padding: 2rem 0 3rem;
}

.footer__title {
  font-size: var(--h2-font-size);
  margin-bottom: var(--mb-0-25);
  color: #FFF;
}

.footer__subtitle {
  font-size: var(--small-font-size);
  color: hsla(0, 0%, 100%, 0.85);
}

.footer__links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer__link {
  color: hsla(0, 0%, 100%, 0.85);
  font-size: var(--small-font-size);
  transition: color 0.3s ease;
}

.footer__link:hover {
  color: #FFF;
}

.footer__copy {
  font-size: var(--smaller-font-size);
  text-align: center;
  color: hsla(0, 0%, 100%, 0.7);
  margin-top: var(--mb-2);
}

/*==================== SCROLL UP ====================*/
.scrollup {
  position: fixed;
  right: 1rem;
  bottom: -20%;
  background-color: var(--first-color);
  opacity: 0.85;
  padding: 0.35rem 0.5rem;
  border-radius: 0.4rem;
  z-index: var(--z-tooltip);
  transition: bottom 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.scrollup:hover {
  background-color: var(--first-color-alt);
  opacity: 1;
}

.scrollup__icon {
  font-size: 1.35rem;
  color: #FFF;
}

.show-scroll {
  bottom: 5rem;
}

/*==================== SCROLL BAR ====================*/
::-webkit-scrollbar {
  width: .5rem;
  background-color: var(--scroll-bar-color);
  border-radius: .5rem;
}

::-webkit-scrollbar-thumb {
  background-color: var(--scroll-thumb-color);
  border-radius: .5rem;
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--text-color-light);
}

/*==================== MEDIA QUERIES ====================*/
/* For small devices */
@media screen and (max-width: 350px) {
  .container {
      padding-left: var(--mb-1);
      padding-right: var(--mb-1);
  }
  .nav__menu {
      padding: 2rem .25rem 4rem;
  }
  .nav__list {
      column-gap: 0;
  }
  .home__emblem-img {
      width: 90px;
      height: 90px;
  }
  .about__info {
      gap: 1.5rem;
  }
}

/* For medium devices */
@media screen and (min-width: 568px) {
  .news__container {
      grid-template-columns: repeat(2, 1fr);
  }
  .gallery__container {
      grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (min-width: 768px) {
  .container {
      padding-left: 0;
      padding-right: 0;
  }

  body {
      margin: 0;
  }
  .section {
      padding: 6rem 0 2rem;
  }
  .section__subtitle {
      margin-bottom: 4rem;
  }
  .header {
      top: 0;
      bottom: initial;
  }

  .header,
  .main,
  .footer__container {
      padding: 0 1rem;
  }

  .nav {
      height: calc(var(--header-height) + 1.5rem);
  }
  .nav__icon,
  .nav__close,
  .nav__toggle {
      display: none;
  }

  .nav__list {
      display: flex;
      column-gap: 2rem;
  }

  .nav__menu {
      margin-left: auto;
  }

  .home__container {
      row-gap: 3rem;
  }

  .home__content {
      padding-top: 5rem;
  }

  .home__emblem-img {
      width: 150px;
      height: 150px;
  }

  .home__scroll {
      display: block;
  }

  .about__info {
      gap: 4rem;
  }

  .gallery__container {
      grid-template-columns: repeat(3, 1fr);
  }

  .footer__container {
      grid-template-columns: 1fr auto;
      text-align: left;
      align-items: center;
  }

  .footer__title {
      text-align: left;
  }

  .footer__links {
      justify-content: flex-end;
  }

  .footer__copy {
      text-align: center;
  }

  .footer__bg {
      padding: 3rem 0 3.5rem;
  }
}

/* For large devices */
@media screen and (min-width: 1024px) {
  .header,
  .main,
  .footer__container {
      padding: 0;
  }

  .home__emblem-img {
      width: 170px;
      height: 170px;
  }

  .news__container {
      grid-template-columns: repeat(2, 1fr);
  }
}
