:root {
  --primary-green: #008c6f;
  --primary-dark-green: #008c6f;
  --accent-yellow: #f1c232;
  --text-color: #333;
  --bg-color: #fff;
  --card-border: #008c6f;
  /*--font-main: "Outfit", sans-serif;*/
}

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

/*
body {
  font-family: var(--font-main);
  background-color: #f9f9f9;
  color: var(--text-color);
  line-height: 1.6;
}
*/

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/*
header {
  margin-bottom: 30px;
  border-bottom: 2px solid var(--primary-green);
  padding-bottom: 10px;
}
*/
/*
header h1 {
  font-size: 2.5rem;
  font-weight: 600;
  color: #000;
}
*/

/* Grid Layout */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
}

/* Card Styles */
.project-card {
  border: 2px solid var(--card-border);
  background: #fff;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.card-header {
  height: 100px; /* Fixed height for all headers */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px;
  font-weight: 700;
  font-size: 1.2rem;
  color: #fff;
  text-transform: uppercase;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.card-header.bourse {
  background-color: var(--primary-green);
  flex-direction: column;
  line-height: 1.2;
}

.card-header.appel {
  background-color: #fff;
  color: #000;
}

.card-body {
  padding: 15px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.card-title {
  color: var(--primary-green);
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 15px;
  text-transform: uppercase;
  text-align: center;
}

.card-header.appel + .card-body .card-title {
  color: #d49e00; /* Darker yellow for text readability */
}

.card-image-placeholder {
  width: 100%;
  height: 200px;
  border: 1px solid #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  background: #f0f0f0;
}

.card-image-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal.visible {
  opacity: 1;
  pointer-events: auto;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
}

.modal-wrapper {
  position: relative;
  width: 90%;
  max-width: 500px;
  /* Allow wrapper to be flexible but respect viewport */
  display: flex;
  flex-direction: column;
}

.modal-content {
  position: relative;
  background: #fff;
  width: 100%;
  max-height: 80vh; /* Reduced to ensure space for arrows/close button on mobile if needed */
  overflow-y: auto;
  z-index: 1001;
  padding: 0;
  border: 2px solid var(--primary-green);
  display: flex;
  flex-direction: column;
}

.modal-close {
  position: absolute;
  top: -40px; /* Outside top */
  right: 0;
  font-size: 2.5rem;
  background: none;
  border: none;
  cursor: pointer;
  color: #fff; /* White on dark overlay */
  z-index: 1002;
  line-height: 1;
}

/* Ensure hover state is visible */
.modal-close:hover {
  color: var(--accent-yellow);
}

.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #fff; /* White on overlay */
  z-index: 1002;
  padding: 10px;
  transition: color 0.2s;
}

.nav-btn:hover {
  color: var(--accent-yellow);
}

.prev-btn {
  left: -70px; /* Outside left */
}

.next-btn {
  right: -70px; /* Outside right */
}

/* Responsive Nav Buttons */
@media (max-width: 768px) {
  .modal-wrapper {
    width: 85%; /* Slightly smaller width to ensure arrows fit if we squeeze them, or just use bottom positioning */
  }

  .nav-btn {
    top: auto;
    bottom: -60px; /* Below the card */
    transform: none;
  }

  .prev-btn {
    left: 20%;
    right: auto;
  }

  .next-btn {
    right: 20%;
    left: auto;
  }

  .modal-close {
    top: -40px;
    right: 0px;
  }
}

.modal-header-image img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

.modal-body {
  padding: 20px;
  text-align: center;
}

.modal-info h2 {
  color: #d49e00;
  text-transform: uppercase;
  margin: 15px 0;
  font-size: 1.5rem;
}

.modal-info .description {
  font-style: italic;
  margin-bottom: 20px;
}

.modal-info .meta {
  margin-bottom: 10px;
}

.modal-info .meta span {
  text-decoration: underline;
  text-decoration-color: red;
  text-decoration-style: wavy;
}

.modal-main-image-container {
  margin-top: 20px;
  border: 1px solid var(--primary-green);
  height: 250px;
  background: #fff;
}

.modal-main-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hidden {
  display: none;
}
