/* ================================================================
   LANDING PAGE — Modern Bootstrap 5 Design
   Uses the CSS custom properties from theme-main.css
================================================================ */

/* ── Reset helpers ────────────────────────────────────────────── */
h1[id],
h2[id],
h3[id],
h4[id],
h5[id],
h6[id],
dt[id] {
  padding-top: 0;
  margin-top: 0;
}

/* ── Section rhythm ───────────────────────────────────────────── */
.section {
  padding-top: 80px;
  padding-bottom: 80px;
}

.section-header {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-heading);
  margin-bottom: 0;
}

.row {
  margin-bottom: 20px;
}

.row.less-bottom-margin {
  margin-bottom: 0;
}

/* ================================================================
   HERO SECTION
================================================================ */

.hero-section {
  position: relative;
  overflow: hidden;
  padding: 100px 0 80px;
  background: var(--surface-page);
}

/* Gradient glow behind the hero */
.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-hero-glow);
  pointer-events: none;
  z-index: 0;
}

.hero-section>.container {
  position: relative;
  z-index: 1;
}

h1.title {
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--text-heading);
  margin: 0 0 16px;
}

h1.title img {
  height: 0.9em;
  vertical-align: middle;
  position: relative;
  top: -2px;
}

h2.subtitle {
  font-size: clamp(1.05rem, 2.5vw, 1.3rem);
  font-weight: 400;
  color: var(--text-secondary);
  margin: 0 0 32px;
  line-height: 1.5;
}

/* CTA button row */
.action-button-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 0;
}

.action-button {
  border-radius: 8px;
  font-weight: 600;
  padding: 10px 20px;
  font-size: 0.9rem;
  transition: transform .15s ease, box-shadow .2s ease;
}

.action-button:hover {
  transform: translateY(-2px);
}

#github-button #stargazers {
  font-size: 0.82em;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  padding: 1px 7px;
  margin-left: 4px;
  vertical-align: middle;
}

/* Hero description — original text, lightly styled */
.hero-description p {
  font-size: 0.9375rem;
  /* same as --text-base */
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 0.85rem;
}

.hero-description strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Hero CTA buttons — pinned colors, no visited-purple bleed */
.action-button-container .action-button {
  color: inherit;
  text-decoration: none;
}

/* Star on GitHub — ghost / neutral */
#github-button .action-button,
#github-button .action-button:hover,
#github-button .action-button:visited {
  color: var(--text-primary) !important;
  border-color: var(--border-default);
  background: transparent;
}

#github-button .action-button:hover {
  background: var(--surface-overlay);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

/* Latest release — blue outline */
#latest-release .action-button,
#latest-release .action-button:hover,
#latest-release .action-button:visited {
  color: var(--blue-600) !important;
  border-color: var(--blue-400);
  background: transparent;
}

#latest-release .action-button:hover {
  background: rgba(58, 157, 212, 0.08);
  border-color: var(--blue-600);
  color: var(--blue-700, #085d93) !important;
  transform: translateY(-1px);
}

.hero-image {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ================================================================
   LATEST NEWS
================================================================ */

#latest-news {
  background-color: var(--surface-news);
  padding: 80px 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

#latest-news .section-header {
  margin-bottom: 40px;
  text-align: center;
}

#news-container {
  display: flex;
  gap: 24px;
}

#news-container .col-md-4 {
  flex: 1;
}

#latest-news a.no-external-marker::after {
  content: none !important;
}

.news-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 24px;
  height: 100%;
  box-shadow: var(--card-shadow);
  transition: box-shadow .25s ease, transform .2s ease, border-color .2s ease;
}

.news-card:hover {
  box-shadow: var(--card-shadow-hover);
  border-color: var(--card-border-hover);
  transform: translateY(-3px);
}

.news-card a.news-link {
  display: block;
  text-decoration: none;
  color: var(--text-primary);
}

.news-card a.news-link:hover {
  text-decoration: none;
}

.news-card h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-heading);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-bottom: 8px;
}

.news-card p:first-of-type {
  font-size: 0.875rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  line-clamp: 5;
  -webkit-box-orient: vertical;
}

@media (max-width: 768px) {
  #news-container {
    flex-wrap: wrap;
  }

  #news-container .col-md-4 {
    flex: 1 1 100%;
  }

  .news-card h4 {
    -webkit-line-clamp: 4;
    line-clamp: 4;
  }
}

/* ================================================================
   USP CARDS
================================================================ */

div.image-holder.usp {
  padding: 20px;
  flex: 0 1 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

div.image-holder.usp>img {
  height: 120px;
}

/* USP card override — lift + border on hover */
.panel-precice.usp {
  transition: box-shadow .25s ease, transform .2s ease, border-color .2s ease;
}

.panel-precice.usp:hover {
  box-shadow: var(--card-shadow-hover) !important;
  transform: translateY(-3px);
  border-color: var(--border-brand) !important;
}

.col-flex {
  display: flex;
  flex-direction: column;
}

.panel-precice {
  flex: 1 1 auto;
}

/* ================================================================
   ADAPTER CARDS
================================================================ */

a.adapter {
  text-decoration: none;
  display: block;
}

a.adapter>div {
  border-radius: 12px;
  border-color: var(--card-border);
  background: var(--card-bg);
  transition: box-shadow .2s, transform .2s, border-color .2s;
}

a.adapter:hover>div {
  box-shadow: var(--card-shadow-hover);
  border-color: var(--border-brand) !important;
  transform: translateY(-4px);
}

img.adapter {
  height: 100px;
  width: 100px;
  object-fit: contain;
  transition: transform 0.3s ease;
}

img.adapter:hover {
  transform: scale(1.08);
}

.img-equivalent {
  height: 100px;
  width: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.adapter p {
  color: var(--text-primary);
  margin-top: 16px;
  font-size: 0.875rem;
  font-weight: 500;
}

/* ================================================================
   TESTIMONIALS (dark section)
================================================================ */

/* ================================================================
   THEMED SECTIONS (background-dark)
   - Light Mode: Vibrant Blue with White Cards
   - Dark Mode: Original Dark-Glass aesthetic
================================================================ */

.background-dark {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Very compact section padding as requested */
.background-dark .section {
  padding-top: 30px !important;
  padding-bottom: 30px !important;
}

/* theme-specific background */
html:not([data-theme="dark"]) .background-dark {
  background-color: #0A76BB !important;
}

html[data-theme="dark"] .background-dark {
  background: linear-gradient(160deg, #0b1120 0%, #0d1828 100%) !important;
}

.background-dark .section-header {
  color: #ffffff !important;
  font-size: clamp(1.4rem, 4vw, 1.8rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 24px !important;
}

/* --- LIGHT MODE CARD STYLES --- */
html:not([data-theme="dark"]) .background-dark .card {
  background-color: #ffffff !important;
  border: none !important;
  border-radius: 10px !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  color: #000000 !important;
  padding: 16px 18px !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  height: 100%;
}

html:not([data-theme="dark"]) .background-dark .card p,
html:not([data-theme="dark"]) .background-dark .card strong,
html:not([data-theme="dark"]) .background-dark .card a {
  color: #000000 !important;
  opacity: 1 !important;
}

/* --- DARK MODE CARD STYLES (Original) --- */
html[data-theme="dark"] .background-dark .card {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 14px !important;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 24px !important;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  color: #c8d6e8 !important;
}

html[data-theme="dark"] .background-dark .card p,
html[data-theme="dark"] .background-dark .card a {
  color: #c8d6e8 !important;
}

/* Shared Typography */
.background-dark .card .quote {
  font-size: 0.95rem;
  line-height: 1.55;
  margin-bottom: 16px;
}

.background-dark .card .quote i {
  color: var(--orange-500);
}

.background-dark img.testimonial {
  border-radius: 50%;
  height: 50px;
  width: 50px;
  object-fit: cover;
  margin-right: 12px;
}

/* Buttons */
.background-dark .btn-primary {
  background-color: #ffffff !important;
  color: #0A76BB !important;
  border: none !important;
  font-weight: 700;
  padding: 8px 18px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.background-dark .btn-primary:hover {
  background-color: #f8f9fa !important;
  transform: translateY(-2px);
}


.vertical-align {
  display: flex;
  align-items: center;
}

.full-height {
  flex: 1 1 auto;
}

/* ================================================================
   OPEN SOURCE / CITATIONS SECTION
================================================================ */

.uni-logo {
  max-width: 100px;
}

.img-equivalent-uni-logo {
  height: 100px;
  width: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.github-link,
.github-link:hover {
  color: var(--text-primary);
  text-decoration: none;
}

.github-link p {
  padding-top: 0.75em;
}

.literature-link,
.next-steps-link {
  margin-top: 12px;
  margin-right: 8px;
}

/* ================================================================
   SUPPORT SECTION
================================================================ */

img.precice-support {
  max-height: 200px;
}

/* ================================================================
   FAQ CARDS
================================================================ */

.panel-precice.usp .panel-heading-precice {
  font-size: 0.95rem;
}

/* ================================================================
   LOGOWALL
================================================================ */

.logo,
.logo>div,
.logo>p {
  opacity: var(--logo-opacity, 0.55);
  filter: var(--logo-filter, grayscale(100%));
  transition: filter 0.25s ease, opacity 0.25s ease, transform 0.25s ease;
  color: var(--text-secondary);
}

.logo:hover,
.logo:hover>div,
.logo:hover>p {
  opacity: var(--logo-opacity-hover, 1);
  filter: var(--logo-filter-hover, grayscale(0%));
  text-decoration: none;
}

.logo:hover>div {
  transform: scale(1.08);
}

.logo>p {
  margin: 0;
  text-decoration: none;
}

p.institution {
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.2;
  margin-top: 0.4em;
  color: var(--text-secondary);
}

p.country {
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 0.8em;
  color: var(--text-tertiary);
}

div.logo-holder {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
}

div.logo-holder>img {
  max-height: 70px;
}

/* ================================================================
   LIGHT BACKGROUND SECTIONS
================================================================ */

.background-light {
  background-color: var(--surface-raised) !important;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.background-light .section-header {
  color: var(--text-heading);
}

/* ================================================================
   CODE DEMO SECTION
================================================================ */

.no-padding {
  padding: 0;
}

/* ================================================================
   RESPONSIVE
================================================================ */

@media (max-width: 992px) {
  .section {
    padding-top: 60px;
    padding-bottom: 60px;
  }

  .hero-section {
    padding: 80px 0 60px;
  }

  h1.title {
    font-size: clamp(1.875rem, 7vw, 2.5rem);
  }
}

@media (max-width: 768px) {
  .section {
    padding-top: 48px;
    padding-bottom: 48px;
  }

  .hero-section {
    padding: 72px 0 48px;
  }

  .action-button-container {
    flex-direction: column;
    align-items: flex-start;
  }
}