/* Accessibility - Skip Link */
.skip-link {
    position: absolute;
    top: -100px;
    left: 6px;
    background: #000;
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 0 0 4px 4px;
    font-size: 0.875rem;
    font-weight: 600;
    z-index: 1000;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid #0056b3;
    outline-offset: 2px;
}

/* Screen reader only content */
.sr-only {
    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;
}

/* Enhanced focus indicators for keyboard navigation only */
*:focus {
    outline: none;
}

/* Only show focus outlines when navigating with keyboard */
*:focus-visible {
    outline: 3px solid #0056b3;
    outline-offset: 2px;
}

/* Custom focus-visible styles */
a:focus-visible,
.nav-link:focus-visible,
.footer-link:focus-visible,
.breadcrumb-link:focus-visible,
.back-link:focus-visible,
.cta-button:focus-visible {
    outline: 3px solid #0056b3;
    outline-offset: 2px;
    border-radius: 2px;
}

button:focus-visible,
.form-submit:focus-visible {
    outline: 3px solid #0056b3;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.2);
}

/* Form inputs should always show focus for accessibility */
input:focus,
textarea:focus,
.form-input:focus,
.form-textarea:focus {
    outline: 3px solid #0056b3;
    outline-offset: 2px;
    border-color: #0056b3;
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.1);
}

.job-card-link:focus-visible .job-card {
    outline: 3px solid #0056b3;
    outline-offset: 2px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), 0 0 0 3px rgba(0, 86, 179, 0.2);
    transform: translateY(-2px);
    border-color: #0056b3;
}

/* Touch target accessibility - minimum 44x44px */
a, button, input[type="file"], [role="button"], [tabindex="0"] {
    min-height: 44px;
    min-width: 44px;
}

.nav-link,
.footer-link,
.breadcrumb-link,
.back-link {
    display: inline-block;
    min-height: 44px;
    line-height: 44px;
    padding: 0 0.5rem;
}

.form-submit,
.cta-button {
    min-height: 44px;
    min-width: 44px;
    padding: 0.75rem 2rem;
}

.form-input,
.form-textarea {
    min-height: 44px;
}

/* Reset and base styles */
*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

body {
    line-height: 1.5;
    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        sans-serif;
    color: #333;
    background-color: #fff;
}

/* Layout */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

.main {
    min-height: calc(100vh - 140px);
    padding: 2rem 0;
}

/* Header */
.header {
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
    padding: 1rem 0;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    color: #000;
    text-decoration: none;
}

.nav-link {
    color: #666;
    text-decoration: none;
    font-weight: 500;
    padding: 1rem 0.5rem;
}

.nav-link:hover {
    color: #000;
}

/* Footer */
.footer {
    background: #f8f9fa;
    border-top: 1px solid #e5e5e5;
    padding: 1.5rem 0;
    color: #666;
    font-size: 0.875rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-link {
    color: #666;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: #000;
}

/* Hero section */
.hero {
    text-align: center;
    margin-bottom: 3rem;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #000;
}

.hero-description {
    font-size: 1.125rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
}

/* Jobs section */
.jobs-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: #000;
}

.jobs-list {
    columns: 2;
    column-gap: 1.5rem;
    column-fill: balance;
}

.job-card-link {
    text-decoration: none;
    color: inherit;
    display: inline-block;
    width: 100%;
    margin-bottom: 1.5rem;
    break-inside: avoid;
}

.job-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.job-card:hover,
.job-card-link:hover .job-card {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-color: #d0d0d0;
}

.job-header {
    margin-bottom: 1rem;
}

.job-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #000;
}

.job-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.875rem;
    color: #666;
}

.job-meta span {
    padding: 0.25rem 0.75rem;
    background: #f1f3f4;
    border-radius: 4px;
    white-space: nowrap;
}

.job-summary {
    color: #555;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.job-link {
    display: inline-block;
    color: #0056b3;
    font-weight: 500;
    transition: color 0.2s ease;
}

.job-card-link:hover .job-link {
    color: #003d82;
}

.no-jobs {
    text-align: center;
    color: #666;
    font-size: 1.125rem;
    padding: 3rem 0;
}

/* Job detail page */
.breadcrumb {
    margin-bottom: 2rem;
}

.breadcrumb-link {
    color: #0056b3;
    text-decoration: none;
}

.breadcrumb-link:hover {
    text-decoration: underline;
}

.job-detail-header {
    margin-bottom: 2rem;
}

.job-detail-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #000;
}

.job-content {
    margin-bottom: 3rem;
    line-height: 1.6;
}

.job-content p {
    margin-bottom: 1.2rem;
    color: #333;
}

.job-content p:last-child {
    margin-bottom: 0;
}

.job-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 2.5rem 0 1.2rem;
    color: #000;
    line-height: 1.3;
}

.job-content h2:first-child {
    margin-top: 0;
}

.job-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 2rem 0 1rem;
    color: #000;
    line-height: 1.4;
}

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

.job-content h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 1.5rem 0 0.8rem;
    color: #333;
    line-height: 1.4;
}

.job-content ul,
.job-content ol {
    margin: 1.5rem 0;
    padding-left: 1.8rem;
}

.job-content li {
    margin-bottom: 0.6rem;
    line-height: 1.5;
}

.job-content li:last-child {
    margin-bottom: 0;
}

.job-content ul ul,
.job-content ol ol,
.job-content ul ol,
.job-content ol ul {
    margin: 0.5rem 0;
}

/* Application form */
.application-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 2rem;
    margin-top: 2rem;
}

.application-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #000;
}

.application-form {
    max-width: 600px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #333;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #0056b3;
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.1);
}

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

.form-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #666;
}

.form-submit {
    background: #0056b3;
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.form-submit:hover {
    background: #003d82;
}

/* Messages */
.success-message,
.error-message {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 2rem;
}

.success-message {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.error-message {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.success-message h3,
.error-message h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.error-message ul {
    margin: 0.5rem 0 0 0;
    padding-left: 1.5rem;
}

.error-message li {
    margin-bottom: 0.4rem;
    line-height: 1.4;
}

.error-message li:last-child {
    margin-bottom: 0;
}

/* Error page */
.error-page {
    text-align: center;
    padding: 4rem 0;
}

.error-page h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #000;
}

.error-page p {
    font-size: 1.125rem;
    color: #666;
    margin-bottom: 2rem;
}

.back-link {
    color: #0056b3;
    text-decoration: none;
    font-weight: 500;
}

.back-link:hover {
    text-decoration: underline;
}

/* Content pages */
.content-page {
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

.content-page h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
    color: #000;
    border-bottom: 2px solid #e5e5e5;
    padding-bottom: 1.2rem;
    line-height: 1.2;
}

.content-page h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 2.5rem 0 1.2rem;
    color: #000;
    line-height: 1.3;
}

.content-page h2:first-child {
    margin-top: 0;
}

.content-page h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 2rem 0 1rem;
    color: #000;
    line-height: 1.4;
}

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

.content-page h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 1.5rem 0 0.8rem;
    color: #333;
    line-height: 1.4;
}

.content-page p {
    margin-bottom: 1.2rem;
    color: #333;
}

.content-page p:last-child {
    margin-bottom: 0;
}

.content-page ul,
.content-page ol {
    margin: 1.5rem 0;
    padding-left: 1.8rem;
}

.content-page li {
    margin-bottom: 0.6rem;
    line-height: 1.5;
}

.content-page li:last-child {
    margin-bottom: 0;
}

.content-page ul ul,
.content-page ol ol,
.content-page ul ol,
.content-page ol ul {
    margin: 0.5rem 0;
}

.last-updated {
    color: #666;
    font-size: 0.875rem;
    font-style: italic;
    margin-bottom: 2rem;
}

/* Page content styles */
.content-page section {
    margin-bottom: 3rem;
}

.content-page section:last-child {
    margin-bottom: 0;
}

/* Add better spacing between consecutive paragraphs and other elements */
.job-content > *:first-child,
.content-page > *:first-child {
    margin-top: 0;
}

.job-content > *:last-child,
.content-page > *:last-child {
    margin-bottom: 0;
}

.cta-section {
    text-align: center;
    margin-top: 2rem;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.cta-button {
    display: inline-block;
    background: #0056b3;
    color: white;
    padding: 0.875rem 2rem;
    text-decoration: none;
    font-weight: 500;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.cta-button:hover {
    background: #003d82;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 0 0.75rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .job-detail-header h1 {
        font-size: 1.5rem;
    }

    .jobs-list {
        columns: 1;
    }

    .application-section {
        padding: 1.5rem;
    }

    .form-submit {
        width: 100%;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
        flex-wrap: wrap;
    }

    .content-page h1 {
        font-size: 1.5rem;
        margin-bottom: 2rem;
        padding-bottom: 1rem;
    }

    .content-page h2,
    .job-content h2 {
        margin: 2rem 0 1rem;
    }

    .content-page h3,
    .job-content h3 {
        margin: 1.5rem 0 0.8rem;
    }

    .content-page p,
    .job-content p {
        margin-bottom: 1rem;
    }

    .content-page ul,
    .content-page ol,
    .job-content ul,
    .job-content ol {
        margin: 1.2rem 0;
        padding-left: 1.5rem;
    }

    .content-page section {
        margin-bottom: 2rem;
    }

    .cta-section {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }

    .main {
        padding: 1rem 0;
    }

    .hero {
        margin-bottom: 2rem;
    }

    .job-card {
        padding: 1rem;
    }

    .content-page h2,
    .job-content h2 {
        margin: 1.5rem 0 0.8rem;
    }

    .content-page h3,
    .job-content h3 {
        margin: 1.2rem 0 0.6rem;
    }

    .content-page p,
    .job-content p {
        margin-bottom: 0.8rem;
    }

    .content-page ul,
    .content-page ol,
    .job-content ul,
    .job-content ol {
        margin: 1rem 0;
        padding-left: 1.2rem;
    }

    .content-page li,
    .job-content li {
        margin-bottom: 0.4rem;
    }
}

/* Loading states */
.form-submit-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
}

.form-submit[disabled] {
    background: #94a3b8 !important;
    color: #f1f5f9 !important;
    cursor: not-allowed !important;
    pointer-events: none;
    opacity: 0.7;
    transform: none !important;
    box-shadow: none !important;
}

.form-submit[disabled]:hover {
    background: #94a3b8 !important;
    transform: none !important;
}

.submit-text,
.submit-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-submit[disabled] .submit-text {
    display: none;
}

.form-submit[disabled] .submit-loading {
    display: flex;
}

.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #dbeafe;
    border: 2px solid #3b82f6;
    border-radius: 6px;
    color: #1e40af;
    font-size: 0.95rem;
    font-weight: 600;
    margin-top: 0.5rem;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
    animation: pulse-blue 2s infinite;
}

@keyframes pulse-blue {
    0%, 100% {
        background: #dbeafe;
        border-color: #3b82f6;
    }
    50% {
        background: #bfdbfe;
        border-color: #2563eb;
    }
}

.loading-spinner {
    width: 18px;
    height: 18px;
    border: 3px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.submit-loading .loading-spinner {
    width: 14px;
    height: 14px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Show loading indicator when HTMX is processing */
.htmx-request .loading-indicator {
    display: flex !important;
}

/* Disabled form inputs styling */
.form-input:disabled,
.form-textarea:disabled {
    background-color: #f8f9fa !important;
    color: #6b7280 !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
    border-color: #d1d5db !important;
}

.form-input:disabled::placeholder,
.form-textarea:disabled::placeholder {
    color: #9ca3af !important;
}

@media (max-width: 768px) {
    .form-submit-container {
        width: 100%;
    }
    
    .form-submit {
        width: 100%;
    }
    
    .loading-indicator {
        width: 100%;
        justify-content: center;
    }
}
