/* ═══════════════════════════════════════════════
   FCE Regulatory News Hub — Styles
   Matches fincrime.expert brand: navy #0B1D3A, gold #D4A843
   MOBILE-FIRST responsive design
   ═══════════════════════════════════════════════ */

/* ── RESET & VARIABLES ── */
.fce-rh-wrap {
    --fce-navy: #0B1D3A;
    --fce-navy-light: #132D52;
    --fce-gold: #D4A843;
    --fce-gold-light: #F2DCA0;
    --fce-surface: #F7F5F0;
    --fce-card: #FFFFFF;
    --fce-text: #1A1A2E;
    --fce-text-secondary: #5A6178;
    --fce-text-muted: #8B90A0;
    --fce-border: #E2DFD8;
    --fce-radius: 10px;
    --fce-radius-lg: 16px;
    --fce-shadow-sm: 0 1px 3px rgba(11,29,58,0.06);
    --fce-shadow-md: 0 4px 16px rgba(11,29,58,0.08);
    --fce-shadow-lg: 0 8px 32px rgba(11,29,58,0.12);
    --fce-tap-min: 44px; /* minimum touch target */

    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--fce-text);
    line-height: 1.6;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
}

@media (min-width: 768px) {
    .fce-rh-wrap {
        padding: 0 24px;
    }
}

@media (min-width: 1024px) {
    .fce-rh-wrap {
        padding: 0;
    }
}

.fce-rh-wrap *,
.fce-rh-wrap *::before,
.fce-rh-wrap *::after {
    box-sizing: border-box;
}

/* Prevent horizontal overflow on mobile */
.fce-rh-wrap img,
.fce-rh-wrap svg,
.fce-rh-wrap video {
    max-width: 100%;
    height: auto;
}

/* ── HERO (mobile-first) ── */
.fce-rh-hero {
    background: linear-gradient(135deg, var(--fce-navy) 0%, var(--fce-navy-light) 100%);
    border-radius: var(--fce-radius);
    padding: 28px 20px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

@media (min-width: 768px) {
    .fce-rh-hero {
        border-radius: var(--fce-radius-lg);
        padding: 40px 32px;
        margin-bottom: 28px;
    }
}

@media (min-width: 1024px) {
    .fce-rh-hero {
        padding: 48px 40px;
    }
}

.fce-rh-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(212,168,67,0.12) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.fce-rh-hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(212,168,67,0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.fce-rh-hero-inner {
    position: relative;
    z-index: 1;
}

.fce-rh-hero-label {
    display: inline-block;
    background: rgba(212,168,67,0.15);
    color: var(--fce-gold);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 5px 12px;
    border-radius: 20px;
    margin-bottom: 12px;
    border: 1px solid rgba(212,168,67,0.25);
}

@media (min-width: 768px) {
    .fce-rh-hero-label {
        font-size: 12px;
        padding: 6px 14px;
        margin-bottom: 16px;
    }
}

.fce-rh-hero-title {
    color: #FFFFFF;
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 10px 0;
    line-height: 1.2;
}

@media (min-width: 768px) {
    .fce-rh-hero-title {
        font-size: 28px;
    }
}

@media (min-width: 1024px) {
    .fce-rh-hero-title {
        font-size: 32px;
        margin-bottom: 12px;
    }
}

.fce-rh-hero-subtitle {
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    margin: 0;
    max-width: 600px;
    line-height: 1.6;
}

@media (min-width: 768px) {
    .fce-rh-hero-subtitle {
        font-size: 15px;
    }
}

/* ── CONTROLS (mobile-first) ── */
.fce-rh-controls {
    margin-bottom: 16px;
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--fce-surface);
    padding: 12px 0;
    margin-left: -16px;
    margin-right: -16px;
    padding-left: 16px;
    padding-right: 16px;
}

@media (min-width: 768px) {
    .fce-rh-controls {
        position: relative;
        top: auto;
        margin-left: 0;
        margin-right: 0;
        padding-left: 0;
        padding-right: 0;
        background: transparent;
        margin-bottom: 20px;
    }
}

.fce-rh-search-wrap {
    position: relative;
    margin-bottom: 12px;
}

.fce-rh-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--fce-text-muted);
    pointer-events: none;
}

.fce-rh-search {
    width: 100%;
    padding: 12px 16px 12px 42px;
    border: 2px solid var(--fce-border);
    border-radius: var(--fce-radius);
    font-size: 16px; /* 16px prevents iOS auto-zoom */
    background: var(--fce-card);
    color: var(--fce-text);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    min-height: var(--fce-tap-min);
    -webkit-appearance: none;
    appearance: none;
}

@media (min-width: 768px) {
    .fce-rh-search {
        padding: 14px 18px 14px 46px;
    }
}

.fce-rh-search:focus {
    border-color: var(--fce-gold);
    box-shadow: 0 0 0 3px rgba(212,168,67,0.15);
}

.fce-rh-search::placeholder {
    color: var(--fce-text-muted);
}

/* ── FILTERS (mobile: horizontal scroll, desktop: wrap) ── */
.fce-rh-filters {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.fce-rh-filters::-webkit-scrollbar {
    display: none;
}

@media (min-width: 768px) {
    .fce-rh-filters {
        flex-wrap: wrap;
        overflow-x: visible;
        padding-bottom: 0;
    }
}

.fce-rh-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    border: 2px solid var(--fce-border);
    border-radius: 50px;
    background: var(--fce-card);
    color: var(--fce-text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    font-family: inherit;
    min-height: var(--fce-tap-min);
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

@media (min-width: 768px) {
    .fce-rh-filter-btn {
        font-size: 13px;
        padding: 8px 16px;
    }
}

.fce-rh-filter-btn:hover {
    border-color: var(--src-color, var(--fce-navy));
    color: var(--src-color, var(--fce-navy));
    background: rgba(11,29,58,0.03);
}

.fce-rh-filter-btn.active {
    background: var(--fce-navy);
    color: #FFFFFF;
    border-color: var(--fce-navy);
}

.fce-rh-filter-btn.active[data-source]:not([data-source="all"]) {
    background: var(--src-color, var(--fce-navy));
    border-color: var(--src-color, var(--fce-navy));
}

.fce-rh-filter-icon {
    font-size: 15px;
    line-height: 1;
}

/* ── STATUS BAR ── */
.fce-rh-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    font-size: 13px;
    color: var(--fce-text-muted);
    border-bottom: 1px solid var(--fce-border);
    margin-bottom: 20px;
}

.fce-rh-spinner svg {
    animation: fce-spin 1s linear infinite;
}

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

/* ── FEED GRID (mobile-first: single column) ── */
.fce-rh-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

@media (min-width: 640px) {
    .fce-rh-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

@media (min-width: 1024px) {
    .fce-rh-grid {
        grid-template-columns: repeat(3, 1fr);
        margin-bottom: 28px;
    }
}

/* ── FEED CARD (mobile-first, touch-friendly) ── */
.fce-rh-card {
    background: var(--fce-card);
    border: 1px solid var(--fce-border);
    border-radius: var(--fce-radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-height: 140px;
}

@media (min-width: 768px) {
    .fce-rh-card {
        padding: 20px;
        gap: 12px;
    }
}

.fce-rh-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--card-color, var(--fce-navy));
    border-radius: 4px 0 0 4px;
}

.fce-rh-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--fce-shadow-md);
    border-color: var(--card-color, var(--fce-navy));
    text-decoration: none;
    color: inherit;
}

.fce-rh-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.fce-rh-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #FFFFFF;
    background: var(--card-color, var(--fce-navy));
    white-space: nowrap;
    flex-shrink: 0;
}

.fce-rh-card-date {
    font-size: 12px;
    color: var(--fce-text-muted);
    white-space: nowrap;
}

.fce-rh-card-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--fce-text);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

@media (min-width: 768px) {
    .fce-rh-card-title {
        font-size: 15px;
    }
}

.fce-rh-card-desc {
    font-size: 13px;
    color: var(--fce-text-secondary);
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    display: none; /* hide on mobile to save space */
}

@media (min-width: 640px) {
    .fce-rh-card-desc {
        display: -webkit-box;
    }
}

.fce-rh-card-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--card-color, var(--fce-navy));
}

.fce-rh-card-footer svg {
    width: 14px;
    height: 14px;
    transition: transform 0.2s;
}

.fce-rh-card:hover .fce-rh-card-footer svg {
    transform: translateX(3px);
}

/* ── PAGINATION (mobile-friendly touch targets) ── */
.fce-rh-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-bottom: 32px;
    flex-wrap: wrap;
    padding: 0 4px;
}

@media (min-width: 768px) {
    .fce-rh-pagination {
        gap: 6px;
        margin-bottom: 40px;
    }
}

.fce-rh-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--fce-tap-min);
    height: var(--fce-tap-min);
    padding: 0 10px;
    border: 2px solid var(--fce-border);
    border-radius: 8px;
    background: var(--fce-card);
    color: var(--fce-text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

@media (min-width: 768px) {
    .fce-rh-page-btn {
        padding: 0 12px;
    }
}

.fce-rh-page-btn:hover {
    border-color: var(--fce-navy);
    color: var(--fce-navy);
}

.fce-rh-page-btn.active {
    background: var(--fce-navy);
    color: #FFFFFF;
    border-color: var(--fce-navy);
}

.fce-rh-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ── EMPTY STATE ── */
.fce-rh-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--fce-text-muted);
}

.fce-rh-empty svg {
    margin-bottom: 16px;
}

.fce-rh-empty p {
    font-size: 15px;
    margin: 0;
}

/* (directory styles moved to mobile-first section below) */

.fce-rh-directory-desc {
    font-size: 14px;
    color: var(--fce-text-muted);
    margin: 0 0 24px;
}

.fce-rh-directory-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

@media (min-width: 480px) {
    .fce-rh-directory-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

@media (min-width: 1024px) {
    .fce-rh-directory-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.fce-rh-source-card {
    background: var(--fce-surface);
    border: 1px solid var(--fce-border);
    border-radius: var(--fce-radius);
    padding: 16px;
    border-left: 4px solid var(--src-color, var(--fce-navy));
    transition: transform 0.2s, box-shadow 0.2s;
}

.fce-rh-source-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--fce-shadow-sm);
}

.fce-rh-source-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.fce-rh-source-icon {
    font-size: 22px;
    line-height: 1;
}

.fce-rh-source-header strong {
    font-size: 15px;
    color: var(--fce-text);
    display: block;
}

.fce-rh-source-region {
    font-size: 11px;
    color: var(--fce-text-muted);
    font-weight: 500;
}

.fce-rh-source-full {
    font-size: 12px;
    color: var(--fce-text-secondary);
    margin: 0;
    line-height: 1.4;
}

/* (disclaimer styles moved to mobile-first section below) */

/* ── SKELETON LOADING ── */
.fce-rh-skeleton {
    background: linear-gradient(90deg, #f0ede8 25%, #e8e4dd 50%, #f0ede8 75%);
    background-size: 200% 100%;
    animation: fce-shimmer 1.5s ease-in-out infinite;
    border-radius: var(--fce-radius);
    border: 1px solid var(--fce-border);
}

.fce-rh-skeleton-card {
    height: 200px;
}

@keyframes fce-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* (mobile styles are now built-in above via mobile-first approach) */

/* ── DIRECTORY (mobile-first) ── */
.fce-rh-directory {
    background: var(--fce-card);
    border: 1px solid var(--fce-border);
    border-radius: var(--fce-radius);
    padding: 20px 16px;
    margin-bottom: 20px;
}

@media (min-width: 768px) {
    .fce-rh-directory {
        border-radius: var(--fce-radius-lg);
        padding: 32px;
        margin-bottom: 24px;
    }
}

.fce-rh-directory-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--fce-text);
}

@media (min-width: 768px) {
    .fce-rh-directory-title {
        font-size: 20px;
    }
}

/* ── DISCLAIMER (mobile) ── */
.fce-rh-disclaimer {
    background: var(--fce-surface);
    border: 1px solid var(--fce-border);
    border-radius: var(--fce-radius);
    padding: 16px;
    margin-bottom: 20px;
}

@media (min-width: 768px) {
    .fce-rh-disclaimer {
        padding: 20px 24px;
    }
}

.fce-rh-disclaimer p {
    font-size: 11px;
    color: var(--fce-text-muted);
    margin: 0;
    line-height: 1.6;
}

@media (min-width: 768px) {
    .fce-rh-disclaimer p {
        font-size: 12px;
    }
}

.fce-rh-disclaimer strong {
    color: var(--fce-text-secondary);
}

/* ── SAFE AREA (notched phones) ── */
@supports (padding: env(safe-area-inset-bottom)) {
    .fce-rh-wrap {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }

    @media (min-width: 1024px) {
        .fce-rh-wrap {
            padding-left: 0;
            padding-right: 0;
        }
    }
}

/* ── REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
    .fce-rh-card,
    .fce-rh-skeleton {
        animation: none !important;
        transition: none !important;
    }

    .fce-rh-spinner svg {
        animation-duration: 3s;
    }
}

/* ── ANIMATIONS ── */
.fce-rh-card {
    animation: fce-fadeUp 0.3s ease both;
}

.fce-rh-card:nth-child(1) { animation-delay: 0.02s; }
.fce-rh-card:nth-child(2) { animation-delay: 0.04s; }
.fce-rh-card:nth-child(3) { animation-delay: 0.06s; }
.fce-rh-card:nth-child(4) { animation-delay: 0.08s; }
.fce-rh-card:nth-child(5) { animation-delay: 0.10s; }
.fce-rh-card:nth-child(6) { animation-delay: 0.12s; }
.fce-rh-card:nth-child(7) { animation-delay: 0.14s; }
.fce-rh-card:nth-child(8) { animation-delay: 0.16s; }
.fce-rh-card:nth-child(9) { animation-delay: 0.18s; }
.fce-rh-card:nth-child(10) { animation-delay: 0.20s; }
.fce-rh-card:nth-child(11) { animation-delay: 0.22s; }
.fce-rh-card:nth-child(12) { animation-delay: 0.24s; }

@keyframes fce-fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── LANDSCAPE PHONE ── */
@media (max-width: 767px) and (orientation: landscape) {
    .fce-rh-hero {
        padding: 20px;
    }
    .fce-rh-hero-title {
        font-size: 20px;
    }
    .fce-rh-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ── PRINT ── */
@media print {
    .fce-rh-controls,
    .fce-rh-pagination,
    .fce-rh-spinner {
        display: none !important;
    }
    .fce-rh-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
