/* ========================================
   Ross Russell Trust - Stylesheet
   Mobile-first, responsive design
   Colours: Navy #1a365d + Teal #0d9488
   ======================================== */

/* CSS Custom Properties */
:root {
    --color-primary: #1a365d;
    --color-primary-dark: #1e2d4a;
    --color-accent: #0d9488;
    --color-accent-dark: #0f766e;
    --color-bg: #f8fafc;
    --color-bg-alt: #ffffff;
    --color-text: #334155;
    --color-text-light: #64748b;
    --color-text-dark: #1e293b;
    --color-border: #e2e8f0;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-error: #ef4444;
    
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    --transition: 0.2s ease-in-out;
    
    --container-max: 1100px;
    --header-height: 70px;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-family);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Skip Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-primary);
    color: white;
    padding: 8px 16px;
    z-index: 1000;
    text-decoration: none;
    border-radius: 0 0 var(--radius-sm) 0;
    transition: top var(--transition);
}

.skip-link:focus {
    top: 0;
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* Container */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--color-text-dark);
    line-height: 1.3;
    font-weight: 600;
}

h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--color-accent-dark);
}

a:focus {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* Focus States */
:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.btn-primary {
    background-color: var(--color-accent);
    color: white;
}

.btn-primary:hover {
    background-color: var(--color-accent-dark);
    color: white;
}

.btn-secondary {
    background-color: var(--color-bg);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background-color: var(--color-border);
    color: var(--color-text);
}

/* Icons */
.icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.icon-large {
    width: 32px;
    height: 32px;
    color: var(--color-accent);
}

.icon-contact {
    width: 40px;
    height: 40px;
    color: var(--color-accent);
    margin-bottom: 12px;
}

.icon-result {
    width: 48px;
    height: 48px;
    color: var(--color-accent);
    margin-bottom: 16px;
}

.icon-success {
    width: 48px;
    height: 48px;
    color: var(--color-success);
    margin-bottom: 16px;
}

/* Header & Navigation */
.header {
    position: sticky;
    top: 0;
    background: white;
    box-shadow: var(--shadow-sm);
    z-index: 100;
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 12px 20px;
    height: var(--header-height);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-primary);
}

.nav-logo:hover {
    color: var(--color-primary);
}

.nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: var(--radius-sm);
}

.nav-toggle:hover {
    background: var(--color-bg);
}

.nav-toggle .icon {
    width: 24px;
    height: 24px;
    color: var(--color-text);
}

.nav-menu {
    display: flex;
    flex-direction: column;
    list-style: none;
    background: white;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    padding: 20px;
    box-shadow: var(--shadow-md);
    gap: 8px;
}

.nav-menu[hidden] {
    display: none;
}

.nav-menu a {
    display: block;
    padding: 12px 16px;
    color: var(--color-text);
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.nav-menu a:hover {
    background: var(--color-bg);
    color: var(--color-accent);
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-image {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(26, 54, 93, 0.9) 0%, rgba(13, 148, 136, 0.8) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    padding: 40px 20px;
}

.hero-content h1 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero-subhead {
    font-size: 1.125rem;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto 1rem;
}

.hero-tagline {
    font-size: 0.875rem;
    opacity: 0.85;
}

/* Sections */
.section {
    padding: 60px 0;
}

.section-alt {
    background-color: white;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    margin-bottom: 0;
}

.section-intro {
    font-size: 1.125rem;
    color: var(--color-text-light);
    margin-bottom: 2rem;
    max-width: 700px;
}

/* About Section */
.content-grid {
    display: grid;
    gap: 40px;
}

.content-text p {
    margin-bottom: 1.25rem;
}

.info-card {
    background: var(--color-bg);
    padding: 24px;
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--color-accent);
}

.info-card h3 {
    color: var(--color-primary);
    margin-bottom: 16px;
}

.info-card dl {
    display: grid;
    gap: 12px;
}

.info-card dt {
    font-weight: 500;
    color: var(--color-text-light);
    font-size: 0.875rem;
}

.info-card dd {
    margin: 0;
    color: var(--color-text-dark);
    font-weight: 500;
}

/* What We Fund - Category Grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
}

.category-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: white;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    transition: all var(--transition);
}

.category-card:hover {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.category-card .icon {
    color: var(--color-accent);
    flex-shrink: 0;
}

.category-card span {
    font-size: 0.9rem;
}

/* Who We Help */
.who-we-help {
    background: var(--color-bg);
    padding: 24px;
    border-radius: var(--radius-lg);
}

.who-we-help h3 {
    color: var(--color-primary);
    margin-bottom: 16px;
}

.who-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.who-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
}

.who-list .icon {
    color: var(--color-accent);
}

/* Eligibility Form */
.eligibility-form {
    max-width: 600px;
    background: white;
    padding: 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
}

.eligibility-form fieldset {
    border: none;
}

.eligibility-form legend {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 24px;
    padding: 0;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--color-text-dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    font-family: inherit;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: white;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.form-actions {
    margin-top: 24px;
}

.form-actions .btn {
    width: 100%;
}

/* Eligibility Result */
.eligibility-result {
    margin-top: 32px;
}

.result-card {
    padding: 32px;
    border-radius: var(--radius-lg);
    text-align: center;
}

.result-fit {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.1) 100%);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.result-no-fit {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(234, 88, 12, 0.1) 100%);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.result-card h3 {
    color: var(--color-text-dark);
    margin-bottom: 12px;
}

.result-card .disclaimer {
    font-size: 0.875rem;
    color: var(--color-text-light);
    margin-top: 16px;
    margin-bottom: 0;
}

/* How to Apply */
.apply-content {
    display: grid;
    gap: 40px;
}

.apply-process {
    display: grid;
    gap: 24px;
}

.process-step {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.step-number {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-accent);
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
    border-radius: 50%;
    flex-shrink: 0;
}

.process-step h3 {
    margin-bottom: 4px;
}

.process-step p {
    margin-bottom: 0;
    color: var(--color-text-light);
}

.apply-image img {
    width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.apply-checklist {
    background: var(--color-bg);
    padding: 24px;
    border-radius: var(--radius-lg);
}

.apply-checklist h3 {
    color: var(--color-primary);
    margin-bottom: 16px;
}

.apply-checklist ul {
    list-style: none;
    display: grid;
    gap: 12px;
}

.apply-checklist li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 24px;
    position: relative;
}

.apply-checklist li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--color-accent);
    font-weight: 600;
}

/* Documents Section */
.documents-content {
    max-width: 600px;
}

.documents-content .btn {
    margin-top: 16px;
}

/* Contact Grid */
.contact-grid {
    display: grid;
    gap: 24px;
    margin-bottom: 40px;
}

.contact-card {
    background: white;
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    text-align: center;
}

.contact-card h3 {
    color: var(--color-primary);
    margin-bottom: 12px;
}

.contact-card address {
    font-style: normal;
    line-height: 1.8;
}

.contact-card p {
    margin-bottom: 4px;
}

.contact-card a {
    font-weight: 500;
}

.contact-note {
    font-size: 0.875rem;
    color: var(--color-text-light);
}

/* Enquiry Form Wrapper */
.enquiry-form-wrapper {
    max-width: 700px;
    background: white;
    padding: 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
}

.enquiry-form-wrapper h3 {
    color: var(--color-primary);
    margin-bottom: 24px;
}

.enquiry-success {
    text-align: center;
    padding: 40px 20px;
}

.enquiry-success h3 {
    color: var(--color-success);
    margin-bottom: 12px;
}

/* Privacy Section */
.privacy-content {
    max-width: 700px;
}

.privacy-content h3 {
    color: var(--color-primary);
    margin-top: 24px;
    margin-bottom: 12px;
}

.privacy-content h3:first-child {
    margin-top: 0;
}

/* Footer */
.footer {
    background: var(--color-primary);
    color: white;
    padding: 32px 0;
}

.footer .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}

.footer-copyright {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.footer-credit {
    margin: 0;
    font-size: 0.875rem;
}

.footer-credit a {
    color: white;
    text-decoration: underline;
}

.footer-credit a:hover {
    opacity: 0.8;
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    padding: 20px;
}

.cookie-banner[hidden] {
    display: none;
}

.cookie-content {
    max-width: var(--container-max);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cookie-content p {
    margin: 0;
    font-size: 0.95rem;
}

.cookie-buttons {
    display: flex;
    gap: 12px;
}

.cookie-buttons .btn {
    flex: 1;
    padding: 10px 16px;
    font-size: 0.9rem;
}

/* Responsive - Tablet */
@media (min-width: 640px) {
    h1 {
        font-size: 2.5rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    .hero-content h1 {
        font-size: 3rem;
    }
    
    .form-row {
        grid-template-columns: 1fr 1fr;
    }
    
    .contact-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .cookie-content {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    
    .cookie-buttons {
        flex: none;
    }
    
    .cookie-buttons .btn {
        flex: none;
    }
}

/* Responsive - Desktop */
@media (min-width: 768px) {
    .nav-toggle {
        display: none;
    }
    
    .nav-menu {
        position: static;
        flex-direction: row;
        padding: 0;
        box-shadow: none;
        gap: 4px;
        background: transparent;
    }
    
    .nav-menu[hidden] {
        display: flex;
    }
    
    .nav-menu a {
        padding: 8px 12px;
        border-radius: var(--radius-sm);
    }
    
    .content-grid {
        grid-template-columns: 1fr 320px;
    }
    
    .apply-content {
        grid-template-columns: 1fr 1fr;
        align-items: center;
    }
    
    .footer .container {
        flex-direction: row;
        justify-content: space-between;
    }
}

@media (min-width: 1024px) {
    .hero {
        min-height: 500px;
    }
    
    .hero-content h1 {
        font-size: 3.5rem;
    }
    
    .section {
        padding: 80px 0;
    }
}

/* Page Header (Inner Pages) */
.page-header {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    padding: 60px 0;
    text-align: center;
}

.page-header h1 {
    color: white;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.page-intro {
    font-size: 1.125rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Legal Content */
.legal-content {
    max-width: 800px;
    margin: 0 auto;
}

.legal-content h2 {
    color: var(--color-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-accent);
}

.legal-content h3 {
    color: var(--color-primary);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.legal-content h3:first-child {
    margin-top: 0;
}

.legal-content p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.legal-content ul,
.legal-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.legal-content li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.legal-content strong {
    color: var(--color-text-dark);
}

.legal-content .important-notice {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(234, 88, 12, 0.1) 100%);
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 20px;
    border-radius: var(--radius-md);
    margin: 1.5rem 0;
}

.legal-content a {
    font-weight: 500;
}

/* Footer Links */
.footer-links {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    font-size: 0.9rem;
}

.footer-links a {
    color: white;
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}

.footer-links span {
    opacity: 0.6;
}

/* Utility Classes */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Print Styles */
@media print {
    .header,
    .footer,
    .cookie-banner,
    .eligibility-form,
    .enquiry-form-wrapper {
        display: none;
    }
    
    .section {
        padding: 20px 0;
    }
    
    a {
        text-decoration: none;
    }
}
