/* ============================================================
   COMMENTS — Formulario de comentarios de WordPress
   Accesos Child Theme · Mobile first
============================================================ */


/* ============================================================
   LABELS VISIBLES
   WordPress oculta los labels con .screen-reader-text.
   Los recuperamos para accesibilidad: el HTML ya los pone
   antes del input, así que position:static los coloca
   naturalmente encima del campo.
============================================================ */

#commentform .screen-reader-text {
	position: static;
	width: auto;
	height: auto;
	padding: 0;
	margin: 0 0 0.35rem;
	overflow: visible;
	clip: auto;
	white-space: normal;
	display: block;
	font-size: var(--font-size-sm);
	font-weight: var(--font-weight-medium);
	color: var(--color-text);
}


/* ============================================================
   ESPACIADO DEL FORMULARIO
   Block layout (no flex) para evitar solapamiento de items.
============================================================ */

#commentform p,
#commentform > label {
	margin-top: 0;
	margin-bottom: 1.25rem;
}

#commentform > input[type="text"],
#commentform > input[type="email"],
#commentform > input[type="url"] {
	display: block;
	margin-bottom: 1.25rem;
}


/* ============================================================
   CAMPOS DE TEXTO
============================================================ */

#commentform input[type="text"],
#commentform input[type="email"],
#commentform input[type="url"],
#commentform textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 0.65rem 1rem;
	font-family: var(--font-family-base);
	font-size: var(--font-size-base);
	color: var(--color-text);
	background-color: var(--color-bg);
	border: 2px solid var(--color-gray-light);
	border-radius: 8px;
	outline: none;
	transition: border-color 0.2s ease;
}

#commentform input[type="text"]:focus,
#commentform input[type="email"]:focus,
#commentform input[type="url"]:focus,
#commentform textarea:focus {
	border-color: var(--color-brand-mid);
}

#commentform textarea {
	resize: vertical;
	min-height: 140px;
}


/* ============================================================
   CHECKBOX COOKIES
============================================================ */

.comment-form-cookies-consent {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
}


.comment-form-cookies-consent label {
	font-size: var(--font-size-sm);
	color: var(--color-text-muted);
	line-height: 1.4;
	cursor: pointer;
}
#wp-comment-cookies-consent input,
.comment-form-cookies-consent input[type="checkbox"]  {
    padding: 12px 14px;
    appearance: auto !important;
    margin-top: unset;
        width: unset;
    height: unset;
    	flex-shrink: 0;
	margin-top: 0.2rem;
	width: 18px;
	height: 18px;
	accent-color: var(--color-brand-mid);
	position: relative;
	z-index: 1;
}

/* ============================================================
   BOTÓN ENVIAR
============================================================ */

#commentform .submit {
	display: block;
	width: 100%;
	padding: 0.75rem 1.75rem;
	font-family: var(--font-family-base);
	font-size: var(--font-size-base);
	font-weight: var(--font-weight-bold);
	color: var(--color-text-inverse);
	background: var(--color-brand-mid);
	border: 2px solid var(--color-brand-mid);
	border-radius: 8px;
	cursor: pointer;
	transition: background-color 0.2s ease, border-color 0.2s ease;
}

#commentform .submit:hover {
	background: var(--color-brand-dark);
	border-color: var(--color-brand-dark);
}

#commentform .submit:focus-visible {
	outline: 3px solid var(--color-focus);
	outline-offset: 2px;
}


/* ============================================================
   DARK MODE
============================================================ */

html[data-theme="dark"] #commentform .screen-reader-text {
	color: var(--color-text);
}

html[data-theme="dark"] #commentform input[type="text"],
html[data-theme="dark"] #commentform input[type="email"],
html[data-theme="dark"] #commentform input[type="url"],
html[data-theme="dark"] #commentform textarea {
	background-color: var(--color-bg-subtle);
	color: var(--color-text);
	border-color: var(--color-bg-dark);
}

html[data-theme="dark"] #commentform input[type="text"]:focus,
html[data-theme="dark"] #commentform input[type="email"]:focus,
html[data-theme="dark"] #commentform input[type="url"]:focus,
html[data-theme="dark"] #commentform textarea:focus {
	border-color: var(--color-brand);
}


/* ============================================================
   HIGH CONTRAST
============================================================ */

html[data-contrast="high"] #commentform .screen-reader-text {
	color: #ffffff;
}

html[data-contrast="high"] #commentform input[type="text"],
html[data-contrast="high"] #commentform input[type="email"],
html[data-contrast="high"] #commentform input[type="url"],
html[data-contrast="high"] #commentform textarea {
	background: #000000;
	color: #ffffff;
	border-color: #ffffff;
}

html[data-contrast="high"] #commentform input[type="text"]:focus,
html[data-contrast="high"] #commentform input[type="email"]:focus,
html[data-contrast="high"] #commentform input[type="url"]:focus,
html[data-contrast="high"] #commentform textarea:focus {
	border-color: #ffd400;
}

html[data-contrast="high"] #commentform .submit {
	background: #000000;
	border-color: #ffffff;
	color: #ffffff;
}

html[data-contrast="high"] #commentform .submit:hover {
	background: #ffffff;
	color: #000000;
}

html[data-contrast="high"] .comment-form-cookies-consent label {
	color: #ffffff;
}
