/* ========== BEACH THEME for IFIRSE ========== */
:root {
  --sand:        #FDF7EC;
  --ocean:       #0f4b6e;
  --ocean-pale:  #3a7da8;
  --coconut:     #6b5e53;
  --white:       #ffffff;
  --light-sand:  #FDF7EC;
  --dark-text:   #2e2e2e;
  --max-width:   1400px;
}

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

body {
  font-family: "Georgia", "Times New Roman", serif;
  font-size: 18px; line-height: 1.6;
  color: var(--dark-text);

  /* Sand texture background */
  background-color: var(--sand);
  background-image: url('ifirse_bkg.jpg');
  background-repeat: repeat;
  background-size: auto;
  background-position: top left;
  background-attachment: fixed;     /* subtle parallax */
}
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}
/* ---------- HEADER ---------- */
header {
  position: relative;
  background: var(--ocean);         /* fallback colour */
  color: var(--white);
  padding: 2rem 0;
  text-align: center;
  border-bottom: 5px solid var(--coconut);

  /* Header panorama */
  background-image: url('ifirse_header01.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
}

header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: -1;
}

header h1 {
  font-size: 2.4rem;
  letter-spacing: 0.05em;
  position: relative;
  z-index: 1;
}

header .subtitle {
  font-style: italic;
  font-size: 2.0rem;
  opacity: 0.95;
   color: var(--sand);
  margin-top: 0.3rem;
  position: relative;
  z-index: 1;
  text-align: center;
  background: rgba(0, 0, 0, 0.35);
}

/* Language / toggles */
.lang-switch {
  position: absolute;
  top: 10px;
  right: 20px;
  z-index: 2;
  display: flex;
  gap: 0.5rem;
}

.lang-switch button {
  background: var(--white);
  color: var(--ocean);
  border: 1px solid var(--ocean);
  padding: 0.3rem 0.8rem;
  cursor: pointer;
  font-size: 1rem;
  border-radius: 4px;
}

.lang-switch button:hover {
  background: var(--ocean);
  color: var(--white);
}

body.lang-en .lang-vi { display: none; }
body.lang-vi .lang-en { display: none; }

/* ---------- Vietnamese typography ---------- */
.lang-vi,
.lang-vi h1, .lang-vi h2, .lang-vi h3, .lang-vi h4, .lang-vi h5,
.lang-vi p, .lang-vi li, .lang-vi a, .lang-vi span,
body.lang-vi {
  font-family: "Be Vietnam Pro", "Noto Serif", Georgia, serif;
}

/* ---------- NAVIGATION ---------- */
nav {
  background: var(--white);
  border-bottom: 2px solid var(--coconut);
  position: relative;
  z-index: 10;
}

nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}

nav li {
  position: relative;
}

nav a {
  display: block;
  padding: 0.8rem 1.2rem;
  color: var(--ocean);
  text-decoration: none;
  font-weight: bold;
  font-size: 1.3rem;
  transition: background 0.3s, color 0.3s;
}

nav a:hover,
nav a.active {
  background: var(--ocean);
  color: var(--white);
}

/* ---------- DROPDOWN MENU ---------- */
.submenu-toggle {
  display: none;           /* hidden on desktop, shown on mobile via JS */
  cursor: pointer;
  color: var(--ocean);
  font-size: 0.8rem;
  margin-left: 2px;
}

.has-submenu > a {
  padding-right: 1.5rem;
}

/* Submenu inside nav */
.submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--white);
  border: 1px solid var(--coconut);
  border-radius: 0 0 6px 6px;
  min-width: 220px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  z-index: 20;
}

.submenu li {
  display: block;
  width: 100%;
}

.submenu a {
  padding: 0.7rem 1rem;
  white-space: nowrap;
}

.has-submenu:hover .submenu {
  display: block;           /* show on hover (desktop) */
}

/* For mobile: toggle via JS adds class .submenu-open */
.has-submenu.submenu-open .submenu {
  display: block;
}

/* ---------- MAIN CONTENT ---------- */
main {
  padding: 2.5rem 0;
}

h2 {
  font-size: 1.7rem;
  background-color: var(--ocean);
  color: var(--white);
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  margin-bottom: 1.2rem;
  border-bottom: none;
}

h3 {
  font-size: 1.4rem;
background-color: var(--ocean);
  color: var(--white);
  margin: 1.5rem 0 0.6rem;
}

p {
  background-color: var(--sand);
  padding: 0.3em 0.6em;
  border-radius: 4px;
  margin-bottom: 1rem;
  text-align: justify;
}

/* ---------- CARDS ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.card {
  background: var(--light-sand);
  border: 1px solid var(--coconut);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.card h3 {
  margin-top: 0;
  font-size: 1.3rem;
  color: var(--ocean);
}

.card a {
  display: inline-block;
  margin-top: 1rem;
  color: var(--ocean);
  font-weight: bold;
  text-decoration: none;
  border-bottom: 2px solid var(--coconut);
}

.card a:hover {
  color: var(--coconut);
}

/* ---------- IMAGE CAROUSEL ---------- */
.slideshow {
  position: relative;
  max-width: 800px;
  margin: 2rem auto;
  border: 3px solid var(--coconut);
  border-radius: 8px;
  overflow: hidden;
}

.slideshow img {
  width: 100%;
  display: block;
  max-height: 400px;
  object-fit: cover;
}

.slideshow .prev, .slideshow .next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(107,94,83,0.7);
  color: white;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  padding: 0 0.6rem;
  border-radius: 3px;
  user-select: none;
}

.slideshow .prev { left: 10px; }
.slideshow .next { right: 10px; }
.slideshow .prev:hover, .slideshow .next:hover {
  background: rgba(107,94,83,0.9);
}

/* ---------- CONTACT FORM ---------- */
form label {
  display: block;
  margin-top: 1rem;
  font-weight: bold;
  color: var(--ocean);
}

form input, form textarea {
  width: 100%;
  padding: 0.6rem;
  margin-top: 0.3rem;
  border: 2px solid var(--coconut);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--light-sand);
}

form button {
  margin-top: 1.5rem;
  padding: 0.7rem 2rem;
  background: var(--ocean);
  color: white;
  font-weight: bold;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
}

form button:hover {
  background: var(--coconut);
}

/* ---------- TABLE (Scientific Committee) ---------- */
table {
  background: var(--light-sand);
  border-collapse: collapse;
}

th, td {
  border: 1px solid var(--coconut);
  padding: 0.6rem;
}

/* ---------- FOOTER ---------- */
footer {
  background: var(--ocean);
  color: var(--coconut);
  text-align: center;
  padding: 1.5rem 0;
  font-size: 0.9rem;
  margin-top: 2rem;
  border-top: 5px solid var(--coconut);
}

footer a {
  color: #ffd166;
  text-decoration: none;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 600px) {
  header h1 { font-size: 1.6rem; }
  nav ul {
    flex-direction: column;
    align-items: center;
  }
  .submenu {
    position: static;
    box-shadow: none;
    border: none;
    padding-left: 1rem;
  }
  .submenu-toggle {
    display: inline;    /* we'll use a span to show toggle on mobile */
  }
}

/* ---------- Added: language-switch active state ---------- */
.lang-switch button.active {
  background: var(--ocean);
  color: var(--white);
  font-weight: bold;
}

/* ---------- Added: parent menu item active when child is the current page ---------- */
nav .has-submenu > a.active {
  background: var(--ocean);
  color: var(--white);
}
nav .submenu a.active {
  background: var(--ocean);
  color: var(--white);
}

/* ---------- Added: Research Highlight card ---------- */
.research-highlight {
  margin: 1rem 0 2.5rem;
}
.highlight-card {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  background: var(--light-sand);
  border: 2px solid var(--coconut);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(15, 75, 110, 0.18);
}

/* ---------- Research-Highlight image: fill the grid cell ---------- */
.highlight-card .highlight-img {
  background: var(--ocean);
  min-height: 280px;
  position: relative;        /* NEW */
  overflow: hidden;
  /* remove: display:flex; align-items:center; justify-content:center; */
}
.highlight-card .highlight-img img {
  position: absolute;        /* NEW */
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.highlight-card .highlight-text {
  padding: 2rem;
  background: var(--light-sand);
}
.highlight-card .highlight-text p {
  background: transparent;
  padding: 0;
  margin-bottom: 1rem;
}
.highlight-tag {
  display: inline-block;
  background: var(--coconut);
  color: var(--white);
  padding: 0.25rem 0.8rem;
  border-radius: 4px;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.8rem;
}
.highlight-card h3 {
  background: transparent;
  color: var(--ocean);
  margin: 0 0 0.6rem;
  font-size: 1.4rem;
}
.highlight-link {
  display: inline-block;
  margin-top: 0.5rem;
  color: var(--ocean);
  font-weight: bold;
  text-decoration: none;
  border-bottom: 2px solid var(--coconut);
}
.highlight-link:hover { color: var(--coconut); }
@media (max-width: 700px) {
  .highlight-card { grid-template-columns: 1fr; }
  .highlight-card .highlight-img { min-height: 200px; }
}

/* ---------- Added: Activity / list-style page items ---------- */
.activity-list {
  list-style: none;
  background: var(--light-sand);
  border: 1px solid var(--coconut);
  border-radius: 8px;
  padding: 0.5rem 0;
  margin-bottom: 1.5rem;
}
.activity-list li {
  padding: 1rem 1.4rem;
  border-bottom: 1px solid rgba(107, 94, 83, 0.2);
}
.activity-list li:last-child { border-bottom: none; }
.activity-list .activity-date {
  display: inline-block;
  background: var(--ocean);
  color: var(--white);
  font-size: 0.85rem;
  font-weight: bold;
  padding: 0.15rem 0.7rem;
  border-radius: 4px;
  margin-right: 0.8rem;
  letter-spacing: 0.03em;
}
.activity-list .activity-title {
  font-weight: bold;
  color: var(--ocean);
}
.activity-list .activity-meta {
  display: block;
  font-size: 0.92rem;
  color: var(--coconut);
  margin-top: 0.3rem;
  font-style: italic;
}

/* ---------- Added: People grid for Organization page ---------- */
.org-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}
.org-card {
  background: var(--light-sand);
  border: 1px solid var(--coconut);
  border-radius: 8px;
  padding: 1.3rem;
  text-align: center;
}

/* ---------- Org avatar: image fills the circle ---------- */
.org-card .org-avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  position: relative;        /* NEW – becomes containing block */
  overflow: hidden;          /* NEW – clips image to circle  */
  background: var(--ocean);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.8rem;
  font-size: 1.5rem;
  font-weight: bold;
  font-family: Georgia, serif;
}

.org-card .org-name {
  font-weight: bold;
  color: var(--ocean);
  display: block;
  margin-bottom: 0.2rem;
}
.org-card .org-role {
  color: var(--coconut);
  font-size: 0.9rem;
  font-style: italic;
  display: block;
  margin-bottom: 0.3rem;
}
.org-card .org-affil {
  font-size: 0.85rem;
  color: var(--dark-text);
}


.org-card .org-avatar img {
  position: absolute;        /* NEW */
  inset: 0;                  /* fill the parent */
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


