/* =========================================
   Variables & Reset
   ========================================= */
:root {
    /* Color Palette */
    --navy: #112866;
    --navy-dark: #0a1a45;
    --navy-light: #1e3a8a;
    --gold: #F7B718;
    --gold-hover: #d99e0b;
    --white: #ffffff;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-800: #1f2937;
    
    /* Theme Variables (Default: Dark) */
    --bg-body: #081026;
    --bg-nav: rgba(17, 40, 102, 0.95);
    --bg-card: #162447;
    --bg-input: #1f305e;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --border-color: #2e4378;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.3);

    /* Typography */
    --font-heading: 'Inter', sans-serif;
    --font-body: 'Open Sans', sans-serif;

    /* Spacing */
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 2rem;
    --spacing-xl: 4rem;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-medium: 0.4s ease;
}

[data-theme="light"] {
    --bg-body: #ffffff;
    --bg-nav: rgba(255, 255, 255, 0.95);
    --bg-card: #f8f9fa;
    --bg-input: #ffffff;
    --text-main: #112866;
    --text-muted: #4b5563;
    --border-color: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: background-color var(--transition-medium), color var(--transition-medium);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: inherit;
    line-height: 1.2;
}

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

ul {
    list-style: none;
}

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

/* =========================================
   Components
   ========================================= */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 2px solid transparent;
    font-family: var(--font-heading);
    font-size: 0.9rem;
}

/* Primary Button is now Gold with Navy Text */
.btn-primary {
    background-color: var(--gold);
    color: var(--navy-dark);
}

.btn-primary:hover {
    background-color: var(--gold-hover);
    transform: translateY(-2px);
    color: var(--navy-dark);
}

.btn-outline {
    border-color: var(--white);
    color: var(--white);
    background: transparent;
}

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

/* Page content wrapper for non-home pages to account for fixed nav */
.page-content {
    padding-top: 120px;
    padding-bottom: 4rem;
    flex: 1;
}

.section {
    padding: var(--spacing-xl) 0;
}

.section-alt {
    background-color: rgba(255,255,255, 0.03);
}

[data-theme="light"] .section-alt {
    background-color: var(--gray-100);
}

.section-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.section-header h2 {
    font-size: 2.5rem;
    color: var(--gold);
}

[data-theme="light"] .section-header h2 {
    color: var(--navy);
}

.divider {
    height: 4px;
    width: 60px;
    background-color: var(--gold);
    margin: 1rem auto;
    border-radius: 2px;
}

/* =========================================
   Navbar
   ========================================= */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background-color: var(--bg-nav);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    transition: background-color var(--transition-medium);
}

[data-theme="light"] .navbar {
    border-bottom: 1px solid var(--gray-200);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    font-size: 2.5rem;
    color: var(--gold);
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.council-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--white);
}

[data-theme="light"] .council-name {
    color: var(--navy);
}

.council-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
}

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

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

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

.nav-links a {
    font-weight: 600;
    font-size: 0.95rem;
    position: relative;
}

.nav-links a:not(.btn):hover,
.nav-links a.active-link:not(.btn) {
    color: var(--gold);
}

/* Theme Toggle */
#theme-toggle {
    background: transparent;
    border: none;
    color: var(--gold);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.2s;
}

#theme-toggle:hover {
    background: rgba(255,255,255,0.1);
}

[data-theme="light"] #theme-toggle {
    color: var(--navy);
}

[data-theme="light"] #theme-toggle:hover {
    background: rgba(0,0,0,0.05);
}

/* Toggle Logic in CSS (display swapping) */
.light-icon { display: block; }
.dark-icon { display: none; }

[data-theme="light"] .light-icon { display: none; }
[data-theme="light"] .dark-icon { display: block; }

/* Hamburger */
.hamburger {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
}

.hamburger .bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: var(--white);
    transition: all 0.3s ease-in-out;
}

[data-theme="light"] .hamburger .bar {
    background-color: var(--navy);
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 80px;
    left: 0;
    width: 100%;
    background-color: var(--bg-nav);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transform: translateY(-150%);
    transition: transform 0.4s ease;
    z-index: 999;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.mobile-menu.active {
    transform: translateY(0);
}

.mobile-menu a {
    font-size: 1.2rem;
    font-weight: 600;
}

/* =========================================
   Hero Section
   ========================================= */
.hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-image: url('https://www.kofc8319.ca/img/saint-augustines.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    margin-top: -80px; /* Counteract navbar height */
    padding-top: 80px;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Updated gradient to use Navy dominant */
    background: linear-gradient(135deg, rgba(17,40,102,0.9), rgba(10, 26, 69, 0.8));
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    color: var(--white);
    max-width: 800px;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* =========================================
   About Section
   ========================================= */
.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.about-card {
    background-color: var(--bg-card);
    padding: 2.5rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
    border-top: 4px solid var(--gold);
}

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

.icon-lg {
    font-size: 3.5rem;
    color: var(--gold);
    margin-bottom: 1rem;
}

.about-card h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

/* =========================================
   Events (Calendar)
   ========================================= */
.calendar-wrapper {
    position: relative;
    padding-bottom: 75%; /* Aspect ratio for mobile */
    height: 0;
    overflow: hidden;
    max-width: 900px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.calendar-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

@media (min-width: 768px) {
    .calendar-wrapper {
        padding-bottom: 600px; /* Fixed height for desktop */
    }
}


/* =========================================
   Footer
   ========================================= */
footer {
    background-color: #050a19; /* Very dark navy */
    padding: 4rem 0 1rem;
    color: var(--white);
    border-top: 3px solid var(--gold);
    margin-top: auto;
}

[data-theme="light"] footer {
    background-color: var(--navy);
    color: var(--white);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}

.footer-brand h3 {
    font-size: 1.5rem;
    color: var(--gold);
}

.footer-socials {
    display: flex;
    gap: 1.5rem;
}

.footer-socials a {
    width: 40px;
    height: 40px;
    background-color: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.footer-socials a:hover {
    background-color: var(--gold);
    color: var(--navy);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1.5rem;
    font-size: 0.85rem;
    opacity: 0.7;
}

.developer-credit {
  font-size: 0.85rem; /* Makes it slightly smaller */
  margin-left: 10px;  /* Puts some breathing room after the copyright */
}

.developer-credit a {
  text-decoration: none;
  transition: color 0.3s ease;
}

.developer-credit a:hover {
  color: var(--gold);
  text-decoration: underline;
}

.heart {
  color: #e25555;
  display: inline-block;
  margin: 0 2px;
  cursor: default;
  animation: heartbeat 1.5s ease infinite;
}

@keyframes heartbeat {
  0% { transform: scale(1); }
  15% { transform: scale(1.2); }
  30% { transform: scale(1); }
  45% { transform: scale(1.1); }
  60% { transform: scale(1); }
  100% { transform: scale(1); }
}

/* =========================================
   Back to Top
   ========================================= */
#back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: var(--gold);
    color: var(--navy);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 900;
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

#back-to-top:hover {
    background-color: var(--gold-hover);
    transform: translateY(-3px);
}

/* =========================================
   Utilities & Animation Classes
   ========================================= */
.hidden {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .hamburger {
        display: block;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .section-header h2 {
        font-size: 2rem;
    }

    .page-content {
        padding-top: 100px;
    }
}
