/* ============================================================================
 * Home page (hp-home.php)
 *
 * Layout:
 *   - Pinned strip (horizontally scrollable, gradient tiles)
 *   - Welcome / dashboard summary
 *   - Searchable feature grid (no accordions)
 * ============================================================================ */

/* Loaded only on the home template — no body-class scope needed. */
.page-template-hp-home,
.page-template-hp-home-php {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
                 Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    color: #212529;
    /* Top/bottom inset for fixed chrome is in app-shell.css (#page.site + body:has(.bottom-nav)) */
}

/* ───────────────────────────── Pinned (Quick Actions) ───────────────────── */
.pinned-strip {
    display: flex;
    gap: 12px;
    padding: 12px 16px 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
}

.pinned-card {
    flex: 0 0 auto;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    position: relative;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s;
    scroll-snap-align: start;
}

.pinned-card:active     { transform: scale(0.95); }
.pinned-card i          { font-size: 32px; margin-bottom: 8px; }
.pinned-card span       { font-size: 12px; font-weight: 500; }

.pinned-card .badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #ff4757;
    color: white;
    border-radius: 12px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
}

/* Rotating gradients across the strip */
.pinned-card:nth-child(2) { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.pinned-card:nth-child(3) { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.pinned-card:nth-child(4) { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
.pinned-card:nth-child(5) { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
.pinned-card:nth-child(6) { background: linear-gradient(135deg, #30cfd0 0%, #330867 100%); }

/* ───────────────────────────── Main content wrapper ─────────────────────── */
.home-main { padding: 16px; }

/* ───────────────────────────── Welcome / dashboard ──────────────────────── */
.dashboard-section {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.dashboard-section h2 {
    font-size: 20px;
    margin-bottom: 16px;
    color: #212529;
}

.dashboard-item {
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.dashboard-item:last-child { margin-bottom: 0; }
.dashboard-item:active     { background: #eef0f3; }
.dashboard-item > i        { font-size: 24px; color: #007bff; }

.dashboard-item-content   { flex: 1; }
.dashboard-item-title     { font-weight: 500; margin-bottom: 4px; }
.dashboard-item-subtitle  { font-size: 12px; color: #6c757d; }

/* ───────────────────────────── Searchable feature grid ──────────────────── */
.features {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Same pattern as birthdays-browser .input-icon — theme input padding can override weaker rules. */
.features-search.input-icon {
    position: relative;
    display: block;
    width: 100%;
    margin-bottom: 16px;
}

.features-search.input-icon .features-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 15px;
    line-height: 1;
    width: 1em;
    text-align: center;
    pointer-events: none;
    z-index: 2;
}

#features .features-search-input,
#features-search-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 12px 12px 12px 44px !important;
    min-height: 44px;
    font-size: 16px;
    line-height: 1.35;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    background: #f8f9fa;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.2s, background 0.2s;
}

#features-search-input::-webkit-search-decoration,
#features-search-input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}

#features-search-input:focus {
    border-color: #007bff;
    background: #fff;
}

.features-group { margin-bottom: 18px; }
.features-group:last-child { margin-bottom: 0; }

.features-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.feature-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 16px 12px;
    text-decoration: none;
    color: #212529;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: background 0.2s, transform 0.1s;
    min-height: 96px;
}

.feature-card:active  { background: #e9ecef; transform: scale(0.97); }
.feature-card i       { font-size: 28px; color: #007bff; margin-bottom: 8px; }
.feature-card span    { font-size: 13px; font-weight: 500; line-height: 1.2; }

/* Hidden by search filter */
.features-group.is-hidden,
.feature-card.is-hidden { display: none; }

.features-empty {
    display: none;
    text-align: center;
    padding: 20px;
    color: #6c757d;
    font-size: 14px;
}

.features.is-empty .features-empty   { display: block; }
.features.is-empty .features-group   { display: none; }

/* ───────────────────────────── Tablet / desktop tweaks ──────────────────── */
@media (min-width: 768px) {
    .features-grid       { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
    .pinned-strip        { justify-content: center; }
    .features-grid       { grid-template-columns: repeat(4, 1fr); }
}
