/* ============================================================================
   HireTheVeterans.com — Resources Directory Styles
   /assets/css/resources.css

   V5 — single-line "phone-book" listing layout (organisation per row, no
   cards). Flags upsized for clear at-a-glance country distinction.

   WCAG 2.1 AA compliance:
   - Body text #1a1a1a on #fff = 21:1
   - Muted text #3a4654 on #fff = 8.6:1 (well above 4.5:1 minimum)
   - Borders #b8bdc4 minimum (3.05:1 vs white) for non-text contrast
   - Focus rings: 2px solid + 2px offset on every interactive element
   - Touch targets: 44px minimum on tappable elements
   - No colour-only meaning (flags pair colour with text label)

   DEPLOYMENT MARKER: PUBLIC_RESOURCES_CSS_V5_PHONEBOOK_LAYOUT
   (search for this string in the live CSS to confirm deployment)
   ============================================================================ */

/* ── Layout ──────────────────────────────────────────────────────────── */
.res-page {
    background: #f0f2f5;
    min-height: 60vh;
    color: #1a1a1a;
}

.res-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    box-sizing: border-box;
}

/* ── Page Header ─────────────────────────────────────────────────────── */
.res-header {
    background: linear-gradient(135deg, #0F1D36 0%, #1B2A4A 100%);
    color: #fff;
    padding: 48px 0 0;
}

.res-header .res-container {
    padding-bottom: 24px;
}

.res-title {
    font-family: 'Barlow Condensed', 'Barlow', sans-serif;
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 8px;
    color: #fff;
}

.res-subtitle {
    font-size: 16px;
    color: #e8e8e8;
    margin: 0 0 28px;
    max-width: 720px;
    line-height: 1.5;
}

/* Country tabs */
.res-country-tabs {
    display: flex;
    gap: 4px;
    margin: 0;
}

.res-country-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    border: 2px solid transparent;
    border-bottom: none;
    transition: background 0.15s, color 0.15s;
    min-height: 44px;
    box-sizing: border-box;
}

.res-country-tab span[aria-hidden="true"] {
    font-size: 22px;
    line-height: 1;
}

.res-country-tab:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    text-decoration: none;
}

.res-country-tab:focus-visible {
    outline: 2px solid #FFD24A;
    outline-offset: 2px;
}

.res-country-tab.is-active {
    background: #f0f2f5;
    color: #0F1D36;
}

/* ── Layout: sidebar + content ───────────────────────────────────────── */
.res-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
    padding-top: 32px;
    padding-bottom: 64px;
    align-items: start;
}

@media (max-width: 880px) {
    .res-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* ── Sidebar ─────────────────────────────────────────────────────────── */
.res-sidebar {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 24px;
}

@media (max-width: 880px) {
    .res-sidebar { position: static; }
}

.res-sidebar-title {
    font-family: 'Barlow Condensed', 'Barlow', sans-serif;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #0F1D36;
    margin: 0 0 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid #C0392B;
}

.res-sidebar-empty {
    color: #3a4654;
    font-size: 14px;
    margin: 0;
}

.res-sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
}

.res-sidebar-list li {
    margin: 0;
}

.res-sidebar-list li + li {
    border-top: 1px solid #eef0f2;
}

.res-sidebar-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 4px;
    color: #1a2a44;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.15s;
    min-height: 40px;
    box-sizing: border-box;
}

.res-sidebar-link:hover {
    color: #C0392B;
    text-decoration: underline;
}

.res-sidebar-link:focus-visible {
    outline: 2px solid #2C5F8A;
    outline-offset: 1px;
    border-radius: 3px;
}

.res-sidebar-link-text {
    flex: 1;
}

.res-sidebar-link-count {
    font-size: 12px;
    background: #eef2f7;
    color: #1a2a44;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    flex-shrink: 0;
}

.res-sidebar-cta {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #eef0f2;
    text-align: center;
}

.res-sidebar-cta p {
    font-size: 13px;
    color: #2a3340;
    margin: 0 0 12px;
    line-height: 1.4;
}

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

/* ── Main Content ───────────────────────────────────────────────────── */
.res-content {
    min-width: 0;
}

.res-results-meta {
    font-size: 14px;
    color: #2a3340;
    margin: 0 0 20px;
}

.res-results-meta strong {
    color: #0F1D36;
}

/* ── Empty State ────────────────────────────────────────────────────── */
.res-empty {
    background: #fff;
    border-radius: 8px;
    padding: 48px 24px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.res-empty h2 {
    font-family: 'Barlow Condensed', 'Barlow', sans-serif;
    font-size: 22px;
    color: #0F1D36;
    margin: 0 0 12px;
    font-weight: 700;
}

.res-empty p {
    color: #2a3340;
    font-size: 15px;
    line-height: 1.5;
    margin: 0;
}

.res-empty a {
    color: #2C5F8A;
    font-weight: 600;
    text-decoration: underline;
}

.res-empty a:hover { color: #C0392B; }

/* ── Category Section ───────────────────────────────────────────────── */
.res-category {
    margin-bottom: 40px;
    scroll-margin-top: 80px;
}

.res-category-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 4px;
    padding-bottom: 8px;
    border-bottom: 3px solid #C0392B;
    flex-wrap: wrap;
}

.res-category-title {
    font-family: 'Barlow Condensed', 'Barlow', sans-serif;
    font-size: 24px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #0F1D36;
    margin: 0;
}

.res-category-count {
    font-size: 13px;
    font-weight: 600;
    color: #2a3340;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.res-category-desc {
    font-size: 14px;
    color: #2a3340;
    line-height: 1.5;
    margin: 12px 0 16px;
    max-width: 800px;
}

/* ── Listings — phone-book single-row layout ─────────────────────────── */
.res-listings {
    list-style: none;
    padding: 0;
    margin: 16px 0 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.res-card {
    /* Each listing renders as a single horizontal row */
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    border-bottom: 1px solid #eef0f2;
    border-left: 4px solid transparent;
    transition: background 0.15s, border-left-color 0.15s;
}

.res-card:last-child {
    border-bottom: none;
}

.res-card:hover {
    background: #fafbfc;
    border-left-color: #C0392B;
}

/* Header block — flag + name on the left */
.res-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
    min-width: 0;
    flex: 1 1 50%;
}

.res-card-title {
    font-family: 'Barlow', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #0F1D36;
    margin: 0;
    line-height: 1.3;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Description: tucked under the name as small inline meta — single-line
   ellipsis to preserve the row layout. Full description still readable
   on the future detail page. */
.res-card-desc {
    font-size: 13px;
    color: #3a4654;
    line-height: 1.4;
    margin-top: 2px;
    margin-bottom: 0;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.res-card-desc p { margin: 0; display: inline; }
.res-card-desc p + p::before { content: ' '; }
.res-card-desc strong, .res-card-desc b { font-weight: 700; }
.res-card-desc a {
    color: #2C5F8A;
    text-decoration: underline;
}
.res-card-desc a:hover { color: #C0392B; }

/* Wrap the name + description so they sit beside the flag as a single block */
.res-card-namegroup {
    min-width: 0;
    flex: 1;
}

/* Contact block — right side, inline horizontal */
.res-card-contact {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: flex-end;
    flex-shrink: 0;
    margin-left: auto;
}

.res-card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #2C5F8A;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 4px 0;
    min-height: 28px;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.res-card-link:hover {
    color: #C0392B;
    text-decoration: underline;
}

.res-card-link:focus-visible {
    outline: 2px solid #2C5F8A;
    outline-offset: 2px;
    border-radius: 2px;
}

.res-card-link span:first-child {
    flex-shrink: 0;
    font-size: 14px;
    width: 18px;
    text-align: center;
}

.res-card-link span:not(:first-child):not(.res-external-icon) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.res-external-icon {
    font-size: 11px;
    color: #4a5560;
    margin-left: 4px;
    flex-shrink: 0;
}

/* ── Country Flag Badges — bigger, clearer ──────────────────────────── */
.res-flag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #eef2f7;
    color: #0F1D36;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 14px;
    border-radius: 4px;
    line-height: 1.4;
    flex-shrink: 0;
    border: 1px solid #c4ccd6;
}

.res-flag-emoji {
    font-size: 26px;     /* was 13px — major upsize */
    line-height: 1;
    display: inline-block;
}

.res-flag-text {
    font-size: 13px;
}

.res-flag-pair {
    background: linear-gradient(90deg, #eef2f7 50%, #f5ecec 50%);
    padding: 8px 16px;
}

.res-flag-pair .res-flag-emoji + .res-flag-emoji {
    margin-left: 2px;
}

/* ── Back to Top ─────────────────────────────────────────────────────── */
.res-back-to-top {
    text-align: right;
    margin: 12px 0 0;
}

.res-back-to-top a {
    color: #2C5F8A;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.res-back-to-top a:hover { text-decoration: underline; }

.res-back-to-top a:focus-visible {
    outline: 2px solid #2C5F8A;
    outline-offset: 2px;
    border-radius: 2px;
}

/* ── Mobile — stack the row when horizontal space runs out ──────────── */
@media (max-width: 720px) {
    .res-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 16px 18px;
    }

    .res-card-header {
        flex: 1 1 100%;
        width: 100%;
    }

    .res-card-contact {
        margin-left: 0;
        width: 100%;
        justify-content: flex-start;
    }

    .res-card-link {
        max-width: 100%;
    }

    .res-card-desc {
        -webkit-line-clamp: 2;
    }
}

@media (max-width: 600px) {
    .res-header { padding-top: 32px; }
    .res-country-tab { padding: 10px 16px; font-size: 14px; }
    .res-country-tab span[aria-hidden="true"] { font-size: 20px; }
    .res-category-title { font-size: 20px; }
    .res-flag-emoji { font-size: 22px; }
}

/* ── Print ───────────────────────────────────────────────────────────── */
@media print {
    .res-sidebar,
    .res-country-tabs,
    .res-back-to-top,
    .res-sidebar-cta { display: none; }
    .res-layout { grid-template-columns: 1fr; }
    .res-listings { box-shadow: none; }
    .res-card { break-inside: avoid; border-bottom: 1px solid #ccc; }
}
