/*
 * Homepage redesign — scoped entirely under .hp so nothing here can leak
 * into archive/tag/category/post pages, which still use the original
 * style.css classes. Colors are driven by CSS variables set inline from
 * the admin-configured theme_color_1 / theme_color_2 settings, so the
 * redesign always matches whatever brand color the admin panel has set.
 */

.hp {
    --hp-ink: #10182b;
    --hp-muted: #5b6472;
    --hp-bg: #f6f8fb;
    --hp-surface: #ffffff;
    --hp-border: #e7eaf0;
    --hp-radius-lg: 24px;
    --hp-radius-md: 16px;
    --hp-radius-sm: 10px;
    --hp-shadow-sm: 0 2px 10px rgba(16, 24, 43, 0.06);
    --hp-shadow-md: 0 12px 30px rgba(16, 24, 43, 0.10);
    --hp-shadow-lg: 0 24px 60px rgba(16, 24, 43, 0.16);
    --hp-gradient: linear-gradient(135deg, var(--hp-primary, #5374d3) 0%, var(--hp-secondary, #1dc175) 100%);
    background: var(--hp-bg);
    color: var(--hp-ink);
    font-family: 'Maven Pro', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    overflow-x: hidden;
}

.hp * { box-sizing: border-box; }

.hp h1, .hp h2, .hp h3 {
    font-family: 'Maven Pro', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-weight: 700;
    color: var(--hp-ink);
    letter-spacing: -0.01em;
}

.hp .hp-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--hp-primary, #5374d3);
    background: #eef1fb;
    background: color-mix(in srgb, var(--hp-primary, #5374d3) 10%, white);
    padding: 6px 14px;
    border-radius: 999px;
    margin-bottom: 14px;
}

.hp .hp-section {
    padding: 64px 0;
}

.hp .hp-section-tight { padding: 40px 0; }

.hp .hp-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 32px;
}

.hp .hp-section-head h2 {
    font-size: 1.9rem;
    margin: 0 0 8px;
}

.hp .hp-section-head p {
    color: var(--hp-muted);
    margin: 0;
    max-width: 560px;
}

.hp .hp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 13px 26px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: transform .25s ease, box-shadow .25s ease, background .25s ease, color .25s ease;
    white-space: nowrap;
}

.hp .hp-btn-primary {
    background: var(--hp-gradient);
    color: #fff;
    box-shadow: 0 10px 24px rgba(83, 116, 211, 0.35);
    box-shadow: 0 10px 24px color-mix(in srgb, var(--hp-primary, #5374d3) 45%, transparent);
}
.hp .hp-btn-primary:hover { transform: translateY(-2px); color: #fff; box-shadow: 0 16px 32px rgba(83, 116, 211, 0.45); box-shadow: 0 16px 32px color-mix(in srgb, var(--hp-primary, #5374d3) 55%, transparent); }

.hp .hp-btn-ghost {
    background: rgba(255,255,255,0.14);
    color: #fff;
    border: 1.5px solid rgba(255,255,255,0.55);
    backdrop-filter: blur(6px);
}
.hp .hp-btn-ghost:hover { background: rgba(255,255,255,0.26); color: #fff; transform: translateY(-2px); }

.hp .hp-btn-outline {
    background: transparent;
    color: var(--hp-primary, #5374d3);
    border: 1.5px solid var(--hp-border);
}
.hp .hp-btn-outline:hover { border-color: var(--hp-primary, #5374d3); background: #f2f4fc; background: color-mix(in srgb, var(--hp-primary, #5374d3) 8%, white); color: var(--hp-primary, #5374d3); transform: translateY(-2px); }

.hp .hp-btn-sm { padding: 9px 18px; font-size: 0.85rem; }

/* ---------- Ticker ---------- */
.hp-ticker-wrap {
    background: var(--hp-surface);
    border-bottom: 1px solid var(--hp-border);
}
.hp-ticker {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 0;
}
.hp-ticker .hp-ticker-label {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--hp-gradient);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 6px 14px;
    border-radius: 999px;
}
.hp-ticker .my-news-ticker {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
    min-width: 0;
    font-size: 0.92rem;
}
.hp-ticker .my-news-ticker li a {
    color: var(--hp-ink);
    text-decoration: none;
    font-weight: 500;
}
.hp-ticker .my-news-ticker li a:hover { color: var(--hp-primary, #5374d3); }

/* ---------- Hero ---------- */
.hp-hero {
    position: relative;
    padding: 28px 0 96px;
}

.hp-hero-frame {
    position: relative;
    border-radius: var(--hp-radius-lg);
    overflow: hidden;
    box-shadow: var(--hp-shadow-lg);
    isolation: isolate;
}

.hp-hero-frame .carousel-item img {
    width: 100%;
    height: clamp(340px, 52vw, 560px);
    object-fit: cover;
    display: block;
}

.hp-hero-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(9,14,28,0.15) 0%, rgba(9,14,28,0.55) 72%, rgba(9,14,28,0.78) 100%);
    z-index: 2;
    pointer-events: none;
}

.hp-hero-content {
    position: absolute;
    z-index: 3;
    left: 0;
    right: 0;
    bottom: 0;
    padding: clamp(24px, 5vw, 64px);
    color: #fff;
}

.hp-hero-content .hp-eyebrow {
    background: rgba(255,255,255,0.16);
    color: #fff;
    backdrop-filter: blur(6px);
}

.hp-hero-content h1 {
    color: #fff;
    font-size: clamp(1.7rem, 4vw, 3rem);
    line-height: 1.15;
    max-width: 820px;
    margin: 0 0 14px;
    text-shadow: 0 2px 18px rgba(0,0,0,0.25);
}

.hp-hero-content .hp-hero-sub {
    color: rgba(255,255,255,0.88);
    font-size: clamp(0.95rem, 1.4vw, 1.1rem);
    max-width: 620px;
    margin: 0 0 26px;
}

.hp-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.hp-hero-frame .carousel-control-prev,
.hp-hero-frame .carousel-control-next {
    width: 48px;
    z-index: 4;
}
.hp-hero-frame .carousel-control-prev-icon,
.hp-hero-frame .carousel-control-next-icon {
    background-color: rgba(255,255,255,0.18);
    border-radius: 50%;
    padding: 20px;
    backdrop-filter: blur(4px);
}

/* Floating search card, overlapping hero bottom edge */
.hp-search-card {
    position: relative;
    z-index: 5;
    margin: -56px auto 0;
    max-width: 1040px;
    background: var(--hp-surface);
    border-radius: var(--hp-radius-md);
    box-shadow: var(--hp-shadow-lg);
    padding: 22px 24px;
    border: 1px solid var(--hp-border);
}

.hp-search-card form .row { --bs-gutter-x: 0.75rem; align-items: stretch; }
.hp-search-card .form-control,
.hp-search-card .form-select {
    height: 48px;
    border-radius: var(--hp-radius-sm);
    border: 1.5px solid var(--hp-border);
    font-size: 0.92rem;
}
.hp-search-card .form-control:focus,
.hp-search-card .form-select:focus {
    border-color: var(--hp-primary, #5374d3);
    box-shadow: 0 0 0 4px rgba(83, 116, 211, 0.14);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--hp-primary, #5374d3) 14%, transparent);
}
.hp-search-card .hp-search-submit {
    width: 100%;
    height: 48px;
    border-radius: var(--hp-radius-sm);
}

@media (max-width: 767px) {
    .hp-hero { padding-bottom: 140px; }
    .hp-search-card { margin-top: -110px; }
    .hp-search-card .col-md-3 { margin-bottom: 10px; }
}

/* ---------- Stats / trust strip ---------- */
.hp-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}
.hp-stat-card {
    background: var(--hp-surface);
    border: 1px solid var(--hp-border);
    border-radius: var(--hp-radius-md);
    padding: 26px 22px;
    text-align: left;
    box-shadow: var(--hp-shadow-sm);
    transition: transform .25s ease, box-shadow .25s ease;
}
.hp-stat-card:hover { transform: translateY(-4px); box-shadow: var(--hp-shadow-md); }
.hp-stat-icon {
    width: 48px; height: 48px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    background: var(--hp-gradient);
    color: #fff;
    font-size: 1.15rem;
    margin-bottom: 16px;
}
.hp-stat-card .hp-stat-num {
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 6px;
}
.hp-stat-card .hp-stat-label {
    color: var(--hp-muted);
    font-size: 0.9rem;
}

@media (max-width: 991px) {
    .hp-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 575px) {
    .hp-stats { grid-template-columns: 1fr; }
}

/* ---------- Browse by subject chips ---------- */
.hp-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.hp-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 999px;
    background: var(--hp-surface);
    border: 1.5px solid var(--hp-border);
    color: var(--hp-ink);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    transition: all .2s ease;
}
.hp-chip:hover {
    border-color: transparent;
    background: var(--hp-gradient);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: var(--hp-shadow-sm);
}

/* ---------- Featured grid (bento) ---------- */
.hp-featured-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 20px;
}
.hp-featured-grid .hp-featured-side {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.hp-card {
    position: relative;
    display: block;
    border-radius: var(--hp-radius-md);
    overflow: hidden;
    background: var(--hp-surface);
    box-shadow: var(--hp-shadow-sm);
    text-decoration: none;
    color: inherit;
    transition: transform .3s ease, box-shadow .3s ease;
    height: 100%;
}
.hp-card:hover {
    transform: translateY(-6px) perspective(800px) rotateX(1deg);
    box-shadow: var(--hp-shadow-lg);
    color: inherit;
}

.hp-card-media {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: var(--hp-border);
}
.hp-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}
.hp-card:hover .hp-card-media img { transform: scale(1.06); }

.hp-featured-grid > a.hp-card .hp-card-media { aspect-ratio: 16 / 11; }

.hp-card-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    background: rgba(255,255,255,0.92);
    color: var(--hp-primary, #5374d3);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 5px 12px;
    border-radius: 999px;
    z-index: 2;
}

.hp-card-body { padding: 18px 20px 20px; }
.hp-card-body h2, .hp-card-body h3 {
    font-size: 1.08rem;
    line-height: 1.4;
    margin: 0 0 10px;
}
.hp-featured-grid > a.hp-card .hp-card-body h3 { font-size: 1.35rem; }
.hp-card-meta {
    color: var(--hp-muted);
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

@media (max-width: 767px) {
    .hp-featured-grid { grid-template-columns: 1fr; }
}

/* ---------- Ad slots ---------- */
.hp-ad-slot {
    text-align: center;
}
.hp-ad-slot .hp-ad-tag {
    display: block;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--hp-muted);
    margin-bottom: 8px;
}
.hp-ad-slot img {
    max-width: 100%;
    height: auto;
    border-radius: var(--hp-radius-sm);
}

/* ---------- Content section (category groups + sidebar) ---------- */
.hp-content-section { background: var(--hp-surface); }

.hp-category-block {
    background: var(--hp-bg);
    border: 1px solid var(--hp-border);
    border-radius: var(--hp-radius-md);
    padding: 24px;
    margin-bottom: 22px;
}
.hp-category-block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}
.hp-category-block-head h2 {
    font-size: 1.25rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.hp-category-block-head h2::before {
    content: "";
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--hp-gradient);
    flex: none;
}

.hp-side-list { display: flex; flex-direction: column; gap: 14px; }
.hp-side-item {
    display: flex;
    gap: 14px;
    text-decoration: none;
    color: inherit;
    background: var(--hp-surface);
    border: 1px solid var(--hp-border);
    border-radius: var(--hp-radius-sm);
    padding: 10px;
    transition: transform .2s ease, box-shadow .2s ease;
}
.hp-side-item:hover { transform: translateX(4px); box-shadow: var(--hp-shadow-sm); color: inherit; }
.hp-side-item .hp-side-thumb {
    flex: none;
    width: 84px; height: 64px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--hp-border);
}
.hp-side-item .hp-side-thumb img { width: 100%; height: 100%; object-fit: cover; }
.hp-side-item .hp-side-body h2, .hp-side-item .hp-side-body h3 { font-size: 0.94rem; margin: 0 0 4px; line-height: 1.35; }
.hp-side-item .hp-side-body { min-width: 0; }

.hp-sidebar-wrap {
    background: var(--hp-bg);
    border-radius: var(--hp-radius-md);
    padding: 4px;
}

/* ---------- Videos ---------- */
.hp-video-item {
    background: var(--hp-surface);
    border-radius: var(--hp-radius-md);
    overflow: hidden;
    box-shadow: var(--hp-shadow-sm);
    border: 1px solid var(--hp-border);
}
.hp-video-thumb-wrap {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #000;
}
.hp-video-thumb-wrap img { width: 100%; height: 100%; object-fit: cover; opacity: 0.85; }
.hp-video-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hp-video-play .hp-play-btn {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: rgba(255,255,255,0.92);
    color: var(--hp-primary, #5374d3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    transition: transform .25s ease;
}
.hp-video-item:hover .hp-play-btn { transform: scale(1.12); }
.hp-video-body { padding: 14px 16px; }
.hp-video-body a { color: var(--hp-ink); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.hp-video-date { color: var(--hp-muted); font-size: 0.8rem; margin-top: 6px; }

/* ---------- Final CTA ---------- */
.hp-cta {
    position: relative;
    border-radius: var(--hp-radius-lg);
    overflow: hidden;
    background: var(--hp-gradient);
    padding: clamp(36px, 6vw, 64px);
    color: #fff;
    text-align: center;
    isolation: isolate;
}
.hp-cta::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(60% 90% at 15% 20%, rgba(255,255,255,0.22), transparent 60%),
                radial-gradient(50% 80% at 90% 100%, rgba(255,255,255,0.16), transparent 60%);
    z-index: -1;
}
.hp-cta h2 { color: #fff; font-size: clamp(1.5rem, 3vw, 2.2rem); margin: 0 0 12px; }
.hp-cta p { color: rgba(255,255,255,0.88); max-width: 560px; margin: 0 auto 26px; }
.hp-cta .hp-hero-actions { justify-content: center; }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .hp .wow,
    .hp *[class*="wow"] {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
        visibility: visible !important;
    }
    .hp .hp-card:hover,
    .hp .hp-stat-card:hover,
    .hp .hp-side-item:hover,
    .hp .hp-btn:hover {
        transform: none !important;
    }
}

@media (max-width: 991px) {
    .hp .hp-section { padding: 44px 0; }
    .hp .hp-section-head { flex-direction: column; align-items: flex-start; }
}
