:root {
  --primary: #006666;
  --secondary: #ff6b6b;
  --light: #f5f5f5;
  --dark: #333333;
  
  --button-shadow: 1px 1px 4px 0 var(--dark);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, html[data-theme="light"] {
  --primary-color: var(--primary);
  --secondary-color: var(--secondary);
  --main-background-color: var(--light);
  --main-text-color: var(--dark);
}

html, html[data-theme="dark"] {
  --primary-color: var(--secondary);
  --secondary-color: var(--primary);
  --main-background-color: var(--dark);
  --main-text-color: var(--light);
}

@media (prefers-color-scheme: dark) {
  html, html[data-theme="dark"] {
    --primary-color: var(--secondary);
    --secondary-color: var(--primary);
    --main-background-color: var(--dark);
    --main-text-color: var(--light);
  }

  html, html[data-theme="light"] {
    --primary-color: var(--primary);
    --secondary-color: var(--secondary);
    --main-background-color: var(--light);
    --main-text-color: var(--dark);
  }
}

html, body {
  margin: 0;
  padding: 0;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: system-ui, sans-serif;
  background: var(--main-background-color);
  color: var(--main-text-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Styling navigation bar on top */
.navbar {
  background: var(--light);
  width: 100%;
  box-shadow: 0 0 20px 1px var(--primary-color);
}

.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  flex-wrap: wrap;            /* allows wrapping */
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* Navigation links */
.nav-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;            /* 👈 key */
  gap: 1rem 1.5rem;
  padding: 0;
  margin: 0;
  justify-content: center;
}

.nav-links a {
  text-decoration: none;
  color: var(--primary-color);
  font-weight: 500;
  white-space: nowrap;
  position: relative;   /* REQUIRED */
  padding-bottom: 0.5rem;
}

/* Active page */
.nav-links a.active {
  color: var(--secondary-color);
  font-weight: 600;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;

  width: 6px;
  height: 6px;
  background: var(--secondary-color);
  border-radius: 50%;

  transform: translateX(-50%) scale(0);
  transition: transform 0.25s ease;
}

.nav-links a.active::after {
  transform: translateX(-50%) scale(1);
}

/* Hover (non-active) */
.nav-links a:not(.active):hover {
  color: var(--secondary-color);
}

.nav-links .cta {
  background: var(--secondary-color);
  color: var(--light);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  box-shadow: var(--button-shadow);
}

.nav-links .cta:hover {
  border-radius: 12px;
}

.nav-links a.cta::after {
  background: var(--light);
  bottom: -10px;
}

.nav-links a.cta.active {
  background: var(--primary-color);
  color: var(--light);
  font-weight: 600;
}

.nav-links a.cta:hover {
  color: var(--light);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;           /* 👈 allows 2 rows */
  align-items: center;
  justify-content: center;
  gap: 1rem 1.5rem;          /* row gap / column gap */
  padding: 0.75rem 1rem;
}

.site-nav a {
  white-space: nowrap;       /* keeps individual links intact */
  font-size: 0.95rem;
}

.a {
  color: var(--secondary-color);
}

.hero {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: var(--light);
  padding: 5rem 1rem;
}

.hero-content {
  max-width: 1100px;
  margin: auto;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;   /* row gap | column gap */
}

.hero-buttons a {
  padding: 0.7rem 1.2rem;
  border-radius: 6px;
  text-decoration: none;
}

.btn-primary {
  background: var(--light);
  color: var(--primary);
  box-shadow: var(--button-shadow);
}

.btn-primary:hover {
  border-radius: 12px;
}

.btn-secondary {
  border: 1px solid var(--light);
  color: var(--light);
  box-shadow: var(--button-shadow);
}

.btn-secondary:hover {
  border-radius: 12px;
}

.section {
  max-width: 1100px;
  margin: auto;
  padding: 3rem 1rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  max-width: 1100px;
  margin: auto;
  padding: 2rem 1rem;
}

.card {
  background: var(--primary-color);
  padding: 1.5rem;
  border-radius: 12px;
  color: var(--main-background-color);
  box-shadow: 0 0 10px 0 var(--primary-color);
  text-align: center;
}

/* Footer design */
.site-footer {
  background: var(--light);
  width: 100%;
  box-shadow: 0 0 40px 1px var(--secondary);
  position: relative;
  bottom: 0;
}

.footer-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
}

.footer-title {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.footer-tagline {
  font-size: 0.9rem;
  color: #456;
}

.footer-links ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: var(--primary);
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-right {
  font-size: 0.85rem;
  color: #456;
}

.footer-license a,
.blog-content a,
.blog-author a,
.event-card a {
  color: var(--secondary);
  text-decoration: none;
}

/* Member page */
.members-grid {
  display: grid;
  gap: 2rem;
}

.member-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
}

.member-photo {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 1rem;
}

.member-role {
  font-size: 0.9rem;
  opacity: 0.8;
  margin-bottom: 0.5rem;
}

.member-affiliation {
  font-size: 0.85rem;
  opacity: 0.65;
  margin-bottom: 0.75rem;
}

.member-bio {
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.member-links a {
  margin: 0 0.4rem;
  font-size: 0.85rem;
  text-decoration: none;
}

.member-bio-wrapper {
  margin-bottom: 0.75rem;
}

.bio-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 0.85rem;
  opacity: 0.7;
  cursor: pointer;
  margin-bottom: 0.75rem;
}

.leaflet-tooltip {
  background: var(--light);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.8rem;
  color: var(--dark);
  box-shadow: 0 2px 6px var(--dark);
}


/* Icon colors */
.fa-youtube {
  color: #cc181e;
}

.member-icon {
  color: #666666;
}

.fa-discord {
  color: #7289da;
}

.fa-github {
  color: #000000;
}

.fa-heart {
  color: var(--secondary);
}

/* Blog index */
.blog-index h1 {
  margin-bottom: 0.5rem;
}

.blog-intro {
  max-width: 700px;
  margin-bottom: 2rem;
  opacity: 0.85;
}

.blog-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.blog-card {
  display: flex;
  gap: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #eee;
}

.blog-author-photo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
}

.blog-card-content h2 {
  margin: 0 0 0.25rem;
}

.blog-card-content a {
  text-decoration: none;
  color: var(--primary);
}

.blog-meta {
  font-size: 0.85rem;
  opacity: 0.7;
  margin-bottom: 0.5rem;
}

.blog-excerpt {
  max-width: 700px;
}

/* Blog post */
.blog-post h1 {
  margin-bottom: 1rem;
}

.blog-post-meta {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 2rem;
}

.blog-author-photo-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
}

.blog-author {
  font-weight: 600;
  margin: 0;
}

.blog-affiliation {
  font-size: 0.85rem;
  opacity: 0.7;
}

.blog-date {
  font-size: 0.8rem;
  opacity: 0.6;
}

.blog-content {
  max-width: 720px;
}

.blog-content p {
  line-height: 1.6;
  margin-bottom: 1.2rem;
}

/* Events */
.events-list {
  display: grid;
  gap: 2rem;
  margin-top: 1.5rem;
}

.event-card {
  background: var(--light);
  padding: 1.5rem 1.75rem;
  border-radius: 12px;
}

.event-meta {
  font-size: 0.8rem;
  color: #567;
  display: flex;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.event-type {
  font-weight: 600;
  color: var(--secondary);
}

.event-title {
  margin: 0.3rem 0 0.6rem;
}

.event-details {
  font-size: 0.85rem;
  color: #456;
  margin-bottom: 0.75rem;
}

.event-description p {
  margin-bottom: 0.5rem;
}

.event-link {
  margin-top: 0.75rem;
}

/* Media */
.media-placeholder {
  margin-top: 3rem;
  padding: 2.5rem;
  text-align: center;
  border-radius: 14px;
  background: var(--light);
}

.media-placeholder i {
  font-size: 3rem;
  color: #FF0000;
  margin-bottom: 1rem;
}


/* Adaptive web design */
/* Mobile */
@media (max-width: 600px) {
  .nav-container {
    justify-content: center;
  }

  .footer-container {
    text-align: center;
  }

  .hero-buttons {
    justify-content: center;
  }

  .hero-buttons a {
    width: 100%;
    text-align: center;
  }

  .blog-card {
    flex-direction: column;
  }

  .blog-post-meta {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Tablet */
@media (min-width: 601px) and (max-width: 1024px) {
  .members-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Desktop */
@media (min-width: 1025px) {
  .members-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}