/**
 * Hero Cards CSS - Overlapping cards below hero section
 * Path: public_html/css/hero-cards.css
 * Version: 2.5.0
 *
 * 4-column grid: 3 featured tool cards (editorial style) + 1 news widget.
 * Cards overlap the dark hero into the light main background
 * via negative top margin. Used ONLY on the homepage.
 */

/* ====================================================================
   CONTAINER - Overlap positioning
   ==================================================================== */
.hero-cards-container {
    max-width: 1100px;
    margin: -80px auto 0;
    padding: 0 20px;
    position: relative;
    z-index: 2;
}

/* Subtle gradient divider below cards */
.hero-cards-container::after {
    content: '';
    display: block;
    height: 1px;
    margin: 32px auto 0;
    max-width: 90%;
    background: linear-gradient(to right, transparent, #d1d5db, transparent);
}

[data-theme="dark"] .hero-cards-container::after {
    background: linear-gradient(to right, transparent, #3d3d3d, transparent);
}

/* ====================================================================
   GRID - 4-column layout
   ==================================================================== */
.hero-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    align-items: stretch;
}

/* ====================================================================
   FEATURED TOOL CARDS - Editorial white cards with accent line
   ==================================================================== */
.hero-featured-card {
    display: flex;
    flex-direction: column;
    padding: 0;
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: #1a1a1a;
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

/* Inner content wrapper */
.hero-card-inner {
    padding: 20px 20px 0;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Header: logo left, badge right */
.hero-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

/* Logo: tinted background matching accent color */
.hero-card-logo {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.hero-card-logo img {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

/* Badge: subtle tinted pill */
.hero-card-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    white-space: nowrap;
    line-height: 1.4;
}

/* Badge color variants — vibrant + WCAG AA verified on tinted bg */
.hero-card-badge-0 { background: rgba(59, 130, 246, 0.15);  color: #1d4ed8; }
.hero-card-badge-1 { background: rgba(124, 58, 237, 0.15);  color: #6d28d9; }
.hero-card-badge-2 { background: rgba(5, 150, 105, 0.15);   color: #046c4e; }

/* Card body - flex-grow pushes footer to bottom for equal height cards */
.hero-card-body {
    margin-bottom: 14px;
    flex: 1;
}

.hero-card-body .hero-card-title {
    display: block;
    font-size: 24px;
    font-weight: 500;
    margin: 0 0 10px;
    color: #1a1a1a;
    line-height: 1.25;
    font-family: Georgia, 'Times New Roman', serif;
}

.hero-card-body p {
    font-size: 14px;
    margin: 0;
    color: #4b5563;
    line-height: 1.6;
}

/* Card footer with category tags */
.hero-card-footer {
    border-top: 1px solid #f0f0f0;
    padding: 12px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.hero-card-tag {
    font-size: 12px;
    background: #f7f7f7;
    color: #4b5563;
    border-radius: 6px;
    padding: 4px 10px;
    line-height: 1.3;
}

/* ====================================================================
   NEWS WIDGET CARD - White background
   ==================================================================== */
.hero-news-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    padding: 16px;
    display: flex;
    flex-direction: column;
}

.hero-news-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.3;
}

.hero-news-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.hero-news-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    text-decoration: none;
}

.hero-news-time {
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
    min-width: 48px;
    flex-shrink: 0;
    padding-top: 1px;
}

.hero-news-headline {
    font-size: 0.85rem;
    color: #334155;
    line-height: 1.4;
}

/* ====================================================================
   HOVER - News items only (tool cards are static)
   ==================================================================== */
@media (hover: hover) {
    .hero-news-item:hover .hero-news-headline {
        color: #2563eb;
    }
}

/* ====================================================================
   FOCUS STATES - Keyboard navigation
   ==================================================================== */
.hero-featured-card:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.hero-news-item:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ====================================================================
   DARK MODE
   ==================================================================== */
[data-theme="dark"] .hero-featured-card {
    background: #252525;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .hero-card-body .hero-card-title {
    color: #e4e4e4;
}

[data-theme="dark"] .hero-card-body p {
    color: #aaaaaa;
}

[data-theme="dark"] .hero-card-footer {
    border-top-color: #3d3d3d;
}

[data-theme="dark"] .hero-card-tag {
    background: #333333;
    color: #aaaaaa;
}

/* Badge dark mode — lighter text on dark tinted backgrounds */
[data-theme="dark"] .hero-card-badge-0 { background: rgba(59, 130, 246, 0.2);  color: #93c5fd; }
[data-theme="dark"] .hero-card-badge-1 { background: rgba(124, 58, 237, 0.2);  color: #c4b5fd; }
[data-theme="dark"] .hero-card-badge-2 { background: rgba(5, 150, 105, 0.2);   color: #6ee7b7; }

[data-theme="dark"] .hero-news-card {
    background: #252525;
    border-color: #3d3d3d;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .hero-news-title {
    color: #e4e4e4;
}

[data-theme="dark"] .hero-news-headline {
    color: #b0b0b0;
}

[data-theme="dark"] .hero-news-time {
    color: #9ca3af;
}

@media (hover: hover) {
    [data-theme="dark"] .hero-news-item:hover .hero-news-headline {
        color: #6db3f2;
    }
}

[data-theme="dark"] .hero-news-item:focus {
    outline-color: #6db3f2;
}

/* ====================================================================
   RESPONSIVE - Tablet (2 columns)
   ==================================================================== */
@media (max-width: 768px) {
    .hero-cards-container {
        margin-top: -100px;
        padding: 0 16px;
    }

    .hero-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .hero-card-inner {
        padding: 16px 16px 0;
    }

    .hero-card-logo {
        width: 42px;
        height: 42px;
        border-radius: 10px;
    }

    .hero-card-logo img {
        width: 30px;
        height: 30px;
    }

    .hero-card-body .hero-card-title {
        font-size: 20px;
    }

    .hero-card-body p {
        font-size: 13px;
    }

    .hero-card-footer {
        padding: 10px 16px;
    }

    .hero-news-card {
        padding: 14px;
    }
}

/* ====================================================================
   RESPONSIVE - Mobile (1 column)
   ==================================================================== */
@media (max-width: 480px) {
    .hero-cards-container {
        margin-top: -80px;
        padding: 0 12px;
    }

    .hero-cards-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .hero-card-inner {
        padding: 14px 14px 0;
    }

    .hero-card-header {
        margin-bottom: 10px;
    }

    .hero-card-body .hero-card-title {
        font-size: 20px;
    }

    .hero-card-footer {
        padding: 10px 14px;
    }

    .hero-news-card {
        padding: 14px;
    }

    .hero-news-list {
        gap: 10px;
    }
}

/* ====================================================================
   HIGH CONTRAST
   ==================================================================== */
@media (prefers-contrast: high) {
    .hero-featured-card {
        border: 2px solid #000000;
    }

    .hero-card-body p {
        color: #333333;
    }

    .hero-news-card {
        border: 2px solid #000000;
    }

    .hero-news-headline {
        color: #000000;
    }

    [data-theme="dark"] .hero-featured-card {
        border-color: #ffffff;
    }

    [data-theme="dark"] .hero-card-body p {
        color: #cccccc;
    }

    [data-theme="dark"] .hero-news-card {
        border-color: #ffffff;
    }

    [data-theme="dark"] .hero-news-headline {
        color: #ffffff;
    }
}
