/* ==========================================
   SUMAWATCH THEME - home.css
   Homepage-specific styles
   ========================================== */

/* ==========================================
   Main Visual (Homepage Banner)
   ========================================== */
.p-mainVisual--home {
    background: linear-gradient(135deg,
        var(--primary-dark, #d06510) 0%,
        var(--primary, #e87722)      60%,
        color-mix(in srgb, var(--primary) 70%, #fff) 100%);
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

/* Subtle geometric accent */
.p-mainVisual--home::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 80% at 80% 50%, rgba(255,255,255,0.08) 0%, transparent 70%),
        radial-gradient(ellipse 40% 60% at 10% 80%, rgba(0,0,0,0.10)        0%, transparent 60%);
    pointer-events: none;
}

/* Post list section title on homepage */
.p-homeSection {
    margin-bottom: 48px;
}

.p-homeSection__title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-light);
    color: var(--text-main);
}

.p-homeSection__title::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 22px;
    background: var(--primary);
    border-radius: 2px;
}

.p-homeSection__more {
    margin-left: auto;
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.p-homeSection__more:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ==========================================
   Latest Posts (-w-new modifier)
   ========================================== */
.p-postList.-w-new .p-postList__item {
    position: relative;
}

.p-postList.-w-new .p-postList__item.-is-new .c-postThumb__title::before {
    content: "NEW";
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    background: var(--primary);
    color: #fff;
    padding: 1px 5px;
    border-radius: 2px;
    margin-right: 6px;
    vertical-align: middle;
    line-height: 1.6;
}

/* ==========================================
   Homepage Sidebar Ranking
   ========================================== */
.c-rankWidget {
    counter-reset: rank-counter;
}

.c-rankWidget__item {
    counter-increment: rank-counter;
}

.c-rankWidget__item a {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-main);
    text-decoration: none;
    transition: background var(--transition-fast);
}

.c-rankWidget__item:last-child a {
    border-bottom: none;
}

.c-rankWidget__item a:hover {
    background: var(--bg-secondary);
}

.c-rankWidget__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--text-light);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 2px;
}

.c-rankWidget__item:nth-child(1) .c-rankWidget__num {
    background: #d4a017;
}

.c-rankWidget__item:nth-child(2) .c-rankWidget__num {
    background: #9e9e9e;
}

.c-rankWidget__item:nth-child(3) .c-rankWidget__num {
    background: #a97b4f;
}

.c-rankWidget__img {
    width: 70px;
    height: 52px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.c-rankWidget__title {
    font-size: 12px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
    min-width: 0;
}

/* ==========================================
   Responsive (Home specific)
   ========================================== */
@media (max-width: 768px) {
    .p-mainVisual--home {
        height: 260px;
    }

    .p-homeSection__title {
        font-size: 17px;
    }
}

/* ==========================================
   Main Visual Mask Overlay (H1 Card)
   ========================================== */

@keyframes maskFadeUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.p-mainVisual__divider {
    width: 48px;
    height: 2px;
    margin: 14px auto 16px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    border-radius: 1px;
    opacity: 0.85;
}

/* Override existing title & desc inside mask */
.p-mainVisual__mask .p-mainVisual__title {
    font-size: clamp(24px, 4.5vw, 38px);
    font-weight: 800;
    color: #ffffff;
    line-height: 1.3;
    letter-spacing: 0.01em;
    margin-bottom: 22px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.22);
}

.p-mainVisual__mask .p-mainVisual__desc {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.7;
    margin: 0;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .p-mainVisual__mask {
        padding: 24px 15px;
        width: 88%;
        border-radius: 12px;
    }

    .p-mainVisual__mask .p-mainVisual__title {
        font-size: 20px;
    }

    .p-mainVisual__mask .p-mainVisual__desc {
        font-size: 13px;
    }
}
