/* ==========================================================================
   DCX REDESIGN — MASTER STYLESHEET
   ==========================================================================
   PURPOSE:  All visual styling for the DCX / MPAM Museum prototype.
   CONTEXT:  This CSS was extracted from the monolithic index.html so the
             ColdFusion developer can maintain styles independently.

   COLDFUSION NOTES:
   -  CSS custom properties (the --color-*, --font-*, etc. variables in :root)
      can be overridden at runtime if you want theme switching via CF.
   -  The .high-contrast and .large-text classes are toggled on <body> by JS.
      If you want to persist those preferences across sessions, store the
      flag in a CF session variable and add the class server-side.
   -  Media queries at the bottom handle responsive breakpoints.
   ========================================================================== */


/* ========================================
   CSS RESET & VARIABLES
   ========================================
   These custom properties are the design tokens for the entire site.
   Changing a value here propagates everywhere it's used.
   ======================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* --- Palette --- */
  --color-bg: #FAFAF7;
  --color-surface: #FFFFFF;
  --color-surface-alt: #F5F3EE;
  --color-border: #D4D0C8;
  --color-text-primary: #1A1A1A;
  --color-text-secondary: #4A4A4A;
  --color-text-muted: #6B6B6B;
  --color-accent: #1B4F72;
  --color-accent-light: #2471A3;
  --color-accent-bg: #EBF5FB;
  --color-gold: #B7950B;
  --color-gold-light: #F9F3D5;
  --color-success: #1E8449;
  --color-focus: #2471A3;
  --color-error: #C0392B;

  /* --- Typography --- */
  --font-sans: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-serif: Georgia, 'Times New Roman', serif;
  --font-size-xs: 0.875rem;
  --font-size-sm: 1rem;
  --font-size-base: 1.125rem;
  --font-size-lg: 1.375rem;
  --font-size-xl: 1.75rem;
  --font-size-2xl: 2.25rem;
  --font-size-3xl: 3rem;

  /* --- Layout & Effects --- */
  --line-height: 1.6;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --transition: 0.2s ease;
  --max-width: 1200px;
}

/* --- Accessibility: High-Contrast override --- */
/* COLDFUSION NOTE: To persist this preference, add class="high-contrast"
   to the <body> tag server-side when the user's session flag is set. */
.high-contrast {
  --color-bg: #FFFFFF;
  --color-surface: #FFFFFF;
  --color-surface-alt: #F0F0F0;
  --color-border: #000000;
  --color-text-primary: #000000;
  --color-text-secondary: #1A1A1A;
  --color-text-muted: #333333;
  --color-accent: #00357A;
  --color-accent-light: #0051B5;
  --color-focus: #0051B5;
}

/* --- Accessibility: Large-Text override --- */
/* COLDFUSION NOTE: Same pattern — add class="large-text" to <body> to persist. */
.large-text {
  --font-size-xs: 1rem;
  --font-size-sm: 1.125rem;
  --font-size-base: 1.375rem;
  --font-size-lg: 1.625rem;
  --font-size-xl: 2rem;
  --font-size-2xl: 2.75rem;
  --font-size-3xl: 3.5rem;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height);
  color: var(--color-text-primary);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

*:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

a { color: var(--color-accent-light); text-decoration: underline; }
a:hover { color: var(--color-accent); }

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--color-accent);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: var(--font-size-sm);
  font-weight: 600;
  z-index: 10000;
  text-decoration: none;
}
.skip-link:focus { top: 16px; }


/* ========================================
   HEADER
   ========================================
   COLDFUSION NOTE: The header is rendered by the ColdFusion layout
   template. These styles apply to the .site-header wrapper and its
   children. Make sure your CF template outputs the same class names. */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner{
  max-width: var(--max-width);
  margin:0 auto;
  padding:12px 24px;

  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;

  flex-wrap:wrap;   /* allows layout to break to second row */
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--color-text-primary);
  flex-shrink: 0;
}

.logo-mark {
  width: 44px;
  height: 44px;
  background: var(--color-accent);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.5px;
}

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

.logo-title {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-accent);
  letter-spacing: -0.5px;
}

.logo-subtitle {
  font-size: 0.65rem;
  color: var(--color-text-muted);
  font-weight: 400;
  white-space: nowrap;
}

.nav-main{
  display:flex;
  align-items:center;
  gap:20px;
  flex-wrap:wrap;
}

.nav-login{
  max-width:180px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

/* --- Main Navigation ---
   COLDFUSION NOTE: Navigation links are currently hardcoded in HTML.
   In CF, you'll likely render these from a query or a config struct.
   The .active class and aria-current="page" should be set dynamically
   based on the current roomid / view. */
.nav-main{
  display:flex;
  align-items:center;
  gap:20px;
  flex-wrap:wrap;
}

.nav-main a {
  padding: 8px 14px;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font-sans);
}

.nav-main a:hover, .nav-main a.active {
  background: var(--color-accent-bg);
  color: var(--color-accent);
}

/* --- Accessibility toggle buttons --- */
.a11y-controls {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.a11y-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--color-text-secondary);
  transition: all var(--transition);
}

.a11y-btn:hover {
  background: var(--color-accent-bg);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.a11y-btn.active {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}


/* ========================================
   HERO / SEARCH SECTION — Compact
   ======================================== */
.hero {
  background: linear-gradient(135deg, var(--color-accent) 0%, #1A3C5E 100%);
  padding: 28px 24px 40px;
  text-align: center;
  position: relative;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 32px;
  background: var(--color-bg);
  border-radius: 32px 32px 0 0;
}

.hero-content {
  max-width: 720px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero h1 {
  color: #fff;
  font-size: var(--font-size-xl);
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

/* --- Stats bar (integrated into hero) ---
   COLDFUSION NOTE: The stat numbers (2,500+ Corps, 45,000+ Photos, etc.)
   are currently hardcoded. In CF, pull these from a summary query:
     <cfquery name="qStats">SELECT COUNT(*) AS total FROM corps</cfquery>
   Then output: #NumberFormat(qStats.total, ",")#+ */
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.hero-stat { text-align: center; }

.hero-stat-number {
  font-size: var(--font-size-base);
  font-weight: 700;
  color: rgba(255,255,255,0.95);
  letter-spacing: -0.3px;
}

.hero-stat-label {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.7);
  font-weight: 400;
}


/* ========================================
   SEARCH BAR
   ======================================== */
.search-container {
  position: relative;
  max-width: 680px;
  margin: 0 auto;
}

.search-bar {
  display: flex;
  background: #fff;
  border-radius: 56px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  border: 2px solid transparent;
  transition: border-color var(--transition);
}

.search-bar:focus-within {
  border-color: var(--color-gold);
  box-shadow: var(--shadow-lg), 0 0 0 4px rgba(183,149,11,0.2);
}

.search-icon {
  display: flex;
  align-items: center;
  padding: 0 0 0 20px;
  color: var(--color-text-muted);
  font-size: 22px;
}

.search-input {
  flex: 1;
  border: none;
  padding: 16px 14px;
  font-size: var(--font-size-sm);
  font-family: var(--font-sans);
  color: var(--color-text-primary);
  background: transparent;
  outline: none;
  min-width: 0;
}

.search-input::placeholder { color: var(--color-text-muted); }

.search-btn {
  padding: 10px 24px;
  margin: 5px;
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: 48px;
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: background var(--transition);
  white-space: nowrap;
}

.search-btn:hover { background: var(--color-accent-light); }

/* --- Suggestion chips below the search bar --- */
.search-suggestions {
  text-align: left;
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.suggestion-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 20px;
  color: rgba(255,255,255,0.9);
  font-size: var(--font-size-xs);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.suggestion-chip:hover {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

/* --- Autocomplete dropdown ---
   COLDFUSION NOTE: In the prototype, autocomplete data is static JSON.
   In CF, you'll want an AJAX endpoint that returns JSON for typeahead:
     /api/autocomplete.cfm?q=<term>
   The JS will fetch() that endpoint and render the dropdown. */
.autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
  overflow: hidden;
  z-index: 50;
  display: none;
}

.autocomplete-dropdown.show { display: block; }

.autocomplete-category {
  padding: 8px 16px 4px;
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}



/* ========================================
   SEARCH RESULTS
   ========================================
   COLDFUSION NOTE: In the live system, search results are rendered
   server-side via the search_results view. These styles still apply
   if you want client-side rendering of results returned as JSON. */
.results-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: none;
}

.results-section.show { display: block; }

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0 16px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 24px;
}

.results-header h2 {
  font-size: var(--font-size-lg);
  font-weight: 600;
}

.results-header .count {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

.result-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
  transition: box-shadow var(--transition), border-color var(--transition);
}

.result-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-accent-light);
}

.result-card .result-type {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 8px;
}

/* Result type color badges */
.result-type.competition { background: #E8F5E9; color: #2E7D32; }
.result-type.corps       { background: #E3F2FD; color: #1565C0; }
.result-type.uniform     { background: #FFF3E0; color: #E65100; }
.result-type.photo       { background: #F3E5F5; color: #7B1FA2; }

.result-card h3 {
  font-size: var(--font-size-lg);
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--color-accent);
}

.result-card .result-meta {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-bottom: 12px;
}

.result-card .result-detail {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  line-height: 1.5;
}

.result-card .result-detail strong { color: var(--color-text-primary); }

/* --- Score table inside result cards --- */
.score-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: var(--font-size-sm);
}

.score-table th {
  text-align: left;
  padding: 8px 12px;
  background: var(--color-surface-alt);
  font-weight: 600;
  border-bottom: 2px solid var(--color-border);
}

.score-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--color-border);
}

.score-table tr:hover td { background: var(--color-accent-bg); }
.score-table .rank-1 { font-weight: 700; color: var(--color-gold); }


/* ========================================
   GALLERY SECTION
   ========================================
   COLDFUSION NOTE: Gallery cards are generated from galleryData JSON.
   In CF, you'll loop over a query or struct to output each card.
   The data-gallery attribute on each card is the KEY that maps to its
   dropdown data (decades, corps, instruments, etc.).
   ======================================== */
.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-top: 24px;
}

.section-header h2 {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-text-primary);
  letter-spacing: -0.3px;
}

.section-header .view-all {
  font-size: var(--font-size-sm);
  color: var(--color-accent-light);
  text-decoration: none;
  font-weight: 500;
}

.section-header .view-all:hover { text-decoration: underline; }

/* --- Gallery grid --- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 16px;
}

.gallery-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.gallery-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.gallery-card:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

.gallery-card.active,
.gallery-card.expanded {
  transform: none !important;
  box-shadow: var(--shadow-lg);
}

/* --- Card gradient backgrounds ---
   Each gallery key gets its own gradient. The data-gallery attribute
   value must match one of these selectors. */
.gallery-card[data-gallery="decades"]     { background: linear-gradient(135deg, #1B4F72, #2E86C1); }
.gallery-card[data-gallery="museum"]      { background: linear-gradient(135deg, #341c7b, #35aacb); }
.gallery-card[data-gallery="corps"]        { background: linear-gradient(135deg, #7B241C, #CB4335); }
.gallery-card[data-gallery="instruments"]  { background: linear-gradient(135deg, #B7950B, #D4AC0D); }
.gallery-card[data-gallery="uniforms"]     { background: linear-gradient(135deg, #1E8449, #27AE60); }
.gallery-card[data-gallery="photos"]       { background: linear-gradient(135deg, #6C3483, #A569BD); }
.gallery-card[data-gallery="scores"]       { background: linear-gradient(135deg, #CA6F1E, #EB984E); }
.gallery-card[data-gallery="hallOfFame"]   { background: linear-gradient(135deg, #1A5276, #5DADE2); }
.gallery-card[data-gallery="blog"]         { background: linear-gradient(135deg, #515A5A, #95A5A6); }
.gallery-card[data-gallery="people"]       { background: linear-gradient(135deg, #6E2C00, #DC7633); }
.gallery-card[data-gallery="links"]        { background: linear-gradient(135deg, #002c6e, #3377dc); }

.gallery-card[data-gallery] {
  border: none;
  color: #fff;
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 220px;
  position: relative;
  overflow: hidden;
}

/* --- Centered gallery card image --- */
.card-image {
  width: 100%;
  max-height: 160px;
  object-fit: contain;
  margin: auto 0;
  flex-shrink: 0;
  border-radius: 6px;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}

/* --- Stats badge (top-left of card) --- */
.card-badge {
  position: absolute;
  top: 10px;
  left: 12px;
  font-size: 11px;
  background: rgba(0,0,0,0.45);
  padding: 3px 10px;
  border-radius: 12px;
  color: #fff;
  font-weight: 500;
  z-index: 1;
}

.gallery-card .card-title {
  font-size: var(--font-size-sm);
  font-weight: 700;
  margin-bottom: 2px;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
  width: 100%;
  text-align: center;
}

.gallery-card .card-desc {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.85);
  line-height: 1.35;
  margin-bottom: 0;
  text-align: center;
  width: 100%;
}

/* --- Featured gallery layout --- */
.gallery-grid.featured {
  grid-template-columns: 1fr 1fr;
}

.gallery-grid.featured .gallery-card:first-child {
  grid-row: span 2;
}

.gallery-grid.featured .gallery-card:first-child .card-image {
  max-height: 280px;
}


/* ========================================
   CARD DROPDOWN — native <select> within each card
   ========================================
   COLDFUSION NOTE: The dropdown is populated dynamically from JSON.
   In CF, the <select> options will come from a query:
     <cfquery name="qOptions">
       SELECT label, url FROM gallery_items WHERE galleryKey = '#key#'
     </cfquery>
   The JS builds <select> elements from the loaded JSON; in CF you can
   either keep this client-side approach (recommended) or render
   <select> elements server-side with <cfoutput>. */
.card-dropdown {
  display: none;
  margin-top: 12px;
}

.gallery-card.expanded .card-dropdown {
  display: block;
}

.card-dropdown select {
  width: 100%;
  padding: 9px 12px;
  font-size: var(--font-size-xs);
  font-family: var(--font-sans);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(0,0,0,0.3);
  color: #fff;
  cursor: pointer;
  appearance: auto;
  backdrop-filter: blur(4px);
}

.card-dropdown select option,
.card-dropdown select optgroup {
  background: #333;
  color: #fff;
}

.card-dropdown select:focus-visible {
  outline: 3px solid rgba(255,255,255,0.6);
  outline-offset: 2px;
}

.card-dropdown select optgroup { font-weight: 600; }


/* ========================================
   FOOTER
   ======================================== */
.site-footer {
  background: var(--color-accent);
  color: rgba(255,255,255,0.85);
  padding: 48px 24px 32px;
  margin-top: 64px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}

.footer-brand .footer-logo {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.footer-brand p {
  font-size: var(--font-size-sm);
  line-height: 1.5;
  opacity: 0.8;
}

.footer-col h4 {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: #fff;
  margin-bottom: 12px;
}

.footer-col a {
  display: block;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: var(--font-size-sm);
  padding: 4px 0;
  transition: color var(--transition);
}

.footer-col a:hover { color: #fff; }

.footer-bottom {
  max-width: var(--max-width);
  margin: 32px auto 0;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.2);
  font-size: var(--font-size-xs);
  opacity: 0.7;
  text-align: center;
}

.footer-bottom a {
  color: #fff;
  text-decoration: underline;
}

.footer-bottom a:hover {
  color: #fff;
}


/* ========================================
   IFRAME VIEWER OVERLAY
   ========================================
   COLDFUSION NOTE: The iframe viewer displays DCX pages inside
   the new UI shell. The openInViewer() JS function appends
   "noheader=1" to dcxmuseum.org URLs so the CF layout template
   suppresses its own header/footer when loaded inside the iframe. */
/* cpmwork 2026-03-06 Replace this with code below to deal with layering things
   .iframe-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99;
  background: var(--color-bg);
}

.iframe-overlay.open {
  display: flex;
  flex-direction: column;
}
*/

.iframe-overlay {
  display: none;
  position: fixed;
  top: var(--dcx-header-offset, 96px);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  background: var(--color-bg);
}

.iframe-overlay.open {
  display: flex;
  flex-direction: column;
}

.iframe-container {
  flex: 1;
  position: relative;
  overflow: auto;
}

.iframe-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}
/* --------- end iframe change -----*/

.iframe-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  background: var(--color-accent);
  gap: 16px;
}

/*.iframe-toolbar-title { display: none; }*/
.iframe-toolbar-title {
  display: block;
  flex: 1;
  color: #fff;
}

.iframe-toolbar-actions {
  display: flex;
  gap: 12px;
}

.iframe-toolbar-btn {
  padding: 8px 24px;
  border: 2px solid #fff;
  background: transparent;
  border-radius: var(--radius);
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-sans);
  color: #fff;
  transition: all var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.iframe-toolbar-btn:hover {
  background: #fff;
  color: var(--color-accent);
}

.iframe-toolbar-btn.close-btn {
  background: rgba(255,255,255,0.15);
}

.iframe-toolbar-btn.close-btn:hover {
  background: #fff;
  color: var(--color-error);
  border-color: #fff;
}

.iframe-container {
  flex: 1;
  position: relative;
  overflow: auto;
}

.iframe-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* --- Responsive image viewer (for direct image URLs) --- */
.image-viewer-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 16px;
  background: #1a1a1a;
}

.image-viewer-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}

.iframe-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  font-size: var(--font-size-base);
  color: var(--color-text-muted);
}

.iframe-loading.hidden { display: none; }

/* --- YouTube embed container --- */
.youtube-embed-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #000;
}

.youtube-embed-container iframe {
  width: 100%;
  max-width: 960px;
  height: 100%;
  max-height: 540px;
  border: none;
}

.youtube-fallback {
  margin-top: 16px;
  color: rgba(255,255,255,0.7);
  font-size: var(--font-size-sm);
  text-align: center;
}

.youtube-fallback a {
  color: #fff;
  text-decoration: underline;
}


/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */
@media (max-width: 768px) {
  .header-inner { flex-wrap: nowrap; }
  .nav-main {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .hero { padding: 20px 16px 36px; }
  .hero h1 { font-size: var(--font-size-lg); }
  .hero-stats { gap: 16px; }
  .search-btn { padding: 8px 16px; }
  .gallery-grid.featured { grid-template-columns: 1fr; }
  .gallery-grid.featured .gallery-card:first-child { grid-row: span 1; min-height: 200px; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .logo-text { display: none; }
  .gallery-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
}

@media (max-width:900px){

  .header-inner{
    align-items:flex-start;
  }

  .nav-main{
    width:100%;
    order:3;
    padding-top:8px;
  }

  .a11y-controls{
    order:2;
  }

}

/* cpmwork 2026-03-03 */
.nav-main .dropdown { position: relative; }
.nav-main .dropdown-menu { position: absolute; }

/* cpmwork 2026-03-05 - changes for auto complete*/
/* --- Autocomplete dropdown (clean + minimal) --- */
.search-container { position: relative; }

.autocomplete-dropdown{
  position: absolute;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 2000;          /* above page content */
  background: #fff;       /* no bleed-through */
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,.12);
}

.autocomplete-category{
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  background: rgba(0,0,0,.04);
  border-top: 1px solid rgba(0,0,0,.08);
}

.autocomplete-item{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  background: #fff;
  border-top: 1px solid rgba(0,0,0,.06);
}

.autocomplete-item:hover{ background: rgba(0,0,0,.035); }

.autocomplete-item .icon{
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.05);
  flex: 0 0 auto;
}

.autocomplete-item .icon i.fa{
  font-size: 14px;
  color: rgba(0,0,0,.70);
}

.autocomplete-item .line{
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
}

.autocomplete-item .title{
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
}

.autocomplete-item .meta{
  font-size: 12px;
  color: rgba(0,0,0,.60);
  overflow: hidden;
  text-overflow: ellipsis;
}

.autocomplete-item .typechip{
  margin-left: auto;
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.12);
  color: rgba(0,0,0,.72);
  background: rgba(0,0,0,.03);
}


/* Autocomplete must sit above hero/gallery badges */
.autocomplete-dropdown {
  z-index: 3500;
}

/* ===========================
   LAYERING (z-index ladder)
   =========================== */

/* 1) Header area always on top (login dropdown, nav menus, etc.) */
#topstuff,
#topnav {
  position: relative;
  z-index: 1000;
}

/* 2) Hero/search sits above the page content */
.hero,
.hero-content,
.search-container {
  position: relative;
  z-index: 100;
}

/* 3) Autocomplete dropdown above hero + gallery cards */
.autocomplete-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 200;
  background: #fff;      /* stays opaque */
}

/* 4) Gallery section/cards below hero dropdown */
.section,
.gallery-grid,
.gallery-card {
  position: relative;
  z-index: 1;
}

/* Simple spinner animation */
.search-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
  margin-right: 5px;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Visual cue that the button is disabled */
.search-btn:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.modern-select {
    padding: 3px 8px;
    font-size: 0.85em; /* Keeps it slightly smaller than the main text */
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #f9f9f9;
    color: #333;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
    vertical-align: middle;
}

.modern-select:hover, .modern-select:focus {
    border-color: #0056b3;
    box-shadow: 0 0 4px rgba(0, 86, 179, 0.2);
    background-color: #fff;
}

/* ===================================================================
   GALLERIES MEGA-MENU (nav dropdown)
   To revert: comment out this entire block. Also comment out the
   nav-galleries-wrap HTML in dcx_top_v2.cfm and uncomment the
   original navGalleries anchor link.
   =================================================================== */

.nav-galleries-wrap {
  position: relative;
}

/* Trigger button: identical visual to .nav-main a links */
.nav-galleries-trigger {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  border-radius: var(--radius);
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  font-weight: 500;
  font-family: var(--font-sans);
  white-space: nowrap;
  cursor: pointer;
  border: none;
  background: none;
  transition: background var(--transition), color var(--transition);
}

.nav-galleries-trigger:hover,
.nav-galleries-trigger[aria-expanded="true"] {
  background: var(--color-accent-bg);
  color: var(--color-accent);
}

.nav-caret {
  font-size: 0.65em;
  transition: transform var(--transition);
  display: inline-block;
}

.nav-galleries-trigger[aria-expanded="true"] .nav-caret {
  transform: rotate(180deg);
}

/* Dropdown panel.
   IMPORTANT: do NOT set display here — the browser's [hidden] attribute
   sets display:none by default. Setting display:grid here would override
   [hidden] and make the panel always visible. */
.nav-galleries-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  width: 460px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 10px;
  z-index: 150;
  animation: galleriesMenuFadeIn 0.13s ease;
}

@keyframes galleriesMenuFadeIn {
  from { opacity: 0; margin-top: -5px; }
  to   { opacity: 1; margin-top: 0; }
}

/* Inner grid — reuses the same .gallery-card elements as the home page.
   Adding a new gallery card to the DB automatically appears here too. */
.nav-galleries-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}

/* Compact card overrides for the nav panel context.
   The gradient colors come from the existing .gallery-card[data-gallery="KEY"]
   rules already in this file — no per-key rules needed here. */
.nav-galleries-panel .gallery-card {
  min-height: 44px;
  padding: 9px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  /* suppress home-page sizing */
  transform: none !important;
}

.nav-galleries-panel .gallery-card .card-title {
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.25;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
  margin: 0;
}

/* Hide home-page-only elements if they ever appear inside the panel */
.nav-galleries-panel .card-image,
.nav-galleries-panel .card-badge,
.nav-galleries-panel .card-desc { display: none; }

/* Expanded card spans full width so the dropdown select has room */
.nav-galleries-panel .gallery-card.expanded {
  grid-column: 1 / -1;
}

/* Mobile: pin to left edge */
@media (max-width: 768px) {
  .nav-galleries-panel {
    left: 0;
    transform: none;
    width: min(460px, calc(100vw - 24px));
  }

  .nav-galleries-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* === END GALLERIES MEGA-MENU === */
