/**
 * AYIO Jobs - Homepage Styles
 * Professional job board homepage
 *
 * Structure:
 *   1. Base styles (no media queries)
 *   2. Responsive overrides (consolidated at end of file)
 *      - max-width: 1024px  (tablets / small laptops)
 *      - max-width: 768px   (landscape phones / portrait tablets)
 *      - max-width: 480px   (phones)
 *      - max-width: 375px   (small phones)
 */

/* ========================================
   HERO KEYFRAME ANIMATIONS (matches Sales)
   ======================================== */
@keyframes heroFloat {
    0%   { transform: translate(0, 0) rotate(0deg); }
    25%  { transform: translate(12px, -18px) rotate(1deg); }
    50%  { transform: translate(-8px, -30px) rotate(-0.5deg); }
    75%  { transform: translate(-16px, -10px) rotate(0.5deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

@keyframes fadeInUp {
    /* Keep content readable if animation is interrupted or never runs —
       no opacity change. Only a subtle rise from below. */
    from { transform: translateY(18px); }
    to   { transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
    .hero-section .hero-content > * { animation: none !important; }
}

/* ========================================
   HERO SECTION
   ======================================== */
.hero-section {
    background: var(--hero-gradient);
    padding: 7rem 0 5rem;
    min-height: 70vh;
    color: var(--white);
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Diagonal line pattern overlay */
.hero-section::before {
    content: '';
    position: absolute;
    inset: -50%;
    width: 200%;
    height: 200%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 60px,
        rgba(255,255,255,0.03) 60px,
        rgba(255,255,255,0.03) 61px
    );
    opacity: 0.05;
    z-index: 0;
    pointer-events: none;
}

/* Gold radial glow from top */
.hero-section::after {
    content: '';
    position: absolute;
    top: -20%;
    left: 50%;
    transform: translateX(-50%);
    width: 120%;
    height: 80%;
    background: radial-gradient(
        ellipse at 50% 0%,
        rgba(240,165,0,0.08) 0%,
        transparent 60%
    );
    z-index: 0;
    pointer-events: none;
}

.hero-section .hero-content {
    position: relative;
    z-index: 2;
}

/* Staggered fade-in for hero children */
.hero-section .hero-content > * {
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}
.hero-section .hero-content > *:nth-child(1) { animation-delay: 0s; }
.hero-section .hero-content > *:nth-child(2) { animation-delay: 0.1s; }
.hero-section .hero-content > *:nth-child(3) { animation-delay: 0.2s; }
.hero-section .hero-content > *:nth-child(4) { animation-delay: 0.3s; }
.hero-section .hero-content > *:nth-child(5) { animation-delay: 0.4s; }

/* Override style.css .hero-content max-width:700px — homepage needs full width for search grid */
.hero-section .hero-content {
    max-width: 100%;
}

.hero-content h1 {
    font-size: clamp(2.4rem, 5vw, 4.2rem);
    font-weight: 800;
    color: var(--white);
    margin: 0 0 1rem;
    letter-spacing: -1px;
    line-height: 1.1;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: rgba(255,255,255,0.92);
    opacity: 1;
    margin: 0 auto 2.5rem;
    max-width: 600px;
    line-height: 1.6;
    text-shadow: 0 1px 2px rgba(0,0,0,0.35);
}

/* Quick Search Bar */
.quick-search {
    max-width: 860px;
    margin: 0 auto 2.5rem;
}

/* Shared Search Row — used on both homepage and jobs page */
.search-row {
    display: flex;
    gap: 0;
    align-items: center;
    background: var(--white);
    padding: 8px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.08);
}

.search-field {
    min-width: 0;
}

.search-field--keywords {
    flex: 2;
    min-width: 160px;
}

.search-field--location {
    flex: 1.5;
    position: relative;
    min-width: 160px;
}

.search-field--radius {
    flex: 0 0 145px;
}

.search-field--state {
    flex: 0 0 140px;
}

/* Location input + geo button wrapper */
.location-input-wrapper {
    position: relative;
    display: flex;
}

.location-input-wrapper .search-input {
    flex: 1;
    padding-right: 40px;
}

.geo-location-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    font-size: 1rem;
    line-height: 1;
    transition: color 0.2s, background 0.2s;
}

.geo-location-btn:hover {
    color: var(--gold);
    background: var(--gray-50);
}

.geo-location-btn.locating {
    color: var(--gold);
    animation: geo-pulse 1s ease-in-out infinite;
}

@keyframes geo-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.search-input,
.search-select {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border: none;
    border-right: 1px solid var(--gray-200);
    border-radius: 8px;
    font-size: 15px;
    color: var(--navy);
    background: transparent;
    font-family: var(--font-body);
    outline: none;
    transition: border-color 0.2s;
    min-width: 0;
    box-sizing: border-box;
}

.search-field:last-of-type .search-input,
.search-field:last-of-type .search-select {
    border-right: none;
}

.search-input:focus,
.search-select:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: none;
}

.search-input::placeholder {
    color: var(--gray-400);
}

.search-btn {
    background: var(--gold);
    color: var(--navy);
    border: none;
    height: 48px;
    min-width: 140px;
    padding: 0 24px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 16px;
    font-family: var(--font-heading);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.search-btn:hover {
    background: var(--gold-dark);
    transform: scale(1.02);
}

/* ========================================
   POPULAR SEARCH PILLS (matches Sales hero-popular)
   ======================================== */
.hero-popular {
    margin-top: 2rem;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.hero-popular span {
    color: rgba(255,255,255,0.5);
    font-size: 13px;
}

.hero-popular a {
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    padding: 4px 12px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius-full, 9999px);
    text-decoration: none;
    transition: all 0.2s ease;
}

.hero-popular a:hover {
    background: rgba(255,255,255,0.1);
    color: var(--white);
    border-color: rgba(255,255,255,0.4);
}

/* ========================================
   HERO CTA BUTTONS (pill style, matches Sales)
   ======================================== */
.hero-cta {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.btn-hero-pill {
    border-radius: var(--radius-full, 9999px);
    padding: 11px 24px;
    font-size: 0.875rem;
    font-weight: 600;
    backdrop-filter: blur(8px);
    background: transparent;
    box-shadow: none;
}

.btn.btn-hero-pill.btn-secondary {
    background: transparent !important;
    border: 1.5px solid rgba(255,255,255,0.35) !important;
    color: #fff;
    box-shadow: none;
}

.btn.btn-hero-pill.btn-secondary:hover {
    background: rgba(255,255,255,0.08) !important;
    border-color: rgba(255,255,255,0.6) !important;
    color: #fff;
    box-shadow: none;
}

.btn-hero-gold {
    background: var(--gold);
    color: var(--navy);
    border-color: var(--gold);
    box-shadow: 0 2px 8px rgba(240,165,0,0.25);
}

.btn-hero-gold:hover {
    background: var(--gold-dark);
    border-color: var(--gold-dark);
    box-shadow: 0 4px 16px rgba(240,165,0,0.4);
}

.btn-large {
    padding: 14px 32px;
    font-size: 1.05rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* ========================================
   STATS SECTION — dark navy bar (matches Sales hero-stats)
   ======================================== */
.stats-section {
    background: var(--navy);
    padding: 2rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.stats-grid {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
    max-width: 800px;
    margin: 0 auto;
}

.stat-item {
    text-align: center;
    padding: 0 2rem;
    border-right: 1px solid rgba(255,255,255,0.12);
}

.stat-item:last-child {
    border-right: none;
}

.stat-icon {
    font-size: 2rem;
    color: var(--gold);
    margin-bottom: 10px;
}

.stat-number {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--gold);
    margin-bottom: 4px;
    letter-spacing: -1px;
    line-height: 1.2;
}

.stat-label {
    font-size: 13px;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ========================================
   SECTION STYLES
   ======================================== */
.featured-section,
.latest-section,
.how-it-works,
.split-cta-section {
    padding: 60px 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--navy);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    color: var(--gold);
}

.view-all-link {
    color: var(--gold);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: gap 0.2s, color 0.2s;
}

.view-all-link:hover {
    gap: 10px;
    color: var(--gold-dark);
}

/* ========================================
   FEATURED & LATEST JOBS
   ======================================== */
.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
    gap: 25px;
}

.jobs-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* ========================================
   HOW IT WORKS
   ======================================== */
.how-it-works {
    background: var(--gray-50);
    text-align: center;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-top: 40px;
}

.step-item {
    background: var(--white);
    padding: 35px 30px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.step-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
}

.step-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 100%);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto 20px;
}

.step-item h3 {
    margin: 0 0 12px;
    color: var(--navy);
    font-size: 1.2rem;
}

.step-item p {
    color: var(--gray-500);
    line-height: 1.6;
    margin: 0;
}

/* ========================================
   SPLIT CTA SECTION
   ======================================== */
.split-cta-section {
    background: var(--white);
}

.split-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(350px, 100%), 1fr));
    gap: 40px;
}

.split-card {
    padding: 45px;
    border-radius: 16px;
    text-align: center;
}

.split-card.candidates {
    background: linear-gradient(135deg, #f0f4f8 0%, #e8eef5 100%);
    border: 2px solid #d4e2ef;
}

.split-card.employers {
    background: linear-gradient(135deg, #fff9e6 0%, #fff3d1 100%);
    border: 2px solid var(--gold);
}

.split-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 20px;
}

.candidates .split-icon {
    background: var(--navy);
    color: var(--white);
}

.employers .split-icon {
    background: var(--gold);
    color: var(--navy);
}

.split-card h3 {
    margin: 0 0 10px;
    font-size: 1.5rem;
    color: var(--navy);
}

.split-card p {
    color: var(--gray-500);
    margin-bottom: 25px;
    font-size: 1.05rem;
}

.split-card ul {
    list-style: none;
    padding: 0;
    margin: 0 0 30px;
    text-align: left;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

.split-card li {
    padding: 10px 0;
    color: #333;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.split-card li:last-child {
    border-bottom: none;
}

.split-card li i {
    color: var(--gold);
    flex-shrink: 0;
}

.split-card .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 35px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.2s;
}

/* ========================================
   Button base (.btn), .btn-primary, .btn-secondary,
   and .btn-gold are defined in style.css (design system).
   Homepage-specific button sizing only above.
   ======================================== */


/* ========================================================================
   RESPONSIVE STYLES — Consolidated Media Queries
   All breakpoints are grouped below, ordered largest to smallest.
   ======================================================================== */

/* ----------------------------------------
   BREAKPOINT: max-width 1024px
   Tablets / small laptops
   ---------------------------------------- */
@media (max-width: 1024px) {
    /* Search row: wrap fields on narrower viewports */
    .search-row {
        flex-wrap: wrap;
    }

    .search-field--keywords {
        flex: 1 1 100%;
    }

    .search-field--location {
        flex: 1 1 45%;
    }

    .search-field--radius {
        flex: 0 0 135px;
    }

    .search-field--state {
        flex: 0 0 130px;
    }

    .search-btn {
        flex: 1;
        justify-content: center;
    }
}

/* ----------------------------------------
   BREAKPOINT: max-width 768px
   Landscape phones / portrait tablets
   ---------------------------------------- */
@media (max-width: 768px) {
    /* Hero */
    .hero-section {
        padding: 50px 0 40px;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-popular {
        gap: 6px;
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
    }

    .btn-large {
        justify-content: center;
    }

    /* Stats */
    .stats-section {
        padding: 1.5rem 0;
    }

    .stats-grid {
        gap: 1.5rem;
    }

    .stat-item {
        padding: 0 1rem;
    }

    .stat-number {
        font-size: 1.75rem;
    }

    /* Section spacing */
    .featured-section,
    .latest-section,
    .how-it-works,
    .split-cta-section {
        padding: 40px 0;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    /* Grids: collapse to single column */
    .featured-grid {
        grid-template-columns: 1fr;
    }

    .steps-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .split-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .split-card {
        padding: 35px 25px;
    }
}

/* ----------------------------------------
   BREAKPOINT: max-width 480px
   Phones
   ---------------------------------------- */
@media (max-width: 480px) {
    /* Hero */
    .hero-section {
        padding: 40px 0 30px;
    }

    .hero-content h1 {
        font-size: 1.7rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
        margin-bottom: 25px;
    }

    /* Search */
    .quick-search {
        padding: 0;
        margin-bottom: 25px;
    }

    .search-row {
        flex-direction: column;
        padding: 12px;
        gap: 8px;
    }

    .search-field--keywords,
    .search-field--location,
    .search-field--radius,
    .search-field--state {
        flex: none;
        width: 100%;
    }

    .search-input,
    .search-select {
        padding: 10px 12px;
        font-size: 16px; /* Prevents iOS zoom */
    }

    .search-btn {
        width: 100%;
        justify-content: center;
    }

    /* Section titles */
    .section-title {
        font-size: 1.3rem;
    }

    /* Stats */
    .stat-item {
        border-right: none;
        padding: 0;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 11px;
    }

    /* How It Works */
    .step-item {
        padding: 25px 20px;
    }

    .step-icon {
        width: 56px;
        height: 56px;
        font-size: 1.5rem;
    }

    /* Split CTA */
    .split-card {
        padding: 25px 16px;
    }

    .split-card h3 {
        font-size: 1.25rem;
    }

    .split-card p {
        font-size: 0.95rem;
    }

    .split-card .btn {
        padding: 12px 24px;
        width: 100%;
        justify-content: center;
    }

    /* Buttons */
    .btn-large {
        padding: 12px 24px;
        font-size: 0.95rem;
    }
}

/* ========================================
   HOMEPAGE FEATURES SECTION
   ======================================== */
.hp-features-section {
    padding: 56px 0;
    background: #f8fafc;
}

.hp-features-heading {
    text-align: center;
    color: #0f1f3d;
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 8px;
    font-family: var(--font-heading, inherit);
}

.hp-features-subtitle {
    text-align: center;
    color: #6b7280;
    font-size: 1.05rem;
    margin: 0 0 40px;
}

.hp-features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.hp-feature-card {
    background: #fff;
    border-radius: 12px;
    padding: 28px 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    transition: box-shadow 0.2s, transform 0.2s;
}

.hp-feature-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.hp-feature-icon {
    font-size: 2.2rem;
    color: var(--gold, #f0a500);
    margin-bottom: 12px;
}

.hp-feature-card h3 {
    color: #0f1f3d;
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 8px;
}

.hp-feature-card p {
    color: #6b7280;
    font-size: 0.88rem;
    line-height: 1.55;
    margin: 0;
}

@media (max-width: 1024px) {
    .hp-features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .hp-features-section {
        padding: 40px 0;
    }

    .hp-features-heading {
        font-size: 1.4rem;
    }

    .hp-features-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .hp-feature-card {
        padding: 20px 18px;
    }
}

/* ----------------------------------------
   BREAKPOINT: max-width 375px
   Small phones (iPhone SE, etc.)
   ---------------------------------------- */
@media (max-width: 375px) {
    .hero-content h1 {
        font-size: 1.5rem;
    }

    .search-row {
        padding: 10px;
    }

    .section-title {
        font-size: 1.2rem;
    }
}

/* MOB-N03/N04 (2026-05-01): WCAG 2.5.5 — 44x44 min touch target on mobile.
   Loaded on every page; overrides smaller btn-sm/btn-success/btn-warning rules
   from earlier in the cascade. */
@media (max-width: 768px) {
    .btn,
    .btn-sm,
    .btn-success,
    .btn-warning,
    .btn-danger,
    .btn-info,
    .btn-primary,
    .btn-secondary,
    button:not([type="checkbox"]):not([type="radio"]):not([disabled]),
    input[type="submit"],
    input[type="button"] {
        min-height: 44px;
        min-width: 44px;
        padding-top: 10px;
        padding-bottom: 10px;
    }
}
