/**
 * Share Buttons & AI-powered Summaries Plugin - CSS Styles
 * Refactored with CSS custom properties, no !important overrides.
 * Version: 2.5.0
 */

/* =============================================
   CSS Custom Properties - Brand colors
   ============================================= */
.ayudawp-share-buttons {
	--ayudawp-twitter: #000000;
	--ayudawp-linkedin: #0077b5;
	--ayudawp-facebook: #1877f2;
	--ayudawp-telegram: #26A5E4;
	--ayudawp-whatsapp: #25d366;
	--ayudawp-email: #6c757d;
	--ayudawp-raindrop: #0F66E3;
	--ayudawp-reddit: #FF4500;
	--ayudawp-bluesky: #0085FF;
	--ayudawp-line: #00C300;
	--ayudawp-mastodon: #6364FF;
	--ayudawp-threads: #000000;
	--ayudawp-pinterest: #BD081C;
	--ayudawp-claude: #D97757;
	--ayudawp-chatgpt: #10a37f;
	--ayudawp-google-ai: #E84430;
	--ayudawp-gemini: #8E75B2;
	--ayudawp-grok: #000000;
	--ayudawp-perplexity: #20808D;
	--ayudawp-deepseek: #4D6BFE;
	--ayudawp-mistral: #F7D046;
	--ayudawp-copilot: #6264A7;
	--ayudawp-qwen: #615CED;
	--ayudawp-meta-ai: #0081FB;
	--ayudawp-copy-link: #5F6C7B;
	--ayudawp-web-share: #2F6FED;
	--ayudawp-custom-bg: #333333;
	--ayudawp-custom-text: #ffffff;

	/* Dark-mode adaptation tokens. Used by the .is-on-dark class set by
	   the optional JS background detector when the parent's background
	   luminance is below 0.5. The "on-dark" variants are only applied to
	   platforms whose brand color is pure black (twitter, threads, grok),
	   which would disappear on dark backgrounds. */
	--ayudawp-on-dark-fg: #e6e6e6;
	--ayudawp-on-dark-fg-muted: #b8b8b8;
	--ayudawp-on-dark-border: #555;
	--ayudawp-on-dark-border-subtle: rgba(255,255,255,0.18);
	--ayudawp-twitter-on-dark: #ffffff;
	--ayudawp-threads-on-dark: #ffffff;
	--ayudawp-grok-on-dark: #ffffff;
}

/* =============================================
   Main container
   ============================================= */
.ayudawp-share-buttons,
.ayudawp-share-buttons h3,
.ayudawp-share-buttons h4,
.ayudawp-share-buttons h5,
.ayudawp-share-buttons h6,
.ayudawp-share-buttons span,
.ayudawp-buttons-container {
	background: transparent;
	background-color: transparent;
}

.ayudawp-share-buttons {
	margin: 30px 0;
	padding: 20px 0;
	border-top: 1px solid #e0e0e0;
	border-bottom: 1px solid #e0e0e0;
	clear: both;
}

/* Separator line toggles (v2.4.0) */

/* Centered alignment */
.ayudawp-share-buttons.ayudawp-aiss-centered {
	text-align: center;
}

.ayudawp-share-buttons.ayudawp-aiss-centered .ayudawp-buttons-container {
	justify-content: center;
}

/* =============================================
   Title styles
   ============================================= */

/* Section title (v1.6.0) - spacing between groups */

/* Section separator (when no title but groups exist) */

/* =============================================
   Buttons container
   ============================================= */
.ayudawp-buttons-container {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
}

/* =============================================
   Base button styles
   ============================================= */
.ayudawp-share-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 8px 16px;
	border-radius: 4px;
	text-decoration: none;
	font-weight: 500;
	font-size: 14px;
	line-height: 1.4;
	transition: all 0.3s ease;
	border: 1px solid #ddd;
	width: 180px;
	min-height: 40px;
	text-align: center;
	background: transparent;
	color: #333;
	font-family: inherit;
	text-transform: capitalize;
	gap: 6px;
	cursor: pointer;
	position: relative;
	overflow: hidden;
	white-space: nowrap;
	box-sizing: border-box;
	-webkit-box-sizing: border-box;
	-moz-box-sizing: border-box;
}

/* Reset button defaults */
button.ayudawp-share-btn {
	border: 1px solid #ddd;
	background: transparent;
	color: #333;
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	outline: none;
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
}

/* Hover/focus/active states */
.ayudawp-share-btn:hover {
	transform: translateY(-2px);
	text-decoration: none;
	color: #000;
	background: rgba(0,0,0,0.05);
	border-color: #999;
	box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.ayudawp-share-btn:focus {
	outline: 2px solid #0073aa;
	outline-offset: 2px;
	text-decoration: none;
}

.ayudawp-share-btn:visited,
.ayudawp-share-btn:active {
	text-decoration: none;
}

.ayudawp-share-btn:active {
	transform: translateY(0);
}

button.ayudawp-share-btn:focus {
	outline: 2px solid #0073aa;
	outline-offset: 2px;
}

/* =============================================
   Button sizes (v1.6.0)
   ============================================= */

/* Compact */

/* Large */

/* Fluid - buttons expand to fill available space */

/* =============================================
   Icon styles
   ============================================= */
.ayudawp-icon-wrapper {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.ayudawp-icon {
	fill: currentColor;
}

.ayudawp-share-buttons.with-icons .ayudawp-share-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.ayudawp-share-buttons.with-icons .ayudawp-button-text {
	display: inline;
}

/* =============================================
   ICONS-ONLY style
   ============================================= */

/* Icons-only size variants */

/* =============================================
   MINIMAL style (default) - Clean transparent background
   ============================================= */
.ayudawp-share-buttons .ayudawp-share-btn {
	background: transparent;
	color: #333;
	border: 1px solid #ddd;
}

.ayudawp-share-buttons .ayudawp-share-btn:hover {
	background: rgba(0,0,0,0.05);
	color: #000;
	border-color: #999;
}

/* =============================================
   BRAND style - Platform colors
   Uses CSS custom properties for maintainability.
   Higher specificity via double class selector.
   ============================================= */
.ayudawp-share-buttons.brand .ayudawp-share-btn.twitter    { background: var(--ayudawp-twitter); border-color: var(--ayudawp-twitter); color: #fff; }
.ayudawp-share-buttons.brand .ayudawp-share-btn.email      { background: var(--ayudawp-email); border-color: var(--ayudawp-email); color: #fff; }
.ayudawp-share-buttons.brand .ayudawp-share-btn.claude     { background: var(--ayudawp-claude); border-color: var(--ayudawp-claude); color: #fff; }
.ayudawp-share-buttons.brand .ayudawp-share-btn.chatgpt    { background: var(--ayudawp-chatgpt); border-color: var(--ayudawp-chatgpt); color: #fff; }
.ayudawp-share-buttons.brand .ayudawp-share-btn.gemini     { background: var(--ayudawp-gemini); border-color: var(--ayudawp-gemini); color: #fff; }
.ayudawp-share-buttons.brand .ayudawp-share-btn.perplexity { background: var(--ayudawp-perplexity); border-color: var(--ayudawp-perplexity); color: #fff; }
.ayudawp-share-buttons.brand .ayudawp-share-btn.mistral    { background: var(--ayudawp-mistral); border-color: var(--ayudawp-mistral); color: #1a1a1a; }
.ayudawp-share-buttons.brand .ayudawp-share-btn.copilot    { background: var(--ayudawp-copilot); border-color: var(--ayudawp-copilot); color: #fff; }

/* Brand hover: darken via filter (single rule for all) */
.ayudawp-share-buttons.brand .ayudawp-share-btn:hover {
	filter: brightness(0.88);
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* =============================================
   OUTLINE style (v1.6.0) - Brand-colored borders, transparent bg
   ============================================= */
.ayudawp-share-buttons.outline .ayudawp-share-btn.twitter    { border-color: var(--ayudawp-twitter); color: var(--ayudawp-twitter); background: transparent; }
.ayudawp-share-buttons.outline .ayudawp-share-btn.email      { border-color: var(--ayudawp-email); color: var(--ayudawp-email); background: transparent; }
.ayudawp-share-buttons.outline .ayudawp-share-btn.claude     { border-color: var(--ayudawp-claude); color: var(--ayudawp-claude); background: transparent; }
.ayudawp-share-buttons.outline .ayudawp-share-btn.chatgpt    { border-color: var(--ayudawp-chatgpt); color: var(--ayudawp-chatgpt); background: transparent; }
.ayudawp-share-buttons.outline .ayudawp-share-btn.gemini     { border-color: var(--ayudawp-gemini); color: var(--ayudawp-gemini); background: transparent; }
.ayudawp-share-buttons.outline .ayudawp-share-btn.perplexity { border-color: var(--ayudawp-perplexity); color: var(--ayudawp-perplexity); background: transparent; }
.ayudawp-share-buttons.outline .ayudawp-share-btn.mistral    { border-color: var(--ayudawp-mistral); color: #8a6a00; background: transparent; }
.ayudawp-share-buttons.outline .ayudawp-share-btn.copilot    { border-color: var(--ayudawp-copilot); color: var(--ayudawp-copilot); background: transparent; }

/* Outline hover: fill with brand color */
.ayudawp-share-buttons.outline .ayudawp-share-btn:hover {
	color: #fff;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.ayudawp-share-buttons.outline .ayudawp-share-btn.twitter:hover    { background: var(--ayudawp-twitter); }
.ayudawp-share-buttons.outline .ayudawp-share-btn.email:hover      { background: var(--ayudawp-email); }
.ayudawp-share-buttons.outline .ayudawp-share-btn.claude:hover     { background: var(--ayudawp-claude); }
.ayudawp-share-buttons.outline .ayudawp-share-btn.chatgpt:hover    { background: var(--ayudawp-chatgpt); }
.ayudawp-share-buttons.outline .ayudawp-share-btn.gemini:hover     { background: var(--ayudawp-gemini); }
.ayudawp-share-buttons.outline .ayudawp-share-btn.perplexity:hover { background: var(--ayudawp-perplexity); }
.ayudawp-share-buttons.outline .ayudawp-share-btn.mistral:hover    { background: var(--ayudawp-mistral); color: #1a1a1a; }
.ayudawp-share-buttons.outline .ayudawp-share-btn.copilot:hover    { background: var(--ayudawp-copilot); }

/* =============================================
   CUSTOM style (v1.6.0) - User-defined colors via CSS vars
   ============================================= */
.ayudawp-share-buttons.custom .ayudawp-share-btn {
	background: var(--ayudawp-custom-bg);
	border-color: var(--ayudawp-custom-bg);
	color: var(--ayudawp-custom-text);
}

.ayudawp-share-buttons.custom .ayudawp-share-btn:hover {
	filter: brightness(0.88);
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* =============================================
   ICONS-ONLY style with brand colors
   ============================================= */

/* Icons-only hover */

/* =============================================
   DARK style - For dark backgrounds
   ============================================= */

/* =============================================
   AI Summary block (v2.0.0)
   Inline summary rendered before / after the buttons or at the start
   of the post content. Uses the native <details>/<summary> elements
   so the collapse/expand behavior works without JavaScript.
   ============================================= */

/*
 * Minimal is the default and, since 2.5.0, actually minimal: no box at all,
 * just a rule above the block. Until now it carried the same 1px border as
 * Outline, so the two presets were indistinguishable on most themes and the
 * choice between them meant nothing.
 */
.ayudawp-aiss-summary {
	margin: 24px 0;
	padding: 12px 0;
	border: 0;
	border-top: 1px solid #e0e0e0;
	border-radius: 0;
	background: transparent;
}

.ayudawp-aiss-summary-details {
	margin: 0;
}

.ayudawp-aiss-summary-details > summary {
	cursor: pointer;
	font-weight: 600;
	list-style: none;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	user-select: none;
}

/* Hide the native disclosure triangle in WebKit/Blink. */
.ayudawp-aiss-summary-details > summary::-webkit-details-marker {
	display: none;
}

/* CSS caret that rotates when the details element is open. */
.ayudawp-aiss-summary-details > summary::after {
	content: "";
	display: inline-block;
	width: 0;
	height: 0;
	margin-left: auto;
	border-left: 5px solid transparent;
	border-right: 5px solid transparent;
	border-top: 6px solid currentColor;
	transition: transform 0.2s ease;
}

.ayudawp-aiss-summary-details[open] > summary::after {
	transform: rotate(180deg);
}

.ayudawp-aiss-summary-icon {
	display: inline-flex;
	align-items: center;
}

.ayudawp-aiss-summary-icon svg {
	width: 16px;
	height: 16px;
}

.ayudawp-aiss-summary-content {
	margin-top: 8px;
}

.ayudawp-aiss-summary-content p {
	margin: 0;
	line-height: 1.5;
}

/* Placeholder variant: contains the "Generate AI summary" button shown to
   visitors when the post has no stored summary yet (v2.0.0 frontend gen). */
.ayudawp-aiss-summary-generate-btn {
	border: 2px solid var(--ayudawp-aiss-accent);
	color: var(--ayudawp-aiss-accent);
}

.ayudawp-aiss-summary-generate-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 14px;
	background: transparent;
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	font-weight: 600;
	font-size: 0.95em;
	color: inherit;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.ayudawp-aiss-summary-generate-btn:hover:not(:disabled) {
	background: rgba(0, 0, 0, 0.04);
	border-color: #c0c0c0;
}

.ayudawp-aiss-summary-generate-btn:disabled {
	cursor: wait;
	opacity: 0.7;
}

.ayudawp-aiss-summary-generate-btn .ayudawp-aiss-summary-icon svg {
	width: 16px;
	height: 16px;
}

/* =============================================
   AI Summary: one paragraph per sentence (v2.1.0)
   Each sentence renders as its own <p> for readability. itemprop="abstract"
   sits on the wrapping container so the schema value stays single.
   ============================================= */

/* Bullet-list format (v2.4.0): opt-in from settings, one <li> per point.
   list-style is explicit because many themes reset it inside articles. */

/* =============================================
   AI Summary: visual style presets (v2.1.0)
   minimal = base look above; the variants below are opt-in from settings.
   --ayudawp-aiss-accent can be overridden by a theme to match its palette.
   ============================================= */

.ayudawp-aiss-summary {
	--ayudawp-aiss-accent: #2563eb;
}

/* Outline: a real box, drawn in the accent colour. */

/* Brand: filled accent background with light text. */

/* Dark: dark callout on light themes. */

/* Custom: colors from the settings color pickers (inline CSS variables). */

/* Keep the attribution and generate button legible on filled variants. */

/*
 * Placeholder variant: the block is a single button, so the preset paints the
 * button and not the wrapper. Until 2.5.0 the filled presets painted the
 * <aside>, which with `padding: 0` meant a slab of accent colour with a small
 * outlined button floating inside it. These rules repeat the base class to
 * outweigh the presets above, which they tie with otherwise.
 */
.ayudawp-aiss-summary.ayudawp-aiss-summary--placeholder {
	display: block;
	width: auto;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: inherit;
}

/* =============================================
   AI Summary: icon position (v2.1.0)
   "hidden" is also handled server-side (the icon span is not rendered).
   ============================================= */

/* =============================================
   AI Summary: visible keyboard focus (v2.1.0, a11y)
   ============================================= */

.ayudawp-aiss-summary-details > summary:focus-visible,
.ayudawp-aiss-summary-generate-btn:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
	border-radius: 4px;
}

/* =============================================
   Auto adaptation to dark backgrounds
   Triggered by the .is-on-dark class set by the JS background detector
   (added when the container's parent background luminance is below 0.5).
   Skipped when container has .dark or .custom (explicit manual choices).
   ============================================= */

/* MINIMAL on dark: legible text and visible border */

/* OUTLINE on dark: black-branded platforms switch to white */

/* Mistral text was #8a6a00 (low contrast on dark) — fall back to brand color */

/* BRAND and ICONS-ONLY on dark: black-branded platforms get a subtle
   light border so they stand out from the dark page background */

/* =============================================
   Tooltip styles
   ============================================= */

/* =============================================
   Copy-to-clipboard / native share notification (v2.5.0)
   Moved out of the inline styles the script used to write, so a site can
   restyle it and the Content Security Policy of strict setups is not a
   problem.
   ============================================= */

/* =============================================
   Accessibility (v2.5.0)
   ============================================= */

/* The native share button is rendered hidden and revealed by the script only
   where navigator.share exists. `display: inline-flex` on .ayudawp-share-btn
   would otherwise beat the user agent's [hidden] rule. */
.ayudawp-share-btn[hidden] {
	display: none;
}

/* Keyboard focus ring that does not show on mouse clicks. The plain :focus
   rule above stays for browsers without :focus-visible. */
.ayudawp-share-btn:focus-visible {
	outline: 2px solid #0073aa;
	outline-offset: 2px;
}

/* =============================================
   Mobile compact mode (v2.5.0)
   Desktop renders exactly as before: everything here lives inside the mobile
   breakpoint, and the toggle is hidden outside it.
   ============================================= */

@media (max-width: 600px) {
	/*
	 * The toggle follows the block's own alignment setting (v2.5.0): it used
	 * to be centred always, which looked wrong on a left-aligned block.
	 */

	/*
	 * And it never inherits the icons-only shape. A 40px circle cannot hold
	 * "Share" plus an icon, so the label came out clipped; the toggle is a
	 * pill with room for both whatever the button style is.
	 */

	/* The same caret as the summary block, rotating when the block opens. */

	/* The visible buttons follow the alignment setting too. */

	/* Single-button mode: nothing but the toggle until it is expanded. */

	/* "N visible + more": the buttons past the count, and any section title
	   left with nothing under it, are marked .aiss-overflow by PHP. */

	/* Compact blocks keep their buttons side by side: the full-width stacking
	   of the 480px breakpoint would defeat the point of showing only three. */

	/* Fluid still fills the row when compact mode is on. */
}

/* =============================================
   Responsive
   ============================================= */
@media (max-width: 768px) {
	.ayudawp-buttons-container {
		gap: 8px;
	}

	.ayudawp-share-btn {
		padding: 6px 12px;
		font-size: 13px;
		width: 150px;
		min-height: 36px;
	}

	.ayudawp-share-buttons {
		padding: 15px 0;
		margin: 20px 0;
	}
}

@media (max-width: 480px) {
	.ayudawp-buttons-container {
		flex-direction: column;
		align-items: center;
	}

	.ayudawp-share-btn {
		width: 100%;
		max-width: 300px;
	}

	/*
	 * Fluid keeps filling the row on phones (v2.5.0). Until now this rule made
	 * it `width: 100%` with `flex: none`, which is exactly what every other
	 * size does at this breakpoint, so choosing "fluid" changed nothing on a
	 * phone. Two per row is what tells it apart from the stacked sizes.
	 */
}

/* =============================================
   Admin danger zone (shared with frontend CSS)
   ============================================= */

/* =============================================
   AI Summary: dark-mode adaptation
   Mirrors the .is-on-dark token system used by the share buttons.
   ============================================= */

/* Only minimal/outline (transparent background) adapt to a dark page; the
   filled presets (brand/dark/custom) carry their own colors, like the share
   buttons skip .dark/.custom. */