/*
Theme Name: Longform
Theme URI: https://jaten.indev.web.id/
Author: Longform
Author URI: https://jaten.indev.web.id/
Description: Tema blok (Full Site Editing) editorial bergaya jurnal pemikiran dengan grid artikel tiga kolom, gambar 3:2, tipografi serif Spectral, dan palet netral terang.
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 7.4
Version: 1.2.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: longform
Tags: blog, news, full-site-editing, block-patterns, block-styles, wide-blocks, one-column, two-columns, custom-colors, custom-logo, editor-style, featured-images, translation-ready
*/

.lf-header-inner {
	display: flex !important;
	width: min(1200px, calc(100vw - clamp(2rem, 14.4vw, 10.25rem))) !important;
	max-width: none !important;
	margin-left: auto !important;
	margin-right: auto !important;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.lf-header-brand {
	display: flex !important;
	align-items: center;
	gap: 2rem;
	min-width: 0;
}

.lf-header-brand .wp-block-site-logo {
	margin: 0;
	flex: 0 0 auto;
}

.lf-header-brand .wp-block-site-logo img {
	display: block;
	width: 80px;
	height: auto;
}

.lf-header-inner .lf-header-title {
	margin: 0;
	text-align: left;
	font-size: clamp(1.75rem, 3.8vw, 2.75rem) !important;
	line-height: 1.1;
}

.lf-header-inner .lf-header-nav {
	flex: 0 0 auto;
}

.lf-header-inner .lf-header-search {
	flex: 0 1 240px;
	min-width: 180px;
	margin: 0;
}

.lf-header-search .wp-block-search__inside-wrapper {
	box-sizing: border-box;
	height: 42px;
	border: 1px solid var(--wp--preset--color--line, #e3e0d8);
	border-radius: 0;
	padding: 0 0 0 12px;
}

.lf-header-search .wp-block-search__input {
	min-width: 0;
	border: 0;
	background: transparent;
	color: var(--wp--preset--color--contrast, #1a1a1a);
	font-family: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
	font-size: 14px;
}

.lf-header-search .wp-block-search__button {
	display: inline-flex;
	width: 42px;
	height: 40px;
	align-items: center;
	justify-content: center;
	margin: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: var(--wp--preset--color--contrast, #1a1a1a);
	padding: 0;
}

.lf-header-search .wp-block-search__button:hover {
	background: var(--wp--preset--color--surface, #f2f0ea);
}

.lf-header-search .wp-block-search__inside-wrapper:focus-within {
	outline: 2px solid var(--wp--preset--color--contrast, #1a1a1a);
	outline-offset: 2px;
}

.lf-site-header {
	padding-top: 20px !important;
	padding-bottom: 20px !important;
}

body .wp-site-blocks > header.wp-block-template-part {
	position: sticky;
	top: var(--wp-admin--admin-bar--position-offset, 0px);
	z-index: 1000;
	background-color: var(--wp--preset--color--base, #faf9f5);
	box-shadow: 0 3px 14px rgb(26 26 26 / 8%);
}

@media (max-width: 600px) {
	.lf-header-inner {
		width: calc(100vw - 2rem) !important;
		flex-wrap: wrap !important;
		gap: 0.75rem;
	}

	.lf-header-brand {
		flex: 1 1 auto;
		gap: 0.75rem;
	}

	.lf-header-inner .lf-header-nav {
		order: 2;
	}

	.lf-header-inner .lf-header-search {
		order: 3;
		flex: 1 0 100%;
		min-width: 0;
	}

	.lf-header-brand .wp-block-site-logo img {
		width: 48px;
	}

	.lf-header-inner .lf-header-title {
		font-size: clamp(1rem, 4.8vw, 1.35rem) !important;
	}
}

.lf-grid-card {
	height: 100%;
	display: flex;
	flex-direction: column;
	align-items: stretch !important;
}

.lf-grid-card .wp-block-post-featured-image {
	aspect-ratio: 16 / 9;
	overflow: hidden;
}

.lf-grid-card .wp-block-post-featured-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.lf-grid-card .wp-block-post-title a {
	text-decoration: none;
}

body .lf-grid-card h2.wp-block-post-title > a {
	display: -webkit-box !important;
	overflow: hidden;
	font-size: clamp(1.4rem, 2vw, 1.7rem) !important;
	line-height: 1.15;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
}

.lf-grid-card .wp-block-post-excerpt p {
	margin-top: 0;
}

body .lf-grid-card p.wp-block-post-excerpt__excerpt {
	display: -webkit-box !important;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 4;
}

.lf-more-pagination {
	justify-content: center !important;
}

.lf-more-pagination .lf-more-button {
	display: inline-flex;
	box-sizing: border-box;
	min-width: 104px;
	width: 104px;
	min-height: 46px;
	align-items: center;
	justify-content: center;
	padding: 0 1.25rem;
	background: #eeeeee;
	color: #5b5b5b;
	font-family: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
	font-size: 0.875rem;
	font-weight: 400;
	letter-spacing: 0.12em;
	line-height: 1;
	text-decoration: none;
	text-transform: uppercase;
	transition: background-color 160ms ease, color 160ms ease;
}

.lf-more-pagination .lf-more-button:hover {
	background: #e3e3e3;
	color: #1a1a1a;
}

.lf-more-pagination .lf-more-button:focus-visible {
	outline: 2px solid var(--wp--preset--color--contrast, #1a1a1a);
	outline-offset: 3px;
}

.lf-footer-archives select {
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	min-height: 38px;
	padding: 0.5rem 0.75rem;
	border: 1px solid var(--wp--preset--color--line, #e3e0d8);
	border-radius: 0;
	background: var(--wp--preset--color--base, #faf9f5);
	color: var(--wp--preset--color--contrast, #1a1a1a);
	font: inherit;
}

.lf-card-label,
.lf-card-meta {
	font-family: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
	text-align: left !important;
}

body .lf-grid-card .lf-card-label,
body .lf-grid-card .lf-card-meta {
	display: block !important;
	width: 100% !important;
}

.lf-card-label > p,
.lf-card-label > .wp-block-post-terms,
.lf-card-meta > * {
	display: inline-block;
	margin-right: 0.35rem;
}

.lf-card-meta {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
	margin-top: auto;
}

.lf-post-meta .wp-block-shortcode {
	display: contents;
}

.lf-post-meta {
	width: 100%;
	justify-content: space-between !important;
}

.lf-post-meta__byline {
	flex: 0 1 auto;
}

.lf-share {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	margin-left: auto;
}

.lf-share__link {
	display: inline-flex;
	width: 34px;
	height: 34px;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--wp--preset--color--line, #e3e0d8);
	border-radius: 50%;
	background: var(--wp--preset--color--base, #fff);
	color: var(--wp--preset--color--muted, #6b6a66);
	padding: 0;
	text-decoration: none;
	transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.lf-share__link svg {
	display: block;
	width: 16px;
	height: 16px;
	fill: currentColor;
}

.lf-share__link:hover,
.lf-share__link:focus-visible {
	border-color: var(--wp--preset--color--contrast, #1a1a1a);
	background: var(--wp--preset--color--contrast, #1a1a1a);
	color: var(--wp--preset--color--base, #fff);
}

.lf-share__link:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent, #8a3324);
	outline-offset: 2px;
}

.lf-share__status {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	clip-path: inset(50%);
}

/* ============================================================
   RESPONSIVE GLOBAL - layout rapi di semua perangkat
   ============================================================ */

html,
body {
	overflow-x: hidden;
}

img {
	max-width: 100%;
	height: auto;
}

/* Gambar & embed di dalam konten artikel */
.wp-block-post-content img,
.wp-block-post-content figure,
.wp-block-post-content iframe,
.wp-block-post-content video,
.wp-block-post-content object,
.wp-block-post-content embed {
	max-width: 100%;
}

.wp-block-post-content .wp-block-embed,
.wp-block-post-content .wp-block-video {
	margin-left: auto;
	margin-right: auto;
}

/* Tabel & pre di konten agar bisa discroll horizontal */
.wp-block-post-content table,
.wp-block-post-content pre {
	overflow-x: auto;
	display: block;
	max-width: 100%;
}

/* ---------- TABLET (601px - 781px) ---------- */
@media (max-width: 781px) {
	.lf-header-inner {
		gap: 0.75rem;
	}

	.lf-header-brand {
		gap: 1rem;
	}

	.lf-header-brand .wp-block-site-logo img {
		width: 56px;
	}

	.lf-header-inner .lf-header-title {
		font-size: clamp(1.25rem, 3.5vw, 1.75rem) !important;
	}

	.lf-header-inner .lf-header-search {
		flex: 0 1 200px;
		min-width: 140px;
	}

	.wp-block-query-pagination-numbers {
		flex-wrap: wrap;
		gap: 0.25rem;
	}

	.wp-block-post-navigation-link {
		width: 100%;
	}

	.wp-block-post-navigation-link + .wp-block-post-navigation-link {
		margin-top: 0.75rem;
	}
}

/* ---------- MOBILE (sampai 600px) ---------- */
@media (max-width: 600px) {
	.lf-post-meta {
		align-items: flex-start !important;
	}

	.lf-share {
		flex: 1 0 100%;
		gap: 0.35rem;
		margin-left: auto;
		justify-content: flex-end;
	}

	.lf-share__link {
		width: 36px;
		height: 36px;
	}

	.lf-header-inner .lf-header-search {
		flex: 1 0 100%;
	}

	main.wp-block-group {
		margin-top: 2rem !important;
	}

	.single h1.wp-block-post-title,
	.search-results h1,
	.archive h1 {
		font-size: clamp(1.6rem, 8vw, 2.2rem) !important;
	}

	.wp-block-post-navigation-link {
		width: 100%;
	}

	.wp-block-categories-list {
		font-size: 0.875rem;
	}

	footer.wp-block-group {
		padding-left: 1rem !important;
		padding-right: 1rem !important;
	}
}

/* ---------- MOBILE KECIL (sampai 380px) ---------- */
@media (max-width: 380px) {
	.lf-header-brand .wp-block-site-logo img {
		width: 40px;
	}

	.lf-header-inner .lf-header-title {
		font-size: clamp(1rem, 5.5vw, 1.2rem) !important;
	}

	.lf-more-pagination .lf-more-button {
		width: 88px;
		min-width: 88px;
	}
}
