/* =====================================================
   Edge Tech Engineering — Main Stylesheet
   ===================================================== */

/* Reset & base */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    background: #fff;
    font-family: 'Figtree', sans-serif;
    color: #1a1a22;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
main { flex: 1; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: 'Space Grotesk', sans-serif; }
img { max-width: 100%; height: auto; display: block; }
p { margin: 0; }

/* Layout */
.container {
    max-width: 1180px;
    margin: 0 auto;
    padding-left: 28px;
    padding-right: 28px;
}

/* ── Header ── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: #ffffff;
    border-bottom: 1px solid #e6e6e2;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding-top: 16px;
    padding-bottom: 16px;
    position: relative;
}
.site-logo { display: flex; align-items: center; flex: none; }
.logo-img { height: 56px; width: auto; }

/* Nav */
.nav {
    display: flex;
    align-items: center;
    gap: 30px;
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: .3px;
}
.nav .navlink {
    color: #1a1a22;
    position: relative;
    padding: 6px 0;
}
.nav .navlink::after {
    content: '';
    position: absolute;
    left: 0; bottom: -2px;
    height: 2px; width: 0;
    background: #d0342c;
    transition: width .18s ease;
}
.nav .navlink:hover { color: #d0342c; }
.nav .navlink:hover::after,
.nav .navlink.active::after { width: 100%; }
.nav .btn-red {
    background: #d0342c;
    color: #fff;
    padding: 11px 20px;
    border-radius: 6px;
    font-weight: 600;
    letter-spacing: .3px;
    order: 10;
}
.nav .btn-red:hover { background: #a4231c; }

.search-wrap {
    position: relative;
    order: 5;
    display: flex;
    align-items: center;
}

/* ── Section label ── */
.section-label {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.section-label .dash {
    width: 28px; height: 2px;
    background: #d0342c;
    flex-shrink: 0;
}
.section-label span {
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: #d0342c;
}

/* ── Page hero ── */
.page-hero {
    border-bottom: 1px solid #e6e6e2;
}
.page-hero .container {
    padding-top: 76px;
    padding-bottom: 56px;
}
.page-hero h1 {
    font-size: clamp(34px, 4.2vw, 50px);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -1px;
    color: #1a1a22;
    margin: 0;
    max-width: 820px;
}

/* ── Buttons ── */
.btn-primary {
    display: inline-block;
    background: #d0342c;
    color: #fff;
    font-size: 14.5px;
    font-weight: 600;
    padding: 15px 30px;
    border-radius: 6px;
    transition: background .18s ease;
}
.btn-primary:hover { background: #a4231c; }
.btn-outline {
    display: inline-block;
    border: 1px solid #e6e6e2;
    color: #1a1a22;
    font-size: 14.5px;
    font-weight: 600;
    padding: 15px 30px;
    border-radius: 6px;
    transition: border-color .18s ease, color .18s ease;
}
.btn-outline:hover { border-color: #d0342c; color: #d0342c; }

/* ── Solution cards ── */
.soln-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}
.soln-card {
    display: block;
    border: 1px solid #e6e6e2;
    border-radius: 10px;
    padding: 34px;
    transition: border-color .18s ease, transform .18s ease;
}
.soln-card:hover { border-color: #d0342c; transform: translateY(-3px); }
.soln-card .card-eyebrow {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: #d0342c;
    margin-bottom: 12px;
}
.soln-card h3 {
    font-size: 21px;
    font-weight: 600;
    color: #1a1a22;
    margin: 0 0 12px;
    letter-spacing: -.3px;
}
.soln-card p {
    font-size: 14.5px;
    line-height: 1.75;
    color: #6b6b76;
}

/* ── Feature cards (Koha) ── */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}
.feature-card {
    border: 1px solid #e6e6e2;
    border-top: 3px solid #d0342c;
    border-radius: 10px;
    padding: 28px;
}
.feature-card .num {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #d0342c;
    margin-bottom: 10px;
}
.feature-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a22;
    margin: 0 0 10px;
    letter-spacing: -.2px;
}
.feature-card p {
    font-size: 14.5px;
    line-height: 1.7;
    color: #6b6b76;
}

/* ── Platform tiles ── */
.plat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}
.plat-tile {
    background: #f6f5f3;
    border-radius: 10px;
    padding: 30px 26px;
    transition: background .18s ease;
}
.plat-tile:hover { background: #fff; box-shadow: 0 0 0 1px #e6e6e2; }
.plat-tile .plat-name {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 19px;
    font-weight: 600;
    color: #1a1a22;
}
.plat-tile .plat-sub {
    font-size: 12px;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: #6b6b76;
    margin-top: 8px;
}

/* ── Bullet list ── */
.bullet-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.bullet-list li {
    position: relative;
    padding: 9px 0 9px 26px;
    font-size: 15.5px;
    line-height: 1.7;
    color: #1a1a22;
}
.bullet-list li::before {
    content: '';
    position: absolute;
    left: 0; top: 16px;
    width: 7px; height: 7px;
    background: #d0342c;
}

/* ── Footer ── */
.site-footer {
    background: #1a1a22;
    color: #9a9aa2;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 56px;
    padding-top: 60px;
    padding-bottom: 44px;
}
.footer-logo-wrap {
    display: inline-block;
    margin-bottom: 22px;
}
.footer-logo-wrap .logo-img {
    height: 100px;
}
.footer-brand p {
    font-size: 14px;
    line-height: 1.85;
    color: #8f8f97;
    max-width: 420px;
}
.footer-heading {
    font-size: 12px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #fff;
    font-weight: 600;
    margin-bottom: 18px;
}
.footer-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 14px;
}
.footer-col a:hover { color: #fff; }
.footer-bottom {
    border-top: 1px solid #33333c;
}
.footer-bottom .container {
    padding-top: 20px;
    padding-bottom: 20px;
    font-size: 13px;
    color: #6a6a72;
}

/* ── CTA band ── */
.cta-band {
    background: #d0342c;
    text-align: center;
}
.cta-band .container {
    padding-top: 72px;
    padding-bottom: 72px;
}
.cta-band h2 {
    font-size: clamp(28px, 3.4vw, 40px);
    font-weight: 700;
    color: #fff;
    margin: 0 0 26px;
    letter-spacing: -.6px;
}
.cta-band .btn-group {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
}
.cta-band .btn-white {
    background: #fff;
    color: #d0342c;
    font-size: 14.5px;
    font-weight: 600;
    padding: 15px 30px;
    border-radius: 6px;
}
.cta-band .btn-ghost {
    border: 1px solid rgba(255,255,255,.6);
    color: #fff;
    font-size: 14.5px;
    font-weight: 600;
    padding: 15px 30px;
    border-radius: 6px;
}

/* ── Contact cards ── */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}
.contact-card {
    border: 1px solid #e6e6e2;
    border-radius: 12px;
    padding: 34px;
}
.contact-card .card-eyebrow {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.3px;
    text-transform: uppercase;
    color: #d0342c;
    margin-bottom: 12px;
}
.contact-card a,
.contact-card .contact-value {
    font-size: 16px;
    color: #1a1a22;
    font-weight: 600;
    line-height: 1.5;
}

/* ── Header search ── */
.search-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: none;
    border: none;
    color: #1a1a22;
    cursor: pointer;
    flex: none;
    padding: 0;
    transition: color .15s ease;
}
.search-toggle:hover { color: #d0342c; }
.header-search {
    position: absolute;
    top: 100%;
    right: 0;
    width: 300px;
    background: #fff;
    border: 1px solid #e6e6e2;
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(0,0,0,.08);
    padding: 18px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
    z-index: 45;
}
.header-search.search-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.header-search form { display: flex; align-items: flex-end; gap: 10px; }
.header-search input {
    flex: 1;
    min-width: 0;
    border: none;
    border-bottom: 2px solid #d0342c;
    outline: none;
    font-family: 'Figtree', sans-serif;
    font-size: 14.5px;
    color: #1a1a22;
    background: transparent;
    padding: 6px 2px;
}
.header-search input::placeholder { color: #9a9aa2; }
.header-search button {
    flex: none;
    background: none;
    border: none;
    color: #d0342c;
    font-family: 'Figtree', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 2px;
    letter-spacing: .2px;
}
.header-search button:hover { text-decoration: underline; }

/* ── Hamburger toggle button ── */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    flex: none;
    padding: 0;
}
.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #1a1a22;
    border-radius: 2px;
    transition: transform .25s ease, opacity .25s ease;
}
.nav-toggle.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-active span:nth-child(2) { opacity: 0; }
.nav-toggle.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

body.nav-scroll-lock { overflow: hidden; }

/* ── Responsive ── */
@media (max-width: 900px) {
    .soln-grid,
    .feature-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .plat-grid { grid-template-columns: repeat(2, 1fr); }
    .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
    .nav-toggle { display: flex; }

    .nav {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: min(78vw, 320px);
        background: #fff;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 96px 28px 28px;
        transform: translateX(100%);
        transition: transform .3s ease;
        box-shadow: -8px 0 30px rgba(0,0,0,.08);
        z-index: 60;
        overflow-y: auto;
    }
    .nav.nav-open { transform: translateX(0); }
    .nav .navlink,
    .nav .btn-red {
        width: 100%;
        padding: 14px 0;
        font-size: 15px;
        border-bottom: 1px solid #f0f0ee;
        border-radius: 0;
    }
    .nav .btn-red {
        margin-top: 12px;
        text-align: center;
        border-radius: 8px;
        border-bottom: none;
        padding: 14px 0;
    }
    .nav .navlink::after { display: none; }

    .header-inner { flex-wrap: nowrap; }
}

@media (max-width: 680px) {
    .footer-grid { grid-template-columns: 1fr; gap: 32px; }
    .plat-grid { grid-template-columns: 1fr; }
    .logo-img { height: 56px !important; }
}

/* ── Global inline-grid rescue for individual pages ── */
/* Pages built with inline grid-template-columns need a class hook to collapse on mobile.
   .rgrid is added alongside inline styles on multi-column rows across pages. */
@media (max-width: 900px) {
    .rgrid-2, .rgrid-3, .rgrid-4 { grid-template-columns: 1fr !important; }
}
@media (max-width: 640px) {
    .rgrid-2-sm { grid-template-columns: 1fr !important; }
}