/*
Theme Name: Fuqer Blog V1.0
Theme URI: https://blog.fuqer.com/
Author: JM
Author URI: https://www.fuqer.com/
Description: A clean, modern Fuqer-styled block theme for a fast, readable blog with a light-card UI, bold accent color, and practical post layouts.
Requires at least: 6.7
Tested up to: 6.8
Requires PHP: 7.2
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: twentytwentyfive
Tags: one-column, custom-colors, custom-menu, custom-logo, editor-style, featured-images, full-site-editing, block-patterns, rtl-language-support, sticky-post, threaded-comments, translation-ready, wide-blocks, block-styles, style-variations, accessibility-ready, blog, portfolio, news
*/

/*
 * Link styles
 * https://github.com/WordPress/gutenberg/issues/42319
 */
a {
	text-decoration-thickness: 1px !important;
	text-underline-offset: .1em;
}

/* Focus styles */
:where(.wp-site-blocks *:focus) {
	outline-width: 2px;
	outline-style: solid;
}

/* Increase the bottom margin on submenus, so that the outline is visible. */
.wp-block-navigation .wp-block-navigation-submenu .wp-block-navigation-item:not(:last-child) {
	margin-bottom: 3px;
}

/* Increase the outline offset on the parent menu items, so that the outline does not touch the text. */
.wp-block-navigation .wp-block-navigation-item .wp-block-navigation-item__content {
	outline-offset: 4px;
}

/* Remove outline offset from the submenus, otherwise the outline is visible outside the submenu container. */
.wp-block-navigation .wp-block-navigation-item ul.wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	outline-offset: 0;
}

/*
 * Progressive enhancement to reduce widows and orphans
 * https://github.com/WordPress/gutenberg/issues/55190
 */
h1, h2, h3, h4, h5, h6, blockquote, caption, figcaption, p {
	text-wrap: pretty;
}

/*
 * Change the position of the more block on the front, by making it a block level element.
 * https://github.com/WordPress/gutenberg/issues/65934
*/
.more-link {
	display: block;
}

/*
 * Fuqer Blog styling (theme-level additions)
 *
 * Note: This theme relies primarily on theme.json for styling. This stylesheet
 * contains a small set of opinionated "card UI" utilities and navigation tweaks.
 */
:root {
	--fuqer-accent: #ef237b;
	--fuqer-accent-soft: #fff7fb;
	--fuqer-bg: #f3f5fa;
	--fuqer-card: #ffffff;
	--fuqer-text: #0a0d1a;
	--fuqer-muted: #66686f;
	--fuqer-border: rgba(172, 176, 186, 0.55);
	--fuqer-shadow: 0 0 26px 1px rgba(50, 50, 60, 0.15);
}

/* Screen-reader-only utility (keeps SEO/structure without affecting layout). */
.fuqer-sr-only {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

body {
	background: var(--fuqer-bg);
}

/* Tame oversized post titles that come from legacy/unused patterns on archive/home/index pages. */
.wp-block-query .wp-block-post-title.has-x-large-font-size {
	font-size: var(--wp--preset--font-size--large) !important;
	line-height: 1.15;
}

/* Footer typography: keep it compact even if the footer content was edited in the Site Editor. */
.wp-site-blocks > .wp-block-template-part:last-child p.has-accent-4-color.has-text-color {
	font-size: var(--wp--preset--font-size--small) !important;
}

.wp-site-blocks > .wp-block-template-part:last-child h1.wp-block-heading {
	font-size: var(--wp--preset--font-size--x-large) !important;
}

/* Remove the divider line shown under the footer search section. */
.wp-site-blocks > .wp-block-template-part:last-child .wp-block-separator,
.wp-site-blocks > .wp-block-template-part:last-child hr {
	display: none !important;
}

body.single .wp-block-group.alignwide.is-style-fuqer-card {
	/* Single post card padding (applies to title + meta + content equally). */
	padding: clamp(10px, 4vw, 50px) !important;
	box-sizing: border-box;
}

/* Reduce the big "top margin" gap on single posts as the viewport shrinks (overrides inline style). */
body.single main.wp-block-group {
	margin-top: clamp(16px, 4vw, 40px) !important;
}

/* Make global padding responsive; on mobile it should cap at 10px. */
.has-global-padding {
	padding-left: clamp(10px, 2.5vw, var(--wp--style--root--padding-left)) !important;
	padding-right: clamp(10px, 2.5vw, var(--wp--style--root--padding-right)) !important;
}

/* The post card is alignwide, but its inner blocks were still constrained to content-size,
   creating large empty side gutters inside the card. Let the inner blocks use full card width. */
body.single .wp-block-group.alignwide.is-style-fuqer-card.is-layout-constrained
	> :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
	max-width: 100% !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
}

/* Some posts have "alignfull" blocks inside the card (especially images). Prevent them from
   bleeding to the card edge, otherwise the card padding will appear to be missing. */
body.single .wp-block-group.alignwide.is-style-fuqer-card :where(.alignfull, .alignwide) {
	max-width: 100% !important;
	width: auto !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
}

/* post-content itself is "constrained" too; remove its inner width limit so the hero image + text can
   use the full width of the post card. */
body.single .wp-block-group.alignwide.is-style-fuqer-card
	.wp-block-post-content.is-layout-constrained
	> :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
	max-width: 100% !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
}

/* Make content images scale to the full available width (otherwise they keep their intrinsic px width). */
body.single .wp-block-group.alignwide.is-style-fuqer-card .wp-block-post-content figure.wp-block-image,
body.single .wp-block-group.alignwide.is-style-fuqer-card .wp-block-post-content figure.wp-block-image img {
	max-width: 100% !important;
	width: 100% !important;
}

/* Keep the same padding on mobile; it reads better with full-bleed media. */

/* core/post-content can carry global padding; we already have card padding. */
body.single .is-style-fuqer-card .wp-block-post-content.has-global-padding {
	padding-left: 0 !important;
	padding-right: 0 !important;
}

/* Slightly smaller body text on single posts. */
body.single .wp-block-post-content {
	font-size: 0.95rem;
	line-height: 1.7;
}

body.single .wp-block-post-content p,
body.single .wp-block-post-content li {
	font-size: inherit;
	line-height: inherit;
}

a {
	color: var(--fuqer-accent);
}

a:hover {
	text-decoration: underline;
}

/* Optional group style: Card */
.is-style-fuqer-card {
	background: var(--fuqer-card);
	border: 1px solid var(--fuqer-border);
	border-radius: 20px;
	box-shadow: var(--fuqer-shadow);
	padding: 10px!important;
}

.is-style-fuqer-card > :first-child {
	margin-top: 0;
}

.is-style-fuqer-card > :last-child {
	margin-bottom: 0;
}

.is-style-fuqer-card img,
.is-style-fuqer-card .wp-block-post-featured-image img {
	border-radius: 16px;
}

/* Make sure post "featured image" blocks behave like thumbnails when using aspect-ratio. */
.wp-block-post-featured-image {
	display: block;
	line-height: 0;
}

.wp-block-post-featured-image img {
	display: block;
}

/* If a style variation applies duotone filters, force media to render normally. */
.wp-block-post-featured-image img,
.wp-block-image img,
.wp-block-cover img,
img.wp-image-0 {
	filter: none !important;
}

.wp-block-post-featured-image,
.wp-block-image,
.wp-block-cover {
	filter: none !important;
}

.wp-duotone-filter {
	filter: none !important;
}

/* Header navigation: pill hover + no "gap" flicker into submenus */
.fuqer-header {
	position: sticky;
	top: 0;
	z-index: 999;
	background: rgba(255, 255, 255, 0.92);
	backdrop-filter: blur(10px);
}

.fuqer-header .wp-block-site-title a {
	color: var(--fuqer-text);
	text-decoration: none;
}

.fuqer-header .wp-block-site-title a:hover {
	color: var(--fuqer-accent);
	text-decoration: none;
}

.wp-block-navigation .wp-block-navigation-item__content {
	border-radius: 999px;
	padding: 10px 12px;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.wp-block-navigation .wp-block-navigation-item__content:hover {
	background: var(--fuqer-accent-soft);
	color: var(--fuqer-accent);
	text-decoration: none;
}

.wp-block-navigation .wp-block-navigation__submenu-container {
	margin-top: 0;
	padding-top: 8px;
}

.wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	border-radius: 12px;
	padding: 8px 10px;
}

/* Post cards: keep excerpt readable and avoid huge margins */
.wp-block-post-excerpt__excerpt {
	color: var(--fuqer-muted);
	font-size: 90%;
}
.wp-block-post-excerpt__more-link {
    display: inline-block;
    font-size: 80%;
}

.wp-block-post-date {
	color: var(--fuqer-muted);
}

/* Search block: nicer input/button defaults */
.wp-block-search__inside-wrapper {
	border-radius: 999px;
	overflow: hidden;
	border: 1px solid var(--fuqer-border);
	background: var(--fuqer-card);
	box-shadow: 0 4px 6px rgba(172, 176, 186, 0.18);
}

.wp-block-search__input {
	border: 0;
	padding: 12px 14px;
	background: transparent;
}

.wp-block-search__button {
	border: 0;
	background: var(--fuqer-accent);
	color: #ffffff;
	padding: 12px 16px;
}

.wp-block-search__button:hover {
	filter: brightness(0.95);
}

/* Footer search (site-editor custom section): keep it compact and modern. */
.wp-site-blocks > .wp-block-template-part:last-child .wp-block-search {
	max-width: 560px;
	margin-left: auto;
	margin-right: auto;
}

.wp-site-blocks > .wp-block-template-part:last-child .wp-block-search__inside-wrapper {
	border-radius: 999px;
	border: 1px solid color-mix(in srgb, var(--fuqer-border) 85%, transparent);
	box-shadow: 0 6px 16px rgba(50, 50, 60, 0.10);
}

.wp-site-blocks > .wp-block-template-part:last-child .wp-block-search__input {
	font-size: 14px;
	padding: 10px 14px;
}

.wp-site-blocks > .wp-block-template-part:last-child .wp-block-search__button {
	font-size: 14px;
	padding: 10px 14px;
	border-radius: 999px;
	margin: 4px;
}

/* Tighten the outer card used for the footer search section. */
.wp-site-blocks > .wp-block-template-part:last-child .wp-block-group.alignwide.is-style-fuqer-card:has(.wp-block-search) {
	padding: 16px !important;
	border-radius: 18px;
	background: linear-gradient(180deg, #ffffff 0%, var(--fuqer-accent-soft) 100%);
	border-color: color-mix(in srgb, var(--fuqer-border) 70%, transparent);
	text-align: center;
}

.wp-site-blocks > .wp-block-template-part:last-child .wp-block-group.alignwide.is-style-fuqer-card:has(.wp-block-search) h1.wp-block-heading {
	margin-top: 0;
	margin-bottom: 6px;
}

.wp-site-blocks > .wp-block-template-part:last-child .wp-block-group.alignwide.is-style-fuqer-card:has(.wp-block-search) p {
	margin-top: 0;
	margin-bottom: 12px;
	max-width: 60ch;
	margin-left: auto;
	margin-right: auto;
}

@media (max-width: 600px) {
	.wp-site-blocks > .wp-block-template-part:last-child .wp-block-search {
		max-width: 100%;
	}
}

@media (max-width: 600px) {
	.has-global-padding {
		padding-left: 10px !important;
		padding-right: 10px !important;
	}
}

@media (max-width: 600px) {
	.is-style-fuqer-card {
		padding: 18px;
		border-radius: 16px;
	}
}

/* Footer mobile layout:
   1) Stack the main columns (logo/text block first, menus block second).
   2) Inside the menus block, keep the two menu columns side-by-side. */
@media (max-width: 781px) {
	/* Outer footer columns: always stack on mobile. */
	.wp-site-blocks > .wp-block-template-part:last-child .wp-block-columns.alignwide {
		flex-wrap: wrap !important;
	}

	.wp-site-blocks > .wp-block-template-part:last-child .wp-block-columns.alignwide > .wp-block-column {
		flex-basis: 100% !important;
	}

	.wp-site-blocks > .wp-block-template-part:last-child .wp-block-columns.alignwide > .wp-block-column:last-child {
		margin-top: 14px;
	}

	/* Inner columns (two footer navs): keep 2-up. */
	.wp-site-blocks > .wp-block-template-part:last-child .wp-block-columns.alignwide > .wp-block-column:last-child > .wp-block-columns {
		flex-wrap: nowrap !important;
		gap: 18px !important;
	}

	.wp-site-blocks > .wp-block-template-part:last-child .wp-block-columns.alignwide > .wp-block-column:last-child > .wp-block-columns > .wp-block-column {
		flex-basis: 50% !important;
	}
}

/* Prev/Next posts (single post) */
.fuqer-pager {
	margin-top: var(--wp--preset--spacing--50);
	/* Match the same "wide" width as the post card above (alignwide). */
	max-width: var(--wp--style--global--wide-size);
	width: 100%;
	margin-left: auto;
	margin-right: auto;
}

.fuqer-pager__grid {
	display: grid !important;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}

.fuqer-pager__grid--single {
	grid-template-columns: 1fr;
}

/* WordPress can wrap shortcode output in <p>/<br> via wpautop; collapse wrappers so CSS grid works. */
.fuqer-pager__grid > p,
.fuqer-related__grid > p {
	display: contents;
	margin: 0;
}

.fuqer-pager__grid > p:empty,
.fuqer-related__grid > p:empty {
	display: none !important;
}

.fuqer-pager__grid br,
.fuqer-related__grid br {
	display: none;
}

.fuqer-pager__link {
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 12px;
	padding: 10px;
	border: 1px solid var(--fuqer-border);
	border-radius: 18px;
	background: #fff;
	box-shadow: 0 4px 6px rgba(172, 176, 186, 0.18);
	text-decoration: none;
	color: var(--fuqer-text);
	overflow: hidden;
	min-height: 108px;
	transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.fuqer-pager__link:hover {
	transform: translateY(-1px);
	box-shadow: 0 10px 24px rgba(50, 50, 60, 0.14);
	border-color: rgba(239, 35, 123, 0.45);
	text-decoration: none;
}

.fuqer-pager__title {
	font-size: 16px;
	font-weight: 900;
	letter-spacing: -0.2px;
	line-height: 1.2;
	min-width: 0;
	/* Allow more title visibility; we clamp only on small screens. */
}

.fuqer-pager__arrow {
	width: 40px;
	height: 40px;
	border-radius: 999px;
	display: grid;
	place-items: center;
	background: rgba(239, 35, 123, 0.08);
	border: 1px solid rgba(239, 35, 123, 0.22);
	color: var(--fuqer-accent);
	font-size: 18px;
	font-weight: 900;
}

.fuqer-pager__thumb {
	display: block;
	width: 128px;
	aspect-ratio: 1 / 1;
	border-radius: 14px;
	border: 1px solid var(--fuqer-border);
	overflow: hidden;
	background: linear-gradient(135deg, rgba(239, 35, 123, 0.10), rgba(239, 35, 123, 0.02));
}

.fuqer-pager__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

@media (max-width: 800px) {
	.fuqer-pager__grid {
		grid-template-columns: 1fr;
	}

	.fuqer-pager__title {
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
		overflow: hidden;
	}

	.fuqer-pager__thumb {
		width: 110px;
	}
}

/* Related posts */
.fuqer-related {
	margin-top: var(--wp--preset--spacing--50);
	padding: 0;
	/* Match the same "wide" width as the post card above (alignwide). */
	max-width: var(--wp--style--global--wide-size);
	width: 100%;
	margin-left: auto;
	margin-right: auto;
}

/* Remove the "card" wrapper styling for related posts: show only the post cards. */
.fuqer-related.is-style-fuqer-card {
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
	border-radius: 0 !important;
}

.fuqer-related__heading {
	margin: 0 0 14px;
	font-size: 20px;
	font-weight: 800;
	letter-spacing: -0.25px;
}

.fuqer-related__grid {
	display: grid !important;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 14px;
}

.fuqer-related__thumb {
	display: block;
	aspect-ratio: 3 / 2;
	overflow: hidden;
	background: linear-gradient(135deg, rgba(239, 35, 123, 0.10), rgba(239, 35, 123, 0.02));
}

.fuqer-related__card {
	display: block;
	text-decoration: none;
	color: inherit;
	border: 1px solid var(--fuqer-border);
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 4px 6px rgba(172, 176, 186, 0.14);
	overflow: hidden;
	padding: 0;
	transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.fuqer-related__card:hover {
	transform: translateY(-1px);
	box-shadow: 0 10px 24px rgba(50, 50, 60, 0.12);
	border-color: rgba(239, 35, 123, 0.45);
	text-decoration: none;
}

	.fuqer-related__thumb,
	.fuqer-related__card .fuqer-card__thumb {
		border-radius: 0;
	}

	.fuqer-related__thumb img {
		width: 100%;
		height: 100%;
		object-fit: cover;
		display: block;
	}

.fuqer-related__title {
	display: block;
	padding: 12px 12px 14px;
	font-size: 14px;
	font-weight: 800;
	letter-spacing: -0.2px;
	line-height: 1.2;
	color: var(--fuqer-text);
	text-align: center;
}

@media (max-width: 980px) {
	.fuqer-related__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 600px) {
	.fuqer-related__grid {
		grid-template-columns: 1fr;
	}
}
