/*
 * Custom stylesheet for Barras.cl website
 *
 * This file defines the colour palette, typography and layout
 * rules used across the site.  It avoids any third‑party
 * frameworks and instead uses native CSS features such as flexbox
 * and CSS Grid to create a responsive, modern design.  Variables
 * declared on the :root selector make it easy to tweak the
 * appearance globally.  Additional helper classes for cards and
 * interactive sections live below.
 */

/* Colour palette */
:root {
  /* Core brand colours inspired by the Chilean flag */
  --primary-color: #d62828;      /* strong red */
  --secondary-color: #023e8a;    /* deep navy blue */
  --accent-color: #fcbf49;       /* warm amber for highlights */
  --light-color: #f8f9fa;        /* very light grey for backgrounds */
  --dark-color: #0a0a23;         /* near black for text and contrast */
}

/* Reset and basic styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--dark-color);
  background-color: var(--light-color);
}

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

a:hover {
  text-decoration: underline;
}

/* Navigation bar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--secondary-color);
  padding: 0.75rem 1rem;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar .logo {
  display: flex;
  align-items: center;
  color: #ffffff;
  font-size: 1.4rem;
  font-weight: bold;
}

.navbar .logo img {
  height: 40px;
  width: 40px;
  margin-right: 0.5rem;
}

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

.nav-links li a {
  color: #ffffff;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  transition: background-color 0.3s;
  font-weight: 500;
}

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

/* Mobile navigation */
.mobile-menu-icon {
  display: none;
  font-size: 1.8rem;
  color: #ffffff;
  cursor: pointer;
}

/* Hero section */
.hero {
  position: relative;
  min-height: 60vh;
  width: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  z-index: 0;
}

.hero-content {
  position: relative;
  text-align: center;
  z-index: 1;
  max-width: 90%;
}

.hero-content h1 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.hero-content p {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
}

.btn-primary {
  display: inline-block;
  background-color: var(--primary-color);
  color: #ffffff;
  padding: 0.7rem 1.4rem;
  border-radius: 25px;
  font-weight: 600;
  transition: background-color 0.3s;
}

.btn-primary:hover {
  background-color: #a4161a;
  text-decoration: none;
}

/* Containers */
.main-container {
  width: 90%;
  max-width: 1200px;
  margin: 2rem auto;
}

.section {
  margin-bottom: 2.5rem;
}

.section-title {
  font-size: 2rem;
  color: var(--secondary-color);
  margin-bottom: 1rem;
  border-bottom: 3px solid var(--accent-color);
  display: inline-block;
  padding-bottom: 0.25rem;
}

/* Cards for home page sections */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.card {
  background-color: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
}

.card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.card-content {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-content h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.4rem;
  color: var(--secondary-color);
}

.card-content p {
  flex: 1;
  margin-bottom: 0.75rem;
  color: #555555;
}

.card-content a {
  align-self: flex-start;
  color: var(--primary-color);
  font-weight: 600;
}

/* Profile cards */
.profiles-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.profile-card {
  background-color: #ffffff;
  border-left: 6px solid var(--secondary-color);
  border-radius: 4px;
  padding: 1rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.profile-card h3 {
  margin-top: 0;
  color: var(--primary-color);
}

.profile-card .summary {
  margin-bottom: 0.5rem;
  color: #444444;
}

.profile-card .details {
  display: none;
  margin-top: 0.5rem;
  color: #333333;
}

.profile-card button {
  background-color: var(--secondary-color);
  color: #ffffff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  font-size: 0.9rem;
}

.profile-card button:hover {
  background-color: var(--primary-color);
}

/* Chronicle and article sections */
.chronicle, .article {
  background-color: #ffffff;
  border-left: 6px solid var(--accent-color);
  border-radius: 4px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.chronicle h3, .article h3 {
  margin-top: 0;
  color: var(--primary-color);
}

.chronicle .details, .article .details {
  display: none;
  margin-top: 0.5rem;
  color: #333333;
}

.chronicle button, .article button {
  background-color: var(--secondary-color);
  color: #ffffff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  font-size: 0.9rem;
}

.chronicle button:hover, .article button:hover {
  background-color: var(--primary-color);
}

/* Ordered list styling within articles */
article ol {
  padding-left: 1.25rem;
  margin-bottom: 1rem;
}

article ol li {
  margin-bottom: 0.5rem;
}

/* Footnotes */
.footnotes {
  font-size: 0.8rem;
  margin-top: 2rem;
  color: #666666;
  border-top: 1px solid #dddddd;
  padding-top: 1rem;
}

.footnotes ol {
  list-style: none;
  padding-left: 0;
}

.footnotes li {
  margin-bottom: 0.3rem;
}

.footnotes a {
  color: var(--primary-color);
}

/* Back to top button */
#backToTop {
  position: fixed;
  bottom: 40px;
  right: 40px;
  background-color: var(--primary-color);
  color: #ffffff;
  border: none;
  padding: 0.7rem 0.9rem;
  border-radius: 50%;
  font-size: 1.4rem;
  cursor: pointer;
  display: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  z-index: 500;
}

#backToTop:hover {
  background-color: #a4161a;
}

/* Responsive adjustments */
@media (min-width: 768px) {
  .profiles-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .profiles-container {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    height: 100%;
    width: 220px;
    background-color: var(--secondary-color);
    flex-direction: column;
    padding-top: 4rem;
    gap: 1rem;
    transition: right 0.3s ease;
  }
  .nav-links.open {
    right: 0;
  }
  .mobile-menu-icon {
    display: block;
  }
}