/*
Theme Name: Puzzle Pieces Modern
Theme URI: https://www.puzzle-pieces.org/
Author: AI Migration
Description: A modern, responsive theme using the Puzzle Pieces brand palette. Features sticky header, hamburger nav, hero slider, card layouts, and full mobile-first responsive design.
Version: 1.0
*/

/* ===================================================
   DESIGN TOKENS (CSS Custom Properties)
=================================================== */
:root {
    --blue-primary: #2E3192;
    --blue-dark:    #1e2070;
    --blue-light:   #3d42b8;
    --cyan:         #00AEEF;
    --pink:         #E91E8C;
    --white:        #ffffff;
    --gray-50:      #f8f9fb;
    --gray-100:     #eef0f4;
    --gray-200:     #d4d8e2;
    --gray-600:     #6b7280;
    --gray-900:     #111827;
    --shadow-sm:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md:    0 4px 16px rgba(0,0,0,.10);
    --shadow-lg:    0 10px 40px rgba(0,0,0,.14);
    --radius:       8px;
    --radius-lg:    16px;
    --transition:   0.25s cubic-bezier(.4,0,.2,1);
    --max-w:        1200px;
    --font-sans:    'Inter', system-ui, -apple-system, sans-serif;
    --font-display: 'Inter', system-ui, -apple-system, sans-serif;
}

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

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

body {
    font-family: var(--font-sans);
    background: var(--white);
    color: var(--gray-900);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: none; }

/* ===================================================
   LAYOUT UTILITIES
=================================================== */
.container {
    width: 100%;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 24px;
}

.section { padding: 80px 0; }

.visually-hidden {
    position: absolute; width: 1px; height: 1px;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap;
}

/* ===================================================
   HEADER — Sticky, transparent → solid on scroll
=================================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--blue-primary);
    transition: box-shadow var(--transition), background var(--transition);
}

.site-header.scrolled {
    box-shadow: var(--shadow-lg);
    background: var(--blue-dark);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 24px;
    gap: 24px;
}

/* Logo */
.site-logo a { display: flex; align-items: center; flex-shrink: 0; }
.site-logo img { height: 48px; width: auto; }

/* Primary nav */
.primary-nav { display: flex; align-items: center; gap: 4px; }

.primary-nav a {
    color: rgba(255,255,255,.85);
    font-size: 14px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: var(--radius);
    transition: color var(--transition), background var(--transition);
    white-space: nowrap;
    letter-spacing: .3px;
}

.primary-nav a:hover,
.primary-nav a:focus {
    color: var(--white);
    background: rgba(255,255,255,.12);
    text-decoration: none;
}

/* CTA buttons in header */
.header-ctas { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.btn-cta {
    display: inline-flex;
    align-items: center;
    padding: 8px 18px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .4px;
    white-space: nowrap;
    transition: all var(--transition);
    border: 2px solid transparent;
}

.btn-cta-outline {
    color: var(--white);
    border-color: rgba(255,255,255,.4);
    background: transparent;
}
.btn-cta-outline:hover {
    border-color: var(--white);
    background: rgba(255,255,255,.1);
    text-decoration: none;
    color: var(--white);
}

.btn-cta-solid {
    background: var(--white);
    color: var(--blue-primary);
    border-color: var(--white);
}
.btn-cta-solid:hover {
    background: var(--gray-100);
    color: var(--blue-dark);
    text-decoration: none;
}

/* Hamburger (mobile) */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px; height: 40px;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: var(--radius);
    transition: background var(--transition);
    padding: 4px;
}
.hamburger:hover { background: rgba(255,255,255,.12); }
.hamburger span {
    display: block;
    width: 22px; height: 2px;
    background: var(--white);
    border-radius: 2px;
    transition: all var(--transition);
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav drawer */
.mobile-nav {
    display: none;
    flex-direction: column;
    background: var(--blue-dark);
    padding: 16px 24px 24px;
    border-top: 1px solid rgba(255,255,255,.1);
    gap: 4px;
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
    color: rgba(255,255,255,.85);
    font-size: 15px;
    font-weight: 600;
    padding: 12px 16px;
    border-radius: var(--radius);
    transition: background var(--transition), color var(--transition);
}
.mobile-nav a:hover { background: rgba(255,255,255,.1); color: var(--white); text-decoration: none; }
.mobile-nav .mobile-ctas {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-top: 12px; padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,.1);
}
.mobile-nav .mobile-ctas a {
    flex: 1; text-align: center; min-width: 100px;
    background: rgba(255,255,255,.12); padding: 10px 14px;
}

/* ===================================================
   HOME HERO — Full-width Swiper Slider
=================================================== */
.hero-section {
    position: relative;
    background: var(--blue-primary);
    overflow: hidden;
}

/* Service pill bar above hero */
.service-bar {
    background: var(--white);
    border-bottom: 1px solid var(--gray-100);
    padding: 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.service-bar::-webkit-scrollbar { display: none; }

.service-bar-inner {
    display: flex;
    justify-content: center;
    gap: 0;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 24px;
}

.service-pill {
    display: inline-flex;
    align-items: center;
    padding: 14px 22px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--gray-600);
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    transition: color var(--transition), border-color var(--transition);
}
.service-pill:hover {
    color: var(--blue-primary);
    border-bottom-color: var(--blue-primary);
    text-decoration: none;
}

/* Swiper hero */
.hero-swiper {
    width: 100%;
    height: 480px;
}
@media (max-width: 768px) { .hero-swiper { height: 300px; } }

.hero-swiper .swiper-slide { overflow: hidden; }
.hero-swiper .swiper-slide img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 8s ease;
}
.hero-swiper .swiper-slide-active img { transform: scale(1.04); }

/* Pause/Play button */
.hero-controls {
    position: absolute;
    bottom: 20px; right: 20px;
    z-index: 20;
    display: flex; gap: 8px;
}
.hero-pause-btn {
    background: rgba(0,0,0,.45);
    color: var(--white);
    border: 1px solid rgba(255,255,255,.3);
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .5px;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: background var(--transition);
}
.hero-pause-btn:hover { background: rgba(0,0,0,.7); }

/* Swiper overrides */
.hero-swiper .swiper-pagination-bullet { background: rgba(255,255,255,.6); }
.hero-swiper .swiper-pagination-bullet-active { background: var(--white); }
.hero-swiper .swiper-button-next,
.hero-swiper .swiper-button-prev { color: var(--white); }

/* Social text below slider */
.social-hook {
    text-align: center;
    padding: 28px 24px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--gray-600);
    background: var(--white);
    border-bottom: 1px solid var(--gray-100);
}
.social-hook a { color: var(--blue-primary); }

/* ===================================================
   SERVICE CARDS SECTION
=================================================== */
.services-section {
    background: var(--gray-50);
    padding: 72px 0;
}
.section-header {
    text-align: center;
    margin-bottom: 48px;
}
.section-label {
    display: inline-block;
    font-size: 12px; font-weight: 700; letter-spacing: 2px;
    text-transform: uppercase; color: var(--cyan);
    margin-bottom: 12px;
}
.section-title {
    font-size: clamp(26px, 4vw, 40px);
    font-weight: 800;
    color: var(--blue-primary);
    line-height: 1.2;
}
.section-subtitle {
    margin-top: 12px;
    font-size: 17px;
    color: var(--gray-600);
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.service-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
.service-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: var(--blue-primary);
    text-decoration: none;
}
.service-card-icon {
    width: 56px; height: 56px;
    background: linear-gradient(135deg, var(--blue-primary), var(--blue-light));
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--white);
    font-size: 22px;
    flex-shrink: 0;
}
.service-card-title {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: var(--gray-900);
    line-height: 1.3;
}
.service-card-arrow {
    margin-top: auto;
    color: var(--blue-primary);
    font-size: 18px;
    font-weight: 700;
    transition: transform var(--transition);
}
.service-card:hover .service-card-arrow { transform: translateX(4px); }

/* ===================================================
   INNER PAGE LAYOUTS
=================================================== */
/* Page banner hero */
.page-hero {
    background: linear-gradient(135deg, var(--blue-primary) 0%, var(--blue-light) 100%);
    padding: 72px 24px 64px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.page-hero::before {
    content: '';
    position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.page-hero h1 {
    position: relative;
    color: var(--white);
    font-size: clamp(30px, 5vw, 54px);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
}
.page-hero .breadcrumb {
    position: relative;
    margin-top: 12px;
    color: rgba(255,255,255,.65);
    font-size: 14px;
}
.page-hero .breadcrumb a { color: rgba(255,255,255,.8); }

/* Content area */
.page-content-area {
    max-width: 860px;
    margin: 0 auto;
    padding: 64px 24px 80px;
}

.page-content-area h2 {
    font-size: clamp(20px, 3vw, 28px);
    font-weight: 800;
    color: var(--blue-primary);
    margin: 40px 0 14px;
    line-height: 1.2;
}

.page-content-area h3 {
    font-size: clamp(17px, 2.5vw, 22px);
    font-weight: 700;
    color: var(--blue-primary);
    margin: 28px 0 10px;
}

.page-content-area p {
    color: var(--gray-600);
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 20px;
}

.page-content-area ul, .page-content-area ol {
    padding-left: 20px;
    margin-bottom: 24px;
}

.page-content-area li {
    color: var(--gray-600);
    font-size: 16px;
    line-height: 1.7;
    margin-bottom: 8px;
    list-style: disc;
}

.page-content-area a { color: var(--blue-primary); font-weight: 600; }

/* Two-column sidebar layout */
.page-two-col {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 56px 24px 80px;
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 40px;
    align-items: start;
}
@media (max-width: 768px) {
    .page-two-col { grid-template-columns: 1fr; }
}

.page-sidebar {
    background: var(--blue-primary);
    border-radius: var(--radius-lg);
    padding: 28px 20px;
    position: sticky;
    top: 90px;
}
.page-sidebar ul { display: flex; flex-direction: column; gap: 4px; }
.page-sidebar ul li a {
    display: block;
    color: rgba(255,255,255,.8);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    padding: 10px 14px;
    border-radius: var(--radius);
    transition: background var(--transition), color var(--transition);
}
.page-sidebar ul li a:hover {
    background: rgba(255,255,255,.15);
    color: var(--white);
    text-decoration: none;
}

.page-main {
    min-width: 0;
}
.page-main p {
    color: var(--gray-600);
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 20px;
}

/* Page banner (legacy compat) */
.page-banner {
    background: linear-gradient(135deg, var(--blue-primary) 0%, var(--blue-light) 100%);
    padding: 60px 24px;
    text-align: center;
}
.page-banner h1 {
    color: var(--white);
    font-size: clamp(28px, 5vw, 50px);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.page-content-padded {
    max-width: 860px;
    margin: 0 auto;
    padding: 56px 24px 80px;
}
.page-content-padded p, .page-content-padded li {
    color: var(--gray-600);
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 14px;
}
.page-content-padded h2 {
    font-size: 24px; font-weight: 800;
    color: var(--blue-primary);
    margin: 36px 0 12px;
}
.page-content-padded a { color: var(--blue-primary); font-weight: 600; }
.page-content-padded ul, .page-content-padded ol { padding-left: 20px; }
.page-content-padded li { list-style: disc; }

/* ===================================================
   BUTTONS (Global)
=================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .3px;
    cursor: pointer;
    border: 2px solid transparent;
    text-decoration: none;
    transition: all var(--transition);
}
.btn-primary {
    background: var(--blue-primary);
    color: var(--white);
    border-color: var(--blue-primary);
}
.btn-primary:hover {
    background: var(--blue-dark);
    border-color: var(--blue-dark);
    color: var(--white);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(46,49,146,.35);
}
.btn-outline {
    background: transparent;
    color: var(--blue-primary);
    border-color: var(--blue-primary);
}
.btn-outline:hover {
    background: var(--blue-primary);
    color: var(--white);
    text-decoration: none;
}

/* PayPal donate */
.paypal-donate-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #6a2fa0;
    color: var(--white) !important;
    padding: 14px 32px;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 700;
    margin: 20px 0 8px;
    transition: background var(--transition), transform var(--transition);
    border: none;
    text-decoration: none;
}
.paypal-donate-btn:hover {
    background: #5a2590;
    transform: translateY(-1px);
    text-decoration: none;
    color: var(--white) !important;
}

.content-btn {
    display: inline-flex;
    align-items: center;
    background: var(--blue-primary);
    color: var(--white) !important;
    padding: 12px 28px;
    border-radius: var(--radius);
    font-weight: 700;
    text-decoration: none;
    transition: all var(--transition);
    margin-top: 12px;
}
.content-btn:hover {
    background: var(--blue-dark);
    color: var(--white) !important;
    text-decoration: none;
    transform: translateY(-1px);
}

/* ===================================================
   FOOTER
=================================================== */
.site-footer {
    background: var(--gray-900);
    color: rgba(255,255,255,.6);
    padding: 0;
}

.footer-top {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 48px;
    align-items: center;
    padding: 56px 24px 48px;
    max-width: var(--max-w);
    margin: 0 auto;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
@media (max-width: 768px) {
    .footer-top { grid-template-columns: 1fr; text-align: center; }
}

.footer-brand p {
    font-size: 14px;
    line-height: 1.7;
    max-width: 360px;
    margin-top: 12px;
}
.footer-brand img { height: 44px; width: auto; }

.footer-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: right;
}
@media (max-width: 768px) { .footer-nav { text-align: center; } }

.footer-nav a {
    color: rgba(255,255,255,.6);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .5px;
    text-transform: uppercase;
    transition: color var(--transition);
}
.footer-nav a:hover { color: var(--white); text-decoration: none; }

.footer-bottom {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
}
.footer-bottom a { color: rgba(255,255,255,.4); }
.footer-bottom a:hover { color: rgba(255,255,255,.8); text-decoration: none; }

/* Legacy footer nav compat */
.footer-menu {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 28px;
    list-style: none;
    padding: 0;
}
.footer-menu li a {
    color: rgba(255,255,255,.5);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: color var(--transition);
}
.footer-menu li a:hover { color: var(--white); text-decoration: none; }

/* ===================================================
   ENTRY CONTENT (WP default pages)
=================================================== */
.entry-title {
    font-size: clamp(24px, 4vw, 40px);
    font-weight: 800;
    color: var(--blue-primary);
    text-align: center;
    padding: 48px 24px 0;
    letter-spacing: -0.02em;
}

.entry-content {
    max-width: 860px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}

.entry-content h1, .entry-content h2 {
    color: var(--blue-primary);
    font-weight: 800;
    margin: 36px 0 12px;
    line-height: 1.2;
}
.entry-content h1 { font-size: clamp(22px, 3.5vw, 34px); }
.entry-content h2 { font-size: clamp(19px, 3vw, 26px); }
.entry-content h3 { color: var(--blue-primary); font-size: 20px; margin: 28px 0 8px; font-weight: 700; }
.entry-content p { color: var(--gray-600); line-height: 1.8; margin-bottom: 20px; font-size: 16px; }
.entry-content ul { padding-left: 20px; margin-bottom: 20px; }
.entry-content ul li { color: var(--gray-600); margin-bottom: 8px; list-style: disc; line-height: 1.7; }
.entry-content ol { padding-left: 20px; margin-bottom: 20px; }
.entry-content ol li { color: var(--gray-600); margin-bottom: 8px; line-height: 1.7; }
.entry-content a { color: var(--blue-primary); font-weight: 600; }
.entry-content img { border-radius: var(--radius); margin: 24px 0; }

/* ===================================================
   RESPONSIVE BREAKPOINTS
=================================================== */
@media (max-width: 1024px) {
    .header-ctas .btn-cta-outline:not(.btn-primary) { display: none; }
}

@media (max-width: 768px) {
    .primary-nav { display: none; }
    .header-ctas { display: none; }
    .hamburger { display: flex; }
    .section { padding: 56px 0; }
    .service-bar-inner { justify-content: flex-start; }
    .services-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-swiper { height: 300px; }
    .footer-top { gap: 32px; }
}

@media (max-width: 480px) {
    .services-grid { grid-template-columns: 1fr; }
    .service-pill { padding: 12px 16px; font-size: 11px; }
    .page-hero { padding: 48px 16px 40px; }
    .container { padding: 0 16px; }
}
