/*
Theme Name: UK Stairlift
Description: Lightweight custom theme for uk-stairlift.co.uk. Replaces Elementor and Jet Engine with hand-coded templates using the site's existing design system (colours, type, spacing) so pages render identically but without the page-builder overhead.
Author: UK Stairlift
Version: 1.0.0
Text Domain: uk-stairlift
*/

/* ===================== Design tokens (from the site's former Elementor global kit) ===================== */
:root {
    --uks-blue: #0b1a5b;
    --uks-blue-light: #1a2d7a;
    --uks-dark: #48244D;
    --uks-purple: #7F2C8A;
    --uks-teal: #0DC7C7;
    --uks-teal-dark: #086e6e;
    --uks-navy-2: #103463;
    --uks-light-bg: #F5F5F5;
    --uks-text: #7A7A7A;
    --uks-white: #FFFFFF;

    --uks-font: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --uks-container: 1300px;
    --uks-radius: 12px;
    --uks-radius-lg: 24px;

    --uks-section-pad: clamp(40px, 6vw, 80px);
    --uks-section-gap: clamp(28px, 4vw, 50px);
}

/* ===================== Reset & base ===================== */
*, *::before, *::after { box-sizing: border-box; }
body {
    margin: 0;
    font-family: var(--uks-font);
    color: var(--uks-text);
    background: var(--uks-white);
    line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--uks-blue); text-decoration: none; }
h1, h2, h3, h4, h5 { font-family: var(--uks-font); color: var(--uks-blue); margin: 0 0 0.5em; line-height: 1.25; }
p { margin: 0 0 1em; }

.uks-container {
    max-width: var(--uks-container);
    margin: 0 auto;
    padding: 0 24px;
}

/* ===================== Buttons ===================== */
.uks-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 30px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.uks-btn:hover { transform: translateY(-2px); }
.uks-btn--teal {
    background: var(--uks-teal);
    color: var(--uks-white);
    box-shadow: 0 8px 20px rgba(13, 199, 199, 0.35);
}
.uks-btn--teal:hover { background: var(--uks-dark); }
.uks-btn--outline {
    background: transparent;
    color: var(--uks-white);
    border-color: var(--uks-white);
}
.uks-btn--outline:hover { background: rgba(255,255,255,0.15); }

/* ===================== Header ===================== */
.uks-topbar {
    background: linear-gradient(90deg, var(--uks-teal) 0%, var(--uks-teal) 100%);
    text-align: center;
    padding: 10px 16px;
    display: none;
}
.uks-topbar a { color: var(--uks-white); font-weight: 700; }

.uks-header {
    background: var(--uks-white);
    padding: 12px 24px;
}
.uks-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.uks-logo img { max-height: 60px; width: auto; }
.uks-nav { flex: 1; }
.uks-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin: 0;
    padding: 0;
}
.uks-nav li { position: relative; }
.uks-nav > ul > li > a {
    color: var(--uks-blue);
    font-weight: 400;
    font-size: 18px;
    padding: 8px 4px;
    display: block;
}
.uks-nav > ul > li > a:hover,
.uks-nav > ul > li.current-menu-item > a { color: var(--uks-teal); }
.uks-nav .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--uks-navy-2);
    min-width: 260px;
    padding: 10px 0;
    border-radius: 0 0 8px 8px;
    z-index: 50;
    max-height: 70vh;
    overflow-y: auto;
}
.uks-nav li:hover > .sub-menu { display: block; }
.uks-nav .sub-menu li a {
    color: var(--uks-white);
    padding: 8px 20px;
    font-size: 15px;
}
.uks-nav .sub-menu li a:hover { background: var(--uks-teal); }
.uks-header-call {
    background: var(--uks-teal);
    color: var(--uks-white);
    font-weight: 400;
    padding: 12px 24px;
    border-radius: 3px;
    white-space: nowrap;
}
.uks-header-call:hover { background: var(--uks-dark); color: var(--uks-white); }

.uks-nav-toggle { display: none; }

@media (max-width: 1024px) {
    .uks-topbar { display: block; }
    .uks-header-call { display: none; }
    .uks-nav { display: none; }
    .uks-nav-toggle {
        display: block;
        margin-left: auto;
        background: var(--uks-blue);
        color: var(--uks-white);
        border: none;
        border-radius: 6px;
        padding: 10px 14px;
        font-size: 20px;
    }
    .uks-nav.is-open {
        display: block;
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        background: var(--uks-white);
        box-shadow: 0 12px 20px rgba(0,0,0,0.1);
        z-index: 100;
    }
    .uks-nav.is-open ul { flex-direction: column; gap: 0; }
    .uks-nav.is-open > ul > li > a { padding: 14px 24px; border-bottom: 1px solid #eee; }
    .uks-nav .sub-menu { position: static; background: var(--uks-light-bg); border-radius: 0; }
    .uks-nav .sub-menu li a { color: var(--uks-blue); }
    .uks-header-inner { position: relative; }
}

/* ===================== Footer ===================== */
.uks-footer {
    background: var(--uks-blue);
    color: rgba(255,255,255,0.85);
    padding: 30px 24px;
}
.uks-footer-inner { max-width: var(--uks-container); margin: 0 auto; }
.uks-footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    list-style: none;
    margin: 0 0 30px;
    padding: 0 0 30px;
    border-bottom: 1px dotted #9b9b9b;
}
.uks-footer-nav a { color: var(--uks-white); }
.uks-footer-nav a:hover { color: var(--uks-teal); }
.uks-footer-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-size: 14px;
}
.uks-footer-bottom a { color: rgba(255,255,255,0.8); }
.uks-social { display: flex; gap: 12px; }
.uks-social a {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.12);
    border-radius: 50%;
    color: var(--uks-white);
}
.uks-social a:hover { background: var(--uks-teal); }

/* ===================== Reusable section system (fixes the old fixed-100px/150px margin bloat) ===================== */
.uks-section {
    padding: var(--uks-section-pad) 24px;
}
.uks-section--tight { padding: calc(var(--uks-section-pad) * 0.6) 24px; }
/* Dark section variants, matched to the actual backgrounds used on the
   existing site (each section uses a real photo/pattern + overlay, not one
   reused flat gradient) rather than a single generic "blue hero" treatment. */
.uks-section--hero,
.uks-section--photo-hero,
.uks-section--dark,
.uks-section--navy {
    color: var(--uks-white);
}
.uks-section--hero h1, .uks-section--hero h2, .uks-section--hero h3, .uks-section--hero h4, .uks-section--hero h5,
.uks-section--photo-hero h1, .uks-section--photo-hero h2, .uks-section--photo-hero h3, .uks-section--photo-hero h4, .uks-section--photo-hero h5,
.uks-section--dark h1, .uks-section--dark h2, .uks-section--dark h3, .uks-section--dark h4, .uks-section--dark h5,
.uks-section--navy h1, .uks-section--navy h2, .uks-section--navy h3, .uks-section--navy h4, .uks-section--navy h5 { color: var(--uks-white); }

/* Fallback generic gradient, used only where no specific photo is available */
.uks-section--hero {
    background: linear-gradient(135deg, var(--uks-blue) 0%, var(--uks-blue-light) 50%, var(--uks-blue) 100%);
}

/* Real hero photo (the same "woman on a stairlift" image used site-wide) with the site's actual blue wash overlay.
   The image URL itself is set inline per-page via uks_photo_hero_style() (functions.php), resolved from the
   attachment ID with wp_get_attachment_image_url() rather than hardcoded, so it works on any environment. */
.uks-section--photo-hero {
    background-size: cover;
    background-position: center;
}

/* Near-black radial overlay, matching the "why choose us" / process-step sections */
.uks-section--dark {
    background: radial-gradient(circle at center, #1a1010 0%, #0d0808 100%);
}

/* Flat navy, matching the FAQ accordion section */
.uks-section--navy {
    background: var(--uks-navy-2);
}

.uks-section--light { background: var(--uks-light-bg); }

.uks-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--uks-section-gap);
    align-items: center;
}
@media (max-width: 900px) {
    .uks-grid-2 { grid-template-columns: 1fr; }
}

.uks-eyebrow {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--uks-teal);
    margin-bottom: 12px;
}

.uks-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

/* Boxed card: used on photo/gradient hero sections and light sections, where
   a card needs to separate itself from a busy or bright background. */
.uks-card {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--uks-radius);
    padding: 28px;
}
.uks-card h3, .uks-card h4 { margin-bottom: 10px; color: var(--uks-white); }
.uks-card p { color: rgba(255,255,255,0.85); }

.uks-section:not(.uks-section--hero):not(.uks-section--photo-hero):not(.uks-section--dark):not(.uks-section--navy) .uks-card {
    background: var(--uks-white);
    border: 1px solid #eee;
    box-shadow: 0 6px 20px rgba(11,26,91,0.06);
}
.uks-section:not(.uks-section--hero):not(.uks-section--photo-hero):not(.uks-section--dark):not(.uks-section--navy) .uks-card h3,
.uks-section:not(.uks-section--hero):not(.uks-section--photo-hero):not(.uks-section--dark):not(.uks-section--navy) .uks-card h4 { color: var(--uks-blue); }
.uks-section:not(.uks-section--hero):not(.uks-section--photo-hero):not(.uks-section--dark):not(.uks-section--navy) .uks-card p { color: var(--uks-text); }

/* On the near-black / flat-navy sections a translucent box has almost no
   contrast against the background, so items there go boxless (matching how
   the site's own icon-box widgets actually render, with no card wrapper)
   and get a small teal accent marker instead to separate each item. */
.uks-section--dark .uks-card,
.uks-section--navy .uks-card {
    background: none;
    border: none;
    padding: 8px 12px;
    text-align: center;
}
.uks-section--dark .uks-card:not(.uks-step) h3,
.uks-section--dark .uks-card:not(.uks-step) h4,
.uks-section--navy .uks-card:not(.uks-step) h3,
.uks-section--navy .uks-card:not(.uks-step) h4 {
    position: relative;
    padding-top: 34px;
}
.uks-section--dark .uks-card:not(.uks-step) h3::before,
.uks-section--dark .uks-card:not(.uks-step) h4::before,
.uks-section--navy .uks-card:not(.uks-step) h3::before,
.uks-section--navy .uks-card:not(.uks-step) h4::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: var(--uks-teal);
    border-radius: 2px;
}

.uks-step { position: relative; text-align: center; padding: 30px 20px; }
.uks-step-num {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--uks-teal);
    color: var(--uks-white);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    margin: 0 auto 16px;
}

.uks-image-frame img {
    border-radius: var(--uks-radius-lg);
    box-shadow: 0 20px 40px rgba(11,26,91,0.15);
}

/* FAQ accordion */
.uks-faq { max-width: 900px; margin: 0 auto; }
.uks-faq-item { border-bottom: 1px solid rgba(255,255,255,0.15); }
.uks-faq-item summary {
    cursor: pointer;
    padding: 18px 4px;
    font-weight: 600;
    color: var(--uks-white);
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.uks-faq-item summary::-webkit-details-marker { display: none; }
.uks-faq-item summary::after { content: '+'; font-size: 1.4rem; }
.uks-faq-item[open] summary::after { content: '\2212'; }
.uks-faq-item p { padding: 0 4px 18px; color: rgba(255,255,255,0.85); }

/* Testimonial */
.uks-testimonial { text-align: center; max-width: 700px; margin: 0 auto; }
.uks-testimonial p { font-size: 1.2rem; font-style: italic; color: var(--uks-blue); }
.uks-testimonial cite { font-weight: 700; font-style: normal; color: var(--uks-teal-dark); }

/* Recent posts grid */
.uks-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}
.uks-post-card {
    background: var(--uks-white);
    border-radius: var(--uks-radius);
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(11,26,91,0.08);
}
.uks-post-card img { aspect-ratio: 16/10; object-fit: cover; }
.uks-post-card .uks-post-body { padding: 18px; }
.uks-post-card h4 { font-size: 1.05rem; margin-bottom: 6px; }
.uks-post-card h4 a { color: var(--uks-blue); }

/* Blog / page content (used by single.php and page.php for plain WP content) */
.uks-content { max-width: 820px; margin: 0 auto; padding: 50px 24px; }
.uks-content h2 { margin-top: 1.4em; }
.uks-content table { width: 100%; border-collapse: collapse; margin: 1.5em 0; }
.uks-content table th, .uks-content table td { border: 1px solid #e2e2e2; padding: 10px 14px; text-align: left; }
.uks-content table th { background: var(--uks-light-bg); }
.uks-content ul { padding-left: 1.3em; }
