/**
 * KF Cooling Co. — Responsive Styles
 * Mobile-first breakpoints for header, content, and footer.
 *
 * @package KF_Cooling
 */

/* ── Extra Small (< 480px) ────────────────────────────── */
@media (max-width: 479px) {
    :root {
        --header-height: 60px;
    }

    .kf-section {
        padding: 50px 0;
    }

    /* Hero */
    .kf-hero {
        min-height: 65vh;
    }
    .kf-hero__title {
        font-size: 2rem;
    }
    .kf-hero__subtitle {
        font-size: 1rem;
    }
    .kf-hero__actions {
        flex-direction: column;
        width: 100%;
    }
    .kf-hero__actions .kf-btn {
        width: 100%;
        justify-content: center;
    }

    /* Stats */
    .kf-stats__grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .kf-stats__item:nth-child(2) {
        border-right: none;
    }
    .kf-stats__item:nth-child(odd) {
        border-bottom: 1px solid var(--border);
    }
    .kf-stats__number {
        font-size: 2rem;
    }

    /* Grids */
    .kf-grid--services,
    .kf-grid--3 {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .kf-grid--4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    /* Why Us */
    .kf-why-us__layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .kf-why-us__item {
        padding: 20px;
    }

    /* Process */
    .kf-process-step__arrow {
        display: none;
    }
    .kf-process-step {
        padding: 30px 20px;
    }

    /* CTA */
    .kf-cta-band {
        padding: 50px 0;
    }
    .kf-cta-band__actions {
        flex-direction: column;
        align-items: stretch;
    }
    .kf-cta-band__actions .kf-btn {
        justify-content: center;
    }

    /* Filter bar */
    .kf-filter-bar {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
    }
    .kf-filter-btn {
        padding: 8px 16px;
        font-size: 0.8125rem;
    }

    /* Blog */
    .kf-blog-card__content {
        padding: 20px;
    }

    /* 404 */
    .kf-404__number {
        font-size: 5rem;
    }
    .kf-404__title {
        font-size: 1.75rem;
    }
}

/* ── Small (480px – 767px) ────────────────────────────── */
@media (min-width: 480px) and (max-width: 767px) {
    :root {
        --header-height: 65px;
    }

    .kf-hero {
        min-height: 70vh;
    }

    .kf-stats__grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .kf-stats__item:nth-child(odd) {
        border-bottom: 1px solid var(--border);
    }
    .kf-stats__item:nth-child(2) {
        border-right: none;
    }

    .kf-grid--services,
    .kf-grid--3 {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }

    .kf-why-us__layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .kf-contact-layout {
        grid-template-columns: 1fr;
    }
}

/* ── Mobile & Tablet: show hamburger menu ─────────────── */
@media (max-width: 1024px) {
    .kf-header__nav {
        display: none;
    }
    .kf-menu-toggle {
        display: flex;
    }
    .kf-mobile-nav {
        display: block;
    }
    .kf-header__phone {
        display: none;
    }
    .kf-header__cta {
        display: none;
    }
}

/* ── Tablet (768px – 1024px) ──────────────────────────── */
@media (min-width: 768px) and (max-width: 1024px) {
    .kf-grid--services,
    .kf-grid--3 {
        grid-template-columns: repeat(2, 1fr);
        gap: 28px;
    }

    .kf-grid--4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }

    .kf-footer__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px;
    }

    .kf-blog-layout {
        grid-template-columns: 1fr;
    }
    .kf-blog-sidebar {
        position: static;
    }
}

/* ── Desktop (1025px+) ────────────────────────────────── */
@media (min-width: 1025px) {
    .kf-menu-toggle {
        display: none;
    }
    .kf-mobile-nav {
        display: none;
    }
    .kf-process-step__arrow {
        display: block;
    }
}

/* ── Large Desktop (1200px+) ──────────────────────────── */
@media (min-width: 1200px) {
    .kf-container {
        padding: 0 40px;
    }
}

/* ── Page Header Styles (shared across templates) ─────── */
.kf-page-header {
    background: linear-gradient(135deg, #003293 0%, #001D5C 100%);
    padding: calc(var(--header-height) + 50px) 0 50px;
    text-align: center;
}

.kf-page-header__title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    color: #fff;
    margin-bottom: 12px;
}

.kf-page-header__desc {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

.kf-page-header__meta {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 12px;
}

.kf-page-header__sep {
    margin: 0 8px;
}

.kf-page-header__cats a {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kf-page-header__cats a:hover {
    color: #fff;
}

/* ── Container Narrow ─────────────────────────────────── */
.kf-container--narrow {
    max-width: 800px;
}

/* ── Blog Layout ──────────────────────────────────────── */
.kf-blog-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
    align-items: start;
}

.kf-blog-main {
    min-width: 0;
}

.kf-blog-featured-image {
    margin-bottom: 30px;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.kf-blog-featured-image img {
    width: 100%;
    height: auto;
}

.kf-blog-content {
    font-size: 1.0625rem;
    line-height: 1.8;
}

.kf-blog-content h2,
.kf-blog-content h3 {
    margin-top: 2em;
}

.kf-blog-content img {
    border-radius: var(--radius-md);
    margin: 1.5em 0;
}

.kf-blog-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 16px 24px;
    margin: 2em 0;
    background: var(--primary-light);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-style: italic;
}

.kf-blog-content ul,
.kf-blog-content ol {
    padding-left: 1.5em;
    margin-bottom: 1.5em;
}

.kf-blog-content ul { list-style: disc; }
.kf-blog-content ol { list-style: decimal; }

.kf-blog-content li {
    margin-bottom: 0.5em;
}

.kf-blog-tags {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.kf-blog-tags__label {
    font-weight: 600;
    margin-right: 8px;
}

.kf-blog-tags a {
    display: inline-block;
    padding: 4px 12px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.8125rem;
    border-radius: 50px;
    margin: 4px;
    transition: all var(--transition);
}

.kf-blog-tags a:hover {
    background: var(--primary);
    color: #fff;
}

/* ── Post Navigation ──────────────────────────────────── */
.kf-post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border);
}

.kf-post-nav__label {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.kf-post-nav__title {
    font-weight: 600;
    color: var(--text-dark);
}

.kf-post-nav .nav-next {
    text-align: right;
}

/* ── Pagination ───────────────────────────────────────── */
.kf-pagination {
    margin-top: 50px;
    text-align: center;
}

.kf-pagination .nav-links {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.kf-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-body);
    text-decoration: none;
    transition: all var(--transition);
}

.kf-pagination .page-numbers:hover,
.kf-pagination .page-numbers.current {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ── 404 Page ─────────────────────────────────────────── */
.kf-404 {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: var(--header-height);
}

.kf-404__number {
    display: block;
    font-size: 8rem;
    font-weight: 900;
    color: var(--primary-light);
    line-height: 1;
    margin-bottom: 16px;
}

.kf-404__title {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.kf-404__text {
    font-size: 1.125rem;
    color: var(--text-light);
    max-width: 450px;
    margin: 0 auto 32px;
}

.kf-404__actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ── No Results ───────────────────────────────────────── */
.kf-no-results {
    padding: 80px 20px;
    text-align: center;
}

/* ── Contact Page ─────────────────────────────────────── */
.kf-contact-card {
    text-align: center;
    padding: 32px 20px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all var(--transition);
}

.kf-contact-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.kf-contact-card__icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 16px;
}

.kf-contact-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.kf-contact-card a,
.kf-contact-card span {
    font-size: 0.9375rem;
    color: var(--text-light);
}

.kf-contact-card a:hover {
    color: var(--primary);
}

.kf-contact-layout {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 50px;
    align-items: start;
}

.kf-contact-form h2 {
    margin-bottom: 24px;
}

.kf-contact-map__placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    background: var(--bg-light);
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

.kf-contact-map__placeholder svg {
    margin-bottom: 16px;
    opacity: 0.4;
}

/* ── Form Styles ──────────────────────────────────────── */
.kf-form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.kf-form__field {
    margin-bottom: 20px;
}

.kf-form__field label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.kf-form__field input,
.kf-form__field select,
.kf-form__field textarea {
    width: 100%;
    padding: 12px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9375rem;
    color: var(--text-body);
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: border-color var(--transition), box-shadow var(--transition);
    -webkit-appearance: none;
}

.kf-form__field input:focus,
.kf-form__field select:focus,
.kf-form__field textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(234, 27, 41, 0.15);
}

.kf-form__field textarea {
    resize: vertical;
    min-height: 120px;
}

.kf-form__field select {
    cursor: pointer;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="%23757575" stroke-width="2"><polyline points="6 9 12 15 18 9"/></svg>');
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

/* ── Portfolio Grid ───────────────────────────────────── */
.kf-filter-bar {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 40px;
}

.kf-filter-btn {
    padding: 10px 24px;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-body);
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 50px;
    cursor: pointer;
    transition: all var(--transition);
}

.kf-filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.kf-filter-btn--active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.kf-portfolio-item {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* ── Blog Sidebar ─────────────────────────────────────── */
.kf-blog-sidebar {
    position: sticky;
    top: calc(var(--header-height) + 20px);
}

.kf-blog-sidebar .widget {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.kf-blog-sidebar .widget-title {
    font-size: 1.0625rem;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-light);
}

/* ── WordPress Core Responsive ────────────────────────── */
@media (max-width: 767px) {
    .kf-blog-layout {
        grid-template-columns: 1fr;
    }

    .kf-blog-sidebar {
        position: static;
    }

    .kf-form__row {
        grid-template-columns: 1fr;
    }

    .kf-grid--4 {
        grid-template-columns: 1fr 1fr;
    }

    .kf-contact-layout {
        grid-template-columns: 1fr;
    }
}

/* ── Footer Responsive ────────────────────────────────── */
@media (max-width: 767px) {
    .kf-footer__top {
        padding: 40px 0 30px;
    }
    .kf-footer__grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .kf-footer__col {
        text-align: left;
    }
    .kf-footer__heading {
        margin-bottom: 14px;
    }
    .kf-footer__bottom .kf-container {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

/* ── Elementor Full-Width Support ─────────────────────── */
.kf-cooling-elementor-active .elementor-widget-container > p {
    margin-bottom: 1.25em;
}

.kf-elementor-page {
    padding: 40px 0;
}
