/**
 * =============================================================
 * @subpackage	RAXO Default Module Layout
 * -------------------------------------------------------------
 * @copyright	Copyright (C) 2009-2026 RAXO Group
 * @link		https://www.raxo.org
 * @license		RAXO Commercial License
 * 				This file is forbidden for redistribution
 * =============================================================
 */


/* ----- RESET & DEFAULT Styles ----- */
.raxo-default {
	container: raxo-default / inline-size;
	margin-block: 2rem;
	box-sizing: border-box;
	word-break: break-word;

	&:first-child { margin-block-start: 0; }
	& *, & ::before, & ::after { box-sizing: inherit; }

	& article, & h3, & h4,
	& img, & a {
		margin: 0;
		padding: 0;
		background: transparent none;
		border: 0 none;
	}
	& a {
		appearance: none;
		outline: 0;
		text-decoration: none;
		transition: all .25s ease-out;
	}
	& a:hover { text-decoration: underline; }
}


/* ----- Module BLOCK ----- */
.raxo-default {
	/* --- Layout SETTINGS --- */
	--top-font-size: 16px;
	--nor-font-size: 14px;
	--image-border: 1px;	/* set 0px to disable */
	--image-spacing: 4px;	/* use the range 0px - 24px */

	/* --- Block HEADER --- */
	& .raxo-header {
		border-top: 2px solid var(--raxo-theme-color);
	}
	& .raxo-block-name {
		padding: 6px 4px;
		font-size: 20px;
		font-weight: normal !important;
		color: var(--raxo-text-base);
	}
	& .raxo-block-intro {
		padding: 8px 4px 12px;
	}

	/* --- Block FOOTER --- */
	& .raxo-footer {
		margin-top: 8px;
		border-top: 1px solid var(--raxo-theme-color);
	}
	& .raxo-block-button {
		padding: 4px;
		text-align: right;
	}


	/* ----- MODULE Items ----- */
	& .raxo-top {
		font-size: var(--top-font-size);
		--icon-size: var(--top-font-size);
	}
	& .raxo-normal {
		font-size: var(--nor-font-size);
		--icon-size: var(--nor-font-size);
	}

	& article {
		padding: 20px 0;
		overflow: hidden;
	}
	& article:not(:first-child),
	& .raxo-top + .raxo-normal article:first-child {
		background: linear-gradient(90deg, var(--raxo-gray-200) 60%, transparent 60%) repeat-x;
		background-size: 10px 1px;
	}
	& .raxo-wrap {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		gap: 16px 24px;
	}

	/* ----- Item IMAGE ----- */
	& .raxo-image {
		flex: 0 1 auto;
		align-self: flex-start;
		padding: var(--image-spacing);
		background-color: var(--raxo-gray-100);
		border: var(--image-border) solid var(--raxo-gray-400);
		border-radius: 3px;
		transition: border-color .4s ease;

		article:hover & { border-color: var(--raxo-theme-color); }
		& img {
			display: block;
			max-width: 100%;
			height: auto;
		}
	}

	/* ----- Item CONTENT ----- */
	& .raxo-content {
		flex: 1 1 144px;
	}
	& .raxo-title {
		margin-bottom: 4px;
		font-size: 1.29em;
		line-height: 1.16;
		font-weight: bold;
	}
	& .raxo-text {
		margin-top: 8px;
		line-height: 1.3;
		color: var(--raxo-text-base);
	}
	& .raxo-text,
	& .raxo-block-intro {
		hyphens: auto;
		hyphenate-limit-chars: 7 3 2;
	}
	& .raxo-readmore { margin-top: 8px; }


	/* ----- Item FIELDS ----- */
	& .raxo-meta {
		display: flex;
		flex-wrap: wrap;
		gap: 8px 16px;
		margin-bottom: 6px;
		font-size: .93em;
		line-height: 1.2;
		color: var(--raxo-text-muted);

		& span {
			display: flex;
			gap: 4px;
		}
		& svg {
			width: var(--icon-size);
			height: var(--icon-size);
			fill: currentColor;
		}
	}
	& .raxo-rating svg {
		width: calc(var(--icon-size) * 5);
		fill: var(--raxo-gray-300);
	}

	& .raxo-info {
		display: flex;
		flex-wrap: wrap;
		gap: 2px 12px;
		padding-bottom: 4px;
		line-height: 1.38;
		color: var(--raxo-text-muted);

		& i { color: var(--raxo-text-light); }
	}
}


/* ----- CONTAINER Queries ----- */
@container raxo-default (width < 480px) {
	.raxo-default .raxo-top .raxo-image,
	.raxo-default .raxo-top .raxo-image img {
		width: 100%;
	}
}


/* ----- COLOR Schemes ----- */
.raxo-default {
	/* --- LIGHT Color Mode (default) --- */
	--raxo-color-base: oklch(0.48 0.19 267.8);
	--raxo-theme-color: var(--raxo-color-base);

	--raxo-gray-100: hsl(232, 1%, 98%);
	--raxo-gray-200: hsl(232, 2%, 88%);
	--raxo-gray-300: hsl(232, 3%, 69%);
	--raxo-gray-400: hsl(232, 4%, 45%);
	--raxo-gray-500: hsl(232, 5%, 30%);
	--raxo-gray-600: hsl(232, 5%, 22%);
	--raxo-gray-900: hsl(232, 7%,  6%);

	--raxo-text-deep:  var(--raxo-gray-900);
	--raxo-text-base:  var(--raxo-gray-600);
	--raxo-text-muted: var(--raxo-gray-400);
	--raxo-text-light: var(--raxo-gray-300);

	/* --- DARK Color Mode --- */
	&.dark-mode, &.mode-dark {
		--raxo-theme-color: oklch(
			from var(--raxo-color-base) calc(l * 1.1) calc(c * 0.8) h
		);

		--raxo-gray-100: hsl(232, 8%,  5%);
		--raxo-gray-200: hsl(232, 6%, 16%);
		--raxo-gray-300: hsl(232, 5%, 29%);
		--raxo-gray-400: hsl(232, 3%, 51%);
		--raxo-gray-500: hsl(232, 2%, 66%);
		--raxo-gray-600: hsl(232, 2%, 73%);
		--raxo-gray-900: hsl(232, 1%, 87%);
	}

	/* --- COLOR Palette --- */
	/* Backwards compatibility with previous module classes: default-colorname */
	&.color-red							{ --raxo-color-base: oklch(0.53 0.19 28.82); }
	&.color-pink,   &.default-pink		{ --raxo-color-base: oklch(0.58 0.19 354.7); }
	&.color-orange, &.default-orange	{ --raxo-color-base: oklch(0.61 0.18 45.23); }
	&.color-yellow, &.default-yellow	{ --raxo-color-base: oklch(0.82 0.17 94.64); }
	&.color-brown						{ --raxo-color-base: oklch(0.44 0.05 39.62); }
	&.color-green,  &.default-green		{ --raxo-color-base: oklch(0.54 0.17 140.3); }
	&.color-teal,   &.default-turquoise	{ --raxo-color-base: oklch(0.58 0.11 186.8); }
	&.color-blue,   &.default-blue		{ --raxo-color-base: oklch(0.48 0.18 259.4); }
	&.color-sky,    &.default-lightblue	{ --raxo-color-base: oklch(0.62 0.15 243.2); }
	&.color-violet, &.default-violet	{ --raxo-color-base: oklch(0.48 0.19 287.4); }
	&.color-purple						{ --raxo-color-base: oklch(0.48 0.19 303.4); }
	&.color-gray,   &.default-gray		{ --raxo-color-base: oklch(0.38 0.0186 254); }

	/* --- COLOR Tuning --- */
	& a {
		color: var(--raxo-theme-color) !important;
	}
	& a:hover {
		color: var(--raxo-text-base) !important;
	}
}