/*
 Theme Name:   MYC Kadence Child
 Theme URI:    https://missouriyachtclub.com
 Description:  Kadence child theme for Missouri Yacht Club. Nautical palette: navy, white, and gold.
 Author:       Missouri Yacht Club
 Template:     kadence
 Version:      1.0.3
 Text Domain:  myc-kadence-child
*/

/* ============================================================
   NAUTICAL COLOR PALETTE
   ─────────────────────
   Navy:        #1B3A6B  (primary)
   Dark navy:   #122952  (hover / depth)
   Gold:        #C9A44C  (accent)
   Dark gold:   #A8872E  (hover accent)
   White:       #FFFFFF
   Off-white:   #F5F7FA  (section backgrounds)
   Mid-grey:    #6B7280  (secondary text)
   Border:      #D1D5DB
   ============================================================ */

/* ── Kadence CSS custom properties override ──────────────────────────────── */
:root {
  --global-palette1: #1B3A6B;   /* Primary — nav, buttons, headings */
  --global-palette2: #122952;   /* Primary hover */
  --global-palette3: #1B3A6B;   /* Heading color */
  --global-palette4: #1f2937;   /* Body text */
  --global-palette5: #6B7280;   /* Muted text */
  --global-palette6: #D1D5DB;   /* Borders */
  --global-palette7: #F5F7FA;   /* Light background */
  --global-palette8: #FFFFFF;   /* Background */
  --global-palette9: #FFFFFF;   /* White */

  --myc-gold:      #C9A44C;
  --myc-gold-dark: #A8872E;
  --myc-navy:      #1B3A6B;
  --myc-navy-dark: #122952;
  --myc-white:     #FFFFFF;
  --myc-off-white: #F5F7FA;
}

/* ── Base typography ─────────────────────────────────────────────────────── */
body {
  font-family: Georgia, 'Times New Roman', serif;
  color: #1f2937;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Palatino Linotype', Palatino, Georgia, serif;
  color: var(--myc-navy);
  letter-spacing: 0.01em;
}

/* ── Links ───────────────────────────────────────────────────────────────── */
a {
  color: var(--myc-navy);
}
a:hover,
a:focus {
  color: var(--myc-gold-dark);
  text-decoration-color: var(--myc-gold);
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.wp-block-button__link,
.kadence-button,
button[type="submit"],
input[type="submit"] {
  background-color: var(--myc-navy) !important;
  color: var(--myc-white) !important;
  border: 2px solid var(--myc-navy) !important;
  border-radius: 3px;
  font-family: Georgia, serif;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.85em;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.wp-block-button__link:hover,
.kadence-button:hover,
button[type="submit"]:hover,
input[type="submit"]:hover {
  background-color: var(--myc-gold) !important;
  border-color: var(--myc-gold) !important;
  color: var(--myc-navy) !important;
}

/* ── Header / site branding ──────────────────────────────────────────────── */
/* !important is required here — Kadence's own dynamic customizer CSS sets
   #masthead's background and loads after this stylesheet, so a plain
   declaration silently loses even though #masthead is an ID selector. */
.site-header,
#masthead {
  background-color: var(--myc-navy) !important;
  border-bottom: 3px solid var(--myc-gold) !important;
}

.site-title a,
.site-title {
  color: var(--myc-white) !important;
  font-family: 'Palatino Linotype', Palatino, Georgia, serif;
  font-size: 1.6rem;
  letter-spacing: 0.05em;
}

/* Header logo — source file is a solid black monogram on a transparent
   background, so it's inverted to white for visibility against the navy
   header. brightness(0) first flattens any anti-aliasing to pure black,
   then invert(1) flips it to pure white. */
.site-logo img,
.custom-logo-link img,
.custom-logo {
  filter: brightness(0) invert(1);
  max-height: 56px;
  width: auto;
}

.site-description {
  color: var(--myc-gold) !important;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ── Navigation ──────────────────────────────────────────────────────────── */
/* .mobile-navigation is Kadence's separate mobile drawer menu — different
   markup from the desktop .main-navigation, needs its own rules or it falls
   back to Kadence's unstyled defaults (white background, default link color)
   regardless of what the desktop nav looks like. */
.main-navigation,
.primary-navigation,
#site-navigation {
  background-color: var(--myc-navy);
}

.mobile-navigation,
.mobile-menu-container {
  background-color: var(--myc-navy) !important;
}

/* Mobile hamburger toggle icon — default is dark grey, invisible on the navy
   header. */
.mobile-toggle-open-container,
.mobile-toggle-open-container svg,
.mobile-toggle-open-container path {
  color: var(--myc-white) !important;
  fill: var(--myc-white) !important;
}

.main-navigation a,
.primary-navigation a,
.mobile-navigation a {
  color: var(--myc-white) !important;
  font-family: Georgia, serif;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  padding: 0.6em 1em;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.main-navigation a:hover,
.primary-navigation a:hover,
.main-navigation li:hover > a,
.primary-navigation li:hover > a,
.mobile-navigation a:hover,
.mobile-navigation a:active {
  color: var(--myc-gold) !important;
  background-color: rgba(255, 255, 255, 0.06);
}

.main-navigation .current-menu-item > a,
.primary-navigation .current-menu-item > a,
.mobile-navigation .current-menu-item > a {
  color: var(--myc-gold) !important;
  border-bottom: 2px solid var(--myc-gold);
}

/* Dropdown menus (desktop hover) and mobile accordion sub-menus */
.main-navigation ul ul,
.primary-navigation ul ul,
.mobile-navigation ul ul,
.mobile-navigation .sub-menu {
  background-color: var(--myc-navy-dark) !important;
  border-top: 2px solid var(--myc-gold);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ── Hero section (homepage) ─────────────────────────────────────────────── */
.myc-hero,
.hero-section,
.wp-block-cover.is-style-hero {
  min-height: 480px;
  background-color: var(--myc-navy);
  background-size: cover;
  background-position: center center;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.myc-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(18, 41, 82, 0.55) 0%,
    rgba(18, 41, 82, 0.3) 60%,
    rgba(18, 41, 82, 0.7) 100%
  );
  pointer-events: none;
}

.myc-hero-text,
.wp-block-group.myc-hero-text {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 3rem 2rem;
  min-height: 320px;
  background-color: var(--myc-navy);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.myc-hero-text h1,
h1.myc-tagline {
  color: var(--myc-white);
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: 0.3em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

p.myc-established,
.myc-established {
  color: var(--myc-gold);
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 0;
}

/* ── Interior page banner (Kadence's built-in title area) ────────────────── */
/* NOTE: functions.php's custom myc-page-banner hook (kadence_before_main_content)
   does not fire in this Kadence version — .myc-page-banner never appears in the
   rendered DOM. Kadence's own default title area (.entry-header.page-title) is
   what actually renders on every page, so that's restyled here to match the
   navy/gold theme instead, and hidden on the front page where the hero section
   already serves this role. The .myc-page-banner rules below are kept for when
   that PHP hook is eventually fixed to use Kadence's real title-bar filter. */
.entry-header.page-title {
  background-color: var(--myc-navy);
  border-bottom: 4px solid var(--myc-gold);
  padding: 2.5rem 1.5rem;
  text-align: center;
  margin: 0 0 2rem;
}

.entry-header.page-title .entry-title {
  color: var(--myc-white);
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  margin: 0;
  letter-spacing: 0.03em;
}

.home .entry-header.page-title {
  display: none;
}

.myc-page-banner {
  background-color: var(--myc-navy);
  border-bottom: 4px solid var(--myc-gold);
  padding: 2.5rem 1.5rem;
  text-align: center;
}

.myc-page-banner h1 {
  color: var(--myc-white);
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  margin: 0;
  letter-spacing: 0.03em;
}

/* When page has a custom banner image */
.myc-page-banner.has-image {
  background-size: cover;
  background-position: center;
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.myc-page-banner.has-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(18, 41, 82, 0.6);
}

.myc-page-banner.has-image h1 {
  position: relative;
  z-index: 1;
}

/* ── Key Dates section ───────────────────────────────────────────────────── */
.myc-key-dates {
  margin: 2rem 0;
}

.myc-key-dates-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.myc-key-date-item {
  background-color: var(--myc-navy);
  border-radius: 4px;
  padding: 1.25rem 1.5rem;
  border-left: 4px solid var(--myc-gold);
  position: relative;
}

.myc-key-date-label {
  color: var(--myc-white);
  font-family: 'Palatino Linotype', Palatino, Georgia, serif;
  font-size: 1.05rem;
  font-weight: bold;
  margin: 0 0 0.3em;
}

.myc-key-date-date {
  color: var(--myc-gold);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  margin: 0;
}

.myc-key-date-note {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.82rem;
  font-style: italic;
  margin: 0.25em 0 0;
}

.myc-key-dates-fallback-notice {
  font-size: 0.8rem;
  color: var(--myc-gold-dark);
  margin-top: 0.75rem;
  font-style: italic;
  text-align: right;
}

/* Calendar placeholder styling */
.myc-calendar-placeholder {
  background: var(--myc-off-white);
  padding: 1.5em;
  border-left: 4px solid var(--myc-navy);
  margin: 1rem 0;
  font-size: 0.9rem;
}

/* ── Past Commodores table ───────────────────────────────────────────────── */
.myc-commodores-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.myc-commodores-table th {
  background-color: var(--myc-navy);
  color: var(--myc-white);
  padding: 0.6em 1em;
  text-align: left;
  letter-spacing: 0.05em;
  font-family: Georgia, serif;
}

.myc-commodores-table td {
  padding: 0.55em 1em;
  border-bottom: 1px solid var(--myc-border, #D1D5DB);
}

.myc-commodores-table tr:nth-child(even) td {
  background-color: var(--myc-off-white);
}

.myc-commodores-table tr:hover td {
  background-color: #eef0f8;
}

/* ── Member Documents section ───────────────────────────────────────────── */
.myc-member-documents-section {
  background-color: var(--myc-off-white);
  border: 1px solid var(--myc-navy);
  border-radius: 4px;
  padding: 1.5rem 2rem;
  margin-top: 1.5rem;
}

h2.myc-member-documents-heading {
  border-bottom: 2px solid var(--myc-gold);
  padding-bottom: 0.4em;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.site-footer,
#colophon {
  background-color: var(--myc-navy-dark);
  color: rgba(255, 255, 255, 0.85);
  border-top: 4px solid var(--myc-gold);
}

.site-footer a,
#colophon a {
  color: var(--myc-gold);
}

.site-footer a:hover,
#colophon a:hover {
  color: var(--myc-white);
}

.site-footer h2,
.site-footer h3,
.site-footer h4,
#colophon h2,
#colophon h3,
#colophon h4 {
  color: var(--myc-gold);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.site-footer .widget,
#colophon .widget {
  color: rgba(255, 255, 255, 0.8);
}

.site-info {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8rem;
  text-align: center;
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ── Horizontal rules ────────────────────────────────────────────────────── */
hr.wp-block-separator {
  border-color: var(--myc-gold);
  opacity: 0.4;
}

/* ── Kadence block overrides ─────────────────────────────────────────────── */
.kb-btn-global-outline {
  border-color: var(--myc-navy) !important;
  color: var(--myc-navy) !important;
}
.kb-btn-global-outline:hover {
  background-color: var(--myc-navy) !important;
  color: var(--myc-white) !important;
}

/* ── Content area spacing ────────────────────────────────────────────────── */
.entry-content {
  max-width: 820px;
}

/* ── Mobile responsive adjustments ──────────────────────────────────────── */
@media (max-width: 768px) {
  .myc-key-dates-list {
    grid-template-columns: 1fr;
  }

  .myc-hero,
  .hero-section {
    min-height: 300px;
  }

  .myc-hero-text h1 {
    font-size: 1.8rem;
  }

  .myc-page-banner {
    padding: 1.75rem 1rem;
  }

  .myc-commodores-table {
    overflow-x: auto;
    display: block;
  }
}

@media (max-width: 480px) {
  .myc-key-date-item {
    padding: 1rem;
  }

  .site-title a {
    font-size: 1.2rem;
  }
}
