/* ==================================================================
 * QT Author Box — Frontend CSS
 * ------------------------------------------------------------------
 * Base "wide editorial" layout shared across all presets, plus
 * per-preset overrides scoped to `.qt-author-box--preset-{key}`.
 * ================================================================ */

/* ------ Container ------
 * The doubled-class selector (.qt-author-box.qt-author-box) doubles the
 * specificity so aggressive theme rules can't accidentally override the
 * flex layout. !important is used only on the layout-critical props.
 */
.qt-author-box-wrap { margin: 2em 0; display: block; }

.qt-author-box.qt-author-box {
	position: relative;
	display: flex !important;
	flex-direction: row !important;
	flex-wrap: nowrap !important;
	align-items: center !important;
	gap: 30px;
	max-width: 800px;
	margin: 0 auto;
	padding: 32px;
	background: var(--qtab-bg, #fff);
	color: var(--qtab-text, #333);
	border: 1px solid var(--qtab-border, #e2e4e7);
	border-radius: var(--qtab-radius, 8px);
	font-family: var(--qtab-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
	box-sizing: border-box;
}
.qt-author-box *, .qt-author-box *::before, .qt-author-box *::after { box-sizing: border-box; }

/* ------ Box style variants ------ */
.qt-author-box--style-card { border: 0; box-shadow: 0 8px 24px rgba(0,0,0,0.08); }
.qt-author-box--style-flat { border: 0; }
.qt-author-box--style-minimal { border: 0; background: transparent; padding: 24px 0; }

/* ------ Avatar (base) ------
 * Doubled specificity + a 150px floor so installs upgrading from the
 * pre-editorial default (avatar_size: 90) still render at a decent size.
 * Explicit width/height with !important defeat theme resets like
 * `img { max-width: 100% !important; height: auto !important; }`.
 */
.qt-author-box.qt-author-box .qt-author-box__avatar {
	position: relative;
	flex-shrink: 0 !important;
	width: max(150px, var(--qtab-avatar-size, 160px));
	height: max(150px, var(--qtab-avatar-size, 160px));
	min-width: 150px;
	display: flex;
	align-items: center;
	justify-content: center;
}
.qt-author-box.qt-author-box .qt-author-box__avatar-img {
	position: relative;
	z-index: 1;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	object-fit: cover;
	display: block;
	margin: 0;
}
.qt-author-box--avatar-circle .qt-author-box__avatar-img { border-radius: 50%; }
.qt-author-box--avatar-rounded .qt-author-box__avatar-img { border-radius: 12px; }
.qt-author-box--avatar-square .qt-author-box__avatar-img { border-radius: 0; }
.qt-author-box--avatar-rotate .qt-author-box__avatar-img { transition: transform .5s ease; }
.qt-author-box--avatar-rotate:hover .qt-author-box__avatar-img { transform: rotate(360deg); }

/* ------ Body / typography ------ */
.qt-author-box__body { flex: 1; min-width: 0; }
.qt-author-box__header { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px; margin-bottom: 6px; }
.qt-author-box__name {
	margin: 0;
	font-size: var(--qtab-name-size, 26px);
	line-height: 1.2;
	font-weight: 600;
	color: var(--qtab-text);
}
.qt-author-box__name a { color: inherit; text-decoration: none; }
.qt-author-box__name a:hover { color: var(--qtab-accent); }

.qt-author-box__website { font-size: var(--qtab-website-size, 13px); }
.qt-author-box__website a { color: var(--qtab-accent); text-decoration: none; }
.qt-author-box__website a:hover { text-decoration: underline; }

.qt-author-box__job-title {
	margin: 0 0 10px;
	font-size: var(--qtab-job-size, 12px);
	color: var(--qtab-text);
	opacity: .65;
	text-transform: uppercase;
	letter-spacing: 1.5px;
}

.qt-author-box__bio {
	margin: 10px 0 14px;
	font-size: var(--qtab-desc-size, 15px);
	line-height: 1.65;
	color: var(--qtab-text);
	opacity: .85;
}
.qt-author-box__bio p:last-child { margin-bottom: 0; }

/* ------ Social icons ------ */
.qt-author-box__social { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.qt-author-box__social-icon {
	display: inline-flex; align-items: center; justify-content: center;
	width: 32px; height: 32px;
	color: var(--qtab-accent);
	background: transparent;
	transition: transform .2s ease, background-color .2s ease, color .2s ease;
	text-decoration: none;
}
.qt-author-box__social-icon:hover { background: var(--qtab-accent); color: var(--qtab-bg); }
.qt-author-box__social-icon svg { width: 16px; height: 16px; }

.qt-author-box--icons-circle .qt-author-box__social-icon { border-radius: 50%; }
.qt-author-box--icons-rounded .qt-author-box__social-icon { border-radius: 6px; }
.qt-author-box--icons-square .qt-author-box__social-icon { border-radius: 0; }
.qt-author-box--icon-border .qt-author-box__social-icon { border: 1px solid var(--qtab-accent); }
.qt-author-box--icon-shadow .qt-author-box__social-icon { box-shadow: 0 2px 6px rgba(0,0,0,0.12); }
.qt-author-box--icon-rotate .qt-author-box__social-icon:hover { transform: rotate(360deg); }

/* ------ Centered layout (avatar on top) ------ */
.qt-author-box--layout-centered { flex-direction: column; text-align: center; align-items: center; }
.qt-author-box--layout-centered .qt-author-box__body { text-align: center; }
.qt-author-box--layout-centered .qt-author-box__header { justify-content: center; }
.qt-author-box--layout-centered .qt-author-box__social { justify-content: center; }

/* ==================================================================
 * Preset variants
 * ================================================================ */

/* ------ Featured (default): framed avatar on a colored circle,
 *        serif name, italic bio, "AUTHOR" small caps ------ */
.qt-author-box--preset-featured {
	padding: 40px;
	gap: 40px;
	background: #fff;
	border: 1px solid #eee;
}
.qt-author-box--preset-featured .qt-author-box__avatar {
	padding: 18px;
	border: 2px solid #1a1a1a;
	background: transparent;
	width: calc(max(150px, var(--qtab-avatar-size, 160px)) + 36px);
	height: calc(max(150px, var(--qtab-avatar-size, 160px)) + 36px);
	border-radius: 0;
}
.qt-author-box--preset-featured .qt-author-box__avatar::before {
	content: "";
	position: absolute;
	inset: 18px;
	background: var(--qtab-accent, #d64545);
	border-radius: 50%;
	z-index: 0;
}
.qt-author-box--preset-featured .qt-author-box__avatar-img {
	border-radius: 50%;
}
.qt-author-box--preset-featured .qt-author-box__name {
	font-family: Georgia, "Playfair Display", "Times New Roman", serif;
	font-size: 32px;
	font-weight: 500;
	letter-spacing: -0.5px;
	margin-bottom: 4px;
}
.qt-author-box--preset-featured .qt-author-box__bio {
	font-family: Georgia, "Times New Roman", serif;
	font-style: italic;
	font-size: 15px;
	line-height: 1.7;
	opacity: 0.85;
}
.qt-author-box--preset-featured .qt-author-box__job-title {
	margin-top: 20px;
	font-size: 11px;
	letter-spacing: 2.5px;
	opacity: 0.55;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.qt-author-box--preset-featured .qt-author-box__website a { border-bottom: 1px solid currentColor; }

/* ------ Editorial: colored circle only, no frame ------ */
.qt-author-box--preset-editorial {
	padding: 36px;
	gap: 36px;
	background: #fafafa;
}
.qt-author-box--preset-editorial .qt-author-box__avatar {
	width: calc(max(150px, var(--qtab-avatar-size, 160px)) + 24px);
	height: calc(max(150px, var(--qtab-avatar-size, 160px)) + 24px);
}
.qt-author-box--preset-editorial .qt-author-box__avatar::before {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--qtab-accent);
	border-radius: 50%;
	opacity: 0.12;
	z-index: 0;
}
.qt-author-box--preset-editorial .qt-author-box__avatar-img {
	width: max(150px, var(--qtab-avatar-size, 160px)) !important;
	height: max(150px, var(--qtab-avatar-size, 160px)) !important;
	border-radius: 50%;
}
.qt-author-box--preset-editorial .qt-author-box__name {
	font-family: Georgia, serif;
	font-size: 28px;
	font-weight: 600;
}
.qt-author-box--preset-editorial .qt-author-box__bio {
	font-family: Georgia, serif;
	font-size: 15px;
}

/* ------ Portrait: dark theme, square-framed avatar, cream type ------ */
.qt-author-box--preset-portrait {
	padding: 40px;
	gap: 40px;
	background: #1e1e1e !important;
	color: #f5f0e6 !important;
	border: 0;
}
.qt-author-box--preset-portrait .qt-author-box__avatar {
	padding: 12px;
	border: 2px solid #e0b46c;
	background: transparent;
	width: calc(max(150px, var(--qtab-avatar-size, 160px)) + 24px);
	height: calc(max(150px, var(--qtab-avatar-size, 160px)) + 24px);
}
.qt-author-box--preset-portrait .qt-author-box__avatar-img {
	border-radius: 0;
	filter: grayscale(0.15) contrast(1.05);
}
.qt-author-box--preset-portrait .qt-author-box__name,
.qt-author-box--preset-portrait .qt-author-box__bio,
.qt-author-box--preset-portrait .qt-author-box__job-title { color: #f5f0e6; }
.qt-author-box--preset-portrait .qt-author-box__name {
	font-family: Georgia, "Playfair Display", serif;
	font-size: 30px;
	font-weight: 500;
}
.qt-author-box--preset-portrait .qt-author-box__bio {
	font-family: Georgia, serif;
	font-style: italic;
	opacity: 0.85;
}
.qt-author-box--preset-portrait .qt-author-box__job-title { color: #e0b46c; opacity: 1; }
.qt-author-box--preset-portrait .qt-author-box__social-icon { color: #e0b46c; border-color: #e0b46c; }
.qt-author-box--preset-portrait .qt-author-box__social-icon:hover { background: #e0b46c; color: #1e1e1e; }

/* ------ Magazine: bold caps name, drop-cap bio, thick accent bar ------ */
.qt-author-box--preset-magazine {
	padding: 36px;
	gap: 36px;
	background: #fff;
	border: 0;
	border-top: 4px solid #111;
	border-bottom: 4px solid #111;
	border-radius: 0;
}
.qt-author-box--preset-magazine .qt-author-box__avatar {
	padding: 10px;
	border: 3px solid #111;
	background: transparent;
	width: calc(max(150px, var(--qtab-avatar-size, 160px)) + 20px);
	height: calc(max(150px, var(--qtab-avatar-size, 160px)) + 20px);
}
.qt-author-box--preset-magazine .qt-author-box__avatar-img { border-radius: 0; }
.qt-author-box--preset-magazine .qt-author-box__name {
	font-family: "Helvetica Neue", Arial, sans-serif;
	font-size: 26px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 2px;
	line-height: 1.15;
}
.qt-author-box--preset-magazine .qt-author-box__bio {
	font-family: Georgia, serif;
	font-size: 15px;
	line-height: 1.65;
}
.qt-author-box--preset-magazine .qt-author-box__bio p:first-child::first-letter {
	font-family: Georgia, serif;
	float: left;
	font-size: 42px;
	line-height: 1;
	padding-right: 8px;
	padding-top: 4px;
	font-weight: 700;
	color: #111;
}
.qt-author-box--preset-magazine .qt-author-box__job-title { color: #111; opacity: 1; font-weight: 700; }

/* ------ Modern: soft bg, blue circle accent, rounded avatar ------ */
.qt-author-box--preset-modern {
	padding: 36px;
	gap: 32px;
	background: #f7f8fa;
	border: 0;
	border-radius: 12px;
}
.qt-author-box--preset-modern .qt-author-box__avatar {
	width: calc(max(150px, var(--qtab-avatar-size, 150px)) + 20px);
	height: calc(max(150px, var(--qtab-avatar-size, 150px)) + 20px);
}
.qt-author-box--preset-modern .qt-author-box__avatar::before {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--qtab-accent, #0b6ecb);
	border-radius: 50%;
	opacity: 0.1;
	z-index: 0;
}
.qt-author-box--preset-modern .qt-author-box__avatar-img {
	width: max(150px, var(--qtab-avatar-size, 150px)) !important;
	height: max(150px, var(--qtab-avatar-size, 150px)) !important;
	border-radius: 12px;
	box-shadow: 0 8px 20px rgba(11,110,203,0.15);
}
.qt-author-box--preset-modern .qt-author-box__name {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	font-size: 26px;
	font-weight: 700;
	letter-spacing: -0.5px;
}
.qt-author-box--preset-modern .qt-author-box__job-title { color: var(--qtab-accent); opacity: 1; }

/* ------ Minimal: no frame, big whitespace, pure typography ------ */
.qt-author-box--preset-minimal {
	padding: 20px 0;
	background: transparent;
	border: 0;
	border-top: 1px solid #e5e7eb;
	border-bottom: 1px solid #e5e7eb;
	border-radius: 0;
}
.qt-author-box--preset-minimal .qt-author-box__avatar-img { border-radius: 50%; }
.qt-author-box--preset-minimal .qt-author-box__name {
	font-family: Georgia, serif;
	font-size: 26px;
	font-weight: 500;
}
.qt-author-box--preset-minimal .qt-author-box__bio {
	font-family: Georgia, serif;
	font-size: 15px;
	line-height: 1.65;
}
.qt-author-box--preset-minimal .qt-author-box__social-icon { border: 1px solid currentColor; }

/* ==================================================================
 * Responsive: stack the wide layout on narrow viewports
 * ================================================================ */
@media (max-width: 600px) {
	.qt-author-box.qt-author-box {
		flex-direction: column !important;
		text-align: center;
		gap: 20px;
		padding: 24px;
	}
	.qt-author-box__body { text-align: center; }
	.qt-author-box__header { justify-content: center; }
	.qt-author-box__social { justify-content: center; }
	.qt-author-box__avatar { margin: 0 auto; }
	.qt-author-box--preset-magazine .qt-author-box__bio p:first-child::first-letter {
		float: none; font-size: 32px; padding: 0;
	}
}

/* RTL */
.qt-author-box--rtl { direction: rtl; }
