/**
 * Internal Linker — Ghost carousel card style
 *
 * Both "延伸閱讀" and "你可能也想看" use the same
 * swipeable card carousel with transparent Ghost style.
 *
 * @package AiSeoAutoPublish
 */

/* ══════════════════════════════════════════════════
   Section — shared wrapper
   ══════════════════════════════════════════════════ */
.aiseo-card-section {
    margin: 2.5em 0;
    padding: 0;
}

/* Header: ── 標題 ── */
.aiseo-card-section__header {
    display: flex;
    align-items: center;
    gap: 1em;
    margin-bottom: 1.2em;
}

.aiseo-card-section__line {
    flex: 1;
    height: 1px;
    background: currentColor;
    opacity: 0.12;
}

.aiseo-card-section__label {
    font-size: 0.75em;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: inherit;
    opacity: 0.4;
    white-space: nowrap;
}


/* ══════════════════════════════════════════════════
   Carousel — horizontal scroll container
   ══════════════════════════════════════════════════ */
.aiseo-carousel {
    position: relative;
}

.aiseo-carousel__track {
    display: flex;
    gap: 1em;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;          /* Firefox */
    padding: 4px 0;
}

.aiseo-carousel__track::-webkit-scrollbar {
    display: none;                  /* Chrome / Safari */
}

/* ── Arrow buttons ── */
.aiseo-carousel__btn {
    position: absolute;
    top: 50%;
    transform: translateY(-60%);
    z-index: 3;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.35);
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2em;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.25s ease, background 0.2s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.aiseo-carousel:hover .aiseo-carousel__btn {
    opacity: 1;
}

.aiseo-carousel__btn:hover {
    background: rgba(0, 0, 0, 0.55);
}

.aiseo-carousel__btn--prev {
    left: -6px;
}

.aiseo-carousel__btn--next {
    right: -6px;
}

.aiseo-carousel__btn--hidden {
    opacity: 0 !important;
    pointer-events: none;
}


/* ══════════════════════════════════════════════════
   Card — Ghost transparent style
   ══════════════════════════════════════════════════ */
.aiseo-carousel__card {
    flex: 0 0 auto;
    width: 180px;
    scroll-snap-align: start;
    border-radius: 8px;
    overflow: hidden;
    background: transparent;
    text-decoration: none !important;
    color: inherit;
    transition: background 0.3s ease;
    display: flex;
    flex-direction: column;
}

.aiseo-carousel__card:hover {
    background: rgba(128, 128, 128, 0.07);
}

/* Card image */
.aiseo-carousel__card-img {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 6px;
    background: rgba(128, 128, 128, 0.08);
}

.aiseo-carousel__card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
    transition: opacity 0.3s ease, transform 0.45s ease;
}

.aiseo-carousel__card:hover .aiseo-carousel__card-img img {
    opacity: 1;
    transform: scale(1.04);
}

/* Placeholder */
.aiseo-carousel__card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 1.5em;
    opacity: 0.3;
}

/* Category badge — hover only */
.aiseo-carousel__card-cat {
    position: absolute;
    top: 6px;
    left: 6px;
    padding: 1px 7px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.6em;
    font-weight: 500;
    letter-spacing: 0.03em;
    border-radius: 3px;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.aiseo-carousel__card:hover .aiseo-carousel__card-cat {
    opacity: 1;
}

/* Card title */
.aiseo-carousel__card-title {
    padding: 0.5em 0.2em 0.3em;
    font-size: 0.72em;
    font-weight: 500;
    line-height: 1.45;
    color: inherit;
    opacity: 0.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: opacity 0.25s ease;
}

.aiseo-carousel__card:hover .aiseo-carousel__card-title {
    opacity: 0.9;
}


/* ══════════════════════════════════════════════════
   Responsive
   ══════════════════════════════════════════════════ */

/* Mobile — smaller cards */
@media (max-width: 640px) {
    .aiseo-carousel__card {
        width: 150px;
    }

    .aiseo-carousel__btn {
        display: none;
    }

    .aiseo-card-section {
        margin: 2em -0.5em;
    }

    .aiseo-carousel__track {
        padding-left: 0.5em;
        padding-right: 0.5em;
    }
}

/* Tablet */
@media (min-width: 641px) and (max-width: 1023px) {
    .aiseo-carousel__card {
        width: 170px;
    }
}

/* Desktop — slightly larger cards */
@media (min-width: 1024px) {
    .aiseo-carousel__card {
        width: 190px;
    }
}
