/* =========================================
   1. Reset & Base Styles
   ========================================= */
* {
  box-sizing: border-box; /* Fixes padding/width calculation issues */
}

body {
  font-family: 'League Spartan', sans-serif;
  margin: 0;
  background-color: #fefefe;
  color: #111;
  line-height: 1.6;
}

/* =========================================
   2. Layout & Container
   ========================================= */
.container {
  max-width: 1100px;
  margin: auto;
  padding: 2rem;
  width: 90%; /* Responsive width for mid-sized screens */
}

/* =========================================
   3. Typography
   ========================================= */
h1 {
  font-size: clamp(1.5rem, 4vw, 2.5rem); /* Fluid scaling */
  margin-bottom: 1.5rem;
  color: #333;
  text-align: center;
}

h2 {
  color: #333;
  text-align: left;
  margin-top: 2rem;
}

a {
  text-decoration: none;
  color: inherit;
}

a:hover {
  text-decoration: underline;
}

.abstract-text {
  text-align: justify;
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.caption {
  text-align: center;
  font-style: italic;
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.9em;
  color: #555;
}

/* =========================================
   4. Header Components (Logos, Authors, Announcement)
   ========================================= */
.logos-container {
  display: flex;
  justify-content: center; /* Centers them in the middle */
  align-items: center;     /* Aligns them vertically */
  gap: 40px;               /* Adds generous space between logos */
  padding: 20px 0;
  margin-bottom: 30px;
  flex-wrap: wrap;         /* Allows wrapping on tiny screens */
}

.logos-container img {
  height: 70px;            /* Fixed height makes them look uniform */
  width: auto;             /* Width adjusts automatically to keep aspect ratio */
  max-width: 100%;         /* Prevents them from overflowing on mobile */
  object-fit: contain;     /* Ensures they are never squashed/stretched */
  opacity: 0.9;            /* Slight transparency blends them better */
  transition: opacity 0.3s ease;
}

.logos-container img:hover {
  opacity: 1;              /* Full brightness on hover */
}
.authors {
  text-align: center;
  color: #000205;
  font-size: 1.1em;
  font-weight: 500;
  line-height: 1.3; /* Tightened for better grouping */
  margin-bottom: 1rem;
}

.authors a {
  color: #111;
  font-weight: 600;
}

.announcement {
  text-align: center;
  margin-top: 0; /* Removes gap between authors and text */
  margin-bottom: 1.5rem;
  font-size: 1.2em;
  color: #d32f2f; /* Standard academic red */
  font-weight: bold;
}

/* =========================================
   5. Images & Videos
   ========================================= */
.teaser {
  display: block;
  width: 80%; /* Prominent but not overwhelming */
  max-width: 100%;
  height: auto;
  margin: 2rem auto 0.5rem auto; /* Bottom margin reduced for caption */
}

.result-img {
  display: block;
  max-width: 100%;
  margin: 2rem auto;
}

video {
  display: block;
  width: 100%;
  max-width: 720px;
  margin: 2rem auto;
}

.full-width-video {
  width: 100%;
  max-width: none;
  margin: 2rem 0;
}

/* =========================================
   6. Results Grid (Cards)
   ========================================= */
.results-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-top: 2rem;
}

.result-item {
  width: calc(50% - 10px); /* 2 columns with gap */
  display: flex;
  flex-direction: column;
}

.prompt-label {
  background-color: #f4f4f4;
  padding: 10px;
  border: 1px solid #ddd;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  font-size: 0.85em;
  font-weight: bold;
  text-align: left;
}

.result-vid {
  width: 100% !important;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid #ddd;
  border-radius: 0 0 8px 8px;
  margin: 0 !important; /* Overrides global video margin */
}

/* =========================================
   7. Footer & Misc
   ========================================= */
pre {
  background-color: #f0f0f0;
  padding: 15px;
  border-radius: 5px;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: monospace;
  font-size: 0.9em;
  text-align: left;
  border: 1px solid #ddd;
}

footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid #eee;
  text-align: center;
  font-size: 0.9em;
  color: #666;
}

footer a {
  color: #3366cc;
}

/* =========================================
   8. Media Queries (Mobile)
   ========================================= */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
    width: 95%;
  }

  /* Stack results vertically */
  .result-item {
    width: 100%;
  }

  .teaser {
    width: 100%;
  }

  .logos-container {
    gap: 15px;
  }

  pre {
    font-size: 0.8rem; /* Prevents code overflow */
  }
}