/*
Theme Name: Flowear
Theme URI: https://example.com/flowear-theme
Author: Flowear
Author URI: https://example.com
Description: A sleek, lightweight social theme with a violet→fuchsia aesthetic. Sticky header, optional sidebar, hide-page-title control, custom page templates, WooCommerce and Elementor ready. Fully responsive across mobile, tablet and desktop. Pairs perfectly with the Flowear Social plugin.
Version: 1.11.0
Requires at least: 5.8
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: flowear
Tags: social, blog, custom-colors, custom-menu, featured-images, sticky-post, threaded-comments, e-commerce, full-width-template, right-sidebar
*/

html {
	scroll-behavior: smooth;
}

:root {
	--ft-bg: oklch(0.985 0.004 280);
	--ft-fg: oklch(0.22 0.03 285);
	--ft-card: oklch(1 0 0);
	--ft-muted: oklch(0.965 0.008 285);
	--ft-muted-fg: oklch(0.55 0.03 285);
	--ft-accent: oklch(0.95 0.04 305);
	--ft-border: oklch(0.92 0.01 290);
	--ft-primary: #9333ea;
	--ft-glow: #d946ef;
	--ft-radius: 1rem;
	--ft-gradient: linear-gradient(135deg, var(--ft-primary), var(--ft-glow));
	--ft-gradient-page: linear-gradient(150deg, oklch(0.97 0.03 300), oklch(0.97 0.02 250), oklch(0.98 0.025 30));
	--ft-shadow-soft: 0 10px 40px -12px color-mix(in oklab, var(--ft-primary) 28%, transparent);
	--ft-shadow-card: 0 4px 24px -8px color-mix(in oklab, oklch(0.5 0.1 285) 18%, transparent);
	--ft-container: 1200px;
}

html[data-theme="dark"], html.ft-dark {
	--ft-bg: oklch(0.18 0.02 285);
	--ft-fg: oklch(0.97 0.01 285);
	--ft-card: oklch(0.22 0.025 285);
	--ft-muted: oklch(0.27 0.02 285);
	--ft-muted-fg: oklch(0.7 0.02 285);
	--ft-accent: oklch(0.3 0.06 300);
	--ft-border: oklch(1 0 0 / 12%);
	--ft-primary: #c084fc;
	--ft-glow: #e879f9;
	--ft-gradient-page: linear-gradient(150deg, oklch(0.2 0.03 300), oklch(0.18 0.02 270), oklch(0.2 0.03 320));
}

/* dark/light toggle switch */
.ft-header-actions { display: flex; align-items: center; gap: .75rem; }
.ft-theme-toggle { position: relative; width: 3.2rem; height: 1.7rem; border: 0; background: none; padding: 0; cursor: pointer; flex-shrink: 0; }
.ft-theme-track { position: absolute; inset: 0; border-radius: 999px; background: var(--ft-border); transition: background .2s; }
html[data-theme="dark"] .ft-theme-track, html.ft-dark .ft-theme-track { background-image: var(--ft-gradient); }
.ft-theme-thumb { position: absolute; top: 50%; left: 3px; transform: translateY(-50%); width: 1.25rem; height: 1.25rem; border-radius: 999px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3); transition: left .2s; }
html[data-theme="dark"] .ft-theme-thumb, html.ft-dark .ft-theme-thumb { left: calc(100% - 1.25rem - 3px); }

*, *::before, *::after { box-sizing: border-box; }

body {
	margin: 0;
	font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	color: var(--ft-fg);
	background-color: var(--ft-bg);
	-webkit-font-smoothing: antialiased;
	line-height: 1.6;
}

/*
 * The page gradient lives on a fixed, viewport-covering pseudo layer instead
 * of `background-attachment: fixed`. Mobile browsers (iOS/Android) emulate
 * fixed backgrounds with a repaint path that visibly flickers the background
 * between light/dark on load and scroll; a fixed pseudo-element avoids that —
 * desktop keeps its "pared, non-scrolling backdrop" visual in both modes.
 */
body::before {
	content: "";
	position: fixed;
	inset: 0;
	z-index: -1;
	background-image: var(--ft-gradient-page);
	background-attachment: scroll;
	background-repeat: no-repeat;
	background-size: cover;
	pointer-events: none;
}
a { color: var(--ft-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -0.02em; }

.ft-container { width: 100%; max-width: var(--ft-container); margin: 0 auto; padding: 0 1rem; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 1rem; top: 1rem; background: #fff; padding: .5rem 1rem; border-radius: .5rem; z-index: 999; }

/* ---------- header ---------- */
.ft-header {
	background: color-mix(in oklab, var(--ft-card) 95%, transparent);
	border-bottom: 1px solid var(--ft-border);
	z-index: 50;
}
.ft-header.is-sticky { position: sticky; top: 0; }
.ft-header-inner { display: flex; align-items: center; gap: 1rem; padding: 0.85rem 0; }
.ft-brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.25rem; color: var(--ft-fg); }
.ft-brand:hover { text-decoration: none; }
.ft-brand .ft-logo-mark {
	display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: .7rem;
	background-image: var(--ft-gradient); color: #fff; font-weight: 800;
}
.ft-nav { margin-left: auto; }
.ft-nav ul { display: flex; gap: .35rem; list-style: none; margin: 0; padding: 0; align-items: center; }
.ft-nav a { color: var(--ft-fg); padding: .5rem .9rem; border-radius: 999px; font-weight: 600; font-size: .95rem; transition: background .15s, color .15s; }
.ft-nav a:hover { background: var(--ft-accent); text-decoration: none; }
.ft-nav .current-menu-item > a, .ft-nav .current_page_item > a { background-image: var(--ft-gradient); color: #fff; box-shadow: var(--ft-shadow-soft); }
.ft-header-cta { display: inline-flex; align-items: center; gap: .4rem; }
.ft-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
	border-radius: 999px; padding: .6rem 1.3rem; font-weight: 700; font-size: .9rem; border: 0; cursor: pointer;
	background-image: var(--ft-gradient); color: #fff; box-shadow: var(--ft-shadow-soft); transition: transform .15s;
}
.ft-btn:hover { transform: translateY(-2px); text-decoration: none; color: #fff; }
.ft-btn-ghost { background-image: none; background: var(--ft-muted); color: var(--ft-fg); box-shadow: none; }

.ft-burger { display: none; background: var(--ft-muted); border: 0; border-radius: .7rem; width: 2.6rem; height: 2.6rem; cursor: pointer; align-items: center; justify-content: center; }
.ft-burger span, .ft-burger span::before, .ft-burger span::after { display: block; width: 18px; height: 2px; background: var(--ft-fg); position: relative; }
.ft-burger span::before, .ft-burger span::after { content: ""; position: absolute; left: 0; }
.ft-burger span::before { top: -6px; } .ft-burger span::after { top: 6px; }

@media (max-width: 880px) {
	.ft-burger { display: inline-flex; }
	.ft-nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--ft-card); border-bottom: 1px solid var(--ft-border); margin-left: 0; display: none; padding: .5rem 1rem 1rem; }
	.ft-nav.ft-nav--desktop-only { display: none !important; }
	.ft-header { position: relative; }
	.ft-header.nav-open .ft-nav:not(.ft-nav--desktop-only) { display: block; }
	.ft-nav ul { flex-direction: column; align-items: stretch; gap: .25rem; }
	.ft-nav a { display: block; }
	.ft-header-cta { display: none; }
}

@media (max-width: 639px) {
  html, body { width: 100%; overflow-x: clip; }
  .ft-header.is-sticky { position: sticky; top: 0; z-index: 999; }
  .ft-container { padding-inline: .75rem; }
  .ft-header { width: 100%; }
  .ft-header-inner { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: .6rem; padding: .7rem 0; }
  .ft-brand { min-width: 0; font-size: 1.05rem; }
  .ft-brand span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ft-brand .ft-logo-mark { width: 2rem; height: 2rem; flex-shrink: 0; }
  .ft-header-actions { min-width: 0; }
  .ft-theme-toggle { width: 3rem; height: 1.55rem; }
  .ft-theme-thumb { width: 1.1rem; height: 1.1rem; }
  html[data-theme="dark"] .ft-theme-thumb, html.ft-dark .ft-theme-thumb { left: calc(100% - 1.1rem - 3px); }
}

/* ---------- hero / page title ---------- */
.ft-page-head { padding: 3rem 0 2rem; text-align: center; }
.ft-page-head h1 { margin: 0; font-size: clamp(1.8rem, 4vw, 2.8rem); }
.ft-page-head .ft-crumbs { color: var(--ft-muted-fg); font-size: .85rem; margin-top: .5rem; }
body.ft-hide-title .ft-page-head { display: none; }

/* ---------- layout ---------- */
.ft-site-main { padding: 2rem 0 3rem; overflow-x: clip; }
@media (max-width: 639px) {
  .ft-site-main { padding: .75rem 0 5.75rem; }
  .ft-site-main > .flowear { margin-inline: calc(50% - 50vw); width: 100vw; max-width: 100vw; }
}
.ft-layout { display: grid; gap: 2rem; align-items: start; }
.ft-layout.has-sidebar { grid-template-columns: 1fr; }
@media (min-width: 1000px) {
	.ft-layout.has-sidebar.sidebar-right { grid-template-columns: minmax(0,1fr) 320px; }
	.ft-layout.has-sidebar.sidebar-left { grid-template-columns: 320px minmax(0,1fr); }
	.ft-layout.has-sidebar.sidebar-left .ft-content { order: 2; }
}
.ft-full .ft-layout { grid-template-columns: 1fr; }

/* ---------- cards / articles ---------- */
.ft-card { background: var(--ft-card); border-radius: var(--ft-radius); box-shadow: var(--ft-shadow-card); overflow: hidden; }
.ft-article { background: var(--ft-card); border-radius: 1.25rem; box-shadow: var(--ft-shadow-card); overflow: hidden; margin-bottom: 2rem; }
.ft-article .ft-thumb img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.ft-article-body { padding: 1.5rem; }
.ft-article-body.ft-single { padding: 2rem; }
.ft-entry-title { margin: 0 0 .5rem; font-size: 1.5rem; }
.ft-entry-title a { color: var(--ft-fg); }
.ft-meta { color: var(--ft-muted-fg); font-size: .85rem; display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.ft-cat { display: inline-block; background-image: var(--ft-gradient); color: #fff; padding: .2rem .8rem; border-radius: 999px; font-size: .72rem; font-weight: 700; }
.ft-excerpt { color: var(--ft-fg); }
.ft-readmore { display: inline-flex; align-items: center; gap: .35rem; margin-top: 1rem; font-weight: 700; }

.ft-content .entry-content p { margin: 0 0 1rem; }
.ft-content blockquote { border-left: 4px solid var(--ft-primary); margin: 1.5rem 0; padding: .5rem 1.25rem; background: var(--ft-muted); border-radius: .5rem; }

/* archive grid */
.ft-grid-posts { display: grid; gap: 1.5rem; }
@media (min-width: 700px) { .ft-grid-posts { grid-template-columns: 1fr 1fr; } }

/* ---------- sidebar ---------- */
.ft-sidebar .widget { background: var(--ft-card); border-radius: 1.25rem; box-shadow: var(--ft-shadow-card); padding: 1.25rem; margin-bottom: 1.5rem; }
.ft-sidebar .widget-title { margin: 0 0 1rem; font-size: 1.05rem; position: relative; padding-bottom: .5rem; }
.ft-sidebar .widget-title::after { content: ""; position: absolute; left: 0; bottom: 0; width: 2.5rem; height: 3px; border-radius: 999px; background-image: var(--ft-gradient); }
.ft-sidebar ul { list-style: none; margin: 0; padding: 0; }
.ft-sidebar li { padding: .4rem 0; border-bottom: 1px solid var(--ft-border); }

/* ---------- footer ---------- */
.ft-footer { background: var(--ft-card); border-top: 1px solid var(--ft-border); margin-top: 2rem; }
.ft-footer-cols { display: grid; gap: 2rem; padding: 3rem 0 2rem; }
@media (min-width: 700px) { .ft-footer-cols { grid-template-columns: repeat(4, 1fr); } }
.ft-footer .widget-title { font-size: 1rem; margin: 0 0 1rem; }
.ft-footer ul { list-style: none; padding: 0; margin: 0; }
.ft-footer a { color: var(--ft-muted-fg); }
.ft-copy { border-top: 1px solid var(--ft-border); padding: 1.25rem 0; text-align: center; color: var(--ft-muted-fg); font-size: .85rem; }

/* ---------- pagination & comments ---------- */
.ft-pagination { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; margin-top: 1rem; }
.ft-pagination .page-numbers { display: grid; place-items: center; min-width: 2.5rem; height: 2.5rem; padding: 0 .5rem; border-radius: 999px; background: var(--ft-card); box-shadow: var(--ft-shadow-card); font-weight: 600; }
.ft-pagination .page-numbers.current { background-image: var(--ft-gradient); color: #fff; }
.ft-comments { background: var(--ft-card); border-radius: 1.25rem; box-shadow: var(--ft-shadow-card); padding: 1.5rem; margin-top: 1.5rem; }
.ft-comments .comment-list { list-style: none; padding: 0; }
.ft-comments .comment-body { padding: 1rem 0; border-bottom: 1px solid var(--ft-border); }
.ft-comments input[type="text"], .ft-comments input[type="email"], .ft-comments input[type="url"], .ft-comments textarea {
	width: 100%; border: 1px solid var(--ft-border); border-radius: .75rem; padding: .7rem .9rem; font-family: inherit; margin-bottom: 1rem; background: var(--ft-bg);
}
.ft-comments .submit { background-image: var(--ft-gradient); color: #fff; border: 0; border-radius: 999px; padding: .7rem 1.6rem; font-weight: 700; cursor: pointer; }

/* ---------- forms / search ---------- */
.ft-searchform { display: flex; gap: .5rem; }
.ft-searchform input[type="search"] { flex: 1; border: 1px solid var(--ft-border); border-radius: 999px; padding: .6rem 1rem; font-family: inherit; background: var(--ft-bg); }
.ft-searchform button { border: 0; border-radius: 999px; padding: .6rem 1.2rem; background-image: var(--ft-gradient); color: #fff; font-weight: 700; cursor: pointer; }

/* 404 */
.ft-404 { text-align: center; padding: 4rem 0; }
.ft-404 .ft-big { font-size: clamp(4rem, 14vw, 9rem); font-weight: 800; background-image: var(--ft-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* WooCommerce small polish */
.woocommerce ul.products li.product, .woocommerce-page ul.products li.product { background: var(--ft-card); border-radius: 1rem; box-shadow: var(--ft-shadow-card); padding: 1rem; }
.woocommerce a.button, .woocommerce button.button, .woocommerce #respond input#submit, .woocommerce .button.alt {
	background-image: var(--ft-gradient) !important; color: #fff !important; border-radius: 999px !important; font-weight: 700 !important;
}
.woocommerce span.price, .woocommerce div.product p.price { color: var(--ft-primary); }

/* ---------- custom logo sizing (PHP replacement handles this) ---------- */

/* ---------- reading progress bar ---------- */
.ft-progress { position: fixed; top: 0; left: 0; width: 0; height: 3px; background-image: var(--ft-gradient); z-index: 100; transition: width .1s linear; pointer-events: none; }

/* ---------- back to top ---------- */
.ft-back-top {
	position: fixed; right: 1.25rem; bottom: 1.5rem; z-index: 90;
	width: 2.75rem; height: 2.75rem; border-radius: 999px; border: 0; cursor: pointer;
	background-image: var(--ft-gradient); color: #fff; box-shadow: var(--ft-shadow-soft);
	display: grid; place-items: center; opacity: 0; transform: translateY(12px);
	transition: opacity .25s, transform .25s; pointer-events: none;
}
.ft-back-top.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.ft-back-top:hover { transform: translateY(-3px); }
.ft-back-top svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- header shrink on scroll ---------- */
.ft-header-inner { transition: padding .2s ease; }
.ft-header .custom-logo { transition: max-height .2s ease; }
.ft-header .ft-brand .ft-logo-mark { transition: width .2s ease, height .2s ease; }
.ft-header.is-shrunk .ft-header-inner { padding: 0.5rem 0; }
.ft-header.is-shrunk .custom-logo { max-height: calc(var(--ft-logo-h, 48px) * 0.75) !important; }
.ft-header.is-shrunk .ft-brand .ft-logo-mark { width: 1.8rem; height: 1.8rem; }

/* ---------- mobile auth button (login / logout) ---------- */
.ft-mobile-auth-btn {
	display: none;
	background-image: var(--ft-gradient);
	color: #fff;
	font-weight: 700;
	font-size: .8rem;
	padding: .4rem 1rem;
	border-radius: 999px;
	text-decoration: none;
	box-shadow: var(--ft-shadow-soft);
	line-height: 1.4;
	white-space: nowrap;
}
.ft-mobile-auth-btn:hover { text-decoration: none; color: #fff; transform: translateY(-1px); }
@media (max-width: 880px) {
	.ft-mobile-auth-btn { display: inline-flex; align-items: center; }
}
@media (min-width: 881px) {
	.ft-mobile-auth-btn { display: none !important; }
}

/* ---------- smooth image load ---------- */
.ft-article .ft-thumb img { transition: opacity .3s; }
.ft-article .ft-thumb img[loading="lazy"] { opacity: 0; }
.ft-article .ft-thumb img[loading="lazy"].loaded { opacity: 1; }

/* ---------- selection highlight ---------- */
::selection { background: color-mix(in oklab, var(--ft-primary) 25%, transparent); }

/* ---------- focus visible ring ---------- */
:focus-visible { outline: 2px solid var(--ft-primary); outline-offset: 2px; border-radius: 4px; }
