/*
 * News: the «Νέα» grid and cards, the category filter row, search, the article page, share row, YouTube
 * click-to-load and the photo lightbox. Orange stays out of here: categories and dates are muted, not orange.
 */

/* =========================================================
   Page head, filter row, search form
   ========================================================= */
.kfm-newspage__head { margin-bottom: 40px; }
.kfm-newspage__head .kfm-lead { margin-top: 12px; }

.kfm-filter { margin-top: 24px; }
.kfm-filter__list { display: flex; flex-wrap: wrap; gap: 10px; }
.kfm-filter__link {
	display: inline-flex; align-items: center;
	min-height: 44px; padding: 8px 20px;
	border: 1px solid var(--line); border-radius: 999px;
	background: var(--panel);
	color: var(--mute);
	font-size: 15px; font-weight: 500; line-height: 1.2;
	text-decoration: none; white-space: nowrap;
}
.kfm-filter__link:hover { border-color: var(--mute); color: var(--ink); }
.kfm-filter__link[aria-current="page"] { border-color: var(--ink); background: var(--bg); color: var(--ink); font-weight: 600; }

.kfm-crumbs { font-size: 15px; line-height: 1.4; color: var(--mute); }
.kfm-crumbs__list { display: flex; flex-wrap: wrap; align-items: center; }
.kfm-crumbs__list li + li::before { content: "›"; content: "›" / ""; margin-inline: 10px; color: var(--mute); opacity: .7; }
.kfm-crumbs a { display: inline-block; padding-block: 8px; color: var(--mute); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: .22em; }
.kfm-crumbs a:hover { color: var(--ink); text-decoration-color: var(--ink); }
.kfm-crumbs--single { margin: -8px 0 4px; }

.kfm-search__form { margin-top: 26px; }
.kfm-searchform { max-width: 600px; }
.kfm-searchform__field { position: relative; flex: 1; min-width: 0; }
.kfm-searchform__field .kfm-icon { position: absolute; left: 14px; top: 50%; width: 20px; height: 20px; margin-top: -10px; color: var(--mute); pointer-events: none; }
.kfm-searchform .search-field { min-height: 48px; padding-left: 44px; font-size: 17px; }
.kfm-searchform .search-field::-webkit-search-cancel-button { filter: invert(.7); }
.kfm-searchform .search-submit { min-height: 48px; }

/* =========================================================
   Grid: 1 column, 2 from 640 px, 3 from 1024 px
   ========================================================= */
.kfm-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px 24px; }
.kfm-grid__item { min-width: 0; }
.kfm-grid__ad { grid-column: 1 / -1; display: flex; justify-content: center; padding-block: 8px; border-block: 1px solid var(--line); }

/* ---------- Card ---------- */
.kfm-post { position: relative; display: flex; flex-direction: column; height: 100%; }
.kfm-post__poster {
	display: grid; place-items: center;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	border-radius: var(--radius);
	background: var(--panel);
}
.kfm-post__img { width: 100%; height: 100%; object-fit: contain; }
.kfm-post__mark { width: 60px; height: 60px; color: var(--line); }
.kfm-post__body { display: flex; flex-direction: column; padding-top: 14px; }
.kfm-post__cat { order: -1; margin-bottom: 6px; color: var(--mute); font-size: 13px; font-weight: 500; line-height: 1.3; }
.kfm-post__title { font-family: var(--font-text); font-size: 19px; font-weight: 600; line-height: 1.3; letter-spacing: 0; overflow-wrap: anywhere; }
.kfm-post__link { color: inherit; text-decoration: none; }
/* The title link covers the whole card: one link, one tab stop. */
.kfm-post__link::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: var(--radius); }
.kfm-post__link:focus-visible { outline: none; }
.kfm-post__link:focus-visible::after { outline: 2px solid var(--ink); outline-offset: 6px; }
.kfm-post:hover .kfm-post__link { text-decoration: underline; text-decoration-color: var(--mute); text-underline-offset: .2em; }
.kfm-post:hover .kfm-post__poster { background: var(--panel-hover); }
.kfm-post__excerpt {
	margin-top: 12px;
	color: var(--mute);
	font-size: 17px; line-height: 1.55;
	max-width: 40em;
	display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
}
.kfm-post__date { margin-top: 8px; color: var(--mute); font-size: 14px; line-height: 1.4; font-variant-numeric: tabular-nums; }

/* ---------- The lead card (first post, page 1) ---------- */
.kfm-post--lead .kfm-post__title {
	font-family: var(--font-display);
	font-weight: 800;
	font-size: clamp(30px, 6.4vw, 44px);
	line-height: 1.04;
	letter-spacing: -.005em;
	text-wrap: balance;
}
.kfm-post--lead .kfm-post__cat { font-size: 14px; }
.kfm-post--lead .kfm-post__date { margin-top: 12px; }

@media (min-width: 640px) {
	.kfm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.kfm-grid__item--lead { grid-column: 1 / -1; }
	.kfm-post--lead { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 28px; align-items: center; }
	.kfm-post--lead .kfm-post__body { padding-top: 0; }
}

@media (min-width: 1024px) {
	.kfm-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px 28px; }
	/* Two columns by two rows; the poster grows to fill, so it lines up with the two cards beside it. */
	.kfm-grid__item--lead { grid-column: span 2; grid-row: span 2; }
	.kfm-post--lead { display: flex; gap: 0; }
	/* No aspect-ratio here: with it, growing taller would also make the box wider than its column. */
	.kfm-post--lead .kfm-post__poster { flex: 1 1 auto; aspect-ratio: auto; width: 100%; min-height: 360px; }
	.kfm-post--lead .kfm-post__img { position: absolute; inset: 0; }
	.kfm-post--lead .kfm-post__poster { position: relative; }
	.kfm-post--lead .kfm-post__body { padding-top: 18px; }
	.kfm-post--lead .kfm-post__title { font-size: clamp(36px, 3.4vw, 46px); }
	.kfm-post--lead .kfm-post__excerpt { font-size: 18px; -webkit-line-clamp: 2; line-clamp: 2; }
}

/* ---------- Pages ---------- */
.kfm-newspage .pagination { margin-top: 56px; }
.kfm-newspage .pagination .prev, .kfm-newspage .pagination .next { padding-inline: 18px; font-weight: 500; }

/* =========================================================
   Article
   ========================================================= */
.kfm-article { padding-top: 32px; }
.kfm-article__main { max-width: 700px; margin-inline: auto; }
.kfm-article__side { display: none; }

@media (min-width: 1024px) {
	.kfm-article.has-side .kfm-article__layout { display: grid; grid-template-columns: minmax(0, 700px) 300px; gap: 64px; justify-content: center; align-items: start; }
	.kfm-article.has-side .kfm-article__main { margin-inline: 0; }
	.kfm-article__side { display: block; position: sticky; top: 24px; padding-top: 8px; }
}

.kfm-article__head { margin-bottom: 32px; }
.kfm-article__title { margin-top: 10px; font-size: clamp(36px, 5.4vw, 58px); line-height: 1.04; overflow-wrap: anywhere; }
.kfm-article__meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-top: 18px; color: var(--mute); font-size: 15px; font-variant-numeric: tabular-nums; }
.kfm-article__sep { opacity: .7; }

.kfm-article__image { margin: 0 0 40px; }
.kfm-article__zoom { display: flex; justify-content: center; overflow: hidden; border-radius: var(--radius); background: var(--panel); cursor: zoom-in; }
.kfm-article__img { width: auto; max-width: 100%; max-height: min(82vh, 900px); object-fit: contain; }
.kfm-article__image figcaption { margin-top: 10px; color: var(--mute); font-size: 14px; line-height: 1.5; }

/* ---------- Article text ---------- */
.kfm-article__body { max-width: none; font-size: 18px; line-height: 1.75; }
.kfm-article__body > p:first-child { font-size: 20px; line-height: 1.65; }
.kfm-article__body > * + * { margin-top: 1.15em; }
.kfm-article__body h2 { font-size: clamp(28px, 3.2vw, 34px); margin-top: 1.7em; }
.kfm-article__body h3 { font-size: 24px; margin-top: 1.6em; }
.kfm-article__body h4 { font-size: 19px; margin-top: 1.5em; }
.kfm-article__body h2 + *, .kfm-article__body h3 + *, .kfm-article__body h4 + * { margin-top: .55em; }
.kfm-article__body strong { font-weight: 600; }
.kfm-article__body ul, .kfm-article__body ol { padding-left: 1.4em; }
/* base.css resets lists that carry a class; the editor's lists (wp-block-list) are content and keep their markers. */
.kfm-prose ul.wp-block-list { list-style: disc; padding-left: 1.4em; }
.kfm-prose ol.wp-block-list { list-style: decimal; padding-left: 1.4em; }
.kfm-article__body li::marker { color: var(--mute); }
.kfm-article__body blockquote, .kfm-article__body .wp-block-quote {
	margin-inline: 0;
	padding: 4px 0 4px 22px;
	border-left: 3px solid var(--mute);
	color: var(--ink);
	font-size: 20px; line-height: 1.6;
	font-style: normal;
}
.kfm-article__body blockquote cite, .kfm-article__body .wp-block-quote cite { display: block; margin-top: 10px; color: var(--mute); font-size: 15px; font-style: normal; }
.kfm-article__body .wp-block-pullquote { padding: 28px 0; border-block: 1px solid var(--line); text-align: left; }
.kfm-article__body .wp-block-pullquote blockquote { border: 0; padding: 0; font-family: var(--font-display); font-weight: 600; font-size: 30px; line-height: 1.2; }
.kfm-article__body figure { margin-inline: 0; }
.kfm-article__body .wp-block-image img, .kfm-article__body .wp-caption img { border-radius: 6px; }
.kfm-article__body .alignwide, .kfm-article__body .alignfull { max-width: none; width: auto; margin-inline: 0; }
.kfm-article__body .wp-block-table { overflow-x: auto; }
.kfm-article__body table { font-size: 16px; font-variant-numeric: tabular-nums; }
.kfm-article__body thead th { color: var(--mute); font-size: 14px; font-weight: 600; border-bottom-color: var(--mute); }
.kfm-article__body .wp-block-table figcaption { text-align: left; }
.kfm-article__body .wp-block-separator { border: 0; border-top: 1px solid var(--line); margin-block: 2em; opacity: 1; }
.kfm-article__body .wp-block-button__link { border-radius: 999px; background: var(--panel); border: 1px solid var(--line); color: var(--ink); font-weight: 600; font-size: 16px; padding: 10px 22px; text-decoration: none; }
.kfm-article__body .wp-block-button__link:hover { border-color: var(--mute); }
.kfm-article__body iframe { max-width: 100%; }
.kfm-article__body pre { overflow-x: auto; max-width: 100%; padding: 14px 16px; background: var(--deep); border: 1px solid var(--line); border-radius: var(--radius); font-size: 15px; }
/* A YouTube link that names no video or playlist stays a plain link (never an iframe). */
.kfm-video-link, .kfm-embed-link { display: inline-block; }

/* Galleries: core's layout, our radius and gaps; photos that open in the lightbox get a zoom cursor. */
.kfm-article__body .wp-block-gallery.has-nested-images { gap: 10px; }
.kfm-article__body .wp-block-gallery.has-nested-images figure.wp-block-image img { border-radius: 4px; }
.kfm-article__body .wp-block-gallery.has-nested-images figure.wp-block-image figcaption { border-radius: 0 0 4px 4px; font-size: 13px; }
.kfm-article__body .gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.kfm-article__body .gallery-item { margin: 0 !important; width: auto !important; }
.kfm-article__body .gallery-item img { width: 100%; height: auto; border: 0 !important; border-radius: 4px; }
.kfm-article__body .gallery br { display: none; }
#kfm-main a[aria-haspopup="dialog"] { cursor: zoom-in; }

/* ---------- Share ---------- */
.kfm-share { margin-top: 52px; padding-top: 24px; border-top: 1px solid var(--line); }
.kfm-share__title { margin-bottom: 14px; font-family: var(--font-text); font-size: 15px; font-weight: 600; line-height: 1.3; letter-spacing: 0; color: var(--mute); }
.kfm-share__list { display: flex; flex-wrap: wrap; gap: 10px; }
.kfm-share__link {
	display: inline-flex; align-items: center; gap: 8px;
	min-height: 44px; padding: 8px 18px 8px 14px;
	border: 1px solid var(--line); border-radius: 999px;
	background: var(--panel); color: var(--ink);
	font-family: var(--font-text); font-size: 15px; font-weight: 500; line-height: 1.2;
	text-decoration: none; white-space: nowrap;
}
.kfm-share__link:hover { border-color: var(--mute); }
.kfm-share__link .kfm-icon { width: 18px; height: 18px; color: var(--mute); }
.kfm-share__link:hover .kfm-icon { color: var(--ink); }
.kfm-share__status { min-height: 1.6em; margin-top: 10px; color: var(--ink); font-size: 15px; }

/* ---------- Related ---------- */
.kfm-related { margin-top: 64px; padding-top: 44px; border-top: 1px solid var(--line); }

/* =========================================================
   YouTube: poster button, then the player
   ========================================================= */
.kfm-embed, .kfm-article__body .wp-block-embed { margin-inline: 0; }
.kfm-video {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	margin: 0; padding: 0;
	overflow: hidden;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: radial-gradient(120% 90% at 50% 38%, var(--panel-hover) 0%, var(--deep) 72%);
	color: var(--ink);
	font: inherit;
	text-align: left;
}
.kfm-video__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; border-radius: 0 !important; }
.kfm-video--poster { background: var(--deep); }
.kfm-video::after { content: ""; position: absolute; inset: auto 0 0; height: 55%; background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--deep) 85%, transparent)); pointer-events: none; }
.kfm-video__play {
	position: absolute; left: 50%; top: 46%; z-index: 1;
	display: grid; place-items: center;
	width: 76px; height: 76px; margin: -38px 0 0 -38px;
	border-radius: 50%;
	background: var(--ink); color: var(--bg);
	box-shadow: 0 6px 24px color-mix(in srgb, var(--deep) 60%, transparent);
}
.kfm-video__play .kfm-icon { width: 34px; height: 34px; margin-left: 4px; }
.kfm-video__text { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; display: flex; flex-direction: column; gap: 2px; padding: 16px 20px 18px; }
.kfm-video__title { font-weight: 600; font-size: 18px; line-height: 1.3; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.kfm-video__note { color: var(--mute); font-size: 13px; line-height: 1.4; }
.kfm-video:hover { border-color: var(--mute); }
.kfm-video:hover .kfm-video__play { box-shadow: 0 0 0 6px color-mix(in srgb, var(--ink) 22%, transparent), 0 6px 24px color-mix(in srgb, var(--deep) 60%, transparent); }
.kfm-video:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.kfm-video--on { aspect-ratio: 16 / 9; background: var(--deep); border-color: transparent; }
.kfm-video--on::after { display: none; }
.kfm-video--on iframe { display: block; width: 100%; height: 100%; border: 0; }
.kfm-video__out { display: none; }
.no-js .kfm-video__out { display: inline-block; margin-top: 8px; font-size: 15px; }
.wp-block-embed.is-provider-youtube .wp-block-embed__wrapper::before { display: none; }

@media (max-width: 599px) {
	.kfm-video__play { width: 60px; height: 60px; margin: -30px 0 0 -30px; top: 42%; }
	.kfm-video__play .kfm-icon { width: 28px; height: 28px; margin-left: 3px; }
	.kfm-video__text { padding: 10px 14px 12px; }
	.kfm-video__title { font-size: 15px; -webkit-line-clamp: 1; line-clamp: 1; }
	.kfm-video__note { font-size: 12px; }
}

/* =========================================================
   Lightbox (lightbox.js): a modal <dialog>, no animation
   ========================================================= */
.kfm-lb-open { overflow: hidden; }
.kfm-lb {
	position: fixed; inset: 0;
	width: 100%; height: 100%; max-width: none; max-height: none;
	margin: 0; padding: 0;
	border: 0;
	background: var(--deep);
	color: var(--ink);
	overscroll-behavior: contain;
}
.kfm-lb::backdrop { background: color-mix(in srgb, var(--deep) 92%, transparent); }
.kfm-lb[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.kfm-lb__bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px var(--gutter); }
.kfm-lb__count { font-family: var(--font-display); font-weight: 600; font-size: 22px; line-height: 1; color: var(--mute); font-variant-numeric: tabular-nums; }
.kfm-lb__btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-width: 44px; min-height: 44px; padding: 8px 16px 8px 12px;
	border: 1px solid var(--line); border-radius: 999px;
	background: var(--panel); color: var(--ink);
	font-size: 15px; font-weight: 500;
}
.kfm-lb__btn:hover { border-color: var(--mute); }
.kfm-lb__btn .kfm-icon { width: 20px; height: 20px; }
.kfm-lb__stage { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 0; margin: 0; padding: 0 84px 24px; }
.kfm-lb__img { flex: 0 1 auto; min-height: 0; width: auto; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; background: var(--panel); }
.kfm-lb__cap { flex: none; max-width: 64ch; margin-top: 14px; color: var(--mute); font-size: 15px; line-height: 1.5; text-align: center; }
.kfm-lb__nav { position: absolute; top: 50%; width: 56px; height: 56px; margin-top: -28px; padding: 0; border-radius: 50%; }
.kfm-lb__nav .kfm-icon { width: 26px; height: 26px; }
.kfm-lb__prev { left: 16px; }
.kfm-lb__next { right: 16px; }

@media (max-width: 639px) {
	.kfm-lb__stage { padding: 0 8px 92px; }
	.kfm-lb__nav { top: auto; bottom: 20px; margin-top: 0; width: 52px; height: 52px; }
	.kfm-lb__prev { left: calc(50% - 64px); }
	.kfm-lb__next { right: calc(50% - 64px); }
	.kfm-lb__close span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
	.kfm-lb__close { padding: 8px; }
}

/* =========================================================
   Phone
   ========================================================= */
@media (max-width: 639px) {
	.kfm-newspage__head { margin-bottom: 28px; }
	/* One row of filters that scrolls sideways, edge to edge. */
	.kfm-filter { margin-inline: calc(var(--gutter) * -1); }
	.kfm-filter .kfm-filter__list { flex-wrap: nowrap; overflow-x: auto; padding: 2px var(--gutter) 6px; scrollbar-width: none; }
	.kfm-filter__list::-webkit-scrollbar { display: none; }
	.kfm-filter__link { min-height: 40px; padding: 6px 16px; font-size: 14px; }
	.kfm-grid { gap: 36px; }
	.kfm-post__title { font-size: 18px; }
	.kfm-article { padding-top: 20px; }
	.kfm-article__head { margin-bottom: 24px; }
	.kfm-article__meta { margin-top: 14px; font-size: 14px; }
	.kfm-article__image { margin-bottom: 28px; margin-inline: calc(var(--gutter) * -1); }
	.kfm-article__zoom { border-radius: 0; }
	.kfm-article__image figcaption { padding-inline: var(--gutter); }
	.kfm-article__body { font-size: 17px; line-height: 1.7; }
	.kfm-article__body > p:first-child { font-size: 19px; }
	.kfm-article__body blockquote, .kfm-article__body .wp-block-quote { font-size: 18px; padding-left: 16px; }
	.kfm-share { margin-top: 40px; }
	.kfm-share__link { padding: 8px 14px 8px 12px; font-size: 14px; }
	.kfm-related { margin-top: 48px; padding-top: 32px; }
	.kfm-searchform { flex-wrap: wrap; }
	.kfm-searchform .search-submit { flex: 1 1 100%; }
}
