/* Shareable feeds — viewer (/feed/{token}), hub (/feeds), editor (/feeds/{token}),
   the "+ Feed" button + picker sheet on /saved. Dark, app-consistent; reuses the
   saved-grid tile feel (aspect-ratio 1/1.2, 7px radius, --ek-accent). */

:root { --ek-accent: var(--ek-accent, #ff2d55); }

.ek-feed-view,
.ek-feeds-hub,
.ek-feed-edit { max-width: 760px; margin: 0 auto; padding: 20px 12px 96px; color: #f2f2f2; }

/* shared tile look (viewer + cards + editor) */
.ek-feed-tile img, .ek-feed-ph,
.ek-feed-edit-tile img,
.ek-feed-add-tile img {
	width: 100%; aspect-ratio: 1 / 1.2; object-fit: cover;
	border-radius: 7px; background: #15151a; display: block;
}
.ek-feed-ph { background: linear-gradient(135deg, #1b1b22, #14141a); display: block; aspect-ratio: 1 / 1.2; border-radius: 7px; }

/* ---- Viewer ------------------------------------------------------------- */
/* Reset the parent theme's global site-header rules (display:flex, a fixed
   height, a white background + shadow) so our content header flows normally,
   grows with its content, and keeps the dark app background. */
.ek-feed-head { display: block; height: auto; min-height: 0; padding: 6px 4px 16px; background: transparent; box-shadow: none; }
.ek-feed-kicker { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ek-accent); font-weight: 700; margin: 0 0 4px; }
.ek-feed-title { font-size: 1.6rem; font-weight: 800; margin: 0 0 6px; line-height: 1.2; }
.ek-feed-desc { color: #cfcfcf; margin: 0 0 8px; }
.ek-feed-meta { color: #9a9a9a; font-size: 0.9rem; margin: 0; }
.ek-feed-manage-link { display: inline-block; margin-top: 10px; color: var(--ek-accent); text-decoration: none; font-weight: 600; font-size: 0.9rem; }

/* Reaction bar (login-to-react) */
.ek-feed-reactions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.ek-react {
	display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
	background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08);
	border-radius: 999px; padding: 6px 12px; color: #e8e8ea; line-height: 1;
	-webkit-tap-highlight-color: transparent; transition: background 0.12s ease, border-color 0.12s ease, transform 0.08s ease;
}
.ek-react:hover { background: rgba(255,255,255,0.1); }
.ek-react:active { transform: scale(0.94); }
.ek-react.is-mine { background: rgba(255,45,85,0.16); border-color: var(--ek-accent); }
.ek-react.is-busy { opacity: 0.6; }
.ek-react-emoji { font-size: 1.08rem; }
.ek-react-count { font-size: 0.82rem; font-weight: 700; min-width: 0.5em; color: #cfcfcf; }
.ek-react.is-mine .ek-react-count { color: #fff; }
.ek-react-count.is-zero { display: none; }
.ek-react-hint { font-size: 0.78rem; color: #8a8a93; margin-left: 2px; }

.ek-feed-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
@media (max-width: 420px) { .ek-feed-grid { grid-template-columns: repeat(2, 1fr); } }
.ek-feed-tile { display: block; line-height: 0; text-decoration: none; }

.ek-feed-empty { text-align: center; padding: 64px 16px; }
.ek-feed-empty-title { font-size: 1.1rem; font-weight: 700; margin: 0 0 6px; }
.ek-feed-empty-sub { color: #9a9a9a; margin: 0; }
.ek-feed-empty-sub a { color: var(--ek-accent); }

/* ---- Hub ---------------------------------------------------------------- */
.ek-feeds-hub-head { display: flex; height: auto; min-height: 0; background: transparent; box-shadow: none; align-items: center; justify-content: space-between; padding: 4px 4px 14px; }
.ek-feeds-hub-title { font-size: 1.5rem; font-weight: 800; margin: 0; }
.ek-feeds-new {
	border: 0; cursor: pointer; font-weight: 700; font-size: 0.9rem;
	background: var(--ek-accent); color: #fff; border-radius: 999px; padding: 9px 18px;
	-webkit-tap-highlight-color: transparent;
}
.ek-feeds-new:disabled { opacity: 0.6; cursor: default; }

.ek-feeds-section { margin-top: 22px; }
.ek-feeds-section-title { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #8a8a93; margin: 0 0 12px; }
.ek-feeds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }

.ek-feed-card {
	position: relative; display: flex; flex-direction: column;
	background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06);
	border-radius: 14px; overflow: hidden; transition: border-color 0.15s ease, transform 0.15s ease;
}
.ek-feed-card:hover { border-color: rgba(255,255,255,0.16); transform: translateY(-2px); }

/* Playlist-style mosaic cover: a square frame of up to four item posters. */
.ek-feed-card-cover { display: block; line-height: 0; }
.ek-mosaic {
	display: grid; gap: 2px; aspect-ratio: 1 / 1; background: #0e0e12;
	grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr;
}
.ek-mosaic img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 0; aspect-ratio: auto; }
.ek-mosaic .ek-feed-ph { grid-column: 1 / 3; grid-row: 1 / 3; aspect-ratio: auto; border-radius: 0; }
.ek-mosaic.is-1 img { grid-column: 1 / 3; grid-row: 1 / 3; }            /* single poster fills the frame */
.ek-mosaic.is-2 img { grid-row: 1 / 3; }                                /* two full-height columns */
.ek-mosaic.is-3 img:first-child { grid-row: 1 / 3; }                    /* tall left, two stacked right */

.ek-feed-card-body { padding: 11px 12px 13px; }
.ek-feed-card-title { display: block; font-weight: 700; font-size: 0.95rem; color: #f4f4f6; text-decoration: none; line-height: 1.25; margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ek-feed-card-sub { color: #8a8a93; font-size: 0.8rem; margin: 0; }
.ek-feed-card-del {
	position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; padding: 0;
	display: flex; align-items: center; justify-content: center; border: 0; border-radius: 50%;
	cursor: pointer; color: #fff; background: rgba(8,8,10,0.62);
	-webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.ek-feed-card-del svg { width: 15px; height: 15px; }
.ek-feed-card-del:hover { background: var(--ek-accent); }

.ek-feeds-empty { padding: 22px 4px; }
.ek-feeds-empty-title { font-weight: 700; margin: 0 0 4px; }
.ek-feeds-empty-sub { color: #9a9a9a; margin: 0; }
.ek-feeds-empty-sub a { color: var(--ek-accent); }

/* ---- Editor ------------------------------------------------------------- */
.ek-feed-back { display: inline-block; color: #9a9a9a; text-decoration: none; font-size: 0.9rem; margin-bottom: 12px; }
.ek-feed-back:hover { color: #f2f2f2; }

.ek-feed-edit-head { display: block; height: auto; min-height: 0; background: transparent; box-shadow: none; position: relative; margin-bottom: 18px; } /* reset parent site-header rules */
.ek-feed-edit-title {
	width: 100%; background: transparent; border: 0; border-bottom: 1px solid rgba(255,255,255,0.12);
	color: #fff; font-size: 1.4rem; font-weight: 800; padding: 4px 2px 8px; outline: none;
}
.ek-feed-edit-title:focus { border-bottom-color: var(--ek-accent); }
.ek-feed-edit-desc {
	width: 100%; margin-top: 10px; resize: vertical; background: rgba(255,255,255,0.04);
	border: 1px solid rgba(255,255,255,0.08); border-radius: 8px; color: #e6e6e6; padding: 9px 11px;
	font: inherit; font-size: 0.95rem; line-height: 1.4; outline: none;
	min-height: 60px; height: 64px; /* override the parent theme's tall textarea min-height */
}
.ek-feed-edit-desc::placeholder { color: #7a7a82; }
.ek-feed-edit-desc:focus { border-color: var(--ek-accent); }
.ek-feed-edit-saved { position: absolute; right: 2px; top: -2px; font-size: 0.74rem; color: #6fcf97; font-weight: 600; }

.ek-feed-share { background: rgba(255,255,255,0.04); border-radius: 12px; padding: 14px 14px 16px; margin-bottom: 20px; }
.ek-feed-share-title { font-size: 1rem; font-weight: 700; margin: 0 0 12px; }
.ek-feed-share-link { display: flex; gap: 8px; }
.ek-feed-share-link input {
	flex: 1; min-width: 0; background: #0e0e12; border: 1px solid rgba(255,255,255,0.1);
	border-radius: 8px; color: #cfcfcf; padding: 9px 10px; font-size: 0.85rem; outline: none;
}
.ek-feed-copy, .ek-feed-send {
	border: 0; cursor: pointer; font-weight: 700; white-space: nowrap;
	background: var(--ek-accent); color: #fff; border-radius: 8px; padding: 9px 16px;
}
.ek-feed-copy:disabled, .ek-feed-send:disabled { opacity: 0.6; cursor: default; }

.ek-feed-vis { border: 0; margin: 16px 0 4px; padding: 0; }
.ek-feed-vis legend { font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: #9a9a9a; padding: 0; margin-bottom: 10px; }
/* Option cards. The whole row is the hit target; the native radio is restyled
   into a small custom dot (explicit size + appearance:none defeats the parent
   theme's global input{} sizing, which otherwise blows the radios up huge). */
.ek-feed-vis label {
	display: flex; gap: 12px; align-items: flex-start;
	padding: 12px 14px; margin-bottom: 8px; cursor: pointer;
	font-size: 0.9rem; line-height: 1.35;
	background: rgba(255,255,255,0.03);
	border: 1px solid rgba(255,255,255,0.09);
	border-radius: 12px;
	transition: border-color .15s ease, background .15s ease;
}
.ek-feed-vis label:last-child { margin-bottom: 0; }
.ek-feed-vis label:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.18); }
.ek-feed-vis label:has(input:checked) {
	border-color: var(--ek-accent, #ff2d55);
	background: rgba(255,45,85,0.10);
	background: color-mix(in srgb, var(--ek-accent, #ff2d55) 13%, transparent);
}
/* !important on the border defeats the parent theme's global input{ border-color:
   #ddd !important }; explicit accent fallbacks because --ek-accent resolves invalid
   on this surface (self-referential :root definition). */
.ek-feed-vis input[type="radio"] {
	appearance: none; -webkit-appearance: none;
	flex: 0 0 auto; box-sizing: border-box;
	width: 18px; height: 18px; margin: 1px 0 0; padding: 0;
	border: 2px solid #6a6a72 !important; border-radius: 50%;
	background: transparent; cursor: pointer;
	transition: border-color .15s ease;
}
.ek-feed-vis input[type="radio"]:checked { border-color: var(--ek-accent, #ff2d55) !important; }
.ek-feed-vis input[type="radio"]:checked::after {
	content: ""; display: block; width: 8px; height: 8px; margin: 3px;
	border-radius: 50%; background: var(--ek-accent, #ff2d55);
}
.ek-feed-vis input[type="radio"]:focus-visible { outline: 2px solid var(--ek-accent); outline-offset: 2px; }
.ek-feed-vis .ek-vis-text { display: block; }
.ek-feed-vis .ek-vis-text strong { display: block; font-weight: 700; color: #f2f2f2; }
.ek-feed-vis .ek-vis-sub { display: block; color: #9a9aa2; font-size: 0.82rem; margin-top: 2px; }

.ek-feed-sendto { margin-top: 12px; }
.ek-feed-sendto label { display: block; font-size: 0.82rem; color: #9a9a9a; margin-bottom: 6px; }
.ek-feed-sendto-row { display: flex; gap: 8px; }
.ek-feed-sendto-row input {
	flex: 1; min-width: 0; background: #0e0e12; border: 1px solid rgba(255,255,255,0.1);
	border-radius: 8px; color: #e6e6e6; padding: 11px 12px; outline: none; font-size: 16px;
}
.ek-feed-sendto-row input::placeholder { color: #7a7a82; }
.ek-feed-sendto-row input:focus { border-color: var(--ek-accent); }
.ek-feed-sendto-msg { font-size: 0.82rem; margin: 8px 0 0; min-height: 1em; }
.ek-feed-sendto-msg.is-ok { color: #6fcf97; }
.ek-feed-sendto-msg.is-err { color: #ff6b6b; }

.ek-feed-regen { margin-top: 14px; background: transparent; border: 1px solid rgba(255,255,255,0.14); color: #cfcfcf; border-radius: 8px; padding: 9px 14px; cursor: pointer; font-weight: 600; font-size: 0.85rem; }
.ek-feed-regen:hover { border-color: #ff6b6b; color: #ff6b6b; }
.ek-feed-regen-note { color: #777; font-weight: 400; }

.ek-feed-items-title { font-size: 1.05rem; font-weight: 700; margin: 0 0 4px; }
.ek-feed-items-count { font-size: 0.8rem; color: #9a9a9a; background: rgba(255,255,255,0.06); border-radius: 999px; padding: 2px 9px; margin-left: 4px; }
.ek-feed-items-hint { color: #9a9a9a; font-size: 0.82rem; margin: 0 0 12px; }

.ek-feed-edit-grid, .ek-feed-add-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
@media (max-width: 420px) { .ek-feed-edit-grid, .ek-feed-add-grid { grid-template-columns: repeat(2, 1fr); } }

.ek-feed-edit-tile { position: relative; cursor: grab; transition: opacity 0.2s ease, transform 0.15s ease; }
.ek-feed-edit-tile.is-dragging { opacity: 0.5; cursor: grabbing; }
.ek-feed-edit-tile.is-removing { opacity: 0; transform: scale(0.92); }
.ek-feed-edit-remove {
	position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; padding: 0;
	display: flex; align-items: center; justify-content: center; border: 0; border-radius: 50%;
	cursor: pointer; color: #fff; background: rgba(8,8,10,0.62);
	-webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.ek-feed-edit-remove svg { width: 15px; height: 15px; }
.ek-feed-edit-remove:hover { background: var(--ek-accent); }

.ek-feed-items-empty { color: #9a9a9a; padding: 18px 2px; }

.ek-feed-add { margin-top: 24px; }
.ek-feed-add-title { font-size: 1.05rem; font-weight: 700; margin: 0 0 12px; }
.ek-feed-add-empty { color: #9a9a9a; }
.ek-feed-add-tile { position: relative; padding: 0; border: 0; background: none; cursor: pointer; line-height: 0; }
.ek-feed-add-plus {
	position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
	font-size: 2rem; font-weight: 300; color: #fff; background: rgba(8,8,10,0.35);
	border-radius: 7px; opacity: 0; transition: opacity 0.15s ease;
}
.ek-feed-add-tile:hover .ek-feed-add-plus, .ek-feed-add-tile:focus .ek-feed-add-plus { opacity: 1; }

/* ---- "+ Feed" button on /saved tiles ----------------------------------- */
.ek-feed-add-btn {
	position: absolute; left: 6px; bottom: 6px;
	display: inline-flex; align-items: center; gap: 4px; padding: 5px 9px 5px 7px;
	border: 0; border-radius: 999px; cursor: pointer;
	color: #fff; background: rgba(8,8,10,0.62); font-size: 0.74rem; font-weight: 700;
	-webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
	-webkit-tap-highlight-color: transparent;
}
.ek-feed-add-btn svg { width: 13px; height: 13px; }
.ek-feed-add-btn:hover { background: var(--ek-accent); }

/* ---- Picker sheet ------------------------------------------------------- */
.ek-feed-sheet { position: fixed; inset: 0; z-index: 9999; }
.ek-feed-sheet[hidden] { display: none; }
.ek-feed-sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.55); }
.ek-feed-sheet-panel {
	position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 480px;
	background: #16161c; border-radius: 16px 16px 0 0; padding: 8px 16px calc(20px + env(safe-area-inset-bottom));
	max-height: 80vh; overflow-y: auto;
	animation: ek-sheet-up 0.18s ease;
}
@keyframes ek-sheet-up { from { transform: translateY(16px); opacity: 0.6; } to { transform: translateY(0); opacity: 1; } }
.ek-feed-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 2px 12px; }
.ek-feed-sheet-head h2 { font-size: 1.05rem; font-weight: 700; margin: 0; color: #f2f2f2; }
.ek-feed-sheet-close { border: 0; background: none; color: #9a9a9a; cursor: pointer; padding: 4px; }
.ek-feed-sheet-close svg { width: 20px; height: 20px; }
.ek-feed-sheet-loading, .ek-feed-sheet-empty { color: #9a9a9a; text-align: center; padding: 18px; margin: 0; }

.ek-feed-row {
	width: 100%; display: flex; align-items: center; gap: 10px; text-align: left;
	background: none; border: 0; border-radius: 10px; padding: 12px 10px; cursor: pointer; color: #f2f2f2;
}
.ek-feed-row:hover { background: rgba(255,255,255,0.05); }
.ek-feed-row.is-busy { opacity: 0.5; }
.ek-feed-row-title { flex: 1; font-weight: 600; }
.ek-feed-row-count { font-size: 0.78rem; color: #9a9a9a; }
.ek-feed-row-tick { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.2); flex: none; position: relative; }
.ek-feed-row.is-in .ek-feed-row-tick { background: var(--ek-accent); border-color: var(--ek-accent); }
.ek-feed-row.is-in .ek-feed-row-tick::after {
	content: ''; position: absolute; left: 7px; top: 3px; width: 5px; height: 10px;
	border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}

.ek-feed-sheet-new { display: flex; gap: 8px; padding: 12px 2px 6px; border-top: 1px solid rgba(255,255,255,0.08); margin-top: 6px; }
.ek-feed-sheet-new input {
	flex: 1; min-width: 0; background: #0e0e12; border: 1px solid rgba(255,255,255,0.1);
	border-radius: 8px; color: #e6e6e6; padding: 11px 12px; outline: none;
	font-size: 16px; line-height: 1.3; /* 16px keeps it legible and stops iOS zoom-on-focus. */
}
.ek-feed-sheet-new input::placeholder { color: #7a7a82; }
.ek-feed-sheet-new input:focus { border-color: var(--ek-accent); }
.ek-feed-sheet-new button { border: 0; cursor: pointer; font-weight: 700; font-size: 0.9rem; background: var(--ek-accent); color: #fff; border-radius: 8px; padding: 9px 16px; }
.ek-feed-sheet-new button:disabled { opacity: 0.6; }
.ek-feed-sheet-manage { display: block; text-align: center; color: var(--ek-accent); text-decoration: none; font-weight: 600; font-size: 0.88rem; padding: 12px 0 4px; }

body.ek-feed-sheet-open { overflow: hidden; }

/* ---- Shared-feed player (intro + end slides) --------------------------- */
/* The parent theme's full-viewport .swiper height is scoped to body classes our
   virtual /feed route doesn't have, so we size the player container ourselves and
   give the slides a fixed (non-recursive) height to fill it. */
/* The player adopts the parent's `media-body` immersive layout (body class added on
   the /feed route): <main> goes full-bleed absolute and the parent's `.swiper{height:
   100%}` fills it — same as home. So height is just 100% of that full-bleed main; do
   NOT pin to 100dvh here (that ignores the admin-bar offset and overflows again). */
.ek-feedplay-swiper { height: 100%; }
.ek-feedplay-swiper > .swiper-wrapper > .swiper-slide { height: 100%; }

/* Scope under .ek-feedplay-swiper so `display:flex` beats Swiper's own
   `.swiper-slide{display:block}` — swiper-bundle.css loads after feeds.css, so an
   unscoped .ek-fp-slide (equal specificity) loses the cascade and the card falls
   into top-left block flow instead of centering. This is what made the intro/end
   pages look "squished" in the corner on desktop. */
.ek-feedplay-swiper .ek-fp-slide {
	display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
	height: 100%; padding: 32px 24px; box-sizing: border-box; color: #f4f4f6;
	background: radial-gradient(120% 120% at 50% 0%, #1a1a22 0%, #0b0b0f 70%);
}
.ek-fp-intro-inner, .ek-fp-end-inner { max-width: 440px; width: 100%; }

.ek-fp-kicker { font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ek-accent); font-weight: 800; margin: 0 0 10px; }
.ek-fp-title { font-size: 2rem; font-weight: 800; line-height: 1.15; margin: 0 0 12px; }
.ek-fp-desc { color: #c4c4cc; font-size: 1rem; line-height: 1.5; margin: 0 0 14px; }
.ek-fp-meta { color: #8a8a93; font-size: 0.9rem; margin: 0 0 28px; }

.ek-fp-start, .ek-fp-again {
	-webkit-appearance: none; appearance: none; border: 0; cursor: pointer;
	background: var(--ek-accent); color: #fff; font-weight: 800; font-size: 1rem;
	border-radius: 999px; padding: 14px 34px; -webkit-tap-highlight-color: transparent;
	box-shadow: 0 6px 22px rgba(255,45,85,0.32); transition: transform 0.08s ease, box-shadow 0.15s ease;
}
.ek-fp-start:active, .ek-fp-again:active { transform: scale(0.96); }

.ek-fp-hint { margin: 22px 0 0; color: #7a7a82; font-size: 0.84rem; display: flex; flex-direction: column; align-items: center; gap: 7px; }
.ek-fp-chev { width: 18px; height: 18px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); animation: ek-fp-bounce 1.5s ease-in-out infinite; }
@keyframes ek-fp-bounce { 0%, 100% { transform: rotate(45deg) translate(0,0); opacity: 0.5; } 50% { transform: rotate(45deg) translate(4px,4px); opacity: 1; } }

.ek-fp-end-check { width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(255,45,85,0.14); color: var(--ek-accent); }
.ek-fp-end-check svg { width: 34px; height: 34px; }
.ek-fp-end-title { font-size: 1.5rem; font-weight: 800; margin: 0 0 8px; }
.ek-fp-end-sub { color: #9a9a9a; font-size: 0.92rem; margin: 0 0 22px; line-height: 1.45; }
.ek-fp-reactions { justify-content: center; margin: 0 0 26px; }
.ek-fp-end-actions { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.ek-fp-manage { color: var(--ek-accent); text-decoration: none; font-weight: 700; font-size: 0.92rem; }
