/*
Theme Name: Gearing Epicyclic Theme
Theme URI: https://gearingepicyclic.com
Author: Cxm
Description: Responsive B2B block theme for an epicyclic gearing RFQ catalogue.
Version: 1.1.0
Requires at least: 6.4
Requires PHP: 7.4
Text Domain: gearing-epicyclic
*/

:root {
    --ink: #0b1f2d;
    --muted: #526573;
    --paper: #f5f7f9;
    --paper-strong: #eaf0f4;
    --white: #fff;
    --accent: #e89a32;
    --accent-dark: #ad5c00;
    --line: #d8e0e6;
    --radius: 18px;
    --shadow: 0 18px 50px rgba(11, 31, 45, .11);
    --wrap: min(1180px, calc(100% - 40px));
    --header-wrap: min(1480px, calc(100% - 40px));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    overflow-x: hidden;
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    line-height: 1.7;
    background: #fff;
}
a { color: var(--accent-dark); text-decoration-thickness: .08em; text-underline-offset: .18em; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -.025em; margin: 0 0 .7em; }
h1 { font-size: clamp(2.55rem, 5vw, 4.9rem); }
h2 { font-size: clamp(1.9rem, 3.2vw, 3rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1.15em; }
.wp-site-blocks { min-height: 100vh; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.gep-wrap { width: var(--wrap); margin-inline: auto; }
.gep-eyebrow { font-size: .78rem; text-transform: uppercase; letter-spacing: .18em; font-weight: 800; color: var(--accent); }
.gep-lead, .gep-intro { font-size: 1.16rem; max-width: 840px; color: #334a5a; }
.gep-text-link { font-weight: 800; }
.gep-section-tint { background: var(--paper); }

.gep-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: .7rem 1.15rem;
    border-radius: 999px;
    background: var(--accent);
    color: #142431;
    text-decoration: none;
    font-weight: 800;
    border: 1px solid var(--accent);
    transition: .2s transform, .2s box-shadow;
    white-space: nowrap;
}
.gep-button:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(232, 154, 50, .25); }
.gep-button-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .68); }
.gep-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.8rem; }

/* Header */
.gep-site-header {
    position: sticky;
    top: 0;
    z-index: 999;
    background: rgba(255, 255, 255, .97);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
}
body.admin-bar .gep-site-header { top: 32px; }
.gep-header-inner {
    width: var(--header-wrap);
    margin: auto;
    min-height: 88px;
    display: flex;
    align-items: center;
    gap: 24px;
}
.gep-brand {
    flex: 0 0 auto;
    max-width: 270px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    text-decoration: none;
    font-weight: 900;
    line-height: 1.05;
}
.gep-brand-mark { width: 48px; height: 48px; flex: none; }
.gep-brand small { display: block; font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: 5px; }
.gep-nav {
    min-width: 0;
    margin-left: auto;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: clamp(14px, 1.5vw, 24px);
}
.gep-nav-links, .gep-nav-tools { display: flex; align-items: center; }
.gep-nav-links { min-width: 0; gap: clamp(10px, 1.15vw, 20px); }
.gep-nav-tools { flex: 0 0 auto; gap: 14px; }
.gep-nav a, .gep-nav-products > button {
    flex: none;
    color: var(--ink);
    text-decoration: none;
    font-weight: 750;
    font-size: clamp(.82rem, .82vw, .94rem);
    white-space: nowrap;
}
.gep-nav-products { position: relative; flex: none; }
.gep-nav-products > button { border: 0; background: none; font-family: inherit; cursor: pointer; padding: 28px 0; }
.gep-dropdown {
    position: absolute;
    top: 100%;
    left: -20px;
    width: min(460px, 80vw);
    max-height: 62vh;
    overflow: auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px;
    box-shadow: var(--shadow);
    display: none;
}
.gep-nav-products:hover .gep-dropdown, .gep-nav-products:focus-within .gep-dropdown { display: block; }
.gep-dropdown a { display: block; padding: 10px 12px; border-radius: 10px; }
.gep-dropdown a:hover { background: var(--paper); }
.gep-header-search { position: relative; }
.gep-header-search input { width: clamp(145px, 12vw, 190px); border: 1px solid var(--line); border-radius: 999px; padding: 10px 14px; }
.gep-search-results { position: absolute; right: 0; top: calc(100% + 8px); background: #fff; border: 1px solid var(--line); border-radius: 12px; width: 310px; box-shadow: var(--shadow); overflow: hidden; }
.gep-search-results a { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: normal; }
.gep-header-cta { min-width: 150px; }
.gep-menu-toggle { display: none; margin-left: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 10px 12px; font-weight: 800; }

/* Heroes */
.gep-hero, .gep-page-hero, .gep-category-hero, .gep-blog-hero {
    position: relative;
    color: #fff;
    background-color: #102c3e;
    background-image: linear-gradient(90deg, rgba(7, 23, 34, .96), rgba(7, 23, 34, .68) 52%, rgba(7, 23, 34, .28)), var(--gep-bg-image, none);
    background-size: cover;
    background-position: center;
}
.gep-hero { min-height: 700px; display: grid; align-items: center; }
.gep-hero-copy { padding-block: 94px; }
.gep-hero-copy > * { max-width: 820px; }
.gep-hero h1 { max-width: 900px; }
.gep-hero .gep-lead { color: #dbe6ed; font-size: 1.24rem; }
.gep-page-hero, .gep-blog-hero, .gep-category-hero { padding: 108px 0 82px; }
.gep-page-hero p, .gep-blog-hero p, .gep-category-hero p, .gep-hero-summary { max-width: 860px; color: #e3edf2; font-size: 1.13rem; }
.gep-page-hero h1, .gep-blog-hero h1, .gep-category-hero h1 { max-width: 1050px; font-size: clamp(2.45rem, 4.6vw, 4.5rem); }
.gep-breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 36px; color: #e3edf2; font-size: .92rem; }
.gep-breadcrumb a { color: #fff; }
.gep-category-lead { max-width: 900px; }

/* Shared sections */
.gep-section { padding: 84px 0; }
.gep-section:nth-of-type(even):not(.gep-section-tint) { background: var(--paper); }
.gep-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 54px; align-items: center; }
.gep-split-reverse > div:first-child { order: 2; }
.gep-card-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; margin-top: 32px; }
.gep-card-title { font-size: 1.25rem; line-height: 1.25; margin-bottom: .7rem; }
.gep-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: 0 6px 22px rgba(11, 31, 45, .05); }
.gep-media { margin: 0; }
.gep-media img { display: block; width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); }
.gep-media figcaption { font-size: .84rem; color: var(--muted); margin-top: 9px; }
.gep-checklist { list-style: none; padding: 0; margin: 1.4rem 0; }
.gep-checklist li { position: relative; padding: 10px 0 10px 31px; border-bottom: 1px solid var(--line); }
.gep-checklist li::before { content: '✓'; position: absolute; left: 0; color: var(--accent); font-weight: 900; }
.gep-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.gep-table-wrap table { border-collapse: collapse; width: 100%; min-width: 720px; }
.gep-table-wrap th, .gep-table-wrap td { padding: 16px 18px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.gep-table-wrap th { background: #102c3e; color: #fff; }

/* FAQ/accordion */
.gep-accordion details { background: #fff; border: 1px solid var(--line); border-radius: 14px; margin: 12px 0; padding: 0 22px; box-shadow: 0 5px 18px rgba(11, 31, 45, .04); }
.gep-accordion details[open] { border-color: rgba(232, 154, 50, .65); }
.gep-accordion summary { position: relative; cursor: pointer; list-style: none; font-weight: 800; padding: 20px 44px 20px 0; }
.gep-accordion summary::-webkit-details-marker { display: none; }
.gep-accordion summary::after { content: '+'; position: absolute; right: 0; top: 14px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--paper); color: var(--accent-dark); font-size: 1.35rem; }
.gep-accordion details[open] summary::after { content: '−'; background: var(--accent); color: var(--ink); }
.gep-accordion details > div { padding: 0 0 18px; color: #334a5a; }
.gep-accordion details > div p:last-child { margin-bottom: 0; }

/* Forms and footer */
.gep-rfq { padding: 88px 0; background: #102c3e; color: #fff; }
.gep-rfq-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 50px; align-items: start; }
.gep-rfq form, .gep-form-fallback { background: #fff; color: var(--ink); border-radius: 18px; padding: 26px; }
.gep-rfq input, .gep-rfq textarea, .gep-rfq select { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 12px; }
.gep-contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.gep-map { margin-top: 30px; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); }
.gep-map iframe { width: 100%; height: 430px; border: 0; }
.gep-site-footer { background: #071722; color: #dbe6ec; padding: 70px 0 24px; }
.gep-footer-grid { display: grid; grid-template-columns: 1.25fr .8fr .8fr; gap: 44px; }
.gep-site-footer a { color: #fff; }
.gep-footer-bottom { border-top: 1px solid rgba(255, 255, 255, .15); margin-top: 36px; padding-top: 20px; display: flex; justify-content: space-between; gap: 20px; }

/* Product/category/blog cards */
.gep-category-grid, .gep-product-grid, .gep-post-grid, .gep-blog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 32px; }
.gep-catalog-card, .gep-blog-card { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: #fff; display: flex; flex-direction: column; min-width: 0; }
.gep-catalog-card img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; }
.gep-catalog-card-content { padding: 22px; display: flex; flex-direction: column; flex: 1; }
.gep-catalog-card-content .gep-button { margin-top: auto; align-self: flex-start; }
.gep-blog-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.gep-blog-card-content { padding: 24px; }
.gep-blog-card h2 { font-size: clamp(1.35rem, 2vw, 1.85rem); margin-bottom: .55em; }
.gep-blog-card h2 a { color: var(--ink); text-decoration: none; }
.gep-pagination { margin-top: 40px; }
.gep-pagination ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.gep-pagination a, .gep-pagination span { display: grid; place-items: center; min-width: 42px; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; }
.gep-pagination .current { background: var(--accent); color: var(--ink); border-color: var(--accent); font-weight: 800; }

/* Product pages and WooCommerce */
.gep-product-intro { padding: 70px 0; background: var(--paper); }
.gep-product-hero { display: grid; grid-template-columns: minmax(280px, 520px) minmax(0, 1fr); gap: 58px; align-items: center; }
.gep-product-hero .gep-media img { background: #fff; border: 1px solid var(--line); }
.woocommerce-breadcrumb, .woocommerce-notices-wrapper { width: var(--wrap); margin-left: auto !important; margin-right: auto !important; }
.woocommerce-breadcrumb { margin-top: 24px !important; margin-bottom: 24px !important; }
.woocommerce div.product { width: var(--wrap); margin: 50px auto; }
.woocommerce div.product .product_title { font-size: clamp(2.25rem, 4vw, 4rem); }
.woocommerce div.product div.images .flex-control-thumbs { list-style: none !important; padding: 0 !important; display: grid !important; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.woocommerce div.product div.images .flex-control-thumbs li { width: auto !important; float: none !important; }
.woocommerce div.product div.images .flex-control-thumbs img { aspect-ratio: 1; object-fit: contain; border: 1px solid var(--line); border-radius: 10px; }
.woocommerce-tabs, .woocommerce-Tabs-panel { width: 100%; }
.woocommerce .woocommerce-tabs ul.tabs { display: none; }
.woocommerce .related.products { width: var(--wrap); margin: 60px auto; }

@media (max-width: 1280px) {
    .gep-menu-toggle { display: block; }
    .gep-nav {
        display: none;
        position: absolute;
        top: 88px;
        left: 0;
        right: 0;
        max-height: calc(100vh - 88px);
        overflow-y: auto;
        background: #fff;
        padding: 24px max(20px, calc((100% - 1180px) / 2));
        border-bottom: 1px solid var(--line);
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
        box-shadow: var(--shadow);
    }
    .gep-nav.is-open { display: flex; }
    .gep-nav-links, .gep-nav-tools { flex-direction: column; align-items: stretch; gap: 12px; }
    .gep-nav a, .gep-nav-products > button { font-size: 1rem; }
    .gep-nav-products > button { width: 100%; padding: 6px 0; text-align: left; }
    .gep-dropdown { position: static; display: block; width: auto; max-height: none; box-shadow: none; border: 0; padding: 8px 0 0 14px; }
    .gep-header-search input { width: 100%; }
    .gep-header-cta { width: 100%; }
    .gep-split, .gep-rfq-grid, .gep-product-hero { grid-template-columns: 1fr; }
    .gep-split-reverse > div:first-child { order: 0; }
    .gep-card-grid, .gep-category-grid, .gep-product-grid, .gep-post-grid, .gep-blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gep-footer-grid { grid-template-columns: 1fr 1fr; }
    .gep-hero { min-height: 620px; }
}

@media (max-width: 782px) {
    body.admin-bar .gep-site-header { top: 46px; }
}

@media (max-width: 640px) {
    :root { --wrap: min(100% - 28px, 1180px); --header-wrap: min(100% - 24px, 1480px); }
    h1 { font-size: 2.45rem; }
    .gep-brand { max-width: 220px; }
    .gep-brand span { max-width: 150px; }
    .gep-brand small { display: none; }
    .gep-header-inner { min-height: 74px; gap: 12px; }
    .gep-nav { top: 74px; max-height: calc(100vh - 74px); }
    .gep-hero { min-height: 590px; }
    .gep-hero-copy { padding-block: 64px; }
    .gep-page-hero, .gep-blog-hero, .gep-category-hero { padding: 80px 0 64px; }
    .gep-section { padding: 60px 0; }
    .gep-card-grid, .gep-category-grid, .gep-product-grid, .gep-post-grid, .gep-blog-grid, .gep-contact-grid, .gep-footer-grid { grid-template-columns: 1fr; }
    .gep-footer-bottom { display: block; }
    .gep-table-wrap table { min-width: 640px; }
    .woocommerce .products { grid-template-columns: 1fr !important; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
