/* ===GLOBAL STYLES=== */
* { box-sizing: border-box; margin:0; padding:0; font-family: Arial, sans-serif; }
body { line-height: 1.6; color: #333; background-color: #fff; }
h1,h2,h3{ font-weight:700; }
a { text-decoration:none; }
img { max-width:100%; display:block; }

/* ===HEADER=== */
header { 
  position: relative; 
  padding: 60px 20px 20px 20px; 
  background-color: #d35400; 
  border-bottom: 2px solid #a04000; 
  text-align:center; 
  color:#fff; 
}


.uniri-logo-left {
  position: absolute;
  top: 15px;
  left: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.uniri-logo,
.uniri-emblem {
  height: 50px;
  width: auto;
}


.lang-toggle-top { position:absolute; top:15px; right:15px; }
.lang-toggle-top button { 
  border:none; background:none; cursor:pointer; margin-left:8px; padding:2px; 
  transition: transform 0.2s, opacity 0.2s, box-shadow 0.2s; 
}
.lang-toggle-top button img { display:block; width:24px; height:auto; }

.header-container {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.logo-title {
  display: flex;
  align-items: center;
  gap: 25px;
  justify-content: center;
}
.project-logo { width: 100px; object-fit: contain; }

.header-container h1 { font-size:2.5rem; margin:0; text-align: left; }
.header-container p {
  font-size: 1.1rem;
  margin: 5px 0 0 0;
  padding-left: 2px;
  color: #fff;
  text-align: left;
}

.title-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.title-text h1 {
  margin: 0;
  font-size: 2.5rem;
  line-height: 1.1;
}
.title-text p {
  font-size: 1.8rem;
  line-height: 1.3;
  color: #ffe1c4;
}

.lang-toggle-top button.active,
.lang-toggle-nav button.active {
  transform: scale(1.1); 
  box-shadow: 0 0 8px #fff;
  opacity: 1;
}
.lang-toggle-top button:not(.active),
.lang-toggle-nav button:not(.active) {
  opacity: 0.6;
}

/* ===NAVIGATION=== */
nav {
  display: flex;
  background: #e67e22;
  padding: 8px 20px;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 1000;
}
.nav-left, .nav-right {
  flex: 1;
  display: flex;
  align-items: center;
}
.nav-center {
  display: flex;
  justify-content: center;
  gap: 25px;
  flex: 0 1 auto;
  flex-wrap: nowrap;
}
.nav-right {
  justify-content: flex-end;
  gap: 15px;
}
nav a {
  color: #fff;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.3s;
  white-space: nowrap; 
  display: inline-flex;
  align-items: center;
}
nav a:hover { color: #ffe1c4; }

/* Flags */
.lang-toggle-nav { display: none; gap: 8px; }
.lang-toggle-nav button { border:none; background:none; cursor:pointer; padding:2px; }
.lang-toggle-nav img { width:24px; height:auto; }

/* Go-to-top button */
.nav-up {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #fff;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  transition: transform 0.3s, box-shadow 0.3s;
}
.nav-up svg {
  stroke: #d35400;
  width: 18px;
  height: 18px;
}
.nav-up:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* ===SECTIONS=== */
section { padding:50px 20px; max-width:1200px; margin:0 auto; }
section:nth-of-type(odd){ background-color:#ffffff; }
section:nth-of-type(even){ background-color:#fff6ed; }
section h2{ text-align:center; margin-bottom:15px; font-size:2rem; color:#a04000; }


/* ===ABOUT SECTION=== */
.about-image-left {
  float: left;
  width: 400px;
  height: auto;
  margin-right: 20px;
  margin-bottom: 15px;
  border-radius: 8px;
}

#about p {
  font-size: 1rem;
  line-height: 1.6;
  text-align: justify;
  overflow: hidden;       /* clears float for long text */
}

#about p span.hr,
#about p span.en {
  display: inline;         /* still works with language toggle */
}

/* ===TEAM SECTION=== */
.team-members { display:flex; flex-direction:column; gap:30px; }
.team-member { display:flex; align-items:center; gap:20px; text-align:left; }
.team-member img { width:120px; height:120px; border-radius:50%; object-fit:cover; border:3px solid #a04000; flex-shrink:0; }
.team-member .member-info { display:flex; flex-direction:column; }
.team-member h3 { font-size:1.1rem; margin-bottom:5px; color:#d35400; }
.team-member p { font-size:0.9rem; color:#555; }

/* ===ACTIVITIES SECTION=== */
#activities { padding: 50px 20px; max-width: 1200px; margin: 0 auto; }
#activities h2 { text-align: center; margin-bottom: 40px; font-size: 2rem; color:#a04000; }
.activities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 25px;
}
.activity-card {
  background: #fff6ed;
  border-radius: 12px;
  padding: 25px 20px;
  text-align: center;
  transition: transform 0.3s, box-shadow 0.3s;
}
.activity-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}
.activity-icon { font-size: 2.5rem; margin-bottom: 15px; color:#e67e22; }
.activity-card h3 { font-size: 1.2rem; margin-bottom: 10px; color: #d35400; }
.activity-card p { font-size: 0.95rem; color: #555; text-align: left; }

/* ===PUBLICATIONS SECTION=== */
.publications-list { list-style-type: disc; padding-left:40px; }
.publications-list li { margin-bottom:10px; }

/* ===GOALS SECTION=== */
.goals-list { list-style: none; padding-left: 0; }
.goals-list li { font-size: 1rem; color: #555; margin-bottom: 20px; display: flex; align-items: center; }
.goal-icon { font-size: 1.5rem; margin-right: 10px; color: #d35400; flex-shrink: 0; }

/* ===CONTACT SECTION=== */
.contact-info { text-align:center; }
.contact-info p { margin-bottom:0px; }

/* ===FOOTER=== */
footer {
  background-color: #e67e22;
  padding: 30px 20px;
  color: #fff;
  border-top: 2px solid #a04000;
  text-align: center;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px; /* space between logo+emblem and text */
  flex-wrap: wrap; /* wrap on small screens */
  position: relative;
}

.footer-logo-wrapper {
  display: flex;
  align-items: center; /* vertical center of logo and emblem */
  gap: 10px; /* space between logo and emblem */
}

.footer-logo,
.footer-emblem {
  height: 50px; /* match heights */
  width: auto;
  flex-shrink: 0;
}


.footer-text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.3;
  color: #fff; /* or #ffcc00 for yellow style */
  text-align: center;
  max-width: 600px;
}

/* ===RESPONSIVE=== */
@media(max-width:768px){
header {
    padding: 10px 10px 10px 10px;
    text-align: left;
    position: relative;
    width: 100%;
  }
  
  

  /* Top row: UNIRI logos left, flags right */
  .header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 5px;
  }

  .uniri-logo-left {
    display: flex;
    align-items: center;
    gap: 5px;
    position: static; /* remove desktop absolute */
  }

  .uniri-logo,
  .uniri-emblem {
    height: 45px;
    width: auto;
  }

  .lang-toggle-top {
    top: 10px;
    right: 10px;
    gap: 4px;
  }

  .lang-toggle-top button img {
    width: 20px;
    height: auto;
  }

  /* Project logo + title */
  .header-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* align left for row layout */
    width: 100%;
    max-width: 100%;
    margin: 0;
  }



  
  .logo-title {
    display: flex;
    flex-direction: row;       
    align-items: center;       /* vertically center title relative to logo */
    gap: 10px;
    width: 100%;
    padding: 10px 10px 15px 10px;           /* add 10px space on left and right */
    box-sizing: border-box;    /* include padding in width calculation */
  }
  
 
  .project-logo {
    flex: 0 0 80px;            /* fixed logo width */
    height: auto;
  }


  .title-text {
    flex: 1 1 auto;            /* take remaining space */
    max-width: calc(100% - 80px - 10px); /* remaining width next to logo */
  }

  .title-text p {
    margin: 0;
    font-size: 1.2rem;         /* smaller font for mobile */
    line-height: 1.1;
    text-align: left;
    word-break: break-word;     /* allow wrapping */
    overflow-wrap: break-word;
  }


  .title-text br {
    display: none;          /* remove desktop <br> */
  }

  

  .team-members{ flex-direction:column; gap:25px; }
  .team-member{ flex-direction:column; text-align:center; align-items:center; }
  .team-member img{ margin-bottom:10px; }
  .footer-logo { position: static; transform: none; display: block; margin: 0 auto 10px auto; }
  footer { text-align: center; }
  
    nav {
    flex-wrap: wrap;
    padding: 10px 5px; /* minimal padding */
  }

  .nav-left,
  .nav-right {
    width: 100%;
    margin-bottom: 3px; /* small spacing */
    text-align: center;
  }

  .nav-center {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    gap: 5px; /* tiny space between links */
  }

  .nav-center a {
    flex: 1 1 30%;       /* 3 items per row */
    max-width: 30%;      /* constrain width */
    margin: 1px 1px;     /* minimal spacing between links */
    padding: 3px 2px;    /* small padding inside links */
    font-size: 1.0rem;   /* smaller text */
    line-height: 1.1;    /* tighter lines */
    text-align: center;
  }

  
}

