/**
 * Domechy Downloads — structure and default appearance.
 *
 * This file is self sufficient: the plugin looks right with no
 * other CSS present. Override anything you like from Additional
 * CSS (see styles/2026-07-26-domechy-downloads-appearance.css) —
 * that file now contains only the variables worth changing, and
 * it wins over these defaults.
 *
 * Colours come from custom properties, so recolouring the whole
 * thing is three lines in Additional CSS rather than an edit here.
 *
 * Note the explicit resets on buttons and links. Astra styles bare
 * <button> and <a> elements site-wide, and without these the like
 * and save buttons inherit the theme's solid orange fill and read
 * as primary calls to action, which is louder than the download
 * button they sit next to.
 *
 * Mobile first per the Domechy Mobile UX Standard: base styles
 * are phone, min-width bumps at 600 and 921. Tap targets 44px,
 * font floor 15px body / 13px meta.
 */

.dd-download,
.dd-reactions,
.dd-stats,
.dd-author,
.dd-saved,
.dd-notes {
	--dd-orange: #f47c1a;
	--dd-orange-dark: #e68900;
	--dd-teal: #00c4cc;
	--dd-line: rgba(127, 127, 127, 0.28);
	--dd-line-strong: rgba(127, 127, 127, 0.5);
	--dd-hover: rgba(127, 127, 127, 0.09);
	--dd-radius: 12px;
	--dd-radius-pill: 14px;
	--dd-heading: 'Poppins', system-ui, -apple-system, sans-serif;
	--dd-body: 'Roboto', system-ui, -apple-system, sans-serif;
}

/* ── DOWNLOAD BUTTON ─────────────────────────────────────── */

.dd-download {
	display: flex;
	flex-direction: column;
	gap: 10px;
	max-width: 380px;
	font-family: var(--dd-body);
}

.dd-download__button,
.dd-download__button:visited {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 44px;
	padding: 15px 24px;
	border: none;
	border-radius: var(--dd-radius-pill);
	background: var(--dd-orange);
	color: #fff !important;
	font-family: var(--dd-heading);
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.01em;
	text-align: center;
	text-decoration: none !important;
	text-transform: none;
	cursor: pointer;
	transition: background 0.18s ease, transform 0.18s ease;
}

.dd-download__button:hover,
.dd-download__button:focus {
	background: var(--dd-orange-dark);
	color: #fff !important;
	transform: translateY(-1px);
}

.dd-download__button:focus-visible {
	outline: 2px solid var(--dd-teal);
	outline-offset: 3px;
}

.dd-download__icon {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
}

.dd-download__secondary,
.dd-download__secondary:visited {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	font-family: var(--dd-body);
	font-size: 13.5px;
	font-weight: 500;
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
	opacity: 0.7;
}

.dd-download__secondary:hover,
.dd-download__secondary:focus {
	color: inherit;
	opacity: 1;
}

.dd-download__optin {
	display: flex;
	align-items: flex-start;
	gap: 9px;
	min-height: 44px;
	font-size: 13px;
	line-height: 1.5;
	cursor: pointer;
}

.dd-download__optin-input {
	margin: 2px 0 0;
	width: 18px;
	height: 18px;
	flex-shrink: 0;
}

.dd-download__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 14px;
	margin: 0;
	font-size: 13px;
	opacity: 0.65;
}

.dd-download__note {
	margin: 0;
	font-size: 13px;
	line-height: 1.6;
	opacity: 0.65;
}

.dd-download__error {
	padding: 10px 14px;
	border-left: 3px solid #b32d2e;
	background: rgba(179, 45, 46, 0.08);
	font-size: 13px;
}

.dd-download--compact {
	max-width: none;
	gap: 6px;
}

.dd-download--compact .dd-download__button {
	padding: 11px 18px;
	font-size: 13px;
}

/* ── AUTHOR CARD ─────────────────────────────────────────── */

.dd-author {
	display: flex;
	align-items: center;
	gap: 12px;
	font-family: var(--dd-body);
}

.dd-author__avatar {
	display: block;
	width: 44px;
	height: 44px;
	flex-shrink: 0;
	border-radius: 50%;
	overflow: hidden;
	background: rgba(127, 127, 127, 0.15);
}

.dd-author__avatar img,
.dd-author__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: 50%;
}

.dd-author__text {
	display: flex;
	flex-direction: column;
	gap: 1px;
	min-width: 0;
}

.dd-author__label,
.dd-author__role {
	font-size: 13px;
	line-height: 1.3;
	opacity: 0.6;
}

.dd-author__name,
.dd-author__name:visited {
	font-family: var(--dd-heading);
	font-size: 15px;
	font-weight: 700;
	line-height: 1.3;
	color: inherit;
	text-decoration: none;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.dd-author__name:hover,
.dd-author__name:focus {
	color: inherit;
	text-decoration: underline;
}

/* ── STATS ROW ───────────────────────────────────────────── */

.dd-stats {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 20px;
	margin: 0;
	padding: 0;
	list-style: none;
	font-family: var(--dd-body);
}

.dd-stats__item {
	display: flex;
	flex-direction: column;
	gap: 1px;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* A count of zero shows nothing rather than announcing that
   nobody cares. Load bearing, not decorative. */
.dd-stats__item--empty {
	display: none;
}

.dd-stats__value {
	font-family: var(--dd-heading);
	font-size: 17px;
	font-weight: 700;
	line-height: 1.2;
}

.dd-stats__label {
	font-size: 13px;
	line-height: 1.3;
	opacity: 0.6;
}

/* ── LIKE AND SAVE ───────────────────────────────────────── */

.dd-reactions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	font-family: var(--dd-body);
}

.dd-reactions__group {
	display: inline-flex;
	align-items: stretch;
	border: 1px solid var(--dd-line);
	border-radius: var(--dd-radius);
	overflow: hidden;
}

/*
 * The resets here are load bearing. Astra gives every bare <button>
 * a solid theme-orange fill, which would make Like and Save shout
 * louder than the download button beside them.
 */
.dd-reaction,
.dd-reaction:visited {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	min-height: 44px;
	min-width: 52px;
	margin: 0;
	padding: 0 14px;
	border: 0;
	border-radius: 0;
	background: transparent;
	background-color: transparent;
	box-shadow: none;
	color: inherit;
	font-family: var(--dd-heading);
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: normal;
	text-transform: none;
	cursor: pointer;
	transition: background 0.16s ease, color 0.16s ease;
	-webkit-tap-highlight-color: transparent;
}

.dd-reaction + .dd-reaction {
	border-left: 1px solid var(--dd-line);
}

.dd-reaction:hover,
.dd-reaction:focus {
	background: var(--dd-hover);
	background-color: var(--dd-hover);
	color: inherit;
	box-shadow: none;
}

.dd-reaction:focus-visible {
	outline: 2px solid var(--dd-teal);
	outline-offset: -2px;
}

.dd-reaction__icon {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	opacity: 0.75;
	transition: opacity 0.16s ease;
}

.dd-reaction:hover .dd-reaction__icon {
	opacity: 1;
}

.dd-reaction__count {
	font-variant-numeric: tabular-nums;
	font-size: 13.5px;
	opacity: 0.65;
}

/* Active state is a colour shift, not a filled slab. */
.dd-reaction.is-active {
	background: rgba(127, 127, 127, 0.07);
	background-color: rgba(127, 127, 127, 0.07);
}

.dd-reaction--like.is-active {
	color: var(--dd-orange);
}

.dd-reaction--save.is-active {
	color: var(--dd-teal);
}

.dd-reaction.is-active .dd-reaction__icon {
	fill: currentColor;
	opacity: 1;
}

.dd-reaction.is-active .dd-reaction__count {
	opacity: 0.85;
}

/* Same rule as the stats row: no number, no element. */
.dd-reaction__count:empty {
	display: none;
}

.dd-reaction[data-dd-busy="1"] {
	opacity: 0.55;
	pointer-events: none;
}

/* Icon-only mode keeps the label in the DOM for screen readers.
   Removing this makes the buttons unusable without sight. */
.dd-reaction__sr {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.dd-reactions__message {
	font-size: 13px;
	line-height: 1.4;
	opacity: 0.75;
}

.dd-reactions__message:empty {
	display: none;
}

/* ── PRINT NOTES ─────────────────────────────────────────── */

.dd-notes {
	font-family: var(--dd-body);
}

.dd-notes__title {
	font-family: var(--dd-heading);
	font-size: 18px;
	font-weight: 800;
	margin: 0 0 10px;
}

.dd-notes__body {
	font-size: 15px;
	line-height: 1.75;
}

.dd-notes__body p {
	margin: 0 0 10px;
}

.dd-notes__body p:last-child {
	margin-bottom: 0;
}

/* ── SAVED MODELS ────────────────────────────────────────── */

.dd-saved {
	display: grid;
	grid-template-columns: 1fr;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.dd-saved__item {
	margin: 0;
	padding: 0;
	list-style: none;
}

.dd-saved__link,
.dd-saved__link:visited {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-height: 44px;
	padding: 12px 14px;
	border: 1px solid rgba(127, 127, 127, 0.2);
	border-radius: var(--dd-radius);
	color: inherit;
	text-decoration: none;
}

.dd-saved__link:hover,
.dd-saved__link:focus {
	border-color: var(--dd-line-strong);
	color: inherit;
}

.dd-saved__title {
	font-family: var(--dd-heading);
	font-size: 15px;
	font-weight: 700;
	line-height: 1.35;
}

.dd-saved__meta {
	font-size: 13px;
	opacity: 0.6;
}

.dd-saved__empty {
	font-size: 15px;
	line-height: 1.6;
	opacity: 0.75;
}

/* ── STICKY DOWNLOAD BAR ─────────────────────────────────── */

/* Position and safe-area padding are structural: without them the
   bar sits under the iPhone home indicator. The look of it is in
   the appearance layer. */
.dd-sticky-download {
	position: sticky;
	bottom: 0;
	z-index: 20;
	display: block;
	padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
	margin: 0 -16px;
	background: rgba(255, 255, 255, 0.97);
	backdrop-filter: blur(8px);
	border-top: 1px solid var(--dd-line);
}

.dd-sticky-download .dd-download {
	width: 100%;
	flex: 1 1 auto;
	max-width: none;
}

.dd-sticky-download .dd-download__button {
	min-height: 48px;
}

/* ── 601px AND UP ────────────────────────────────────────── */

@media (min-width: 601px) {
	.dd-stats {
		gap: 10px 28px;
	}

	.dd-stats__value {
		font-size: 18px;
	}

	.dd-saved {
		grid-template-columns: repeat(2, 1fr);
	}

	/* Past phone width the primary action lives in the layout
	   rather than pinned to the bottom of the screen. */
	.dd-sticky-download {
		position: static;
		padding: 0;
		margin: 0;
		background: none;
		backdrop-filter: none;
		border-top: none;
	}
}

/* ── 922px AND UP ────────────────────────────────────────── */

@media (min-width: 922px) {
	.dd-author__avatar {
		width: 52px;
		height: 52px;
	}

	.dd-saved {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 600px) {
	.dd-download {
		max-width: none;
	}
}
