/* 活動專頁（Views/Event/Page.cshtml，ev- 開頭）：建立在小農包新品頁的 fp- 樣式之上（farmerpack.css 先載入），
   這裡只放活動專頁才有的元件：主視覺（全幅照片／文字＋直式海報）、狀態標籤、議程、產品卡、影片、地點、放大看圖，
   以及區塊可選淺色／深色背景後，原本只設計給一種背景的 fp- 元件（數字、常見問題、結尾呼籲）在另一種背景的配色 */

/* ── 主視覺 ── */
.ev-hero {
    position: relative;
    padding: clamp(3rem, 2rem + 4vw, 5.5rem) 0;
}

.ev-hero-title {
    font-size: clamp(2.1rem, 1.3rem + 3.4vw, 4.25rem);
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 0.75rem;
}

.ev-hero-subtitle {
    font-size: clamp(1.25rem, 1rem + 1.1vw, 1.9rem);
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 1rem;
}

.ev-hero-lead {
    max-width: 40rem;
    margin-bottom: 1.5rem;
}

.ev-hero-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.ev-status {
    display: inline-block;
    padding: 0.25rem 0.85rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 700;
    background: var(--fp-tag-bg);
    color: #fff;
}

.ev-status-ongoing {
    background: #c2410c; /* 展期中：橘，白字 5.2:1 */
}

.ev-status-ended {
    background: #4b5563;
}

.ev-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    list-style: none;
    margin: 0 0 1.75rem;
    padding: 0;
    font-weight: 600;
}

.ev-facts .bi {
    margin-right: 0.4rem;
    color: var(--fp-accent-ink);
}

.ev-hero-actions,
.ev-actions-start {
    justify-content: flex-start;
}

/* 主視覺的麵包屑靠左（farmerpack.css 置中） */
.ev-hero .fp-breadcrumb ol {
    justify-content: flex-start;
}

/* 全幅照片：文字壓在照片上，下方加深 */
.ev-hero-cover {
    min-height: min(88vh, 820px);
    display: flex;
    align-items: flex-end;
    isolation: isolate;
    overflow: clip;
}

.ev-hero-cover > .container {
    position: relative;
}

.ev-hero-media {
    position: absolute;
    inset: 0;
    z-index: -2;
}

.ev-hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ev-hero-cover::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(to top, rgba(0, 0, 0, 0.86) 0%, rgba(0, 0, 0, 0.55) 45%, rgba(0, 0, 0, 0.15) 80%),
        linear-gradient(to right, rgba(0, 0, 0, 0.45), transparent 70%);
}

.ev-hero-cover .ev-hero-text {
    max-width: 52rem;
}

.ev-hero-cover .fp-breadcrumb ol,
.ev-hero-cover .fp-lead {
    color: rgba(255, 255, 255, 0.86);
}

.ev-hero-cover .fp-breadcrumb li + li::before {
    color: rgba(255, 255, 255, 0.6);
}

.ev-hero-cover .ev-facts .bi {
    color: var(--fp-hi);
}

/* 沒有主視覺圖：深色漸層底 */
.ev-hero-cover.ev-hero-plain {
    min-height: 0;
    background:
        radial-gradient(ellipse 60% 70% at 80% 30%, rgba(var(--fp-brand-rgb), 0.28), transparent 70%),
        var(--fp-ink);
}

.ev-hero-cover.ev-hero-plain::before {
    content: none;
}

/* 文字＋直式海報 */
.ev-hero-split {
    background: radial-gradient(ellipse 70% 60% at 75% 50%, #ececec 0%, var(--fp-paper) 70%);
    color: #1d1d1f;
}

.ev-hero-split .fp-lead {
    color: #424245;
}

.ev-hero-split .fp-breadcrumb a:hover {
    color: var(--fp-green-ink);
}

.ev-hero-grid {
    display: grid;
    gap: 2.5rem;
    align-items: center;
}

.ev-hero-split .ev-hero-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
}

.ev-hero-poster img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 78vh;
    object-fit: contain;
    border-radius: 1rem;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
}

@media (max-width: 991.98px) {
    .ev-hero-split .ev-hero-grid {
        grid-template-columns: 1fr;
    }

    .ev-hero-poster {
        max-width: 32rem;
    }
}

/* ── 文字段落、圖文 ── */
.ev-richtext {
    max-width: 46rem;
    margin: 0 auto;
    font-size: 1.05rem;
    line-height: 1.85;
}

.ev-block-media .ev-richtext {
    margin: 0;
}

.ev-richtext h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 2rem 0 0.75rem;
}

.ev-richtext img {
    max-width: 100%;
    height: auto;
    border-radius: 1rem;
}

.fp-light .ev-richtext {
    color: #2c2c2e;
}

.fp-dark .ev-richtext {
    color: var(--fp-dim);
}

.fp-dark .ev-richtext :is(h3, h4, strong) {
    color: var(--fp-text);
}

.fp-dark .ev-richtext a {
    color: var(--fp-green-glow);
}

.ev-media-title {
    font-size: clamp(1.7rem, 1.2rem + 2vw, 2.75rem);
    margin-bottom: 1rem;
}

.ev-media {
    margin: 0;
}

.ev-media img {
    width: 100%;
    height: auto;
    border-radius: var(--fp-radius);
}

/* ── 亮點卡片：一列最多 4 張（5、6 張時排成 3 張一列），farmerpack.css 的卡片寬度 span 2 不適用 ── */
.ev-cards {
    display: grid;
    grid-template-columns: repeat(var(--ev-cols, 3), minmax(0, 1fr));
    gap: 1rem;
}

.ev-cards .fp-card {
    grid-column: auto;
    min-height: 0;
}

@media (max-width: 991.98px) {
    .ev-cards {
        grid-template-columns: repeat(var(--ev-cols-md, 2), minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .ev-cards {
        grid-template-columns: 1fr;
    }
}

.ev-card-image {
    width: calc(100% + 3.5rem);
    max-width: none;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    margin: -1.9rem -1.75rem 1.25rem;
    border-radius: var(--fp-radius) var(--fp-radius) 0 0;
}

.ev-card p:last-child {
    margin-bottom: 0;
}

/* ── 展出產品：卡片寬度固定範圍、置中（只有一兩項時不會撐滿整列） ── */
.ev-products {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 20rem));
    justify-content: center;
    gap: 1rem;
}

.ev-product {
    display: flex;
    flex-direction: column;
    border-radius: var(--fp-radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: transform 0.3s, box-shadow 0.3s;
}

.fp-dark .ev-product {
    background: var(--fp-ink-2);
    border: 1px solid var(--fp-line);
}

@media (hover: hover) {
    .ev-product:hover {
        transform: translateY(-3px);
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
        color: inherit;
    }
}

.ev-product-media {
    display: block;
    aspect-ratio: 4 / 3;
    background: var(--fp-studio);
}

.ev-product-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ev-product-body {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1.25rem 1.4rem 1.5rem;
    flex: 1;
}

.ev-product-name {
    font-size: 1.2rem;
    font-weight: 700;
}

/* 產品名後的箭頭是裝飾（bi-arrow-right，替代文字空白） */
.ev-product-name::after {
    content: "\f138" / "";
    font-family: bootstrap-icons;
    font-size: 0.85em;
    margin-left: 0.4rem;
    color: var(--fp-green-ink);
}

.fp-dark .ev-product-name::after {
    color: var(--fp-green-glow);
}

.ev-product-tagline {
    color: var(--fp-accent-ink);
    font-weight: 600;
    font-size: 0.95rem;
}

.fp-dark .ev-product-tagline {
    color: var(--fp-accent-glow);
}

.ev-product-text {
    color: #515154;
    font-size: 0.95rem;
    margin-top: 0.35rem;
}

.fp-dark .ev-product-text {
    color: var(--fp-dim);
}

/* ── 數字亮點：項目數不固定（最多一列 4 個），淺色背景也能用 ── */
.ev-stats {
    grid-template-columns: repeat(var(--ev-count, 4), minmax(0, 1fr));
}

@media (max-width: 767.98px) {
    .ev-stats {
        grid-template-columns: repeat(var(--ev-count-sm, 2), minmax(0, 1fr));
    }
}

.ev-block-stats.fp-section .fp-stats {
    max-width: 1320px;
    margin: 0 auto;
}

.fp-light .ev-stats {
    background: #d2d2d7;
    border-color: #d2d2d7;
}

.fp-light .ev-stats .fp-stat {
    background: var(--fp-paper);
}

.fp-light .ev-stats .fp-stat-value.fp-gradient-text {
    background: none;
    color: var(--fp-green-ink);
}

.fp-light .ev-stats :is(.fp-stat-label, .fp-stat-value small) {
    color: #515154;
}

/* ── 議程 ── */
.ev-agenda {
    max-width: 52rem;
    margin: 0 auto;
    padding: 0;
    list-style: none;
    border-top: 1px solid #d2d2d7;
}

.ev-agenda li {
    display: grid;
    grid-template-columns: 11rem minmax(0, 1fr);
    gap: 1.5rem;
    padding: 1.4rem 0;
    border-bottom: 1px solid #d2d2d7;
}

.ev-agenda-time {
    font-weight: 700;
    color: var(--fp-accent-ink);
    font-variant-numeric: tabular-nums;
}

.ev-agenda h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.ev-agenda p {
    margin: 0;
    color: #515154;
}

.fp-dark .ev-agenda,
.fp-dark .ev-agenda li {
    border-color: var(--fp-line);
}

.fp-dark .ev-agenda-time {
    color: var(--fp-accent-glow);
}

.fp-dark .ev-agenda p {
    color: var(--fp-dim);
}

@media (max-width: 575.98px) {
    .ev-agenda li {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }
}

/* ── 圖片集：點照片放大（event.js）；照片高度一致、寬度依原比例（海報不裁切） ── */
.ev-gallery figure {
    width: auto;
}

.ev-gallery img {
    width: auto;
    min-width: 10rem;
    max-width: 85vw;
    height: clamp(15rem, 10rem + 18vw, 24rem);
    aspect-ratio: auto;
}

.ev-gallery figcaption {
    max-width: 24rem;
}

.ev-zoom {
    display: block;
    border-radius: 1.25rem;
    cursor: zoom-in;
}

.fp-light .fp-gallery figcaption {
    color: #515154;
}

.ev-lightbox {
    max-width: min(96vw, 1400px);
    max-height: 94vh;
    padding: 0;
    border: 0;
    border-radius: 1rem;
    background: #000;
    color: #fff;
    overflow: hidden;
}

.ev-lightbox::backdrop {
    background: rgba(0, 0, 0, 0.82);
}

.ev-lightbox img {
    display: block;
    max-width: 100%;
    max-height: calc(94vh - 3.5rem);
    margin: 0 auto;
    object-fit: contain;
}

.ev-lightbox-caption {
    margin: 0;
    padding: 0.75rem 1rem;
    text-align: center;
    font-size: 0.95rem;
}

.ev-lightbox-caption:empty {
    display: none;
}

.ev-lightbox-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 1.1rem;
}

/* ── 影片：點了才載入 YouTube ── */
.ev-video {
    position: relative;
    display: block;
    max-width: 960px;
    margin: 0 auto;
    aspect-ratio: 16 / 9;
    border-radius: var(--fp-radius);
    overflow: hidden;
    background: #000;
}

.ev-video img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.85;
    transition: opacity 0.2s;
}

.ev-video iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.ev-video-play {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    place-items: center;
    width: 84px;
    height: 84px;
    margin: -42px 0 0 -42px;
    border-radius: 50%;
    background: var(--green-700);
    color: #fff;
    font-size: 2.6rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s;
}

@media (hover: hover) {
    .ev-video:hover img {
        opacity: 1;
    }

    .ev-video:hover .ev-video-play {
        transform: scale(1.06);
    }
}

/* ── 地點與交通 ── */
.ev-venue {
    margin: 0;
    display: grid;
    gap: 1rem;
}

.ev-venue > div {
    padding-bottom: 1rem;
    border-bottom: 1px solid #d2d2d7;
}

.fp-dark .ev-venue > div {
    border-color: var(--fp-line);
}

.ev-venue dt {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--fp-accent-ink);
    margin-bottom: 0.25rem;
}

.fp-dark .ev-venue dt {
    color: var(--fp-accent-glow);
}

.ev-venue dt .bi {
    margin-right: 0.4rem;
}

.ev-venue dd {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.ev-block-venue .ev-richtext {
    margin: 0;
}

/* ── 常見問題：深色背景 ── */
.fp-dark .fp-faq,
.fp-dark .fp-faq-item {
    border-color: var(--fp-line);
}

.fp-dark .fp-faq-item summary::after {
    color: var(--fp-accent-glow);
}

.fp-dark .fp-faq-item p {
    color: var(--fp-dim);
}

/* ── 結尾行動呼籲：淺色背景 ── */
.ev-block-cta.fp-light {
    background:
        radial-gradient(ellipse 55% 65% at 50% 48%, rgba(var(--fp-brand-rgb), 0.14), transparent 70%),
        var(--fp-paper);
}

.ev-block-cta .fp-lead {
    max-width: 40rem;
    margin: 1rem auto 0;
}

/* 相鄰兩個區塊背景相同時，第二個不再加上方留白（否則中間空太多） */
.ev .fp-section.fp-light + .fp-section.fp-light,
.ev .fp-section.fp-dark + .fp-section.fp-dark:not(.fp-finale) {
    padding-top: 0;
}

/* 主視覺以外的區塊錨點：跳過去時不要被網站頁首與活動導覽列擋住 */
.ev [id] {
    scroll-margin-top: calc(var(--fp-header-h) + 60px);
}
