/* ========================================
   流程卡片樣式 (Process Flow Cards)
   ======================================== */

.process-flow {
    position: relative;
}

/* 流程卡片本身樣式 */
.process-card {
    position: relative;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    overflow: visible;
}

.process-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 6px 16px rgba(0, 102, 204, 0.2);
    transform: translateY(-2px);
}

/* 步驟編號標籤 (圓形徽章) */
.process-step-badge {
    position: absolute;
    top: -12px;
    left: 20px;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.3);
    z-index: 10;
    border: 3px solid white;
}

/* 流程卡片的標題樣式 */
.process-card .card-title {
    padding-top: 0.5rem;
    color: var(--primary-color);
    font-weight: 600;
}

/* 流程卡片的文本內容 */
.process-card .card-text {
    color: #555;
    line-height: 1.6;
}

.process-card .card-text p {
    margin-bottom: 0.75rem;
}

.process-card .card-text a {
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

.process-card .card-text a:hover {
    text-decoration: underline;
}

/* 在較大螢幕上的流程卡片樣式 */
@media (min-width: 768px) {
    .process-flow > .col {
        position: relative;
    }
}

/* 手機版本調整 */
@media (max-width: 767px) {
    .process-step-badge {
        top: -10px;
        left: 15px;
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    .process-card {
        margin-top: 12px;
    }
}

/* 第一步卡片額外樣式 */
.process-flow > .col:first-child .process-card {
    border-left: 4px solid var(--primary-color);
}

/* 最後一步卡片額外樣式 */
.process-flow > .col:last-child .process-card {
    border-right: 4px solid var(--success-color);
}

/* ------------------------------
   Reduce CLS helpers
   - Reserve space for dynamic content (homepage content / ads)
   - Make floating menu and back-to-top fixed so they don't push layout
   ------------------------------ */

/* Reserve a minimum height for the homepage content area so
   the initial loader/skeleton doesn't cause a large layout shift
   when real content is inserted. 調整此數值視內容而定。 */
#homepage-content {
    min-height: 360px;
}

/* Ad placeholders: keep a minimum height so that ad script
   insertion doesn't shift page content. 視需自訂不同位置高度 */
.ad-slot {
    min-height: 250px;
    width: 100%;
    display: block;
}
.ad-slot.ad-header { min-height: 90px; }
.ad-slot.ad-middle { min-height: 250px; }
.ad-slot.ad-footer { min-height: 90px; }

/* Floating menu should overlay content (fixed) instead of being injected
   into document flow which can cause reflows. */
#floating-menu-container {
    position: fixed;
    right: 1rem;
    bottom: 4.5rem;
    z-index: 1050;
    pointer-events: auto;
}

/* Back-to-top: keep it out of flow and reveal with opacity to avoid reflow */
#back-to-top {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1060;
    display: inline-block;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.18s ease, visibility 0.18s ease;
}
#back-to-top.show {
    visibility: visible;
    opacity: 1;
}

/* Images: ensure responsive sizing to avoid unexpected layout jumps
   Prefer adding explicit width/height attributes on critical images. */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

