/* ==========================================================================
   Front page v4 (template-frontpage-v4.php)
   Same visual language as /streymi/ (css/streymi-nytt.css).
   ========================================================================== */

.fp4 {
    --fp4-ink: var(--kvik-ink, #1a1f24);
    --fp4-muted: var(--kvik-muted, #6b7280);
    --fp4-line: #e6eaed;
    --fp4-bg: #f3f5f6;
    --fp4-teal: var(--kvik-teal, #62b0ba);
    --fp4-teal-dark: var(--kvik-teal-dark, #0d9488);
    --fp4-want: var(--kvik-want, #e0654f);
    background: var(--fp4-bg);
    color: var(--fp4-ink);
    font-family: 'Open Sans', Arial, sans-serif;
    padding: 20px 0 56px;
}
.fp4-wrap { max-width: 1200px; margin: 0 auto; padding-inline: 16px; box-sizing: border-box; }
.fp4-section { margin-top: 36px; }
.fp4 a { color: inherit; text-decoration: none; }
.fp4-muted { color: var(--fp4-muted); }

.fp4 .fp4-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; padding: 0; background: none; }
.fp4 .fp4-head h2 { display: flex; align-items: center; gap: 10px; margin: 0; padding: 0; background: none; font-size: 22px; font-weight: 800; color: var(--fp4-ink); }
.fp4-head a { font-size: 14px; font-weight: 700; color: var(--fp4-teal-dark); white-space: nowrap; }
.fp4-head a:hover { text-decoration: underline; }

.fp4-chip { display: inline-block; padding: 1px 8px; border-radius: 5px; background: rgba(255, 255, 255, .16); font-size: 12px; font-weight: 700; }
.fp4-chip--imdb { background: #f5c518; color: #111; }

.fp4-btn { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 18px; border-radius: 999px; font-size: 14px; font-weight: 700; cursor: pointer; border: 1px solid transparent; }
.fp4-btn--primary { background: #fff; color: var(--fp4-ink) !important; }
.fp4-btn--primary:hover { background: #e6f3f4; }
.fp4-btn--ghost { border-color: rgba(255, 255, 255, .5); color: #fff !important; }
.fp4-btn--ghost:hover { background: rgba(255, 255, 255, .12); }
.fp4-btn--want { background: var(--fp4-want); color: #fff !important; }
.fp4-btn--want:hover { background: var(--kvik-want-dark, #c9553f); }

/* ── 1. Featured + next showings ──────────────────────────────────────── */
.fp4-top { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
.fp4-feature {
    position: relative; overflow: hidden; border-radius: 16px; min-height: 380px; display: flex; align-items: flex-end;
    background: linear-gradient(135deg, #2b3034, #2f4b50); color: #fff; gap: 22px; padding: 0 0 0 26px;
}
.fp4-feature::before { content: ''; position: absolute; inset: 0; background: var(--fp4-backdrop, none) center 25% / cover no-repeat; }
.fp4-feature--noback::before { filter: blur(22px) saturate(1.15); transform: scale(1.2); opacity: .75; }
.fp4-feature__poster { position: relative; z-index: 1; flex: 0 0 150px; align-self: flex-end; margin-bottom: 26px; border-radius: 10px; overflow: hidden; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); }
.fp4-feature__poster img { display: block; width: 100%; aspect-ratio: 2 / 3; object-fit: cover; }
.fp4-feature__shade { position: absolute; inset: 0; z-index: 0; background: linear-gradient(to top, rgba(10, 14, 18, .92) 10%, rgba(10, 14, 18, .45) 55%, rgba(10, 14, 18, .1)); }
.fp4-feature__body { position: relative; z-index: 1; padding: 26px 28px 26px 0; max-width: 600px; }
.fp4-feature__eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #9fd6dc; }
.fp4 .fp4-feature__title { margin: 6px 0 8px; padding: 0; background: none; font-size: clamp(26px, 3.4vw, 40px); font-weight: 800; line-height: 1.1; color: #fff; }
.fp4-feature__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 13.5px; color: rgba(255, 255, 255, .85); }
.fp4-feature__plot { margin: 12px 0 0; font-size: 15px; line-height: 1.55; color: rgba(255, 255, 255, .88); }
.fp4-feature__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

.fp4-next { background: #fff; border-radius: 16px; padding: 18px 18px 8px; box-shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 6px 16px rgba(0, 0, 0, .04); display: flex; flex-direction: column; }
.fp4-next__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.fp4 .fp4-next__head h2 { margin: 0; padding: 0; background: none; font-size: 18px; font-weight: 800; color: var(--fp4-ink); }
.fp4-next__head a { font-size: 13px; font-weight: 700; color: var(--fp4-teal-dark); }
.fp4-next__list { list-style: none; margin: 0; padding: 0; }
.fp4-next__item { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--fp4-line); }
.fp4-next__list li:first-child .fp4-next__item { border-top: 0; }
.fp4-next__item:hover b { color: var(--fp4-teal-dark); }
.fp4-next__time { font-variant-numeric: tabular-nums; font-size: 16px; font-weight: 800; }
.fp4-next__film { display: flex; flex-direction: column; min-width: 0; }
.fp4-next__film b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp4-next__film small { font-size: 12px; color: var(--fp4-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp4-next__film em { font-style: normal; font-weight: 700; color: var(--fp4-teal-dark); }
.fp4-next__soon { font-size: 12px; font-weight: 700; color: var(--kvik-want-dark, #c9553f); white-space: nowrap; }
.fp4-next__empty { padding: 14px 0; font-size: 14px; color: var(--fp4-muted); }

/* ── 2. Personal week / pitch ─────────────────────────────────────────── */
.fp4-mine { background: var(--kvik-want-soft, #fdece8); border-radius: 16px; padding: 18px; }
.fp4-mine__row { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.fp4-mine__item { flex: 0 0 132px; display: flex; flex-direction: column; gap: 4px; }
.fp4-mine__item img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 10px; box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
.fp4-mine__title { font-size: 13.5px; font-weight: 700; line-height: 1.25; }
.fp4-mine__why { font-size: 12px; font-weight: 700; color: var(--fp4-teal-dark); }
.fp4-mine__why--premiere { color: #b45309; }
.fp4-mine__why--cinema { color: var(--kvik-want-dark, #c9553f); }

.fp4-pitch { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding: 20px 22px; border-radius: 16px; background: linear-gradient(120deg, #fdece8, #e6f3f4); border: 1px solid #f6d5cd; }
.fp4-pitch__text strong { display: block; font-size: 18px; margin-bottom: 6px; }
.fp4-pitch__text ul { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.6; color: #374151; }

/* ── 3–5. Cards ───────────────────────────────────────────────────────── */
.fp4-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px; }
.fp4-row { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.fp4-card { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fp4-card--row { flex: 0 0 150px; scroll-snap-align: start; }
.fp4-card__poster { position: relative; display: block; aspect-ratio: 2 / 3; border-radius: 10px; overflow: hidden; background: #dfe5e8; box-shadow: 0 1px 3px rgba(0, 0, 0, .1), 0 6px 14px rgba(0, 0, 0, .06); transition: transform .15s ease, box-shadow .15s ease; }
.fp4-card__poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fp4-card:hover .fp4-card__poster { transform: translateY(-3px); box-shadow: 0 4px 10px rgba(0, 0, 0, .12), 0 14px 28px rgba(0, 0, 0, .1); }
.fp4-card__title { font-size: 14px; font-weight: 700; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fp4-card:hover .fp4-card__title { color: var(--fp4-teal-dark); }
.fp4-card__meta { font-size: 12.5px; color: var(--fp4-muted); }
.fp4-card__next { color: var(--fp4-teal-dark); font-weight: 700; }
.fp4-badge { position: absolute; left: 8px; top: 8px; padding: 3px 8px; border-radius: 999px; background: rgba(20, 24, 28, .82); color: #fff; font-size: 11px; font-weight: 700; }

.fp4-ice { background: #fff; border-radius: 16px; padding: 18px 18px 14px; margin-top: 36px; max-width: 1168px; }
.fp4-flag { width: 22px; height: 16px; border-radius: 3px; display: inline-block; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 25 18'%3E%3Crect width='25' height='18' rx='2' fill='%2302529c'/%3E%3Cpath d='M0 9h25M9 0v18' stroke='%23fff' stroke-width='4'/%3E%3Cpath d='M0 9h25M9 0v18' stroke='%23dc1e35' stroke-width='2'/%3E%3C/svg%3E") center / contain no-repeat; }

/* ── 6. Streaming tabs (cards come from css/streymi-nytt.css) ─────────── */
.fp4-stream.sn-page { background: none; padding-bottom: 0; }
.fp4-tabs { display: inline-flex; padding: 3px; border-radius: 999px; background: #e6eaed; margin-bottom: 16px; }
.fp4-tab { border: 0; background: none; padding: 7px 16px; border-radius: 999px; font: inherit; font-size: 13.5px; font-weight: 700; color: #4b5563; cursor: pointer; }
.fp4-tab.is-on { background: #fff; color: var(--fp4-ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

/* ── 7. News ──────────────────────────────────────────────────────────── */
.fp4-news { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.fp4-news__item { display: flex; flex-direction: column; gap: 6px; }
.fp4-news__img { display: block; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #dfe5e8; }
.fp4-news__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fp4-news__title { font-size: 15px; font-weight: 700; line-height: 1.3; }
.fp4-news__item:hover .fp4-news__title { color: var(--fp4-teal-dark); }
.fp4-news__date { font-size: 12px; color: var(--fp4-muted); }

/* ── 8. For you (v3 AJAX markup, shown as a scroll row without Swiper) ── */
.fp4-foryou .swiper-wrapper { display: flex; gap: 16px; overflow-x: auto; transform: none !important; padding-bottom: 6px; }
.fp4-foryou .swiper-slide { flex: 0 0 150px; width: 150px !important; margin: 0 !important; }
.fp4-foryou .swiper-button-next, .fp4-foryou .swiper-button-prev, .fp4-foryou .swiper-pagination { display: none; }

@media (max-width: 900px) {
    .fp4-top { grid-template-columns: 1fr; }
    .fp4-feature { min-height: 320px; }
    .fp4-news { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .fp4 .fp4-head h2 { font-size: 19px; }
    .fp4-feature { padding-left: 18px; gap: 14px; }
    .fp4-feature__body { padding: 20px 18px 20px 0; }
    .fp4-feature__poster { flex-basis: 96px; margin-bottom: 20px; }
    .fp4-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
    .fp4-card--row, .fp4-mine__item { flex-basis: 128px; }
}
@media (prefers-reduced-motion: reduce) {
    .fp4-card__poster { transition: none; }
}

/* ── Ads, followed series, most wanted, bottom lists ──────────────────── */
.fp4-side-ad { display: none; }
@media (min-width: 1860px) {
    .fp4-side-ad { display: block; position: fixed; top: 100px; right: calc((100vw - 1200px) / 2 - 330px); width: 310px; z-index: 50; }
    .fp4-side-ad iframe { display: block; }
}
.fp4 .fp4-sub { margin: -8px 0 14px; font-size: 13.5px; color: var(--fp4-muted); }
.fp4-badge--ep { left: auto; right: 8px; top: auto; bottom: 8px; background: rgba(13, 148, 136, .92); }
.fp4-ep__when { color: var(--fp4-teal-dark); }
.fp4-rank { position: absolute; left: 8px; bottom: 6px; font-size: 34px; font-weight: 800; line-height: 1; color: #fff; text-shadow: 0 2px 8px rgba(0, 0, 0, .6); }
.fp4-want { font-weight: 800; color: var(--kvik-want-dark, #c9553f); }
.fp4-lists { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.fp4-list { background: #fff; border-radius: 16px; padding: 18px 20px; box-shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 6px 16px rgba(0, 0, 0, .04); }
.fp4 .fp4-list h3 { margin: 0 0 10px; padding: 0; background: none; font-size: 17px; font-weight: 800; color: var(--fp4-ink); }
.fp4-list ol { list-style: none; counter-reset: fp4n; margin: 0; padding: 0; }
.fp4-list li { counter-increment: fp4n; display: flex; gap: 10px; align-items: baseline; padding: 7px 0; border-top: 1px solid var(--fp4-line); font-size: 14px; line-height: 1.35; }
.fp4-list li:first-child { border-top: 0; }
.fp4-list li::before { content: counter(fp4n); flex: 0 0 18px; font-weight: 800; color: var(--fp4-teal-dark); font-variant-numeric: tabular-nums; }
.fp4-list li a:hover { color: var(--fp4-teal-dark); }
.fp4-list__more { display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 700; color: var(--fp4-teal-dark) !important; }
.fp4-list__src { display: block; margin-top: 8px; font-size: 11.5px; color: var(--fp4-muted); }
@media (max-width: 900px) { .fp4-lists { grid-template-columns: 1fr; } }

/* ── Í bíó í dag: one compact row + "all films" tile ──────────────────── */
.fp4 .fp4-count { font-size: 14px; font-weight: 600; color: var(--fp4-muted); }
.fp4-row--compact .fp4-card--row { flex-basis: 128px; }
.fp4-row--compact .fp4-card__title { font-size: 13.5px; }
.fp4-more-tile .fp4-card__poster { background: linear-gradient(150deg, #2b3034, #2f4b50); }
.fp4-more-tile__in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 10px; text-align: center; color: #fff; }
.fp4-more-tile__in b { font-size: 36px; font-weight: 800; line-height: 1; }
.fp4-more-tile__in span { font-size: 13px; line-height: 1.3; color: rgba(255, 255, 255, .85); }
.fp4-more-tile__in em { margin-top: 6px; font-style: normal; font-size: 13px; font-weight: 700; color: #9fd6dc; }
@media (max-width: 560px) { .fp4-row--compact .fp4-card--row { flex-basis: 112px; } }

/* ── Þín vika: list films + followed episodes in one row ──────────────── */
.fp4-head__links { display: inline-flex; gap: 14px; }
.fp4-mine__poster { position: relative; display: block; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 8px rgba(0, 0, 0, .15); background: #f3d9d2; aspect-ratio: 2 / 3; }
.fp4-mine__poster img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; box-shadow: none; display: block; }
.fp4-mine__item { flex-basis: 120px; }
.fp4-mine__why--episode { color: #7e22ce; }

/* ── Síminn partnership block ─────────────────────────────────────────── */
.fp4-partner { background: #fff; border-radius: 16px; padding: 18px 18px 14px; max-width: 1168px; border: 1px solid #e3e8eb; }
.fp4-partner__head { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.fp4-partner__logo { height: 34px; width: auto; flex: 0 0 auto; }
.fp4-partner__label { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--fp4-muted); }
.fp4 .fp4-partner__head h2 { margin: 2px 0 2px; padding: 0; background: none; font-size: 20px; font-weight: 800; color: var(--fp4-ink); }
.fp4-partner__head p { margin: 0; font-size: 13.5px; color: #4b5563; }
.fp4-partner__preview { margin-left: auto; padding: 3px 10px; border-radius: 999px; background: #fff7ed; color: #9a3412; font-size: 12px; font-weight: 700; }
.fp4-sim { flex: 0 0 140px; display: flex; flex-direction: column; gap: 5px; min-width: 0; scroll-snap-align: start; }
.fp4-sim .fp4-card__title:hover { color: var(--fp4-teal-dark); }
.fp4 .fp4-sim .kca-btn.fp4-sim__follow {
    position: static; width: 100%; height: 32px; margin-top: 2px; padding: 0 10px; border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    background: #fff; border: 1px solid var(--kvik-action-off-line, #d4dadf); color: var(--kvik-action-off-ink, #374151);
    font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; transform: none; box-shadow: none;
}
.fp4 .fp4-sim .kca-btn.fp4-sim__follow svg { width: 14px; height: 14px; fill: none; stroke: var(--kvik-want, #e0654f); stroke-width: 2; stroke-linejoin: round; }
.fp4 .fp4-sim .kca-btn.fp4-sim__follow.is-on { background: var(--kvik-want, #e0654f); border-color: var(--kvik-want, #e0654f); color: #fff; }
.fp4 .fp4-sim .kca-btn.fp4-sim__follow.is-on svg { stroke: #fff; fill: #fff; }
.fp4-sim__watch { font-size: 12px; font-weight: 700; color: var(--fp4-teal-dark) !important; text-align: center; }
.fp4-sim__watch:hover { text-decoration: underline !important; }
.fp4-partner__cta { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--fp4-line); font-size: 13.5px; color: #4b5563; }
.fp4-partner__cta a { font-weight: 800; color: var(--fp4-teal-dark) !important; }
@media (max-width: 560px) { .fp4-sim { flex-basis: 124px; } .fp4-partner__cta { justify-content: flex-start; flex-wrap: wrap; } }
.fp4-sim .fp4-card__meta { flex: 1; }   /* align follow buttons across cards */

/* ── Íslenskt: where/what pills on the posters ────────────────────────── */
.fp4-pill { position: absolute; left: 7px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; line-height: 1.5; color: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
.fp4-pill--cinema, .fp4-pill--soon, .fp4-pill--stream { top: 7px; }
.fp4-pill--cinema { background: #ea580c; }   /* not coral: coral = "Langar að sjá" */
.fp4-pill--soon { background: #b45309; }
.fp4-pill--stream { background: var(--fp4-teal-dark); }
.fp4-pill--type { bottom: 7px; background: rgba(20, 24, 28, .78); font-weight: 700; }

/* 5c. Kvikmyndalistar row — tiles from css/kvikmyndalistar.css in a horizontal scroller */
.fp4-listrow { gap: 14px; padding: 2px 2px 10px; }
.fp4-listrow .kl-tile { flex: 0 0 260px; scroll-snap-align: start; }
.fp4-listrow .kl-tile:hover { transform: none; }
@media (max-width: 560px) { .fp4-listrow .kl-tile { flex-basis: 220px; } }

/* 3a. Kemur út — release-kind badge on the poster + "Í dag" highlight */
.fp4-badge--rel { left: 6px; right: auto; top: auto; bottom: 6px; max-width: calc(100% - 12px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp4-badge--season { background: #9333ea; }
.fp4-badge--stream { background: #0d9488; }
.fp4-badge--cinema { background: #ea580c; }
.fp4-rel-today { color: #e0654f; }

/* 9a. Vinsældalistar — #1 with poster, then 2–10 with movement vs. last week */
.fp4-lists--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fp4-chart__top { display: flex; gap: 12px; align-items: center; padding: 4px 0 10px; text-decoration: none; color: var(--fp4-ink); }
.fp4-chart__top img { width: 52px; height: 78px; object-fit: cover; border-radius: 8px; box-shadow: 0 2px 6px rgba(0, 0, 0, .18); flex: 0 0 auto; }
.fp4-chart__top span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fp4-chart__top small { font-size: 12px; font-weight: 800; color: var(--fp4-teal-dark); }
.fp4-chart__top b { font-size: 15.5px; line-height: 1.25; }
.fp4-chart__top:hover b { color: var(--fp4-teal-dark); }
.fp4-chart ol { counter-reset: fp4n 1; }
.fp4-chart li a { flex: 1; min-width: 0; }
.fp4-mv { flex: 0 0 auto; margin-left: auto; font-size: 11.5px; font-weight: 800; color: #9ca3af; font-variant-numeric: tabular-nums; }
.fp4-mv--up { color: #0d9488; }
.fp4-mv--down { color: #e0654f; }
.fp4-mv--new { color: #9333ea; }
@media (max-width: 900px) { .fp4-lists--two { grid-template-columns: 1fr; } }
