/* Yellow Hat Consulting - Main Styles */

/* ─────────────────────────────────────────────────────────────
   ACCESSIBILITY — Skip to main content (WCAG 2.4.1)
   Visually hidden until focused by keyboard. Must be the
   first focusable element in <body> on every page.
   ───────────────────────────────────────────────────────────── */
.skip-to-main {
    position: absolute;
    top: -100%;
    left: 1rem;
    z-index: 9999;
    background: var(--yellow-hat);
    color: var(--dark-grey-dark);
    font-weight: 700;
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0 0 0.5rem 0.5rem;
    text-decoration: none;
    transition: top 0.2s ease;
}
.skip-to-main:focus {
    top: 0;
    outline: 3px solid var(--dark-grey-dark);
    outline-offset: 2px;
}

/* ─────────────────────────────────────────────────────────────
   ACCESSIBILITY — Visible focus ring (WCAG 2.4.7)
   :focus-visible shows ring for keyboard nav only,
   not on mouse clicks — best of both worlds.
   ───────────────────────────────────────────────────────────── */
:focus-visible {
    outline: 3px solid var(--yellow-hat-dark);
    outline-offset: 3px;
    border-radius: 2px;
}
:focus:not(:focus-visible) {
    outline: none;
}

/* ─────────────────────────────────────────────────────────────
   ACCESSIBILITY — Screen-reader only utility class
   Hides content visually but keeps it accessible to
   assistive technology (e.g. form error summaries,
   additional context on icon-only buttons).
   ───────────────────────────────────────────────────────────── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Custom CSS Variables for Yellow Hat Branding */
:root {
  --yellow-hat: #FFD65B;
  --yellow-hat-dark: #F59E0B;
  --yellow-hat-light: #FEF3C7;
  --yellow-hat-support-olive: #a18f65;
  --yellow-hat-support-sand: #a38f5c;
  --yellow-hat-cream: #fef9f0;
  --yellow-hat-grey-light: #dfe0df;
  --navbar-footer-bg: #402e32;
  --site-bg: #fff9ee;
  --text-on-dark-primary: #fef9f0;
  --text-on-dark-secondary: #dfe0df;
  --dark-grey: #374151;
  --dark-grey-light: #4B5563;
  --dark-grey-dark: #1F2937;
}

/* Global Styles */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Mulish', system-ui, sans-serif;
}

/* ─────────────────────────────────────────────────────────────
   MOBILE MENU
   Uses visibility + opacity (not display:none) so assistive
   technology correctly treats it as hidden when closed.
   The aria-hidden attribute on the element itself is managed
   by main.js whenever the menu opens or closes.
   ───────────────────────────────────────────────────────────── */
.mobile-menu {
    visibility: hidden;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.25s ease, max-height 0.3s ease, visibility 0s linear 0.3s;
}

.mobile-menu.show {
    visibility: visible;
    opacity: 1;
    max-height: 400px;
    transition: opacity 0.25s ease, max-height 0.3s ease, visibility 0s linear 0s;
}

/* Hamburger Menu Button */
.hamburger {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    padding: 4px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: #FEF3C7;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 3px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Hero background pattern */
.hero-pattern {
    background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.15) 1px, transparent 0);
    background-size: 60px 60px;
}

/* Logo carousel animations */
.carousel-container {
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}
.carousel-track {
    display: inline-flex;
    animation: scroll 30s linear infinite;
    gap: 1.5rem;
}
@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.carousel-track:hover {
    animation-play-state: paused;
}

/* Keyframe animations */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes fadeIn {
    from { transform: translateY(30px); }
    to { transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Animation utility classes */
.animate-float {
    animation: float 6s ease-in-out infinite;
}

.animate-fadeIn {
    animation: fadeIn 0.8s ease-out forwards;
}

.animate-slideIn {
    animation: slideIn 0.5s ease-out forwards;
}

/* Custom hover effects */
.hover-lift {
    transition: all 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Custom button styles */
.btn-primary {
    background-color: var(--yellow-hat);
    color: var(--dark-grey-dark);
    font-weight: 600;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background-color: var(--yellow-hat-dark);
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    background-color: transparent;
    border: 2px solid var(--yellow-hat);
    color: var(--yellow-hat);
    font-weight: 600;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background-color: var(--yellow-hat);
    color: var(--dark-grey-dark);
}

/* Navigation active state */
.nav-active {
    color: var(--yellow-hat-dark) !important;
    font-weight: 600;
    border-bottom: 2px solid var(--yellow-hat-dark);
}

/* Ensure images scale properly and are contained */
section img {
  object-fit: cover;
  width: 100%;
  height: auto;
}

/* Mobile adjustments for full-sized images */
@media (max-width: 640px) {
  section img {
    max-height: 16rem;
  }
}

/* Hover overlay effect for images */
section img {
  position: relative;
  transition: all 0.3s ease;
}

section img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.3), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 0.75rem;
}

section img:hover::after {
  opacity: 1;
}

/* Ensure CTA buttons align properly */
.btn-primary {
  margin-top: 1rem;
}

/* Tabbed Interface */
.service-tab {
    transition: all 0.3s ease;
}
.service-tab[aria-selected="true"] {
    background-color: var(--yellow-hat-light);
    color: var(--dark-grey-dark);
}

/* Accordion Styling (Desktop) */
.accordion-toggle svg:last-child {
    transition: transform 0.3s ease;
}
.accordion-toggle[aria-expanded="true"] svg:last-child {
    transform: rotate(180deg);
}
.service-accordion {
    transition: all 0.3s ease;
}
.service-accordion:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    background-color: var(--yellow-hat-light);
}

/* Icon Styling */
.service-panel svg,
.accordion-toggle svg,
.service-card svg {
    fill: var(--yellow-hat);
}
.service-panel svg:hover,
.accordion-toggle svg:hover,
.service-card svg:hover {
    fill: var(--yellow-hat-dark);
}

/* Desktop Layout */
@media (min-width: 1024px) {
    .service-panel {
        min-height: 24rem;
    }
    .service-accordion {
        width: 100%;
    }
}

/* Mobile Grid Layout */
@media (max-width: 1023px) {
    .service-card {
        max-width: 24rem;
        margin-left: auto;
        margin-right: auto;
    }
    .service-card:focus {
        outline: 2px solid var(--yellow-hat-dark);
        outline-offset: 2px;
    }
    .lg\:flex {
        display: none !important;
    }
}

/* YouTube Iframe */
.service-panel iframe,
.service-card iframe {
    width: 100%;
    height: 100%;
}

/* Ensure images in service cards are centered and contained */
.service-card img {
  object-fit: contain;
}

/* Mobile padding adjustment */
@media (max-width: 640px) {
  .service-card {
    padding: 1.25rem;
  }
}

/* Alternate card backgrounds for visual variety */
.service-card:nth-child(even) {
  background: linear-gradient(135deg, var(--yellow-hat-cream), #f9fafb);
}

/* Service card hover effects */
.service-card {
    transition: all 0.3s ease;
    background: linear-gradient(135deg, var(--yellow-hat-light), white);
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.service-card:nth-child(even) {
    background: linear-gradient(135deg, #f9fafb, white);
}

/* White paper image hover effect */
.whitepaper-image {
    transition: all 0.3s ease;
}

.whitepaper-image:hover {
    transform: scale(1.05);
}

.whitepaper-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.whitepaper-image:hover::after {
    opacity: 1;
}

/* Event card styles */
.event-card {
    transition: all 0.3s ease;
}

.event-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

/* Journey Map Styles */
.journey-container {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 0;
}

.journey-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    background-color: var(--yellow-hat-light);
    z-index: 0;
}

.journey-step {
    position: relative;
    z-index: 1;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.journey-step.active {
    transform: scale(1.1);
}

.journey-step svg {
    fill: var(--yellow-hat);
}

.journey-step:hover svg {
    fill: var(--yellow-hat-dark);
}

.journey-step.active svg {
    fill: var(--yellow-hat-dark);
}

.journey-content {
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.journey-content.active {
    display: block;
    opacity: 1;
}

@media (max-width: 767px) {
    .journey-container {
        flex-direction: column;
        gap: 2rem;
    }
    .journey-line {
        width: 4px;
        height: 100%;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
    }
    .journey-step {
        width: 100%;
        max-width: 20rem;
    }
    .journey-content {
        margin-top: 1rem;
    }
}

/* Assessment Tool Styles */
.assessment-container {
    max-width: 32rem;
    margin: 0 auto;
}

.progress-bar {
    height: 0.5rem;
    background-color: var(--yellow-hat-light);
    border-radius: 0.25rem;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background-color: var(--yellow-hat);
    transition: width 0.3s ease;
}

.assessment-step {
    display: none;
}

.assessment-step.active {
    display: block;
    animation: slideIn 0.5s ease-out forwards;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.radio-label {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background-color: white;
    border: 2px solid var(--yellow-hat-light);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.radio-label:hover {
    border-color: var(--yellow-hat);
    background-color: var(--yellow-hat-cream);
}

.radio-label input[type="radio"] {
    margin-right: 0.5rem;
}

.radio-label input[type="radio"]:checked + span {
    font-weight: 600;
    color: var(--yellow-hat-dark);
}

.results-container {
    display: none;
}

.results-container.active {
    display: block;
    animation: fadeIn 0.8s ease-out forwards;
}

.score-bar {
    height: 1rem;
    background-color: var(--yellow-hat-light);
    border-radius: 0.5rem;
    overflow: hidden;
}

.score-bar-fill {
    height: 100%;
    background-color: var(--yellow-hat-dark);
    transition: width 1s ease;
}

@media (max-width: 640px) {
    .assessment-container {
        padding: 0 1rem;
    }
    .radio-label {
        padding: 0.5rem;
        font-size: 0.875rem;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .carousel-track {
        animation-duration: 20s;
    }
    .hero-pattern {
        background-size: 15px 15px;
    }
}

/* ─────────────────────────────────────────────────────────────
   ACCESSIBILITY — Reduced motion (WCAG 2.3.3)
   Respects the user's OS-level "Reduce Motion" preference.
   All transforms, transitions, and animations are either
   removed or replaced with simple opacity fades.
   ───────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {

    /* Disable all transitions globally */
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    /* Stop carousel scrolling — show logos statically */
    .carousel-track {
        animation: none;
    }

    /* Remove float animation */
    .animate-float {
        animation: none;
    }

    /* Replace slide/fade-in with instant opacity reveal */
    .animate-fadeIn,
    .animate-slideIn {
        animation: none;
        opacity: 1;
        transform: none;
    }

    /* Remove hover lifts */
    .hover-lift:hover,
    .service-card:hover,
    .event-card:hover,
    .whitepaper-image:hover {
        transform: none;
    }

    /* Keep mobile menu visible if open, just skip transition */
    .mobile-menu.show {
        transition: none;
    }

    /* Disable hero button transforms */
    a[class*="hover:-translate"] {
        transform: none !important;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    h1, h2, h3 {
        page-break-after: avoid;
    }
}

/* ═══════════════════════════════════════════════════════════════
   SCROLL-TO-TOP BUTTON
   Appears after scrolling 300px. Keyboard accessible.
   ═══════════════════════════════════════════════════════════════ */
.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 500;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--yellow-hat, #FFD65B);
    color: var(--dark-grey-dark, #1F2937);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition:
        opacity      0.3s ease,
        visibility   0s linear 0.3s,
        transform    0.3s ease,
        background   0.2s ease;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition:
        opacity      0.3s ease,
        visibility   0s linear 0s,
        transform    0.3s ease,
        background   0.2s ease;
}

.scroll-to-top:hover {
    background-color: var(--yellow-hat-dark, #F59E0B);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}

.scroll-to-top:focus-visible {
    outline: 3px solid var(--dark-grey-dark, #1F2937);
    outline-offset: 3px;
}

.scroll-to-top svg {
    width: 20px;
    height: 20px;
    pointer-events: none;
}

/* Move button up when cookie banner is visible */
.cookie-banner-visible .scroll-to-top {
    bottom: 5.5rem;
}

@media (max-width: 640px) {
    .scroll-to-top {
        bottom: 1.25rem;
        right: 1.25rem;
        width: 42px;
        height: 42px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .scroll-to-top,
    .scroll-to-top.visible {
        transition: opacity 0.01ms, visibility 0s;
        transform: none;
    }
}
