/**
 * WD Author — frontend styles.
 *
 * Design goals:
 *  - Inherit every colour and font from the active theme — no hardcoded hex.
 *  - Purely typographic / spacing — no heavy card or box shadow.
 *  - A single thin bottom rule visually separates the box from the image below.
 *  - Starts at opacity:0; the wp_footer script fades it in once placed.
 *  - Expose CSS custom properties so a theme can override without !important.
 */

/* ── Custom properties ──────────────────────────────────────────────────── */
:root {
	--wd-author-font-size:    0.8125em;   /* ≈13 px at 16 px base           */
	--wd-author-line-height:  1.5;
	--wd-author-gap:          0.5em;
	--wd-author-meta-gap:     0.2em;
	--wd-author-avatar-gap:   0.65em;
	--wd-author-spacing-y:    0.9em;      /* top + bottom padding            */
	--wd-author-spacing-x:    0;          /* flush with content edges        */
	--wd-author-divider:      1px solid currentColor;
	--wd-author-divider-opacity: 0.12;
	--wd-author-muted:        0.6;        /* opacity for secondary text      */
	--wd-author-name-weight:  600;
	--wd-author-transition:   opacity 0.3s ease;
}

/* ── Container ─────────────────────────────────────────────────────────── */
.wd-author-box {
	display: flex;
	flex-direction: column;
	gap: var(--wd-author-gap);
	padding: var(--wd-author-spacing-y) var(--wd-author-spacing-x);
	border-bottom: var(--wd-author-divider);
	/* Soften the divider without losing theme color inheritance */
	border-bottom-color: rgba( 0, 0, 0, var(--wd-author-divider-opacity) );
	margin-bottom: 1.5em;
	font-size: var(--wd-author-font-size);
	line-height: var(--wd-author-line-height);
	font-family: inherit;
	color: inherit;
	box-sizing: border-box;
	/* Controlled by wp_footer script — starts hidden to prevent position flash */
	transition: var(--wd-author-transition);
}

/* ── Author row ─────────────────────────────────────────────────────────── */
.wd-author-box__author {
	display: flex;
	align-items: center;
	flex-wrap: nowrap;
	gap: var(--wd-author-avatar-gap);
}

/* ── Avatar ─────────────────────────────────────────────────────────────── */
.wd-author-box__avatar {
	flex-shrink: 0;
	line-height: 0;
}

.wd-author-box__avatar-img {
	display: block;
	border-radius: 50%;
	object-fit: cover;
}

/* ── Text column ─────────────────────────────────────────────────────────── */
.wd-author-box__meta {
	display: flex;
	flex-direction: column;
	gap: var(--wd-author-meta-gap);
	min-width: 0;
}

/* ── "By Name" line ─────────────────────────────────────────────────────── */
.wd-author-box__byline {
	display: block;
	font-size: 0.92em;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	opacity: var(--wd-author-muted);
}

/* ── Author name link ────────────────────────────────────────────────────── */
.wd-author-box__name {
	color: inherit;
	text-decoration: none;
	font-weight: var(--wd-author-name-weight);
}

.wd-author-box__name:hover,
.wd-author-box__name:focus {
	text-decoration: underline;
	text-underline-offset: 2px;
}

.wd-author-box__name:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
	border-radius: 2px;
}

/* ── Author bio ─────────────────────────────────────────────────────────── */
.wd-author-box__bio {
	display: block;
	opacity: var(--wd-author-muted);
	font-size: 0.95em;
}

/* ── Post description ───────────────────────────────────────────────────── */
.wd-author-box__description {
	margin: 0.4em 0 0;
	padding-top: 0.5em;
	border-top: 1px solid rgba( 0, 0, 0, var(--wd-author-divider-opacity) );
	opacity: 0.75;
	font-style: italic;
}

/* ── Responsive: wrap avatar above text below 380 px ─────────────────────── */
@media ( max-width: 380px ) {
	.wd-author-box__author {
		flex-wrap: wrap;
	}
}
