/* ============================
   Root & Global Styles
============================ */

:root {
  --er-bg: #fffaf5;              /* warm background */
  --er-primary: #f29c9f;         /* soft coral/pink */
  --er-primary-dark: #e27176;
  --er-accent: #f5c26b;          /* golden accent */
  --er-accent-dark: #dca353;
  --er-dark: #333333;
  --er-muted: #777777;
  --er-card-bg: #ffffff;
  --er-border-radius: 16px;
  --er-shadow: 0 8px 24px rgba(15, 14, 23, 0.06);
  --navbar-height: 65px; /* Matches original positioning - dynamically calculated by JS on load */
  --er-radius-pill: 999px;
  --er-max-width: 1100px;
}

/* Reset-ish */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--er-bg);
  color: var(--er-dark);
}

/* Let header/footer hug edges, main content centered */
.page-container {
  max-width: var(--er-max-width);
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

main {
  display: block;
}

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

a:hover {
  text-decoration: underline;
}

h1, h2, h3 {
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 0;
  color: var(--er-dark);
}

p {
  margin-top: 0;
  color: var(--er-dark);
}

/* ============================
   Navbar
============================ */

.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.75rem;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  min-height: var(--navbar-height);
  box-sizing: border-box;
}

.navbar-admin {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  border-bottom: 3px solid var(--er-accent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.navbar-admin .nav-link {
  color: rgba(255, 255, 255, 0.9);
}

.navbar-admin .nav-link:hover {
  color: #ffffff;
}

.navbar-admin .nav-link.active {
  color: var(--er-accent);
  background: rgba(245, 194, 107, 0.15);
}

.navbar-admin .nav-link.active::after {
  background: var(--er-accent);
}

.navbar-admin .nav-user {
  color: rgba(255, 255, 255, 0.85);
}

.nav-separator {
  width: 1px;
  height: 20px;
  background: rgba(0, 0, 0, 0.1);
  display: inline-block;
  margin: 0 0.25rem;
}

.navbar-admin .nav-separator {
  background: rgba(255, 255, 255, 0.2);
}

/* Admin Sub-Navigation */
.admin-subnav {
  position: sticky;
  top: var(--navbar-height); /* Position below the main navbar using dynamic height */
  z-index: 51; /* Higher than navbar to ensure it stays on top when scrolling */
  background: #000000;
  border-bottom: 2px solid var(--er-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.admin-subnav-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1.75rem;
  flex-wrap: wrap;
}

.admin-subnav-link {
  font-size: 0.9rem;
  color: var(--er-primary);
  font-weight: 500;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.admin-subnav-link:hover {
  color: #ffffff;
  background: rgba(242, 156, 159, 0.15);
}

.admin-subnav-link.active {
  color: #ffffff;
  background: var(--er-primary);
}

.navbar-admin .btn-outline {
  border-color: rgba(255, 255, 255, 0.4);
  color: rgba(255, 255, 255, 0.9);
  background: transparent;
}

.navbar-admin .btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.6);
  color: #ffffff;
}

.navbar-admin .btn-accent {
  background: var(--er-accent);
  color: #ffffff;
}

.navbar-admin .btn-accent:hover {
  background: var(--er-accent-dark);
}

.navbar-admin .btn-text {
  color: rgba(255, 255, 255, 0.85);
}

.navbar-admin .btn-text:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.tag {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--er-primary);
  color: #ffffff;
}

.tag-small {
  padding: 0.15rem 0.4rem;
  font-size: 0.7rem;
}

.navbar-admin .tag {
  background: rgba(245, 194, 107, 0.2);
  color: var(--er-accent);
  border: 1px solid rgba(245, 194, 107, 0.3);
}

.navbar-left,
.navbar-center,
.navbar-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.navbar-center {
  justify-content: center;
  flex: 1;
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.logo-image {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.logo-text {
  font-weight: 600;
  font-size: 1rem;
  color: var(--er-dark);
}

.navbar-admin .logo-text {
  color: #ffffff;
}

.nav-link {
  font-size: 0.9rem;
  color: var(--er-dark);
  font-weight: 500;
  text-decoration: none;
  position: relative;
  padding-bottom: 0.15rem;
  transition: all 0.2s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.1rem;
  width: 0;
  height: 2px;
  background: var(--er-primary);
  transition: width 0.2s ease;
}

.nav-link:hover::after {
  width: 100%;
}

.nav-link.active {
  font-weight: 600;
  color: var(--er-primary-dark);
  background: rgba(242, 156, 159, 0.1);
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
}

.nav-link.active::after {
  width: 100%;
  height: 2px;
  bottom: 0.15rem;
}

.nav-user {
  font-size: 0.85rem;
  color: var(--er-muted);
}

.inline-form {
  display: inline-block;
  margin: 0;
}

/* ============================
   Buttons
============================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.4rem;
  border-radius: var(--er-radius-pill);
  border: none;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.1s ease, color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--er-primary);
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(242, 156, 159, 0.35);
}

.btn-primary:hover {
  background: var(--er-primary-dark);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(242, 156, 159, 0.45);
}

.btn-accent {
  background: var(--er-accent);
  color: #ffffff;
}

.btn-accent:hover {
  background: var(--er-accent-dark);
  text-decoration: none;
}

.btn-outline {
  border: 1px solid var(--er-primary);
  background: #ffffff;
  color: var(--er-primary-dark);
}

.btn-outline:hover {
  background: rgba(242, 156, 159, 0.06);
  text-decoration: none;
}

.btn-text {
  background: none;
  border: none;
  color: var(--er-primary-dark);
}

.btn-text:hover {
  background: rgba(0, 0, 0, 0.03);
}

.btn-small {
  padding: 0.35rem 0.9rem;
  font-size: 0.8rem;
}

.btn-full {
  width: 100%;
  justify-content: center;
}

/* ============================
   Hero Sections
============================ */

.hero {
  background: radial-gradient(circle at top left, #ffe5e4 0, #fffaf5 50%, #fff);
  padding: 3rem 1.25rem 2.5rem;
}

.hero-small {
  padding: 2.5rem 1.25rem 1.5rem;
}

.hero-inner {
  max-width: var(--er-max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 3rem;
  align-items: center;
}

.hero-text h1 {
  font-size: 2rem;
  text-transform: none;
  letter-spacing: 0.02em;
}

.hero-text p {
  margin-top: 0.75rem;
  font-size: 0.98rem;
  color: var(--er-muted);
}

.hero-actions {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-image {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-photo-placeholder {
  width: 100%;
  max-width: 340px;
  aspect-ratio: 4 / 5;
  border-radius: 32px;
  background: linear-gradient(145deg, #f7ced2, #fbe4d4);
  box-shadow: var(--er-shadow);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: #ffffff;
}

/* ============================
   Sections & Layout
============================ */

.section {
  padding: 2.5rem 0;
}

.section-alt {
  background: #fff5ec;
}

.section-header {
  max-width: var(--er-max-width);
  margin: 0 auto 1.75rem;
  text-align: left;
}

.section-title {
  text-transform: uppercase;
  font-size: 1rem;
  letter-spacing: 0.2em;
}

.section-subtitle {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  color: var(--er-muted);
}

.header-with-actions {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
}

.center {
  text-align: center;
}

/* Grid helpers */

.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Cards */

.card {
  background: var(--er-card-bg);
  border-radius: var(--er-border-radius);
  box-shadow: var(--er-shadow);
  padding: 1.5rem 1.75rem;
}

.card-narrow {
  max-width: 520px;
  margin: 0 auto;
}

/* Impact cards */

.impact-highlight {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.impact-card {
  background: #ffffff;
  border-radius: var(--er-border-radius);
  padding: 1.25rem 1.5rem;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.04);
}

.impact-card h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-bottom: 0.35rem;
}

.impact-card p {
  font-size: 1.05rem;
  font-weight: 600;
}

/* ============================
   Tables
============================ */

.table-container {
  width: 100%;
  max-height: 600px;
  overflow-x: auto;
  overflow-y: auto;
  margin-top: 1rem;
  border-radius: var(--er-border-radius);
  box-shadow: var(--er-shadow);
  background: #ffffff;
}

/* Custom scrollbar styling for table containers */
.table-container::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.table-container::-webkit-scrollbar-track {
  background: #f5f5f5;
  border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
  background: #999;
}

.table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: #ffffff;
}

.table thead {
  background: #fff3ec;
  position: sticky;
  top: 0;
  z-index: 10;
}

.table th,
.table td {
  padding: 0.75rem 1rem;
  text-align: left;
}

.table th {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--er-muted);
}

.table tbody tr:nth-child(even) {
  background: #fffaf5;
}

.table-actions {
  white-space: nowrap;
}

.link-small {
  font-size: 0.8rem;
  text-decoration: none;
}

.link-small:hover {
  text-decoration: underline;
}

/* ============================
   Forms
============================ */

.form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.form-group-inline {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.form-group label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--er-muted);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  border: 1px solid #e4d8d0;
  background: #ffffff;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--er-primary);
  box-shadow: 0 0 0 2px rgba(242, 156, 159, 0.25);
  background: #fffdfb;
}

textarea {
  resize: vertical;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* Filters on dashboard */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.75rem;
  align-items: flex-end;
}

/* ============================
   Flash Messages
============================ */

.flash {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.flash-success {
  background: #e7f7ef;
  color: #14673a;
  border: 1px solid #a8ddc0;
}

.flash-error {
  background: #fde8ea;
  color: #a82833;
  border: 1px solid #f2a5ae;
}

/* ============================
   Milestone List
============================ */

.milestone-list {
  list-style: none;
  padding-left: 0;
  margin: 0 0 1rem;
}

.milestone-list li {
  padding: 0.25rem 0;
  font-size: 0.9rem;
}

.muted {
  color: var(--er-muted);
  font-size: 0.85rem;
}

/* ============================
   Footer
============================ */

.site-footer {
  border-top: 1px solid #f0e3da;
  padding: 1.5rem 1.25rem 2rem;
  background: #ffffff;
}

.footer-inner {
  max-width: var(--er-max-width);
  margin: 0 auto;
  text-align: center;
}

.footer-inner p {
  margin: 0.15rem 0;
  font-size: 0.8rem;
}

.footer-sub {
  color: var(--er-muted);
}

/* ============================
   Responsive
============================ */

@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
    text-align: left;
  }

  .hero-image {
    order: -1;
    margin-bottom: 1.5rem;
  }

  .navbar-center {
    display: none; /* simple mobile nav (you can improve later) */
  }

  .header-with-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }

  .form-group-inline {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 600px) {
  .navbar {
    padding-inline: 1rem;
  }

  .page-container {
    padding-inline: 1rem;
  }

  .hero {
    padding-inline: 1rem;
  }
}

/* HERO IMAGE (main logo) */
.hero-photo {
  width: 380px;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

/* Section card images */
.card-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 12px;
}

.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.card-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 12px;
}

/* Better spacing for cards on programs page */
.card h2 {
  margin-top: 0;
}

/* Move mariachi image upward so faces are centered */
.mariachi-img {
  object-position: center top; /* moves the visible crop upward */
}

/* Impact page banner */
.impact-banner {
  width: 100%;
  max-height: 260px;
  overflow: hidden;
  margin-bottom: 2rem;
}

.impact-banner-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Rounded gradient section (WELCOME BACK + Hero sections) */
.rounded-section {
    background: linear-gradient(90deg, #FFE6E6, #FFF9F6);
    padding: 40px 50px;
    border-radius: 18px; /* <-- Rounds the corners */
    margin: 20px auto;
}

/* Heading styling */
.rounded-section h1,
.rounded-section h2 {
    font-family: 'DM Serif Display', serif;
    font-size: 42px;
    color: #333;
    margin-bottom: 15px;
}

/* Paragraph styling */
.rounded-section p {
    font-family: 'Montserrat', sans-serif;
    font-size: 18px;
    color: #444;
}

/* Buttons inside these sections */
.rounded-section .btn {
    border-radius: 30px;
    padding: 12px 28px;
}
