/* 
   Hadfield & Alletson Ltd - Main Stylesheet 
*/

/* 1. Variables */
:root {
    /* Colors - Aligned with Logo */
    --color-primary: #004d40; /* Keep Deep Teal as brand primary */
    --color-primary-light: #00695c;
    --color-accent: #e65100; /* Deep Orange/Red from logo accents */
    --color-accent-dark: #bf360c;
    --color-brand-dark: #1a1a1a; /* Charcoal from logo */
    --color-brand-grey: #757575; /* Grey from logo */
    
    --color-bg-light: #fdfdfd; /* Off-white */
    --color-bg-muted: #f5f7f5; /* Subtle pale green/grey */
    --color-text-main: #212121; /* Darker charcoal */
    --color-text-muted: #616161;
    --color-white: #ffffff;
    --color-border: #e0e0e0;

    /* Typography */
    --font-heading: 'DM Serif Display', serif;
    --font-body: 'Inter', sans-serif;

    /* Spacing */
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;

    /* Container */
    --container-width: 1200px;
    
    /* Transitions */
    --transition: all 0.3s ease;

    /* Shadow */
    --shadow: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-hover: 0 10px 15px rgba(0,0,0,0.1);
}

/* 2. Reset and Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
}

body, h1, h2, h3, h4, p, ul, ol, li, figure, figcaption, blockquote, dl, dd {
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text-main);
    background-color: var(--color-bg-light);
    overflow-x: hidden;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

ul {
    list-style: none;
}

button {
    font: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

section {
    padding: var(--spacing-lg) 0;
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--color-primary);
    color: white;
    padding: 1rem;
    z-index: 10000;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* 3. Typography */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: 1.75rem; }

.text-center { text-center: center; }
.section-title {
    text-align: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: var(--spacing-lg);
}

/* 4. Buttons */
.btn {
    display: inline-block;
    padding: 0.85rem 2rem;
    border-radius: 4px;
    font-weight: 600;
    text-align: center;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-white);
}

.btn-primary:hover {
    background-color: var(--color-primary-light);
    transform: translateY(-2px);
}

.btn-accent {
    background-color: var(--color-accent);
    color: var(--color-primary);
}

.btn-accent:hover {
    background-color: var(--color-accent-dark);
    transform: translateY(-2px);
}

.btn-outline {
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
}

.btn-outline:hover {
    background-color: var(--color-primary);
    color: var(--color-white);
}

/* 5. Header and Navigation */
.site-header {
    background-color: var(--color-white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0.75rem 0;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
}

.logo-img {
    height: auto;
    width: 250px;
    max-width: 100%;
    display: block;
}

.nav-list {
    display: flex;
    gap: 1.25rem;
    align-items: center;
}

.nav-list a {
    font-weight: 500;
    color: var(--color-brand-dark);
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    font-size: 0.95rem;
    white-space: nowrap;
}

.nav-list a:hover, .nav-list a.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-accent);
}

.nav-cta {
    background-color: var(--color-primary);
    color: var(--color-white) !important;
    padding: 0.6rem 1.2rem !important;
    border-radius: 4px;
    border-bottom: none !important;
    white-space: nowrap;
}

.nav-cta:hover {
    background-color: var(--color-primary-light);
}

/* Dropdown */
.has-dropdown { position: relative; }
.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--color-white);
    box-shadow: var(--shadow);
    padding: 1rem;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    border-top: 3px solid var(--color-primary);
}

.has-dropdown:hover .dropdown {
    opacity: 1;
    visibility: visible;
}

.dropdown li { margin-bottom: 0.5rem; }
.dropdown a { border-bottom: none !important; }

/* Mobile Navigation Toggle */
.nav-toggle {
    display: none;
    width: 40px;
    height: 40px;
    position: relative;
    z-index: 1001;
}

.hamburger {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-primary);
    position: absolute;
    left: 8px;
    top: 19px;
    transition: background 0.3s;
}

.hamburger::before, .hamburger::after {
    content: '';
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-primary);
    position: absolute;
    transition: transform 0.3s;
}

.hamburger::before { top: -8px; }
.hamburger::after { top: 8px; }

/* 6. Hero Section */
.hero {
    background: linear-gradient(rgba(0, 77, 64, 0.9), rgba(0, 77, 64, 0.9)), url('../img/hero-bg.jpg') center/cover no-repeat;
    color: var(--color-white);
    padding: var(--spacing-xl) 0;
    text-align: center;
}

.hero-content {
    max-width: 900px;
    margin: 0 auto;
}

.hero h1 {
    margin-bottom: 1.5rem;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    opacity: 0.9;
}

.hero-btns {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 3rem;
}

.hero-trust {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    font-weight: 600;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.trust-item::before {
    content: '✓';
    color: var(--color-accent);
}

/* 7. Service Cards */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.card {
    background: var(--color-white);
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border-top: 4px solid var(--color-primary);
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.card-icon {
    font-size: 2.5rem;
    color: var(--color-accent);
    margin-bottom: 1.5rem;
}

.card h3 {
    margin-bottom: 1rem;
}

/* 8. Industries & Accreditations Section */
.industries {
    background-color: var(--color-bg-muted);
}

.industry-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.industry-item {
    background: var(--color-white);
    padding: 1.5rem;
    text-align: center;
    border-radius: 4px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.accreditation-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.accreditation-card {
    min-height: 210px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: #fff;
    border: 1px solid var(--color-border, #e5e5e5);
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.accreditation-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.accreditation-logo-wrap {
    width: 100%;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.accreditation-logo {
    display: block;
    width: auto;
    max-width: 180px;
    max-height: 90px;
    object-fit: contain;
}

.accreditation-card h3 {
    margin: 0;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.3;
}

@media (max-width: 1050px) {
    .accreditation-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .accreditation-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 430px) {
    .accreditation-grid {
        grid-template-columns: 1fr;
    }
}

/* 9. Consultancy Package */
.package-box {
    background: var(--color-primary);
    color: var(--color-white);
    padding: 4rem;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.package-price {
    font-size: 3.5rem;
    font-family: var(--font-heading);
    color: var(--color-accent);
    margin: 1.5rem 0;
}

.package-features {
    text-align: left;
    margin-bottom: 2rem;
}

.package-features li {
    margin-bottom: 0.5rem;
}

.package-features li::before {
    content: '→';
    margin-right: 0.5rem;
    color: var(--color-accent);
}

/* 10. Team Section */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
}

.team-card {
    text-align: center;
}

.team-img {
    width: 200px;
    height: 200px;
    background: var(--color-primary);
    color: var(--color-white);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    font-family: var(--font-heading);
    border: 5px solid var(--color-accent);
}

.team-card h3 { margin-bottom: 0.25rem; }
.team-role {
    color: var(--color-primary);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: block;
}

/* 11. Testimonials */
.testimonial-card {
    background: var(--color-white);
    padding: 3rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    position: relative;
    font-style: italic;
}

.testimonial-card::before {
    content: '"';
    font-family: var(--font-heading);
    font-size: 5rem;
    color: var(--color-accent);
    position: absolute;
    top: 0;
    left: 1rem;
    opacity: 0.3;
}

.testimonial-meta {
    margin-top: 1.5rem;
    font-style: normal;
    font-weight: 700;
    color: var(--color-primary);
}

/* 12. Contact Form */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

input, select, textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-family: inherit;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--color-primary);
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.checkbox-group input { width: auto; margin-top: 0.4rem; }

.status-msg {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

.status-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
.status-error { background: #ffebee; color: #c62828; border: 1px solid #ffcdd2; }

/* 13. Footer */
.site-footer {
    background-color: var(--color-primary);
    color: var(--color-white);
    padding: var(--spacing-lg) 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.site-footer h3 {
    color: var(--color-accent);
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
}

.site-footer .footer-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    max-width: 100%;
    padding: 10px 14px;
    background: var(--color-white);
    border-radius: 8px;
    text-decoration: none;
}

.site-footer .footer-logo img {
    display: block;
    width: 230px;
    max-width: 100%;
    height: auto;
}

.footer-desc { margin-top: 1.5rem; opacity: 0.8; }

.site-footer ul li { margin-bottom: 0.75rem; }
.site-footer a:hover { color: var(--color-accent); }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 2rem;
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    opacity: 0.7;
    font-size: 0.9rem;
}

.footer-legal { display: flex; gap: 1.5rem; }

.footer-copyright-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.footer-copyright-group p {
    margin: 0;
}

.website-credit {
    font-size: 0.78rem;
    opacity: 0.62;
}

.website-credit a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid currentColor;
    border-bottom-color: rgba(255, 255, 255, 0.22);
    transition:
        color 0.2s ease,
        opacity 0.2s ease,
        border-color 0.2s ease;
}

.website-credit a:hover,
.website-credit a:focus-visible {
    color: #ffffff;
    opacity: 1;
    border-bottom-color: rgba(255, 255, 255, 0.75);
}

.website-credit a:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 4px;
    border-radius: 2px;
}

/* 14. Responsive */
@media (max-width: 1200px) {
    .logo-img { width: 200px; }
    .nav-list { gap: 0.75rem; }
    .nav-list a { font-size: 0.9rem; }
    .nav-cta { padding: 0.5rem 1rem !important; }
}

@media (max-width: 1024px) {
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
    .contact-wrapper { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .nav-toggle { display: block; }
    
    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100dvh;
        background: var(--color-primary);
        padding: 6rem 2rem;
        transition: right 0.4s ease;
        z-index: 1000;
        overflow-y: auto;
    }

    .main-nav.open { right: 0; }

    .nav-list {
        flex-direction: column;
        align-items: flex-start;
        gap: 2rem;
    }

    .nav-list a {
        color: var(--color-white);
        font-size: 1.5rem;
    }

    .dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        background: none;
        box-shadow: none;
        padding-left: 1.5rem;
        border: none;
        display: none;
    }

    .has-dropdown:hover .dropdown { display: block; }

    .nav-toggle.open .hamburger { background: transparent; }
    .nav-toggle.open .hamburger::before { transform: translateY(8px) rotate(45deg); background: var(--color-white); }
    .nav-toggle.open .hamburger::after { transform: translateY(-8px) rotate(-45deg); background: var(--color-white); }

    .hero-trust { flex-direction: column; align-items: center; gap: 1rem; }
    
    .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
    .footer-bottom-content { flex-direction: column; gap: 1rem; text-align: center; }

    .footer-copyright-group {
        align-items: center;
        text-align: center;
    }
}

/* Training Page Specifics */
.search-container {
    max-width: 600px;
    margin: 0 auto 3rem;
}

.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.course-card {
    background: var(--color-white);
    padding: 1.5rem;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border-left: 4px solid var(--color-primary);
    transition: var(--transition);
}

.course-card:hover { border-left-color: var(--color-accent); transform: translateX(5px); }

/* Accessibility & Utils */
@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}

body.nav-open { overflow: hidden; }
