:root {
  --color-primary: #00AEEF;
  --color-secondary: #00AEEF;
  --color-text-light: #666666;
}

@font-face {
  font-family: 'Lexend';
  src: url('../fonts/Lexend-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

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

body {
  font-family: 'Lexend', sans-serif;
  color: #333333;
  line-height: 1.6;
  background-color: #ffffff;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s;
}

ul {
  list-style: none;
}

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

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Lexend', sans-serif;
  font-weight: 700;
  color: #008cc9;
  margin-bottom: 1rem;
}

h1 {
  font-size: 2.5rem;
  line-height: 1.2;
}

h2 {
  font-size: 2rem;
  color: var(--color-primary);
}

h3 {
  font-size: 1.5rem;
  color: var(--color-primary);
}

p {
  margin-bottom: 1rem;
}

strong {
  font-weight: 700;
}

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

.btn {
  display: inline-block;
  padding: 10px 25px;
  background-color: var(--color-primary);
  color: #ffffff;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 0;
  transition: background-color 0.3s;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  letter-spacing: 1px;
}

.btn:hover {
  background-color: #008cc9;
}

.text-center {
  text-align: center;
}

.mt-md {
  margin-top: 2rem;
}

.mb-md {
  margin-bottom: 2rem;
}

header {
  background-color: #ffffff;
  padding-top: 2rem;
}

.header-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
}

@media (max-width: 768px) {
  .header-top {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }
}

.header-left {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.header-right {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
}

@media (max-width: 768px) {
  .header-right {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  .header-right .btn {
    display: none;
  }
}

@media (max-width: 768px) {
  .header-left {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }
}

.logo-area {
  display: flex;
  align-items: self-start;
  gap: 2rem;
}

.logo-ifapa-conecta {
  width: 300px;
}

.logo-junta-andalucia {
  margin-top: 0.5rem;
  width: 400px;
}

.main-nav {
  border-top: 1px solid var(--color-primary);
  border-bottom: 1px solid var(--color-primary);
}

.main-nav ul {
  display: flex;
  justify-content: space-between;
  padding: 15px 0;
}

@media (max-width: 768px) {
  .main-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0;
  }

  .main-nav li {
    display: none;
    text-align: center;
    border-bottom: 1px solid #eee;
  }

  .main-nav li:last-child {
    border-bottom: none;
  }

  /* Show the active one by default */
  .main-nav li:has(.active) {
    display: block;
    background-color: #f9f9f9;
  }

  /* When expanded, show all */
  .main-nav.expanded li {
    display: block;
  }

  .main-nav a {
    display: block;
    padding: 15px;
  }

  /* Add an arrow to the active item when collapsed */
  .main-nav:not(.expanded) li:has(.active) a::after {
    content: ' ▼';
    font-size: 0.8em;
  }

  .main-nav.expanded li:has(.active) a::after {
    content: ' ▲';
    font-size: 0.8em;
  }
}

.main-nav a {
  font-weight: 700;
  text-transform: uppercase;
  color: #333333;
  font-size: 0.9rem;
  letter-spacing: 2px;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--color-primary);
}

footer {
  background-color: #d0d0d0;
  color: #ffffff;
  padding: 3rem 0;
  margin-top: 2rem;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  /* Vertically align items */
  margin-bottom: 1rem;
  gap: 2rem;
}

@media (max-width: 900px) {
  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: 2rem;
    align-items: center;
  }
}

.footer-left {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
}

.footer-logo img {
  margin-top: 1rem;
  width: 150px;
  /* Reduced specific width for logo in footer */
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.footer-links a {
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: bold;
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

/* Center Section */
.footer-center {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  /* Allow it to take available space if needed */
  justify-content: center;
}

@media (max-width: 900px) {
  .footer-center {
    margin: 1rem 0;
  }
}

.location-icon img {
  width: 40px;
  height: auto;
}

.location-text p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
  color: #ffffff;
  text-align: left;
}

/* CTA Section */
.footer-cta {
  text-align: right;
}

/* Bottom Section */
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  /* Optional separator if desired, or just spacing */
  padding-top: 1rem;
}

@media (max-width: 768px) {
  .footer-bottom {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
  }
}

.footer-disclaimer p {
  margin: 0;
  font-size: 0.75rem;
  color: #ffffff;
  max-width: 600px;
  line-height: 1.3;
}

.footer-social {
  display: flex;
  gap: 1rem;
}

.footer-social a img {
  width: 24px;
  height: auto;
  opacity: 0.8;
  transition: opacity 0.3s;
}

.footer-social a:hover img {
  opacity: 1;
}

.main-image {
  position: relative;
  height: 200px;
  overflow: hidden;
  margin-bottom: 2rem;
}

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

.home-content {
  display: flex;
  gap: 4rem;
  align-items: flex-start;
  padding: 2rem 0;
}

@media (max-width: 768px) {
  .home-content {
    flex-direction: column;
    align-items: center;
    gap: 2rem;
  }
}

.home-graphic {
  flex: 0 0 300px;
}

@media (max-width: 768px) {
  .home-graphic {
    flex: 0 0 100px;
    width: 60%;
  }
}

.home-text {
  flex: 1;
  text-align: justify;
}

.home-text h2 {
  margin-top: 0;
  color: var(--color-primary);
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.program-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0rem;
  margin-top: 2rem;
}

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

.program-day {
  padding: 2rem 4rem 2rem 2rem;
  border-left: 1px solid var(--color-primary);
}

.program-day:first-child {
  border-left: none;
  padding-left: 4rem;
  padding-right: 2rem;
}

@media (max-width: 768px) {
  .program-day {
    border-right: none;
    border-left: none;
    padding: 0 1rem 1rem;
    margin-bottom: 2rem;
    border-bottom: none;
  }

  .program-day:first-child {
    border-right: none;
    border-left: none;
    border-bottom: 1px solid var(--color-primary);
    padding: 0 1rem 1rem;
  }
}

.program-day h2 {
  color: #252525;
  font-size: 1.8rem;
  margin-bottom: 2rem;
}

.program-item {
  margin-bottom: 2rem;
}

.program-item h3 {
  font-size: 1.2rem;
}

.program-item p {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  text-align: justify;
}

.speakers-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  margin-top: 2rem;
  justify-items: center;
}

@media (max-width: 768px) {
  .speakers-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

.speaker-card {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2rem;
}

.speaker-img {
  width: 120px;
  height: 120px;
  border: 1px solid var(--color-primary);
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

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

.speaker-info h3 {
  font-size: 1.3rem;
  margin-bottom: 0.2rem;
  color: var(--color-primary);
  text-transform: none;
  border-bottom: 1px solid var(--color-primary);
  padding: 0 1rem 0rem 0.3rem;
}

.speaker-role {
  text-transform: uppercase;
  font-size: 0.9rem;
  color: #666666;
  padding-left: 0.3rem;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4rem;
  margin-top: 2rem;
}

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

.news-item {
  margin-bottom: 2rem;
}

.news-item img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  margin-bottom: 1rem;
}

.news-item h3 {
  font-size: 1.2rem;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
  text-transform: none;
}

.news-item .read-more {
  color: var(--color-primary);
  font-size: 0.9rem;
  font-weight: bold;
}

.contact-container {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.contact-title {
  color: var(--color-primary);
  font-size: 2.5rem;
  margin: 1rem 0 2rem;
  text-align: left;
}

.contact-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  text-align: left;
}

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

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

@media (max-width: 768px) {
  .form-group {
    grid-column: span 2;
  }
}

.form-group.full-width {
  grid-column: span 2;
}

.form-group label {
  display: block;
  text-transform: uppercase;
  font-size: 0.8rem;
  margin-bottom: 5px;
  letter-spacing: 1px;
}

.form-group input {
  width: 100%;
  padding: 10px;
  background-color: #e0e0e0;
  border: none;
  font-size: 1rem;
}

.form-group textarea {
  width: 100%;
  padding: 10px;
  background-color: #e0e0e0;
  border: none;
  font-size: 1rem;
}

.form-submit {
  grid-column: span 2;
  text-align: right;
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.form-submit p {
  text-align: left;
  font-size: 0.6rem;
}

.form-submit #submit {
  margin-left: 1rem;
  max-height: 40px;
}

/* News Detail Styles */
.news-detail {
  max-width: 800px;
  margin: 0 auto;
  padding: 4rem 0;
}

.news-back-link {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--color-secondary);
  font-weight: bold;
}

.news-detail h1 {
  font-size: 2.5rem;
  color: var(--color-primary);
  margin-bottom: 1rem;
}

.news-detail .meta {
  color: var(--color-text-light);
  margin-bottom: 2rem;
  font-size: 0.9rem;
}

.news-error {
  padding: 4rem 0;
  text-align: center;
}

.news-error .btn {
  margin-top: 1rem;
}

.image-noticia-container {
  max-width: 800px;
  max-height: 400px;
  margin: 0 auto;
  text-align: center;
  overflow: hidden;
  margin-bottom: 2rem;
}

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

/* Contact Data Styles */
.form-contact-data {
  grid-column: span 2;
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
  text-align: left;
  gap: 2rem;
  border-top: 1px solid #eee;
  padding-top: 2rem;
}

.contact-person h3 {
  font-size: 0.9rem;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.contact-person p {
  margin-bottom: 0.2rem;
  font-size: 0.9rem;
}

.contact-person a {
  color: #333;
  text-decoration: underline;
}

@media (max-width: 768px) {
  .form-contact-data {
    flex-direction: column;
    gap: 2rem;
  }
}

/* Alert Styles */
.alert {
  padding: 15px;
  margin-bottom: 20px;
  border: 1px solid transparent;
  border-radius: 4px;
}

.alert.success {
  color: #3c763d;
  background-color: #dff0d8;
  border-color: #d6e9c6;
  padding-bottom: 0;
  margin-bottom: 3rem;
}

.alert.error {
  color: #a94442;
  background-color: #f2dede;
  border-color: #ebccd1;
  padding-bottom: 0;
  margin-bottom: 3rem;
}