/* style.css - Design system for Fondation Europatlas */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  /* Color Palette */
  --bg-primary: #FAF6F0; /* Ivory/Sand */
  --bg-secondary: #F3ECE3; /* Slightly darker sand for sections */
  --text-main: #2D2522; /* Charcoal with warm undertones */
  --text-muted: #6B5E5A; /* Muted brown-gray */
  --primary: #C85C40; /* Warm Terracotta */
  --primary-hover: #A9452B;
  --secondary: #E5A63C; /* Solar Ocre */
  --secondary-hover: #C68E2F;
  --white: #FFFFFF;
  --border-color: #E6DDD5;
  --success: #4A8B5B;
  --error: #C84A4A;
  --shadow: 0 10px 30px rgba(45, 37, 34, 0.06);
  --shadow-hover: 0 15px 40px rgba(45, 37, 34, 0.12);
  --border-radius: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --max-width: 1200px;
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  line-height: 1.25;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

button, .btn {
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  border: none;
  outline: none;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  text-decoration: none;
}

/* Typography Helpers */
.title-large {
  font-size: clamp(2.5rem, 5vw, 4rem);
  color: var(--white);
  margin-bottom: 1.5rem;
}

.title-section {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  color: var(--text-main);
  position: relative;
  padding-bottom: 1rem;
  margin-bottom: 2rem;
}

.title-section::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 4px;
  background-color: var(--primary);
  border-radius: 2px;
}

.text-lead {
  font-size: 1.25rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-bottom: 2rem;
}

/* Layout Containers */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

section {
  padding: 6rem 0;
}

.section-alt {
  background-color: var(--bg-secondary);
}

/* Header & Navigation */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(250, 246, 240, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

header.scrolled {
  padding: 0.5rem 0;
  box-shadow: var(--shadow);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
}

.logo svg {
  fill: currentColor;
  width: 32px;
  height: 32px;
}

nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-links a {
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
  padding: 0.5rem 0;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary);
  transition: var(--transition);
}

.nav-links a.active {
  color: var(--primary);
}

.nav-links a.active::after, .nav-links a:hover::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Language Selector */
.lang-selector {
  display: flex;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  overflow: hidden;
  background: var(--white);
}

.lang-btn {
  background: none;
  border: none;
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}

.lang-btn.active {
  background-color: var(--primary);
  color: var(--white);
}

/* Buttons */
.btn {
  padding: 0.8rem 1.8rem;
  border-radius: 50px;
  font-size: 0.95rem;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--white);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(200, 92, 64, 0.3);
}

.btn-secondary {
  background-color: var(--secondary);
  color: var(--white);
}

.btn-secondary:hover {
  background-color: var(--secondary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(229, 166, 60, 0.3);
}

.btn-outline {
  border: 2px solid var(--primary);
  color: var(--primary);
  background: transparent;
}

.btn-outline:hover {
  background-color: var(--primary);
  color: var(--white);
}

/* Pages Structure */
.page {
  display: none;
  padding-top: 80px; /* Space for fixed header */
  animation: fadeIn 0.4s ease;
}

.page.active {
  display: block;
}

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

/* Hero Section */
.hero {
  position: relative;
  height: 90vh;
  display: flex;
  align-items: center;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  margin-top: 0;
  padding-top: 80px;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to right, rgba(45, 37, 34, 0.8) 0%, rgba(45, 37, 34, 0.4) 100%);
}

.hero-content {
  position: relative;
  z-index: 10;
  max-width: 650px;
}

.hero-content p {
  color: #ECEAE7;
  font-size: 1.25rem;
  margin-bottom: 2.5rem;
}

/* Mission Section */
.mission-box {
  background-color: var(--white);
  padding: 4rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  border-left: 6px solid var(--primary);
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.mission-text {
  font-family: 'Outfit', sans-serif;
  font-size: 1.8rem;
  line-height: 1.4;
  color: var(--text-main);
  font-weight: 500;
  font-style: italic;
}

/* Card Grids */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2.5rem;
  margin-top: 3rem;
}

/* Project Cards */
.card-project {
  background: var(--white);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.card-project:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
}

.card-img {
  position: relative;
  height: 240px;
  overflow: hidden;
}

.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.card-project:hover .card-img img {
  transform: scale(1.05);
}

.card-tag {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background-color: var(--primary);
  color: var(--white);
  padding: 0.4rem 0.8rem;
  border-radius: 30px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.card-body {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.card-title {
  font-size: 1.4rem;
  color: var(--text-main);
  margin-bottom: 1rem;
}

.card-text {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.btn-card {
  align-self: flex-start;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-card svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  transition: var(--transition);
}

.btn-card:hover svg {
  transform: translateX(4px);
}

/* Featured Blog / News Section */
.featured-news {
  background-color: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-top: 3rem;
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  .featured-news {
    flex-direction: row;
  }
  .featured-news-img {
    width: 50%;
    min-height: 350px;
  }
  .featured-news-content {
    width: 50%;
  }
}

.featured-news-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-news-content {
  padding: 3.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-news-tag {
  color: var(--primary);
  text-transform: uppercase;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 1px;
  margin-bottom: 1rem;
}

.featured-news-title {
  font-size: 2rem;
  margin-bottom: 1rem;
}

/* About Page Styles */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4rem;
  align-items: center;
}

@media (min-width: 768px) {
  .about-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.about-img img {
  width: 100%;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

.values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 4rem;
}

.value-card {
  background-color: var(--white);
  padding: 3rem 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  text-align: center;
}

.value-icon {
  background-color: var(--bg-secondary);
  color: var(--primary);
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem auto;
}

.value-icon svg {
  width: 32px;
  height: 32px;
  fill: currentColor;
}

/* Filters for Projects */
.filters {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.filter-btn {
  background: var(--white);
  border: 1px solid var(--border-color);
  padding: 0.6rem 1.4rem;
  border-radius: 30px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.filter-btn.active, .filter-btn:hover {
  background-color: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

/* Contact Page Form & Layout */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4rem;
  margin-top: 3rem;
}

@media (min-width: 768px) {
  .contact-layout {
    grid-template-columns: 1.2fr 0.8fr;
  }
}

.contact-form-box, .info-box {
  background-color: var(--white);
  padding: 3rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.form-control {
  width: 100%;
  padding: 0.9rem 1.2rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  background-color: var(--bg-primary);
  color: var(--text-main);
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  background-color: var(--white);
}

.spam-challenge {
  background-color: var(--bg-secondary);
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.spam-label {
  font-weight: 700;
  color: var(--primary);
}

.info-item {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.info-icon {
  color: var(--primary);
  flex-shrink: 0;
}

.info-icon svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.info-text h4 {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.info-text p {
  color: var(--text-muted);
}

/* Map Mockup */
.map-mock {
  height: 250px;
  border-radius: var(--border-radius);
  overflow: hidden;
  position: relative;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-marker {
  position: absolute;
  color: var(--primary);
  animation: pulse 2s infinite;
}

.map-marker svg {
  width: 45px;
  height: 45px;
  fill: currentColor;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* Footer */
footer {
  background-color: #241E1C;
  color: #ECEAE7;
  padding: 4rem 0 2rem 0;
  border-top: 1px solid #332B28;
}

.footer-top {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid #332B28;
}

@media (min-width: 768px) {
  .footer-top {
    flex-direction: row;
    justify-content: space-between;
  }
}

.footer-brand {
  max-width: 350px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 1rem;
}

.footer-links-group {
  display: flex;
  gap: 4rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links h4 {
  color: var(--white);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.footer-links a:hover {
  color: var(--primary);
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.social-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #332B28;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
}

.social-icon:hover {
  background-color: var(--primary);
}

.social-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.footer-bottom {
  padding-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 0.85rem;
  color: #9C938F;
}

@media (min-width: 768px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
  }
}

/* Modal View details for Projects/Blog */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  background-color: rgba(45, 37, 34, 0.7);
  backdrop-filter: blur(8px);
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.modal.active {
  display: flex;
}

.modal-content {
  background-color: var(--bg-primary);
  border-radius: var(--border-radius);
  max-width: 950px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  animation: modalSlide 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlide {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  cursor: pointer;
}

.modal-close:hover {
  transform: rotate(90deg);
  background-color: var(--primary);
  color: var(--white);
}

.modal-close svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.modal-hero {
  position: relative;
  height: 350px;
}

.modal-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-body {
  padding: 3rem;
}

.modal-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

@media (min-width: 768px) {
  .modal-layout {
    grid-template-columns: 1.7fr 1.3fr;
  }
}

.modal-desc h3 {
  margin-bottom: 1.5rem;
}

/* Sidebar Info Block */
.modal-sidebar {
  background-color: var(--white);
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  align-self: start;
}

.sidebar-title {
  font-size: 1.2rem;
  color: var(--primary);
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--bg-secondary);
  padding-bottom: 0.5rem;
}

.sidebar-list {
  list-style: none;
}

.sidebar-item {
  margin-bottom: 1.25rem;
}

.sidebar-item:last-child {
  margin-bottom: 0;
}

.sidebar-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.sidebar-val {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  margin-top: 0.2rem;
}

/* Gallery inside modal */
.gallery-section {
  margin-top: 2rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.gallery-thumb {
  height: 90px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
}

.gallery-thumb.active {
  border-color: var(--primary);
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ADMIN PANEL STYLING */
.admin-login {
  max-width: 400px;
  margin: 5rem auto;
}

.admin-dashboard {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 70vh;
  gap: 2rem;
  margin-top: 2rem;
}

@media (max-width: 768px) {
  .admin-dashboard {
    grid-template-columns: 1fr;
  }
}

.admin-sidebar {
  background-color: var(--white);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.admin-nav-btn {
  width: 100%;
  padding: 0.8rem 1.2rem;
  border-radius: 8px;
  justify-content: flex-start;
  font-weight: 600;
  background: transparent;
  color: var(--text-muted);
  text-align: left;
}

.admin-nav-btn.active, .admin-nav-btn:hover {
  background-color: var(--bg-secondary);
  color: var(--primary);
}

.admin-nav-btn svg {
  margin-right: 0.75rem;
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.admin-content {
  background-color: var(--white);
  padding: 3rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
}

.admin-table th, .admin-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.admin-table th {
  font-weight: 700;
  color: var(--text-muted);
}

.action-btn-group {
  display: flex;
  gap: 0.5rem;
}

.mini-btn {
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
}

.mini-btn-edit {
  background-color: var(--bg-secondary);
  color: var(--text-main);
}

.mini-btn-delete {
  background-color: rgba(200, 74, 74, 0.1);
  color: var(--error);
}

.mini-btn-delete:hover {
  background-color: var(--error);
  color: var(--white);
}

.mini-btn-edit:hover {
  background-color: var(--primary);
  color: var(--white);
}

/* Bilingual Form Styling */
.bilingual-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (min-width: 992px) {
  .bilingual-form-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.form-lang-col {
  background-color: var(--bg-primary);
  padding: 2rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.form-lang-header {
  font-size: 1.1rem;
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

/* Translation Loader & Buttons */
.translate-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.btn-translate {
  background-color: var(--secondary);
  color: var(--white);
  font-size: 0.85rem;
  padding: 0.6rem 1.2rem;
  border-radius: 20px;
  gap: 0.5rem;
}

.btn-translate:hover {
  background-color: var(--secondary-hover);
}

.btn-translate.loading svg {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

/* Notifications toast */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background-color: var(--text-main);
  color: var(--white);
  padding: 1rem 2rem;
  border-radius: var(--border-radius);
  box-shadow: 0 10px 20px rgba(0,0,0,0.2);
  z-index: 3000;
  display: flex;
  align-items: center;
  gap: 1rem;
  animation: toastIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes toastIn {
  from { transform: translateY(100px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.toast.success {
  border-left: 5px solid var(--success);
}

.toast.error {
  border-left: 5px solid var(--error);
}

.toast.info {
  border-left: 5px solid var(--secondary);
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
  margin-bottom: 2rem;
}

/* Form URL Inputs for Multiple Images */
.image-list-input {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.image-input-item {
  display: flex;
  gap: 0.5rem;
}

.btn-icon {
  background-color: var(--bg-secondary);
  border-radius: 4px;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.btn-icon:hover {
  background-color: var(--primary);
  color: var(--white);
}

.btn-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}
