/*
Theme Name: Credo
Theme URI: https://credocomms.com
Author: Credo Communications
Author URI: https://credocomms.com
Description: Custom WordPress theme for Credo Communications, tailored for corporate credibility, strategic influence, and modern performance.
Version: 1.0.1
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
Text Domain: credo
*/

/* Reset & Helper overrides */
html {
    overflow-x: hidden !important;
    max-width: 100vw;
    margin: 0 !important;
    padding: 0 !important;
}
body {
    overflow-x: hidden !important;
    max-width: 100vw;
    position: relative;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Ensure sticky/fixed navigation aligns cleanly with or without the WordPress admin bar */
body.admin-bar nav {
    top: 32px;
}
@media screen and (max-width: 782px) {
    body.admin-bar nav {
        top: 46px;
    }
}
@media screen and (max-width: 600px) {
    body.admin-bar nav.header-scrolled {
        top: 0 !important;
    }
}

/* Hide scrollbar for Chrome, Safari and Opera */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
/* Hide scrollbar for IE, Edge and Firefox */
.no-scrollbar {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* =========================================================
   ENTRANCE & SCROLL REVEAL ANIMATION SYSTEM
   ========================================================= */

[data-reveal] {
    opacity: 0;
    transition-property: opacity, transform;
    transition-duration: 0.85s;
    transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

[data-reveal="up"] {
    transform: translateY(35px);
}

[data-reveal="down"] {
    transform: translateY(-35px);
}

[data-reveal="left"] {
    transform: translateX(35px);
}

[data-reveal="right"] {
    transform: translateX(-35px);
}

[data-reveal="fade"] {
    transform: none;
}

[data-reveal="scale"] {
    transform: scale(0.92);
}

/* Revealed active state */
[data-reveal].is-revealed {
    opacity: 1 !important;
    transform: translate(0, 0) scale(1) !important;
}

/* Stagger delay utility attributes */
[data-reveal-delay="100"] { transition-delay: 0.1s; }
[data-reveal-delay="150"] { transition-delay: 0.15s; }
[data-reveal-delay="200"] { transition-delay: 0.2s; }
[data-reveal-delay="250"] { transition-delay: 0.25s; }
[data-reveal-delay="300"] { transition-delay: 0.3s; }
[data-reveal-delay="350"] { transition-delay: 0.35s; }
[data-reveal-delay="400"] { transition-delay: 0.4s; }
[data-reveal-delay="450"] { transition-delay: 0.45s; }
[data-reveal-delay="500"] { transition-delay: 0.5s; }
[data-reveal-delay="600"] { transition-delay: 0.6s; }
[data-reveal-delay="700"] { transition-delay: 0.7s; }
[data-reveal-delay="800"] { transition-delay: 0.8s; }

/* Initial load hero animation keyframes */
@keyframes heroEntranceFadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heroEntranceFadeDown {
    from {
        opacity: 0;
        transform: translateY(-25px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.anim-nav-in {
    animation: heroEntranceFadeDown 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.anim-hero-tag {
    animation: heroEntranceFadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.15s forwards;
    opacity: 0;
}

.anim-hero-title {
    /* Instantly visible for optimal LCP without render blocking delay */
    opacity: 1;
}

.anim-hero-desc {
    animation: heroEntranceFadeUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.45s forwards;
    opacity: 0;
}

.anim-hero-buttons {
    animation: heroEntranceFadeUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.6s forwards;
    opacity: 0;
}

/* =========================================================
   STICKY SCROLLING HEADER & LOGO SWAP
   ========================================================= */
#site-navigation {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    transition: background-color 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

body.admin-bar #site-navigation {
    top: 32px;
}
@media screen and (max-width: 782px) {
    body.admin-bar #site-navigation {
        top: 46px;
    }
}
@media screen and (max-width: 600px) {
    body.admin-bar #site-navigation.header-scrolled {
        top: 0 !important;
    }
}

/* Default / Top State: Transparent, White Logo shown */
#site-navigation:not(.header-scrolled) {
    background-color: transparent !important;
    box-shadow: none !important;
    border-bottom: 1px solid transparent;
}

#site-navigation:not(.header-scrolled) #site-logo-white {
    display: block !important;
}

#site-navigation:not(.header-scrolled) #site-logo-colored {
    display: none !important;
}

#site-navigation:not(.header-scrolled) .nav-link-item:not(.nav-link-active) {
    color: #ffffff !important;
}
#site-navigation:not(.header-scrolled) .nav-link-item:not(.nav-link-active):hover {
    color: #4c92db !important;
}

#site-navigation:not(.header-scrolled) #mobile-menu-toggle {
    color: #ffffff !important;
}

#site-navigation:not(.header-scrolled) #mobile-menu {
    background-color: rgba(11, 22, 44, 0.96) !important;
}
#site-navigation:not(.header-scrolled) #mobile-menu .mobile-nav-link:not(.nav-link-active) {
    color: #ffffff !important;
}

/* Scrolled State: Solid White, Colored Logo shown */
#site-navigation.header-scrolled {
    background-color: #ffffff !important;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.08) !important;
    border-bottom: 1px solid #f1f5f9 !important;
}

#site-navigation.header-scrolled .nav-inner-container {
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
}

#site-navigation.header-scrolled #site-logo-white {
    display: none !important;
}

#site-navigation.header-scrolled #site-logo-colored {
    display: block !important;
}

#site-navigation.header-scrolled .nav-link-item:not(.nav-link-active) {
    color: #0b162c !important;
}
#site-navigation.header-scrolled .nav-link-item:not(.nav-link-active):hover {
    color: #4c92db !important;
}

#site-navigation.header-scrolled #mobile-menu-toggle {
    color: #0b162c !important;
}

#site-navigation.header-scrolled #mobile-menu {
    background-color: #ffffff !important;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}
#site-navigation.header-scrolled #mobile-menu .mobile-nav-link:not(.nav-link-active) {
    color: #0b162c !important;
}

/* =========================================================
   PAGINATION STYLING (Work & Insights)
   ========================================================= */
.credo-pagination ul.page-numbers {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.credo-pagination ul.page-numbers li {
    display: inline-flex;
    margin: 0;
    padding: 0;
}

.credo-pagination ul.page-numbers a,
.credo-pagination ul.page-numbers span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    height: 2.75rem;
    padding: 0 0.875rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.75rem;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
    border: 1px solid #e2e8f0;
    background-color: #ffffff;
    color: #475569;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.credo-pagination ul.page-numbers a:hover {
    background-color: #f1f5f9;
    color: #0b162c;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07);
}

.credo-pagination ul.page-numbers span.current {
    background-color: #0b162c;
    color: #ffffff;
    border-color: #0b162c;
    box-shadow: 0 4px 12px rgba(11, 22, 44, 0.18);
}

.credo-pagination ul.page-numbers .dots {
    border: none;
    background: transparent;
    box-shadow: none;
    color: #94a3b8;
    cursor: default;
    min-width: 1.5rem;
}

.credo-pagination ul.page-numbers a.prev,
.credo-pagination ul.page-numbers a.next {
    font-size: 0.8125rem;
    font-weight: 600;
    gap: 0.25rem;
    padding: 0 1.125rem;
}

/* =========================================================
   CLIENT LOGOS TWO-ROW INFINITE MARQUEE
   ========================================================= */

.credo-marquee-viewport {
    position: relative;
    width: 100%;
    overflow: hidden;
    mask-image: linear-gradient(to right, transparent 0%, #000 36px, #000 calc(100% - 36px), transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 36px, #000 calc(100% - 36px), transparent 100%);
}

@media (min-width: 768px) {
    .credo-marquee-viewport {
        mask-image: linear-gradient(to right, transparent 0%, #000 64px, #000 calc(100% - 64px), transparent 100%);
        -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 64px, #000 calc(100% - 64px), transparent 100%);
    }
}

.credo-marquee-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

@media (min-width: 768px) {
    .credo-marquee-wrapper {
        gap: 1.5rem;
    }
}

.credo-marquee-row {
    position: relative;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    display: flex;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.credo-marquee-row::-webkit-scrollbar {
    display: none;
}

.credo-marquee-track {
    display: flex;
    width: max-content;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.credo-marquee-track-interactive {
    animation: none !important;
}

.credo-marquee-track-left {
    will-change: transform;
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    animation: credoMarqueeLeft 52s linear infinite;
}

.credo-marquee-track-right {
    will-change: transform;
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    animation: credoMarqueeRight 58s linear infinite;
}

.credo-marquee-group {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 2rem;
    padding-right: 2rem;
    contain: layout paint;
}

@media (min-width: 768px) {
    .credo-marquee-group {
        gap: 3rem;
        padding-right: 3rem;
    }
}

.credo-marquee-item {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 8.5rem;
    height: 4.5rem;
    padding: 0.375rem 0.5rem;
    user-select: none;
    -webkit-user-select: none;
    contain: layout;
}

@media (min-width: 640px) {
    .credo-marquee-item {
        width: 10.5rem;
        height: 5.25rem;
        padding: 0.5rem 0.75rem;
    }
}

@media (min-width: 768px) {
    .credo-marquee-item {
        width: 12.5rem;
        height: 6rem;
        padding: 0.5rem 1rem;
    }
}

.credo-marquee-logo {
    max-height: 2.35rem;
    max-width: 7.25rem;
    width: auto;
    height: auto;
    object-fit: contain;
    opacity: 0.85;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

@media (min-width: 640px) {
    .credo-marquee-logo {
        max-height: 2.75rem;
        max-width: 8.75rem;
    }
}

@media (min-width: 768px) {
    .credo-marquee-logo {
        max-height: 3.1rem;
        max-width: 9.75rem;
    }
}

.credo-marquee-item:hover .credo-marquee-logo {
    opacity: 1;
    transform: scale(1.05);
}

/* Size boost for light, thin, or fine-detail logos (Chaimaa, Shurooq, TUV, DCD, BHA, etc.) */
.credo-marquee-logo--compact {
    max-height: 2.85rem;
    max-width: 7.25rem;
    transform: scale(1.08);
}

@media (min-width: 640px) {
    .credo-marquee-logo--compact {
        max-height: 3.35rem;
        max-width: 8.5rem;
        transform: scale(1.12);
    }
}

@media (min-width: 768px) {
    .credo-marquee-logo--compact {
        max-height: 3.85rem;
        max-width: 9.5rem;
        transform: scale(1.15);
    }
}

.credo-marquee-item:hover .credo-marquee-logo--compact {
    opacity: 1;
    transform: scale(1.22);
}

/* Optimized boosted size for square, badge, and fine-detail logos (HKTDC, RTHK) */
.credo-marquee-logo--tall {
    max-height: 3.15rem;
    max-width: 8rem;
    transform: scale(1.18);
}

@media (min-width: 640px) {
    .credo-marquee-logo--tall {
        max-height: 3.75rem;
        max-width: 9rem;
        transform: scale(1.24);
    }
}

@media (min-width: 768px) {
    .credo-marquee-logo--tall {
        max-height: 4.25rem;
        max-width: 10rem;
        transform: scale(1.28);
    }
}

.credo-marquee-item:hover .credo-marquee-logo--tall {
    opacity: 1;
    transform: scale(1.35);
}

/* Dedicated prominent sizing for ZonesCorp (triangular icon + small label) */
.credo-marquee-logo--zonescorp {
    max-height: 3.4rem;
    max-width: 8rem;
    transform: scale(1.26);
}

@media (min-width: 640px) {
    .credo-marquee-logo--zonescorp {
        max-height: 4.1rem;
        max-width: 9rem;
        transform: scale(1.32);
    }
}

@media (min-width: 768px) {
    .credo-marquee-logo--zonescorp {
        max-height: 4.65rem;
        max-width: 10rem;
        transform: scale(1.38);
    }
}

.credo-marquee-item:hover .credo-marquee-logo--zonescorp {
    opacity: 1;
    transform: scale(1.46);
}

/* Reduced size for visually heavy, bold-letter, or solid-color block logos (Isuzu, OQT, Sorbonne) */
.credo-marquee-logo--reduced {
    max-height: 1.85rem;
    max-width: 6.25rem;
    transform: scale(0.88);
}

@media (min-width: 640px) {
    .credo-marquee-logo--reduced {
        max-height: 2.15rem;
        max-width: 7.25rem;
        transform: scale(0.9);
    }
}

@media (min-width: 768px) {
    .credo-marquee-logo--reduced {
        max-height: 2.35rem;
        max-width: 8rem;
        transform: scale(0.9);
    }
}

.credo-marquee-item:hover .credo-marquee-logo--reduced {
    opacity: 1;
    transform: scale(0.96);
}

/* Keyframes for seamless 4-group cycle */
@keyframes credoMarqueeLeft {
    0% {
        transform: translate3d(0, 0, 0);
    }
    100% {
        transform: translate3d(-25%, 0, 0);
    }
}

@keyframes credoMarqueeRight {
    0% {
        transform: translate3d(-25%, 0, 0);
    }
    100% {
        transform: translate3d(0, 0, 0);
    }
}

/* Accessibility: Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .credo-marquee-viewport {
        mask-image: none !important;
        -webkit-mask-image: none !important;
        overflow: visible !important;
    }
    .credo-marquee-wrapper {
        gap: 2rem !important;
    }
    .credo-marquee-track {
        animation: none !important;
        transform: none !important;
        width: 100% !important;
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
    }
    .credo-marquee-group {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        padding-right: 0 !important;
        gap: 1.5rem !important;
    }
    .credo-marquee-group[aria-hidden="true"] {
        display: none !important;
    }
}

