/* =============================================================
   iProphesy Homepage — home.css
   Prefix: .iphome-
   ============================================================= */

/* ── Reset & container ─────────────────────────────────────── */
.iphome {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans TC', sans-serif;
    color: #1a1a2e;
    overflow-x: hidden;
}
.iphome-container {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 32px;
}
.iphome-section-title {
    font-size: 28px;
    font-weight: 800;
    color: #1a1a2e;
    margin: 0 0 32px;
    line-height: 1.3;
}

/* ── HERO ──────────────────────────────────────────────────── */
.iphome-hero {
    background: #0a1628;
    padding: 100px 0 80px;
    min-height: 520px;
    display: flex;
    align-items: center;
}
.iphome-hero-inner {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    align-items: center;
    gap: 40px;
}
.iphome-hero-left {
    flex: 0 0 320px;
    max-width: 320px;
}
/* Badge 兩層 blob 動畫 keyframes */
@keyframes iphome-blob-inner {
    0%,100% { border-radius: 56% 44% 38% 62% / 55% 35% 65% 45%; }
    33%     { border-radius: 40% 60% 55% 45% / 38% 62% 42% 58%; }
    66%     { border-radius: 62% 38% 48% 52% / 60% 40% 55% 45%; }
}
@keyframes iphome-blob-outer {
    0%,100% { border-radius: 68% 32% 48% 52% / 40% 62% 38% 60%; }
    33%     { border-radius: 45% 55% 65% 35% / 58% 42% 55% 45%; }
    66%     { border-radius: 35% 65% 40% 60% / 62% 38% 65% 35%; }
}

.iphome-hero-badge {
    display: inline-block;
    background: linear-gradient(135deg, #ff6eb4 0%, #ff1f87 55%, #c0175e 100%);
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .06em;
    padding: 8px 22px;
    border-radius: 50px;
    border: none;
    margin-bottom: 20px;
    cursor: default;
    position: relative;
    z-index: 1;
    animation: iphome-blob-inner 5s ease-in-out infinite;
    transition: transform .25s ease;
    will-change: border-radius, transform;
}

/* 外層半透明 blob */
.iphome-hero-badge::before {
    content: '';
    position: absolute;
    inset: -14px -20px;
    background: rgba(255, 80, 160, 0.3);
    border-radius: 68% 32% 48% 52% / 40% 62% 38% 60%;
    z-index: -1;
    animation: iphome-blob-outer 4s ease-in-out infinite;
    animation-delay: -2s;
    transition: inset .3s ease, background .3s ease;
    will-change: border-radius;
}

/* 距離較遠 ~380px：稍微加速 */
.iphome-hero-badge.blob-far               { animation-duration: 3.5s; }
.iphome-hero-badge.blob-far::before       { animation-duration: 3s; }

/* 距離中等 ~220px：明顯加速＋微微放大 */
.iphome-hero-badge.blob-near              { animation-duration: 2s; transform: scale(1.05); }
.iphome-hero-badge.blob-near::before     { animation-duration: 1.8s; inset: -18px -25px; background: rgba(255,80,160,.38); }

/* 非常靠近 ~80px：快速抖動＋明顯放大 */
.iphome-hero-badge.blob-close             { animation-duration: 0.7s; transform: scale(1.12); }
.iphome-hero-badge.blob-close::before    { animation-duration: 0.6s; inset: -22px -30px; background: rgba(255,80,160,.48); }
.iphome-hero-title {
    font-size: 40px;
    font-weight: 900;
    color: #ffffff;
    line-height: 1.25;
    margin: 0 0 20px;
    letter-spacing: -.01em;
}
.iphome-hero-desc {
    font-size: 16px;
    color: rgba(255, 255, 255, .72);
    line-height: 1.8;
    margin: 0;
}
.iphome-hero-right {
    flex: 1;
    min-width: 0;   /* 防止 flex 子元素溢出 */
}
/* ── Hero 手風琴照片格 ────────────────────────────────────── */
.iphome-hero-grid {
    display: flex;
    flex-direction: row;
    gap: 0;                          /* 圖片之間無間隙 */
    height: 340px;
    width: 100%;
    border-radius: 16px;             /* 整體四個角圓角 */
    overflow: hidden;                /* 裁切子圖至圓角 */
}
.iphome-hero-photo {
    flex: 1;
    border-radius: 0;                /* 各圖不要自己的圓角 */
    overflow: hidden;
    background: rgba(255, 255, 255, .06);
    position: relative;
    cursor: pointer;
    text-decoration: none;
    transition: flex .45s cubic-bezier(.4, 0, .2, 1);
    display: block;
}

/* 手風琴展開：hover 的張開，其他縮小 */
.iphome-hero-grid:has(.iphome-hero-photo:hover) .iphome-hero-photo {
    flex: 0.75;
}
.iphome-hero-photo:hover {
    flex: 1.6 !important;
}

.iphome-hero-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
}

/* Hover 遮罩 — 立即出現 */
.iphome-hero-photo-overlay {
    position: absolute;
    inset: 0;
    background: rgba(30, 30, 30, .48);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    padding: 20px 16px 40px;
    text-align: center;
    opacity: 0;
    transition: opacity .25s ease;
}
.iphome-hero-photo:hover .iphome-hero-photo-overlay {
    opacity: 1;
}

/* 標題與按鈕：預設在下方隱藏，hover 後 0.3s 滑上來 */
.iphome-hero-photo-title,
.iphome-hero-photo-btn {
    transform: translateY(16px);
    opacity: 0;
    transition: transform .35s ease, opacity .35s ease;
    transition-delay: 0s;
}
.iphome-hero-photo:hover .iphome-hero-photo-title,
.iphome-hero-photo:hover .iphome-hero-photo-btn {
    transform: translateY(0);
    opacity: 1;
    transition-delay: .3s;
}

.iphome-hero-photo-title {
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.55;
    margin: 0;
    text-shadow: 0 1px 6px rgba(0, 0, 0, .6);
}
.iphome-hero-photo-btn {
    display: inline-block;
    background: #ff1f87;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    padding: 9px 28px;
    border-radius: 50px;
    text-decoration: none;
    white-space: nowrap;
    transition: background .2s, transform .2s, opacity .35s ease;
}
.iphome-hero-photo-btn:hover {
    background: #ff6eb4;
    color: #ffffff;
}

/* ── COURSES ───────────────────────────────────────────────── */
.iphome-courses {
    background: #f8f9fc;
    padding: 40px 0 64px;   /* reduced top gap to the section above */
}
.iphome-courses .iphome-section-title.iphome-courses-title {
    text-align: left;
    font-weight: 500;       /* not bold */
    margin-bottom: 12px;    /* tighter gap to the cards below */
}
/* Align course cards' left edge with the heading (remove grid-wrap inset) */
.iphome-courses .ilms-grid-wrap {
    max-width: none;
    padding-left: 0;
    padding-right: 0;
    padding-top: 0;
}

/* ── CATEGORIES ────────────────────────────────────────────── */
.iphome-categories {
    background: #ffffff;
    padding: 80px 0;
}
.iphome-categories .iphome-section-title {
    text-align: center;
}
.iphome-cat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-top: 8px;
}
.iphome-cat-card {
    background: #f8f9fc;
    border-radius: 16px;
    padding: 36px 20px 28px;
    text-align: center;
    transition: transform .2s, box-shadow .2s;
    cursor: pointer;
}
.iphome-cat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .1);
}
.iphome-cat-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #e8eaf6;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.iphome-cat-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.iphome-cat-label {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
}

/* ── STATS ─────────────────────────────────────────────────── */
.iphome-stats {
    position: relative;
    background: #0a1628 center bottom/cover no-repeat;
    padding: 80px 0;
    color: #ffffff;
}
.iphome-stats-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 22, 40, .48);
}
.iphome-stats-inner {
    position: relative;
    z-index: 1;
    text-align: center;
}
.iphome-stats-title {
    font-size: 30px;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 12px;
}
.iphome-stats-desc {
    font-size: 16px;
    color: rgba(255, 255, 255, .7);
    margin: 0 0 52px;
}
.iphome-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
}
.iphome-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.iphome-stat-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #d63a4a;
    color: #ffffff;
}
.iphome-stat-icon--globe,
.iphome-stat-icon--bell,
.iphome-stat-icon--people,
.iphome-stat-icon--case  { background: #d63a4a; color: #ffffff; }
.iphome-stat-num {
    font-size: 40px;
    font-weight: 900;
    color: #ffffff;
    line-height: 1;
}
.iphome-stat-label {
    font-size: 14px;
    color: rgba(255, 255, 255, .65);
    font-weight: 500;
}

/* ── TESTIMONIALS ──────────────────────────────────────────── */
.iphome-testimonials {
    background: #f8f9fc;
    padding: 80px 0;
}
.iphome-testimonials-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 36px;
}
.iphome-carousel-nav {
    display: flex;
    gap: 8px;
}
.iphome-carousel-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #d0d5dd;
    background: #ffffff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .2s, background .2s;
    color: #1a1a2e;
}
.iphome-carousel-btn:hover {
    border-color: #d63a4a;
    background: #fff0f1;
    color: #d63a4a;
}
.iphome-testimonials-body {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 32px;
    align-items: start;
}
.iphome-testimonials-cards {
    overflow: hidden;
}
.iphome-cards-track {
    display: flex;
    transition: transform 0.4s ease;
}
.iphome-track-item {
    flex: 0 0 50%;
    max-width: 50%;
    padding-right: 20px;
    box-sizing: border-box;
}
.iphome-track-item:last-child { padding-right: 0; }
.iphome-testimonial-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .06);
    height: 100%;
    box-sizing: border-box;
}
.iphome-testimonial-top {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}
.iphome-testimonial-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
    background: #e8eaf6;
}
.iphome-testimonial-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.iphome-testimonial-quote {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.5;
    margin-bottom: 4px;
}
.iphome-testimonial-name {
    font-size: 13px;
    color: #6b7280;
    font-weight: 600;
}
.iphome-testimonial-body {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.75;
    margin: 0;
}
.iphome-testimonials-video {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 100px;
}
.iphome-video-title {
    margin-bottom: 0 !important;
}
.iphome-video-wrap {
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 16/9;
    background: #0a1628;
    position: relative;
}
.iphome-video-player {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.iphome-video-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
}
.iphome-video-play:hover { opacity: 0.8; }
.iphome-video-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.iphome-video-placeholder {
    text-align: center;
    color: rgba(255, 255, 255, .85);
    padding: 32px;
}
.iphome-video-placeholder span {
    display: block;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .1em;
    color: rgba(255, 255, 255, .5);
    text-transform: uppercase;
    margin-bottom: 16px;
}
.iphome-video-placeholder p {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.5;
    margin: 0;
}

/* ── CTA ───────────────────────────────────────────────────── */
.iphome-cta {
    background: #e8574a;
    padding: 22px 0;
}
.iphome-cta-inner {
    display: flex;
    align-items: center;
    gap: 24px;
}
.iphome-cta-deco {
    flex-shrink: 0;
    width: 300px;
}
.iphome-cta-heart-img {
    width: 100%;
    height: auto;
    display: block;
}
.iphome-cta-text {
    flex: 1;
    min-width: 0;
}
.iphome-cta-title {
    font-size: 28px;
    font-weight: 900;
    color: #ffffff;
    margin: 0 0 6px;
    letter-spacing: .02em;
}
.iphome-cta-desc {
    font-size: 15px;
    color: rgba(255, 255, 255, .9);
    line-height: 1.7;
    margin: 0;
}

/* ── Full-width override for GeneratePress grid ────────────── */
body.home #page,
body.home #page.grid-container {
    display: block !important;   /* 關掉 GP 的 grid，讓區塊垂直堆疊 */
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
}
body.home #content,
body.home #primary,
body.home .site-main {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}
body.home #iphome,
body.home .iphome-footer {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
}

/* ── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .iphome-hero-left { flex: 0 0 360px; }
    .iphome-hero-title { font-size: 34px; }
    .iphome-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .iphome-testimonials-body { grid-template-columns: 1fr; }
    .iphome-testimonials-video { position: static; }
}
@media (max-width: 768px) {
    .iphome-hero {
        padding: 80px 0 60px;
    }
    .iphome-hero-inner {
        flex-direction: column;
        gap: 40px;
    }
    .iphome-hero-left {
        flex: unset;
        max-width: 100%;
        text-align: center;
    }
    .iphome-hero-title { font-size: 28px; }
    .iphome-hero-right { width: 100%; }
    .iphome-cat-grid { grid-template-columns: repeat(2, 1fr); }
    .iphome-testimonials-header { flex-direction: column; align-items: flex-start; gap: 16px; }
    .iphome-track-item { flex: 0 0 100% !important; max-width: 100% !important; padding-right: 0; }
    .iphome-section-title { font-size: 22px; }
    .iphome-stats-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }
    .iphome-stat-num { font-size: 32px; }
    .iphome-cta-deco { width: 200px; }
    .iphome-cta-title { font-size: 22px; }
    .iphome-cta-desc { font-size: 13px; }
}
@media (max-width: 480px) {
    .iphome-cat-grid { grid-template-columns: 1fr 1fr; }
    .iphome-stats-grid { grid-template-columns: 1fr 1fr; }
    .iphome-container { padding: 0 20px; }
    .iphome-hero-inner { padding: 0 20px; }
    .iphome-cta-deco { display: none; }
    .iphome-cta-title { font-size: 18px; }
}
