/* ============================================
   ΕΠΑΣΕΦ Project Website - Styles
   ============================================ */

/* === Reset & Base === */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.7;
  color: #2d3436;
  background: #fafafa;
}

a {
  color: #0984e3;
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: #074b83;
}

img {
  max-width: 100%;
  height: auto;
}

/* === Utility === */
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 5rem 0;
}

.section-title {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 3rem;
  position: relative;
}
.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: linear-gradient(135deg, #00509e, #003366);
  margin: 0.75rem auto 0;
  border-radius: 2px;
}

.section-subtitle {
  text-align: center;
  font-size: 1.35rem;
  font-weight: 600;
  color: #1a1a2e;
  margin-bottom: 1.5rem;
}

/* === Navbar === */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #e8e8e8;
  transition: box-shadow 0.3s;
}
.navbar.scrolled {
  box-shadow: 0 2px 20px rgba(0,0,0,0.08);
}
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.navbar-brand {
  font-size: 1.2rem;
  font-weight: 700;
  color: #003366;
  letter-spacing: -0.5px;
}
.navbar-brand span {
  color: #00509e;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 0.25rem;
  align-items: center;
}
.nav-links a {
  display: block;
  padding: 0.5rem 0.9rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #555;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}
.nav-links a:hover {
  background: #eef5ff;
  color: #003366;
}
.nav-links a.nav-active,
.nav-links a.nav-active:hover {
  color: #003366;
  background: #dce8fc;
  font-weight: 600;
}

/* === Language Toggle === */
.nav-lang-switch {
  margin-left: 0.5rem;
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 2px;
  background: #eef5ff;
  border: 1px solid #d0dcee;
  border-radius: 8px;
  padding: 3px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  transition: background 0.2s;
  line-height: 1;
}
.lang-toggle:hover {
  background: #dce8fc;
}

.lang-option {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  color: #777;
  transition: background 0.2s, color 0.2s;
}

.lang-option.active {
  background: #003366;
  color: #fff;
}

/* === Hero === */
.hero {
  padding: 9rem 0 5rem;
  background: linear-gradient(135deg, #003366 0%, #00509e 50%, #0a6bc5 100%);
  color: #fff;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(255,255,255,0.04) 0%, transparent 50%);
  pointer-events: none;
}

.hero h1 {
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
}
.hero .subtitle {
  font-size: 1.15rem;
  opacity: 0.9;
  max-width: 700px;
  margin: 0 auto 1.5rem;
  line-height: 1.6;
}
/* === Page Header (sub-pages like News) === */
.page-header {
  padding: 9rem 0 3.5rem;
  background: linear-gradient(135deg, #003366 0%, #00509e 50%, #0a6bc5 100%);
  color: #fff;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.page-header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(255,255,255,0.04) 0%, transparent 50%);
  pointer-events: none;
}
.page-header h1 {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

/* === News Teaser (homepage) === */
.news-teaser {
  background: #f0f4f8;
}

.news-teaser-btn {
  display: inline-block;
  background: linear-gradient(135deg, #00509e, #003366);
  color: #fff;
  padding: 0.85rem 2rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 1.05rem;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
}
.news-teaser-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,80,158,0.35);
  color: #fff;
}

.hero .code-badge {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  padding: 0.4rem 1.2rem;
  border-radius: 20px;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  margin-bottom: 1.5rem;
}

/* === EU Co-financing Badge === */
.eu-badge {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  background: rgba(255,255,255,0.12);
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.4;
  margin-top: 0.5rem;
}
.eu-badge svg {
  flex-shrink: 0;
}
.eu-badge-text {
  text-align: left;
  max-width: 320px;
}

.eu-badge-text small {
  display: block;
  font-size: 0.75rem;
  opacity: 0.8;
  margin-top: 0.2rem;
}

/* === Funding Section === */
.funding-section {
  background: #f0f4f8;
}

.funding-logos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.funding-banner {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  text-align: center;
}

.espa-frame-logo {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.funding-disclaimer {
  max-width: 780px;
  margin: 0 auto 2rem;
  text-align: center;
  font-size: 0.875rem;
  color: #555;
  line-height: 1.6;
  padding: 1.5rem;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #dde4ec;
}

/* === Budget Table === */
.funding-budget {
  max-width: 780px;
  margin: 0 auto;
}

.budget-table-wrap {
  overflow-x: auto;
}

.budget-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #dde4ec;
}

.budget-table th,
.budget-table td {
  padding: 0.85rem 1.25rem;
  text-align: left;
  font-size: 0.9rem;
}

.budget-table th {
  background: #003366;
  color: #fff;
  font-weight: 600;
}

.budget-table td {
  border-bottom: 1px solid #eef2f7;
}

.budget-table tr:last-child td {
  border-bottom: none;
}

.budget-table tbody tr:hover {
  background: #f5f9ff;
}

/* === About Section === */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.objective-card {
  background: #fff;
  padding: 1.75rem;
  border-radius: 12px;
  border: 1px solid #e8edf4;
  transition: transform 0.2s, box-shadow 0.2s;
}
.objective-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.06);
}

.objective-card .number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: #003366;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 50%;
  margin-bottom: 0.75rem;
}
.objective-card h3 {
  font-size: 1.05rem;
  color: #1a1a2e;
  margin-bottom: 0.5rem;
}
.objective-card p {
  font-size: 0.925rem;
  color: #555;
  line-height: 1.6;
}

.about-intro {
  max-width: 780px;
  margin: 0 auto 3rem;
  text-align: center;
  font-size: 1.05rem;
  color: #444;
  line-height: 1.7;
}

/* === Partners Section === */
.partners-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 2rem;
}

.partner-card {
  background: #fff;
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid #e8edf4;
  text-align: left;
  transition: transform 0.2s, box-shadow 0.2s;
}
.partner-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.06);
}
.partner-card.coordinator {
  border-color: #00509e;
  border-width: 2px;
}

.partner-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #eef5ff;
  margin: 0 auto 1rem;
}
.partner-icon svg {
  color: #003366;
}

.partner-card h3 {
  font-size: 1.15rem;
  color: #1a1a2e;
  margin-bottom: 0.25rem;
  text-align: center;
}
.partner-card > .role {
  display: block;
  width: fit-content;
  margin: 0 auto 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #00509e;
  background: #eef5ff;
  padding: 0.2rem 0.8rem;
  border-radius: 12px;
  text-align: center;
}

/* Partner detail grid */
.partner-details {
  margin: 1rem 0;
  padding: 0.75rem;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #eef2f7;
}

.partner-detail-grid {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 0.5rem;
  padding: 0.35rem 0;
  font-size: 0.85rem;
  border-bottom: 1px solid #eef2f7;
}
.partner-detail-grid:last-child {
  border-bottom: none;
}

.partner-detail-grid .detail-label {
  font-weight: 600;
  color: #555;
  white-space: nowrap;
}

.partner-detail-grid a {
  color: #0984e3;
  word-break: break-all;
}

/* Partner team */
.partner-team,
.partner-contact {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e8edf4;
}

.partner-team h4,
.partner-contact h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: #003366;
  margin-bottom: 0.5rem;
}

.partner-team ul,
.partner-contact ul {
  list-style: none;
  padding: 0;
}

.partner-team li,
.partner-contact li {
  font-size: 0.85rem;
  color: #555;
  padding: 0.2rem 0;
  line-height: 1.5;
}

/* === News Section === */
.news-section {
  background: #f0f4f8;
}

.news-list {
  max-width: 800px;
  margin: 0 auto;
}

.news-item {
  background: #fff;
  padding: 1.75rem;
  border-radius: 12px;
  border: 1px solid #e8edf4;
  margin-bottom: 1.5rem;
  transition: box-shadow 0.2s;
}
.news-item:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.04);
}

.news-date {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #00509e;
  background: #eef5ff;
  padding: 0.2rem 0.7rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}
.news-item h3 {
  font-size: 1.1rem;
  color: #1a1a2e;
  margin-bottom: 0.5rem;
}
.news-item .news-body {
  font-size: 0.925rem;
  color: #555;
  line-height: 1.7;
}
.news-item .news-body p {
  margin-bottom: 0.5rem;
}
.news-item .news-body p:last-child {
  margin-bottom: 0;
}

/* === News Call-to-Action === */
.news-cta {
  margin-top: 1.25rem;
  text-align: center;
}

.news-link-btn {
  display: inline-block;
  background: linear-gradient(135deg, #00509e, #003366);
  color: #fff;
  padding: 0.7rem 1.75rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
}
.news-link-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0,80,158,0.35);
  color: #fff;
}

.news-loading,
.news-empty,
.news-error {
  text-align: center;
  padding: 2rem;
  color: #888;
  font-size: 0.95rem;
}

.news-error {
  color: #d63031;
}

/* === Contact Section === */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.contact-card {
  background: #fff;
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid #e8edf4;
}
.contact-card h3 {
  font-size: 1.1rem;
  color: #1a1a2e;
  margin-bottom: 1rem;
}

.contact-detail {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  color: #555;
}
.contact-detail:last-child {
  margin-bottom: 0;
}
.contact-detail .icon {
  flex-shrink: 0;
  width: 20px;
  text-align: center;
  color: #003366;
  font-size: 1rem;
}
.contact-detail .label {
  font-weight: 600;
  color: #333;
}
.contact-detail a {
  color: #0984e3;
}

/* === Footer === */
.footer {
  background: #1a1a2e;
  color: #b0b8c4;
  padding: 2.5rem 0;
  text-align: center;
  font-size: 0.85rem;
}
.footer p {
  margin-bottom: 0.25rem;
}

/* === Back to Top === */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  background: #003366;
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s, transform 0.2s;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  z-index: 999;
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}
.back-to-top:hover {
  transform: translateY(-3px);
  background: #00509e;
}

/* === Responsive === */
@media (max-width: 768px) {
  .navbar .container {
    height: 56px;
  }

  .hamburger {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    padding: 0.5rem 1.5rem 1.5rem;
    border-bottom: 1px solid #e8e8e8;
    display: none;
    gap: 0;
  }
  .nav-links.open {
    display: flex;
  }
  .nav-links a {
    padding: 0.7rem 0;
    border-radius: 0;
    border-bottom: 1px solid #f0f0f0;
  }
  .nav-links a:last-child {
    border-bottom: none;
  }

  .nav-lang-switch {
    margin-left: 0;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e8e8e8;
  }

  .hero,
  .page-header {
    padding: 7rem 0 3.5rem;
  }
  .hero h1,
  .page-header h1 {
    font-size: 1.8rem;
  }
  .hero .subtitle {
    font-size: 1rem;
  }

  .eu-badge {
    flex-direction: column;
    text-align: center;
    padding: 1rem;
  }
  .eu-badge-text {
    text-align: center;
  }

  .section {
    padding: 3rem 0;
  }
  .section-title {
    font-size: 1.6rem;
    margin-bottom: 2rem;
  }

  .about-grid,
  .partners-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .partners-grid {
    grid-template-columns: 1fr;
  }

  .funding-logos {
    flex-direction: column;
    gap: 1.5rem;
  }

  .budget-table th,
  .budget-table td {
    padding: 0.6rem 0.75rem;
    font-size: 0.8rem;
  }

  .back-to-top {
    bottom: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .partner-detail-grid {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
}

@media (max-width: 480px) {
  .hero h1,
  .page-header h1 {
    font-size: 1.5rem;
  }
  .navbar-brand {
    font-size: 1rem;
  }
}
