/* ==========================================================================
   CAL40.COM - Master Stylesheet
   Theme: Sophisticated Nautical Performance
   ========================================================================== */

/* 1. DESIGN TOKENS & VARIABLES */
:root {
  /* Color Palette */
  --navy-dark:      #001a33;
  --navy-primary:   #002b49;
  --navy-light:     #0a3d62;
  --brass-accent:   #b5a642;
  --slate-text:     #2c3e50;
  --gray-bg:        #f4f6f8;
  --white:          #ffffff;
  --border-color:   #e2e8f0;

  /* Typography */
  --font-heading:   'Oswald', Georgia, serif;
  --font-body:      'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Fluid Typography with clamp(min, ideal, max) */
  --h1-size:        clamp(2.2rem, 5vw, 3.8rem);
  --h2-size:        clamp(1.6rem, 3.5vw, 2.4rem);
  --h3-size:        clamp(1.2rem, 2vw, 1.5rem);
  --body-size:      clamp(0.95rem, 1.2vw, 1.05rem);

  /* Elevation & Shadows */
  --shadow-sm:      0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md:      0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg:      0 12px 32px rgba(0, 0, 0, 0.12);
  --transition:     all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* 2. RESET & BASE STYLES */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  font-size: var(--body-size);
  color: var(--slate-text);
  background-color: var(--gray-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--navy-light);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--brass-accent);
}

/* 3. FLUID LAYOUT CONTAINERS */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Auto-resizing Dashboard Grid (No hardcoded media queries needed) */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
  margin: 3rem 0;
}

/* 4. BUTTONS & UI ACCENTS */
.btn-primary {
  display: inline-block;
  background-color: var(--brass-accent);
  color: var(--white);
  font-weight: 600;
  padding: 0.85rem 1.8rem;
  border-radius: 4px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.85rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.btn-primary:hover {
  background-color: #9e9037;
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* HEADER & NAVIGATION STYLES */
.site-header {
  background-color: var(--navy-dark);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-md);
}

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

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--white);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: 0.05em;
}

.logo-icon {
  stroke: var(--brass-accent);
}

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

.nav-link {
  color: #d1d5db;
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.5rem 0;
}

.nav-link:hover {
  color: var(--brass-accent);
}

/* Mobile Nav Toggle Button */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle .bar {
  width: 25px;
  height: 2px;
  background-color: var(--white);
  transition: var(--transition);
}

/* FOOTER STYLES */
.site-footer {
  background-color: var(--navy-dark);
  color: #a0aec0;
  padding-top: 4rem;
  margin-top: 4rem;
  border-top: 3px solid var(--brass-accent);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2.5rem;
  padding-bottom: 3rem;
}

.footer-heading {
  color: var(--white);
  font-family: var(--font-heading);
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: #a0aec0;
}

.footer-links a:hover {
  color: var(--brass-accent);
}

.footer-bottom {
  background-color: #001224;
  padding: 1.25rem 0;
  text-align: center;
  font-size: 0.85rem;
}

/* RESPONSIVE NAVIGATION BREAKPOINT */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-menu {
    position: absolute;
    top: 70px;
    left: 0;
    width: 100%;
    background-color: var(--navy-dark);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
  }

  .nav-menu.active {
    max-height: 350px;
  }

  .nav-list {
    flex-direction: column;
    padding: 1.5rem;
    gap: 1.25rem;
  }
}

/* RACE CALENDAR MODULE STYLES */
.race-calendar-card {
  background-color: var(--white);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.calendar-header {
  background-color: var(--navy-primary);
  color: var(--white);
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.header-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.calendar-icon {
  stroke: var(--brass-accent);
}

.calendar-header h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  margin: 0;
}

.schedule-link {
  color: var(--brass-accent);
  font-size: 0.85rem;
  font-weight: 600;
}

.schedule-link:hover {
  color: var(--white);
}

.event-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.event-item {
  display: flex;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

.event-item:last-child {
  border-bottom: none;
}

.event-item:hover {
  background-color: var(--gray-bg);
}

.event-badge {
  background-color: var(--navy-dark);
  color: var(--white);
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  min-width: 65px;
  text-align: center;
  margin-right: 1.25rem;
  flex-shrink: 0;
  border-bottom: 2px solid var(--brass-accent);
}

.badge-month {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--brass-accent);
}

.badge-day {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.1;
}

.event-details strong {
  display: block;
  color: var(--navy-dark);
  font-size: 0.95rem;
}

.event-details small {
  color: #64748b;
  font-size: 0.8rem;
}

/* Highlight Current/Active Event */
.event-item.active-event {
  background-color: #f8fafc;
  border-left: 4px solid var(--brass-accent);
}

/* COMPACT INNER PAGE HERO */
.hero-section.inner-hero {
  min-height: 220px !important;
  max-height: 280px;
}

.hero-section.inner-hero .hero-content {
  padding: 2.5rem 1.5rem !important;
}

.hero-section.inner-hero .hero-title {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 0.25rem;
}

.hero-subtitle {
  font-family: var(--font-body);
  color: var(--brass-accent);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
}

.btn-secondary {
  display: inline-block;
  background-color: transparent;
  color: var(--white);
  border: 1px solid var(--white);
  font-weight: 600;
  padding: 0.85rem 1.8rem;
  border-radius: 4px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.85rem;
  transition: var(--transition);
}

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

/* DASHBOARD & FEATURE CARDS */
.feature-card {
  background: var(--white);
  border-radius: 8px;
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.card-tag {
  color: var(--brass-accent);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.card-title {
  font-family: var(--font-heading);
  font-size: var(--h2-size);
  color: var(--navy-dark);
  margin-bottom: 0.25rem;
}

.card-excerpt {
  color: var(--slate-text);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.card-link {
  font-weight: 600;
  color: var(--navy-light);
}

/* QUICK LINKS GRID */
.quick-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.quick-link-item {
  background-color: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.quick-link-item:hover {
  border-color: var(--brass-accent);
  transform: translateY(-2px);
}

.quick-link-item strong {
  display: block;
  color: var(--navy-dark);
  font-size: 0.95rem;
}

.quick-link-item span {
  display: block;
  color: #64748b;
  font-size: 0.8rem;
}

/* ==========================================================================
   VISUALS & POLISH (Step 3 Addition)
   ========================================================================== */

/* 1. STUNNING HERO SECTION */
.hero-section {
  position: relative;
  /* Link your optimized action photo here */
  background: var(--navy-dark) url('images/cal40-hero.png') center/cover no-repeat;
  color: var(--white);
  padding: clamp(6rem, 15vw, 12rem) 0; /* Deep padding for dramatic effect */
  text-align: center;
  overflow: hidden;
}

/* Subtle dark gradient overlay to make text pop over the photo */
.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(0,26,51,0.5) 0%, rgba(0,26,51,0.85) 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2; /* Sits above the overlay */
  max-width: 850px;
}

/* Bold typography tweaks for h1 */
.hero-title {
  font-family: var(--font-heading);
  font-size: var(--h1-size);
  font-weight: 700;
  line-height: 1.1;
  text-shadow: 0 4px 15px rgba(0,0,0,0.4);
  margin-bottom: 1rem;
}

/* 2. REFINED FEATURE CARD WITH IMAGE */
.feature-card.with-image {
  padding: 0; /* Override padding for full-bleed image */
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-image-wrap {
  position: relative;
  width: 100%;
  height: clamp(180px, 25vw, 250px); /* Fluid height */
  overflow: hidden;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Ensures image fills space perfectly */
  transition: transform 0.5s ease; /* Subtle hover effect setup */
}

/* Image zoom effect on hover */
.feature-card:hover .card-image {
  transform: scale(1.05);
}

.card-body {
  padding: 1.75rem; /* Restore padding to body text */
}

/* 3. POLISHED BRASS ACCENTS */
/* Button and Icon adjustments from the thumbnail look */
.logo-icon path {
  stroke: var(--brass-accent); /* Make the sailboat icon brass */
}

/* Primary buttons are brass */
.btn-primary {
  background-color: var(--brass-accent);
  color: var(--white) !important;
}

/* Hover effects for secondary buttons and links */
.btn-secondary:hover {
  background-color: var(--brass-accent);
  border-color: var(--brass-accent);
  color: var(--white);
}

/* Active navigation link accent line */
.nav-link.active {
  border-bottom: 2px solid var(--brass-accent);
}

/* Calendar Date Badges have a brass highlight */
.event-badge {
  border-top: 2px solid var(--brass-accent);
}

/* ==========================================================================
   DROPDOWN NAVIGATION STYLES
   ========================================================================== */

/* Dropdown Parent Styling */
.nav-list .has-dropdown {
  position: relative;
}

.nav-link .arrow {
  font-size: 0.7em;
  margin-left: 4px;
  transition: transform 0.2s ease;
}

/* Hidden Dropdown Menu Container (Desktop) */
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 210px;
  background-color: var(--navy-dark);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: 2px solid var(--brass-accent);
  box-shadow: var(--shadow-md);
  list-style: none;
  padding: 0.5rem 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: var(--transition);
  z-index: 1010;
}

.dropdown-menu li a {
  display: block;
  padding: 0.6rem 1.25rem;
  color: #d1d5db;
  font-size: 0.85rem;
  text-transform: none; /* Keeps subheader titles easy to read */
  font-weight: 400;
  white-space: nowrap;
}

.dropdown-menu li a:hover {
  background-color: var(--navy-primary);
  color: var(--brass-accent);
}

/* Hover & Focus State for Desktop */
@media (min-width: 769px) {
  .has-dropdown:hover .dropdown-menu,
  .has-dropdown:focus-within .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .has-dropdown:hover .arrow {
    transform: rotate(180deg);
  }
}

/* Accordion Layout for Mobile Screens */
@media (max-width: 768px) {
  .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    background-color: rgba(0, 0, 0, 0.2);
    padding-left: 1rem;
  }

  .dropdown-menu li a {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }
}

/* Multi-column layout for long dropdowns like Resources */
.has-dropdown .dropdown-menu.mega-menu {
  min-width: 380px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem 0.5rem;
  padding: 0.75rem;
}