/* ===========================
   BASE STYLES
   Loaded on every page, before the page's own stylesheet.
   Covers: reset, tokens, header/nav, footer, shared form
   styles, accessibility and print.

   Breakpoints used across the site:
     968px — navigation switches to the mobile menu
     768px — tablet
     480px — phone
   =========================== */

/* ===========================
   GLOBAL STYLES & RESET
   =========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color Palette — Blue/Red brand system (matches logo) */
    --primary-color: #1a365d;           /* Deep navy */
    --secondary-color: #2c5282;         /* Mid blue */
    --accent-color: #e63946;            /* Logo red */
    --accent-hover: #c1121f;            /* Deeper red on hover */
    --accent-light: rgba(230, 57, 70, 0.08);
    --text-dark: #2d3748;
    --text-light: #718096;
    --background-light: #f7fafc;
    --background-white: #ffffff;
    --border-color: #e2e8f0;
    --footer-bg: #0f1419;
    --footer-text: #a0aec0;
    --success-color: #276749;

    /* Typography */
    --font-primary: 'Lato', sans-serif;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 3rem;
    --spacing-xl: 4rem;
}

@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
}

/* Keep anchored sections clear of the sticky header */
[id] { scroll-margin-top: 110px; }

body {
    font-family: var(--font-primary);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

/* The hidden attribute always wins over display rules */
[hidden] {
    display: none !important;
}

/* !important so form field styles can't make hidden inputs visible */
.visually_hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ===========================
   HEADER & NAVIGATION
   =========================== */
.top_panel {
    background-color: var(--background-white);
    padding: 1rem 0;
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.main_menu {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.desktop_nav {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: space-between;
}

.nav-group {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex: 1;
}

.nav-group.right {
    justify-content: flex-end;
}

.nav-group a,
.dropdown_btn {
    color: var(--text-dark);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    position: relative;
    padding: 0.5rem 0;
}

.nav-group a:hover,
.dropdown_btn:hover,
.nav-group a[aria-current="page"] {
    color: var(--accent-color);
}

.nav-group a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

.nav-group a:hover::after,
.nav-group a[aria-current="page"]::after {
    width: 100%;
}

/* Dropdown Styles */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown_btn {
    background: none;
    border: none;
    font-family: var(--font-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.dropdown_btn::before {
    content: '▼';
    font-size: 0.6rem;
    margin-left: 0.25rem;
    transition: transform 0.3s ease;
}

.dropdown.open .dropdown_btn::before {
    transform: rotate(180deg);
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--background-white);
    min-width: 220px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    margin-top: 0.5rem;
    padding: 0.5rem 0;
    z-index: 1001;
    border-top: 3px solid var(--accent-color);
}

/* Invisible bridge so the menu stays open while the pointer crosses the gap */
.dropdown-content::before {
    content: '';
    position: absolute;
    top: calc(-0.5rem - 3px);
    left: 0;
    right: 0;
    height: 0.5rem;
}

.dropdown.open .dropdown-content {
    display: block;
    animation: fadeInDown 0.3s ease;
}

@media (hover: hover) {
    .dropdown:hover .dropdown-content {
        display: block;
        animation: fadeInDown 0.3s ease;
    }

    .dropdown:hover .dropdown_btn::before {
        transform: rotate(180deg);
    }
}

.dropdown-content a {
    color: var(--text-dark);
    padding: 0.75rem 1.5rem;
    display: block;
    text-transform: capitalize;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

.dropdown-content a::after {
    display: none;
}

.dropdown-content a:hover,
.dropdown-content a[aria-current="page"] {
    background-color: var(--accent-light);
    color: var(--accent-color);
}

.dropdown-content a:hover {
    padding-left: 2rem;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Logo */
.nav-logo { flex-shrink: 0; }

.nav-logo img {
    height: 70px;
    width: auto;
    transition: transform 0.3s ease;
}

.nav-logo img:hover { transform: scale(1.05); }

/* Desktop: hide mobile-only elements */
.hamburger,
.mobile_menu_tray,
.mobile-only {
    display: none;
}

.desktop-only {
    display: block;
}

/* ===========================
   MAIN CONTENT
   =========================== */
.page_content_wrap { min-height: 60vh; }

/* ===========================
   FORMS (shared)
   =========================== */
.form_label {
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.4rem;
}

.form_label .required {
    color: var(--accent-color);
}

.form_group {
    position: relative;
}

.form_group input,
.form_group textarea,
.form_group select {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: var(--background-light);
}

.form_group input:focus,
.form_group textarea:focus,
.form_group select:focus {
    outline: none;
    border-color: var(--accent-color);
    background-color: var(--background-white);
    box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.12);
}

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

.btn_submit {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--background-white);
    padding: 1.25rem;
    border: none;
    border-radius: 8px;
    font-family: var(--font-primary);
    font-size: 1.125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn_submit:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(26, 54, 93, 0.3);
}

.btn_submit:active {
    transform: translateY(0);
}

button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: wait;
    transform: none;
}

.form_status {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    border-left: 4px solid currentColor;
}

.form_status.success {
    color: var(--success-color);
    background-color: rgba(39, 103, 73, 0.08);
}

.form_status.error {
    color: var(--accent-hover);
    background-color: var(--accent-light);
}

/* ===========================
   FOOTER
   =========================== */
.footer {
    background: linear-gradient(135deg, #0f1419 0%, #1a202c 100%);
    color: var(--footer-text);
    padding: var(--spacing-xl) 0 var(--spacing-md);
    position: relative;
    overflow: hidden;
}

/* Thin tri-colour rule at top — nods to the blue+red logo */
.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color) 50%, var(--accent-color) 100%);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-section h3 {
    color: var(--background-white);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    letter-spacing: 1px;
}

.footer-section p,
.footer-section a {
    color: var(--footer-text);
    line-height: 1.8;
    font-size: 0.95rem;
}

.footer-section a:hover { color: var(--accent-color); }

.footer-links { list-style: none; }
.footer-links li { margin-bottom: 0.75rem; }

.footer-links a {
    display: inline-block;
    transition: all 0.3s ease;
}

.footer-links a:hover { transform: translateX(5px); }

.socials {
    display: flex;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.socials a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.socials a:hover {
    background-color: var(--accent-color);
    color: #ffffff;
    transform: translateY(-3px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    text-align: center;
}

.footer-bottom p {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

/* ===========================
   MOBILE NAVIGATION (968px and below)
   =========================== */
@media (max-width: 968px) {
    .desktop_nav {
        display: none !important;
    }

    .mobile-only {
        display: block;
    }

    .desktop-only {
        display: none !important;
    }

    .nav-logo {
        z-index: 10001;
    }

    .nav-logo img {
        height: 50px;
    }

    /* Hamburger button */
    .hamburger {
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        width: 30px;
        height: 25px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 10001;
        position: relative;
    }

    .hamburger span {
        width: 100%;
        height: 3px;
        background-color: var(--text-dark);
        border-radius: 10px;
        transition: all 0.3s ease;
        transform-origin: center;
    }

    /* Hamburger to X animation */
    .hamburger.active span:nth-child(1) {
        transform: translateY(11px) rotate(45deg);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
        transform: translateX(-20px);
    }

    .hamburger.active span:nth-child(3) {
        transform: translateY(-11px) rotate(-45deg);
    }

    /* Menu tray — hidden (and out of the tab order) until opened */
    .mobile_menu_tray {
        display: block;
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 400px;
        height: 100vh;
        background-color: var(--background-white);
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.3);
        z-index: 10000;
        visibility: hidden;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .mobile_menu_tray.active {
        right: 0;
        visibility: visible;
    }

    .mobile_menu_content {
        padding: 100px 0 40px;
    }

    /* Menu items */
    .menu_item {
        display: block;
        padding: 1.25rem 2rem;
        color: var(--text-dark);
        font-size: 1.125rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        transition: all 0.3s ease;
        border-bottom: 1px solid var(--border-color);
        text-decoration: none;
    }

    .menu_item:hover,
    .menu_item:active {
        background-color: var(--background-light);
        color: var(--accent-color);
        padding-left: 2.5rem;
    }

    .menu_item[aria-current="page"],
    .submenu a[aria-current="page"] {
        color: var(--accent-color);
        border-left: 4px solid var(--accent-color);
    }

    /* Services dropdown in tray */
    .dropdown_menu {
        border-bottom: 1px solid var(--border-color);
    }

    .dropdown_toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 1.25rem 2rem;
        background: transparent;
        border: none;
        color: var(--text-dark);
        font-size: 1.125rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        text-align: left;
        cursor: pointer;
        transition: all 0.3s ease;
        font-family: var(--font-primary);
    }

    .dropdown_toggle:hover {
        background-color: var(--background-light);
        color: var(--accent-color);
        padding-left: 2.5rem;
    }

    .dropdown_arrow {
        transition: transform 0.3s ease;
        flex-shrink: 0;
    }

    .dropdown_toggle.active .dropdown_arrow {
        transform: rotate(180deg);
    }

    .submenu {
        max-height: 0;
        overflow: hidden;
        visibility: hidden;
        background-color: var(--background-light);
        transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s;
    }

    .submenu.active {
        max-height: 300px;
        visibility: visible;
    }

    .submenu a {
        display: block;
        padding: 1rem 2rem 1rem 3rem;
        color: var(--text-light);
        font-size: 1rem;
        font-weight: 500;
        transition: all 0.3s ease;
    }

    .submenu a:hover {
        background-color: rgba(255, 255, 255, 0.5);
        color: var(--accent-color);
        padding-left: 3.5rem;
    }

    /* Social buttons in tray */
    .mobile_menu_socials {
        display: flex;
        justify-content: center;
        gap: 2rem;
        padding: 2.5rem 2rem;
        margin-top: 2rem;
        border-top: 1px solid var(--border-color);
    }

    .mobile_menu_socials a {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 48px;
        height: 48px;
        border-radius: 50%;
        background-color: var(--background-light);
        color: var(--text-dark);
        transition: all 0.3s ease;
    }

    .mobile_menu_socials a:hover {
        background-color: var(--accent-color);
        color: #ffffff;
        transform: translateY(-3px);
        box-shadow: 0 4px 12px rgba(230, 57, 70, 0.4);
    }

    .mobile_menu_socials svg {
        width: 24px;
        height: 24px;
    }

    /* Body scroll lock & dim overlay behind the tray */
    body.menu-open {
        overflow: hidden;
    }

    body.menu-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(5px);
        animation: fadeIn 0.3s ease;
        pointer-events: auto;
    }

    @keyframes fadeIn {
        from { opacity: 0; }
        to   { opacity: 1; }
    }

    /* Footer: two columns */
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.5rem;
    }

    .footer-section h3 {
        font-size: 1.125rem;
    }

    .footer-section p,
    .footer-section a {
        font-size: 0.875rem;
    }
}

.mobile_menu_tray::-webkit-scrollbar {
    width: 6px;
}

.mobile_menu_tray::-webkit-scrollbar-track {
    background: var(--background-light);
}

.mobile_menu_tray::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 3px;
}

.mobile_menu_tray::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
}

/* ===========================
   TABLET (768px and below)
   =========================== */
@media (max-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }

    /* Footer: left-aligned. Company info across the top, the two link
       lists side by side, contact details underneath. */
    .footer {
        padding: 2.5rem 0 1.5rem;
    }

    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 2rem 1.5rem;
        margin-bottom: 2rem;
    }

    .footer-brand,
    .footer-contact {
        grid-column: 1 / -1;
    }

    .footer-brand {
        padding-bottom: 2rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .footer-contact {
        padding-top: 2rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .footer-section h3 {
        position: relative;
        margin-bottom: 1.25rem;
        padding-bottom: 0.625rem;
        font-size: 0.95rem;
        text-transform: uppercase;
        letter-spacing: 1.5px;
    }

    /* Short red rule under each heading */
    .footer-section h3::after {
        content: '';
        position: absolute;
        left: 0;
        bottom: 0;
        width: 28px;
        height: 2px;
        background-color: var(--accent-color);
    }

    .footer-brand h3 {
        font-size: 1.25rem;
        text-transform: none;
        letter-spacing: 1px;
    }

    .footer-section p {
        margin-bottom: 0.75rem;
    }

    .footer-links li {
        margin-bottom: 0.25rem;
    }

    /* Bigger tap targets for links */
    .footer-links a {
        display: block;
        padding: 0.375rem 0;
    }

    .footer-links a:hover {
        transform: none;
        color: var(--accent-color);
    }

    .footer-contact p {
        display: grid;
        grid-template-columns: 5.5rem 1fr;
        align-items: baseline;
        margin-bottom: 0.625rem;
    }

    .footer-contact p br {
        display: none;
    }

    .socials {
        gap: 1rem;
        margin-top: 1.25rem;
    }

    .socials a {
        width: 40px;
        height: 40px;
    }

    .footer-bottom {
        padding-top: 1.5rem;
    }

    .footer-bottom p {
        font-size: 0.8125rem;
    }
}

/* ===========================
   PHONE (480px and below)
   =========================== */
@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .mobile_menu_tray {
        width: 90%;
    }

    .menu_item,
    .dropdown_toggle {
        font-size: 1rem;
        padding: 1.125rem 1.5rem;
    }

    .submenu a {
        font-size: 0.938rem;
        padding: 0.875rem 1.5rem 0.875rem 2.5rem;
    }

    .nav-logo img {
        height: 45px;
    }

    .hamburger {
        width: 28px;
        height: 22px;
    }

    .hamburger span {
        height: 2.5px;
    }
}

/* ===========================
   ACCESSIBILITY
   =========================== */

/* Visible focus ring for keyboard users only */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (prefers-contrast: high) {
    .nav-group a,
    .dropdown_btn,
    .dropdown-content a {
        border: 1px solid currentColor;
        padding: 0.5rem 1rem;
    }
}

/* ===========================
   PRINT
   =========================== */
@media print {
    .top_panel,
    .footer,
    .hamburger,
    .mobile_menu_tray,
    form button {
        display: none !important;
    }

    .page_content_wrap {
        padding: 0;
    }

    a {
        text-decoration: underline;
    }

    * {
        background: white !important;
        color: black !important;
    }
}
