/* Pixforia: shared base. Design tokens (CSS variables), font, generic utilities.
   Loaded on every page. Section styles live in client/client.css and portfolio/portfolio.css. */

/* ---------- Design tokens ---------- */
:root {
	/* Colors */
	--pix-color-primary: #39b54a;
	--pix-color-primary-hover: #2c9a3b;
	--pix-color-on-primary: #fff;
	--pix-color-accent: #e6208c;
	--pix-color-header-bg: #000;
	--pix-color-footer-bg: #969696;
	--pix-modal-backdrop: rgba(0, 0, 0, .8);
	--pix-modal-close-bg: rgba(0, 0, 0, .6);
	--pix-modal-close-bg-hover: #000;
	--pix-color-disabled-bg: #dcdcdc;
	--pix-color-disabled-text: #8c8c8c;
	--pix-color-text-muted: #777;
	--pix-shadow-hover: 0 3px 4px rgba(0, 0, 0, .4);

	/* Typography */
	--pix-font: 'Open Sans', system-ui, sans-serif;

	/* Shape */
	--pix-radius: 8px;

	/* Spacing scale */
	--pix-1: .25rem;
	--pix-2: .5rem;
	--pix-3: 1rem;
	--pix-4: 3rem;
	--pix-5: 3rem;
}

/* ---------- Font: Open Sans (self-hosted, latin subset = accented characters included) ---------- */
@font-face {
	font-family: 'Open Sans'; font-style: normal; font-weight: 400 700; font-display: swap;
	src: url('../../fonts/open-sans-latin.woff2') format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122;
}

/* ---------- Utilities ---------- */

/* Container */
.pix-container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: var(--pix-3); }

/* Flex / grid */
.pix-flex { display: flex; }
.pix-grid { display: grid; }
.pix-wrap { flex-wrap: wrap; }
.pix-col { flex-direction: column; }
.pix-center { align-items: center; justify-content: center; }
.pix-between { justify-content: space-between; }
/* Column layouts: flex wrap, so an incomplete last row stays centered. Card width = (100% - gaps) / columns. */
.pix-grid-2, .pix-grid-3 { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--pix-gap, 0); }
.pix-grid-2 { --cols: 2; }
.pix-grid-3 { --cols: 3; }
.pix-grid-2 > *, .pix-grid-3 > * { flex: 0 0 calc((100% - (var(--cols) - 1) * var(--pix-gap, 0px)) / var(--cols)); min-width: 0; }

/* Responsive: 3 columns -> 2 columns (tablet) -> 1 column (phone) */
@media (max-width: 1024px) { .pix-grid-3 { --cols: 2; } }
@media (max-width: 640px) { .pix-grid-2, .pix-grid-3 { --cols: 1; } }

/* Centered flex row (several rows possible, one per group) */
.pix-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: var(--pix-3); }
.pix-row-start { justify-content: flex-start; }

/* Spacing (gap, margin, padding) */
.pix-gap-1 { --pix-gap: var(--pix-1); gap: var(--pix-1); } .pix-gap-2 { --pix-gap: var(--pix-2); gap: var(--pix-2); }
.pix-gap-3 { --pix-gap: var(--pix-3); gap: var(--pix-3); } .pix-gap-4 { --pix-gap: var(--pix-4); gap: var(--pix-4); }
.pix-m-0 { margin: 0; }
.pix-mt-3 { margin-top: var(--pix-3); } .pix-mt-4 { margin-top: var(--pix-4); } .pix-mt-5 { margin-top: var(--pix-5); }
.pix-mb-3 { margin-bottom: var(--pix-3); }
.pix-p-3 { padding: var(--pix-3); } .pix-p-4 { padding: var(--pix-4); }

/* Text */
.pix-text-center { text-align: center; }
.pix-text-right { text-align: right; }

/* Misc */
.pix-hidden { display: none; }
.pix-w-full { width: 100%; }
.pix-img-fluid { max-width: 100%; height: auto; display: block; }

/* ---------- Footer band (client and portfolio items) ----------
   Sticks to the bottom of the window on short pages: the body is a column that fills the window,
   and the footer takes margin-top: auto. The transparent top border keeps a minimum gap above it. */
body.single-client, body.single-portfolio {
	display: flex; flex-direction: column;
	min-height: calc(100vh - var(--wp-admin--admin-bar--height, 0px));
}
.pix-footer {
	margin-top: auto; height: 2rem;
	border-top: var(--pix-5) solid transparent; background-clip: padding-box;
	background-color: var(--pix-color-footer-bg);
	box-sizing: content-box; flex-shrink: 0;
}

/* ---------- Popin: near-fullscreen dialog with an iframe (see assets/js/modal.js, used on client and portfolio items) ---------- */
.pix-modal {
	width: 96vw; height: 92vh; max-width: none; max-height: none;
	padding: 0; border: 0; overflow: hidden;
	border-radius: var(--pix-radius); background: var(--pix-color-header-bg);
}
.pix-modal::backdrop { background: var(--pix-modal-backdrop); }
.pix-modal-frame { display: block; width: 100%; height: 100%; border: 0; }
.pix-modal-close {
	position: absolute; top: .5rem; right: .5rem; z-index: 2;
	display: flex; align-items: center; justify-content: center;
	width: 2rem; height: 2rem; padding: 0; border: 0; border-radius: 0; /* small square, the X icon keeps its size */
	background-color: var(--pix-modal-close-bg); color: var(--pix-color-on-primary);
	font-size: 1.75rem; line-height: 1; cursor: pointer; transition: background-color .15s;
}
.pix-modal-close:hover, .pix-modal-close:focus { background-color: var(--pix-modal-close-bg-hover); color: var(--pix-color-on-primary); }
html.pix-modal-open { overflow: hidden; } /* no page scroll behind the popin */
