/* Sankofa Calgary */

/* Color Palette */
:root {
  --primary-color: #8B4513;
  --secondary-color: #DAA520;
  --accent-color: #2E8B57;
  --text-color: #333;
  --light-text-color: #f8f8f8;
  --background-color: #fdfaf6;
}

/* Global Styles */
body {
  font-family: 'Roboto', sans-serif;
  margin: 0;
  padding: 0;
  color: var(--text-color);
  background-color: var(--background-color);
  line-height: 1.7;
  scroll-behavior: smooth;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

h1, h2, h3, h4 {
  font-family: 'Playfair Display', serif;
  color: var(--primary-color);
  margin-bottom: 0.8em;
}

h1 {
  font-size: 2.8em;
}

h2 {
  font-size: 2.4em;
  text-align: center;
}

h3 {
  font-size: 2em;
}

h4 {
  font-size: 1.4em;
  color: var(--accent-color);
}

a {
  text-decoration: none;
  color: var(--primary-color);
  transition: color 0.3s ease;
}

a:hover {
  color: var(--accent-color);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Buttons */
.btn, .btn-small {
  display: inline-block;
  background-color: var(--secondary-color);
  color: var(--light-text-color);
  padding: 12px 25px;
  border-radius: 5px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: background-color 0.3s ease;
  border: none;
  cursor: pointer;
}

.btn:hover, .btn-small:hover {
  background-color: var(--accent-color);
}

.btn-small {
  padding: 8px 18px;
  font-size: 0.9em;
}

/* Header */
header {
  background-color: #fff;
  padding: 15px 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
}

/* Header layout fix */
.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.header-section {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Prevent logo from shrinking */
.logo {
  flex: 0 0 auto;
}

/* Allow social and nav sections to grow equally */
.social-links,
.nav-links {
  flex: 1;
  display: flex;
  justify-content: center;
}

/* Logo stays centered and styled */
.logo a {
  font-family: 'Playfair Display', serif;
  font-size: 1.8em;
  font-weight: bold;
  color: var(--primary-color);
  text-decoration: none;
}

/* Social links styled like nav */
.social-links a {
  font-weight: bold;
  font-size: 1.1em;
  color: var(--text-color);
  text-decoration: none;
  margin: 0 12px;
  transition: color 0.3s ease;
}

.social-links a:hover {
  color: var(--primary-color);
}

/* Nav styling */
.nav-links ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.nav-links li {
  margin: 0 12px;
}

.nav-links a {
  font-weight: bold;
  font-size: 1.1em;
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

.nav-links a:hover {
  color: var(--primary-color);
}

/* Hero Section */
.hero-section {
  position: relative;
  overflow: hidden;
  height: 70vh;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 100px 0;
  color: var(--light-text-color);
}

.hero-bg {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: opacity 1.5s ease, transform 1.5s ease;
  z-index: 0;
  opacity: 0;
  transform: translateX(100%);
}

.hero-bg.active {
  opacity: 1;
  transform: translateX(0);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding: 20px;
}

.hero-content h2 {
  font-size: 3.5em;
  margin-bottom: 0.5em;
  color: var(--light-text-color);
}

.hero-content p {
  font-size: 1.3em;
  margin-bottom: 1.5em;
  font-weight: 300;
}

/* About Section */
.about-section {
  padding: 60px 0;
  background-color: #fdfaf6;
}

.about-content {
  display: flex;
  gap: 10rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.about-text,
.about-media {
  flex: 1 1 320px;
  min-width: 280px;
}

.about-media video {
  width: 100%;
  height: auto;
  max-width: 720px;
  border-radius: 10px;
  background: #000;
}

/* Donate Button */
.donate-button-wrapper {
  margin-top: 100px;
  text-align: center;
}

#donateBtn {
  font-size: 1.2em;
  padding: 16px 32px;
  background-color: var(--secondary-color);   
  color: var(--light-text-color);             
  border: none;
  border-radius: 5px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
}

#donateBtn:hover {
  background-color: var(--accent-color);
  color: var(--light-text-color); 
}

/* Overlay Base */
.donate-overlay,
.payment-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.donate-overlay[aria-hidden="false"],
.payment-overlay[aria-hidden="false"] {
  display: flex;
}

/* Panel Styles */
.donate-panel,
.payment-panel {
  background: #fff;
  max-width: 500px;
  width: 100%;
  border-radius: 10px;
  padding: 28px;
  position: relative;
  box-shadow: 0 10px 40px rgba(0,0,0,0.25);
}

/* Events Section */
.events-section {
  padding: 60px 0;
  background-color: #fff;
}

/* Shared card style for events and media */
.event-grid,
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.event-item,
.media-item {
  background-color: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  text-align: center;
  padding-bottom: 20px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.event-item:hover,
.media-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.event-item img,
.media-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.event-item h4,
.media-item h4 {
  margin: 15px 0;
  font-size: 1rem;
  color: #333;
}

.media-showcase {
  margin-top: 60px;
}

.media-showcase h3 {
  text-align: left; 
  margin-bottom: 30px;
}

.media-item a {
  text-decoration: none;
  color: inherit;
}

.media-item button {
  margin-top: 10px;
}

/* Programs Section */
.programs-section {
  padding: 60px 0;
  background-color: #fdfaf6;
}

/* Program grid: original 7 items use responsive auto-fit, but modal gallery uses 3x4 */
.program-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

/* Program item styling and consistent layout */
.program-item {
  background-color: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  text-align: center;
  padding-bottom: 16px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 320px;
}

.program-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

/* Media wrapper for uniform program thumbnails */
.program-media {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  flex: 0 0 auto;
}

.program-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Program text layout */
.program-item h4 {
  margin: 12px 16px 6px;
  font-size: 1.1rem;
}

.program-item p {
  margin: 0 16px 12px;
  color: var(--text-color);
  font-size: 0.95rem;
  flex: 1 0 auto;
}

/* Button placement */
.program-item .btn-small {
  margin: 0 16px 16px;
  align-self: center;
}

/* Shared overlay base (used for both events and programs) */
.detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

/* When aria-hidden is false show overlay */
.detail-overlay[aria-hidden="false"] {
  display: flex;
}

/* Panel that contains the content */
.detail-panel {
  background: #fff;
  max-width: 1000px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 10px;
  padding: 28px;
  position: relative;
  box-shadow: 0 10px 40px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
}

/* Close button */
.detail-close {
  position: absolute;
  top: 18px;
  right: 18px;
}

/* Detail content */
.detail-content h4 {
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
}

.detail-content .muted {
  color: #666;
  margin-bottom: 1rem;
}

.detail-content p {
  line-height: 1.6;
}

/* Overlay gallery container: 3 columns, 4 rows */
.detail-gallery {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

/* Each gallery cell keeps a uniform aspect ratio */
.detail-gallery .gallery-cell {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 6px;
  background: #f4f4f4;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.detail-gallery .gallery-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Accessibility focus outline */
.btn-learn:focus,
.detail-close:focus,
.btn-small:focus {
  outline: 3px solid rgba(46, 139, 87, 0.35);
  outline-offset: 2px;
}

/* Contact Section */
.contact-section {
  padding: 60px 0;
  background-color: var(--secondary-color);
  color: var(--light-text-color);
}

.contact-section h3 {
  text-align: center;   /* centered heading */
  margin-bottom: 30px;
  font-size: 1.8rem;
  color: var(--light-text-color);
}

.contact-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.contact-item {
  background-color: var(--primary-color);
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.contact-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 15px rgba(0,0,0,0.15);
}

.contact-item h4 {
  margin-bottom: 10px;
  font-size: 1.2rem;
  color: var(--light-text-color);
}

.contact-item p a {
  color: var(--light-text-color);
  text-decoration: none;
  font-size: 1.1rem;
}

.contact-item p a:hover {
  text-decoration: underline;
}

.contact-description {
  font-size: 1.1rem;
  color: var(--light-text-color);
  text-align: center;   /* centered description */
}

/* Footer */
footer {
  background-color: #333;
  color: rgba(255, 255, 255, 0.7);
  padding: 30px 0;
  text-align: center;
}

footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

footer p {
  margin-bottom: 15px;
}

/* Responsive Design */
@media (max-width: 992px) {
  header .container {
    flex-direction: column;
  }
  .header-section {
    margin-bottom: 10px;
  }

  nav ul {
    margin-top: 15px;
    flex-wrap: wrap;
    justify-content: center;
  }

  nav li {
    margin: 5px 10px;
  }

  .hero-content h2 {
    font-size: 3em;
  }

  .about-content {
    flex-direction: column;
  }

  .about-image {
    width: 100%;
    margin-top: 20px;
  }

  .event-grid {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  /* Program grid in modal becomes 2 columns on medium screens */
  .detail-gallery {
    grid-template-columns: repeat(2, 1fr);
  }

  .program-item {
    min-height: 300px;
  }

  .event-item img {
    height: 180px;
  }
}

@media (max-width: 768px) {
  h1 {
    font-size: 2.5em;
  }

  h2 {
    font-size: 2em;
  }

  h3 {
    font-size: 1.8em;
  }

  .hero-section {
    padding: 80px 0;
    height: 50vh;
  }

  .hero-content h2 {
    font-size: 2.8em;
  }

  .hero-content p {
    font-size: 1.1em;
  }

  .btn {
    padding: 10px 20px;
  }
}

@media (max-width: 576px) {
  .logo a {
    font-size: 1.5em;
  }

  nav a {
    font-size: 1em;
  }

  .hero-content h2 {
    font-size: 2.2em;
  }

  .about-content, .event-grid, .gallery-grid {
    gap: 20px;
  }

  /* Modal gallery stacks to single column on very small screens */
  .detail-gallery {
    grid-template-columns: 1fr;
  }

  .detail-gallery .gallery-cell {
    aspect-ratio: 16 / 9;
  }

  .program-item {
    min-height: auto;
  }

  .program-media {
    aspect-ratio: 16 / 9;
  }
}