/* ==========================================================================
   HNME Exclusive - Componentes de contenido (web + editor)
   Los selectores de elementos genéricos (blockquote, table, input...) van
   dentro de :where(), que tiene especificidad CERO: cualquier regla con una
   clase (por ejemplo la de un plugin) gana sin necesidad de !important.
   Para excluir un elemento concreto añade la clase "hnme-no-style".
   ========================================================================== */

/* ---------- Citas y manifiestos ---------- */
:where(:is(.entry-content, .editor-styles-wrapper, .hnme-card-excerpt) blockquote:not(.hnme-no-style)),
.wp-block-quote {
  position: relative;
  margin: 2rem auto;
  padding: 1.75rem 2.25rem;
  background: linear-gradient(135deg, var(--hnme-royal) 0%, var(--hnme-royal-mid) 65%, var(--hnme-burgundy) 100%);
  color: #FFFFFF;
  border-left: 6px solid var(--hnme-gold-bright);
  border-radius: var(--hnme-radius-md);
  box-shadow: var(--hnme-shadow-md);
  font-family: var(--hnme-font-editorial);
  font-style: italic;
  font-size: clamp(1.08rem, 1.6vw, 1.32rem);
  line-height: 1.6;
}

:where(:is(.entry-content, .editor-styles-wrapper, .hnme-card-excerpt) blockquote:not(.hnme-no-style) p),
.wp-block-quote p {
  color: #FFFFFF;
  margin-bottom: 0.5rem;
}

:where(:is(.entry-content, .editor-styles-wrapper, .hnme-card-excerpt) blockquote:not(.hnme-no-style) cite),
.wp-block-quote cite {
  display: block;
  margin-top: 0.75rem;
  font-family: var(--hnme-font-sans);
  font-style: normal;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--hnme-gold-bright);
}

/* ---------- Separadores heráldicos ---------- */
:where(:is(.entry-content, .editor-styles-wrapper) hr:not(.hnme-no-style)),
.wp-block-separator {
  border: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--hnme-gold) 25%, var(--hnme-crimson) 50%, var(--hnme-gold) 75%, transparent 100%);
  margin: 2.25rem auto;
  opacity: 0.85;
}

/* ---------- Tablas ---------- */
:where(:is(.entry-content, .editor-styles-wrapper) table:not(.hnme-no-style)) {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1.75rem 0;
  background: var(--hnme-surface);
  border-radius: var(--hnme-radius-md);
  overflow: hidden;
  box-shadow: var(--hnme-shadow-sm);
  border: 1px solid var(--hnme-border);
}

:where(:is(.entry-content, .editor-styles-wrapper) table:not(.hnme-no-style) thead th) {
  background: linear-gradient(90deg, var(--hnme-royal) 0%, var(--hnme-royal-mid) 100%);
  color: #FFFFFF;
  font-family: var(--hnme-font-serif);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.95rem 1.15rem;
  text-align: left;
  border-bottom: 3px solid var(--hnme-gold);
}

:where(:is(.entry-content, .editor-styles-wrapper) table:not(.hnme-no-style) tbody td) {
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--hnme-border);
  color: var(--hnme-ink);
}

:where(:is(.entry-content, .editor-styles-wrapper) table:not(.hnme-no-style) tbody tr:nth-child(even)) {
  background-color: var(--hnme-ivory);
}

:where(:is(.entry-content, .editor-styles-wrapper) table:not(.hnme-no-style) tbody tr:hover) {
  background-color: var(--hnme-gold-soft);
}

/* Tablas anchas: desplazamiento horizontal en pantallas pequeñas */
@media (max-width: 640px) {
  :where(:is(.entry-content) table:not(.hnme-no-style)) {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ---------- Campos de formulario ---------- */
:where(:is(.entry-content, .editor-styles-wrapper, .hnme-footer, .hnme-header-aside, .hnme-topbar-right, .comment-respond, .search-form, .woocommerce) :is(input[type="text"], input[type="email"], input[type="tel"], input[type="url"], input[type="number"], input[type="password"], input[type="search"], input[type="date"], select, textarea):not(.hnme-no-style)) {
  width: 100%;
  padding: 0.72rem 1rem;
  font-family: var(--hnme-font-sans);
  font-size: 0.95rem;
  color: var(--hnme-ink);
  background-color: var(--hnme-surface);
  border: 1.5px solid rgba(9, 30, 58, 0.2);
  border-radius: var(--hnme-radius-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

:where(:is(.entry-content, .editor-styles-wrapper, .hnme-footer, .hnme-header-aside, .hnme-topbar-right, .comment-respond, .search-form, .woocommerce) :is(input[type="text"], input[type="email"], input[type="tel"], input[type="url"], input[type="number"], input[type="password"], input[type="search"], input[type="date"], select, textarea):not(.hnme-no-style):focus) {
  border-color: var(--hnme-gold);
  box-shadow: 0 0 0 3px rgba(200, 155, 43, 0.3);
}

/* ---------- Botones ----------
   Se estilizan: .hnme-btn, botones de bloques, input[type=submit/button] y
   <button> dentro de formularios del propio tema (búsqueda, comentarios, pie).
   Un <button> suelto dentro del contenido (p. ej. de un plugin) NO se toca;
   para estilizarlo añade la clase "hnme-btn". */
.hnme-btn,
.wp-block-button__link,
.wp-element-button,
.wp-block-file__button,
:where(:is(.entry-content, .editor-styles-wrapper, .hnme-footer, .hnme-header-aside, .hnme-topbar-right, .comment-respond, .search-form) :is(input[type="submit"], input[type="button"]):not(.hnme-no-style)),
:where(:is(.hnme-footer, .hnme-header-aside, .hnme-topbar-right, .comment-respond, .search-form, .wp-block-search) button:not(.hnme-no-style)) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.78rem 1.65rem;
  font-family: var(--hnme-font-sans);
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  color: #FFFFFF;
  background: linear-gradient(135deg, var(--hnme-crimson) 0%, var(--hnme-crimson-bright) 100%);
  border: 1.5px solid var(--hnme-gold);
  border-radius: var(--hnme-radius-sm);
  box-shadow: 0 6px 18px rgba(177, 27, 36, 0.28);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.hnme-btn:hover,
.wp-block-button__link:hover,
.wp-element-button:hover,
.wp-block-file__button:hover,
:where(:is(.entry-content, .editor-styles-wrapper, .hnme-footer, .hnme-header-aside, .hnme-topbar-right, .comment-respond, .search-form) :is(input[type="submit"], input[type="button"]):not(.hnme-no-style):hover),
:where(:is(.hnme-footer, .hnme-header-aside, .hnme-topbar-right, .comment-respond, .search-form, .wp-block-search) button:not(.hnme-no-style):hover) {
  transform: translateY(-2px);
  background: linear-gradient(135deg, var(--hnme-crimson-deep) 0%, var(--hnme-crimson) 100%);
  color: #FFFFFF;
  box-shadow: 0 10px 24px rgba(177, 27, 36, 0.38);
}

@media (prefers-reduced-motion: reduce) {
  .hnme-btn:hover,
  .wp-block-button__link:hover,
  .wp-element-button:hover {
    transform: none;
  }
}
