/*
Theme Name: HUMAN-AI Child
Theme URI: https://human-ai.us.edu.pl
Description: Child theme for HUMAN-AI project (Divi 5). Provides design tokens (CSS vars), self-hosted fonts, lucide icon helper, custom post types and a small set of defensive Divi overrides. NO content shortcodes — page composition happens in Visual Builder using native Divi modules.
Author: HUMAN-AI consortium / University of Silesia
Author URI: https://us.edu.pl
Template: Divi
Version: 0.18.0
Text Domain: human-ai-child
*/

/* ----------------------------------------------------------
   Brand tokens
   :root { --ha-* } is rendered server-side by HA_Design_Tokens
   on wp_head priority 1. Source of truth: theme-tokens.json.
   ---------------------------------------------------------- */

/* ----------------------------------------------------------
   Defensive Divi overrides
   ---------------------------------------------------------- */

/* Hide page title on the home page (front page owns its own headline) */
body.home .entry-title,
body.home .et_post_meta_wrapper,
body.home .et_pb_title_meta_container {
  display: none !important;
}

/* Kill Divi's container borders/shadows that bleed through.
   NOTE: removed .et_pb_post from this list — was killing borders on
   Blog Module grid cards (and any other module that wraps in et_pb_post).
   If you need a borderless card somewhere, set it per-module in GUI. */
#left-area,
#main-content,
#content-area,
#main-content .container,
.et_pb_extra_column_main,
.et_pb_widget_area {
  border: 0 !important;
  box-shadow: none !important;
}
/* Section/row pseudo-element separators stay killed — those are the actual
   ghost vertical lines between Divi columns. Post pseudo-elements left alone. */
.et_pb_row::before,
.et_pb_row::after,
.et_pb_column::before,
.et_pb_column::after,
.et_pb_section::before,
.et_pb_section::after {
  display: none !important;
}

/* Hide right sidebar globally (full-width content) */
body.et_right_sidebar #sidebar,
body.et_left_sidebar  #sidebar,
.single-ha_partner #sidebar,
.single-ha_team    #sidebar,
.single-ha_event   #sidebar,
.single-ha_publication #sidebar,
.single-ha_deliverable #sidebar,
.archive #sidebar,
.blog    #sidebar,
.search  #sidebar {
  display: none !important;
}
body.et_right_sidebar #left-area,
body.et_left_sidebar  #left-area,
.single-ha_partner #left-area,
.single-ha_team    #left-area,
.archive #left-area,
.blog    #left-area,
.search  #left-area {
  width: 100% !important;
  max-width: 100% !important;
  padding-right: 0 !important;
  padding-left: 0 !important;
  float: none !important;
}
#main-content .container,
.archive .container,
.blog    .container,
.search  .container {
  width: 100% !important;
  max-width: var(--ha-container-max) !important;
}

/* ----------------------------------------------------------
   Base typography (overrides Divi defaults)
   ---------------------------------------------------------- */
body, .et_pb_section, .et_pb_row {
  font-family: var(--ha-font-sans);
  color: var(--ha-text-primary);
}
h1, h2, h3, h4, h5, h6 {
  font-family: var(--ha-font-serif);
  letter-spacing: -0.01em;
}
/* Divi modules: only set font-family — let per-module Color settings win */
.et_pb_module h1, .et_pb_module h2, .et_pb_module h3, .et_pb_module h4 {
  font-family: var(--ha-font-serif);
  letter-spacing: -0.01em;
}
/* Apply primary text color only outside Divi modules (non-builder content) */
body :not(.et_pb_module) > h1,
body :not(.et_pb_module) > h2,
body :not(.et_pb_module) > h3,
body :not(.et_pb_module) > h4 {
  color: var(--ha-text-primary);
}
a { color: var(--ha-color-primary-500); }
a:hover, a:focus { color: var(--ha-color-primary-600); }

/* ----------------------------------------------------------
   Defensive image rules
   ---------------------------------------------------------- */
.entry-content img,
.et_pb_post img,
.et_pb_text img {
  max-width: 100%;
  height: auto;
}

/* ----------------------------------------------------------
   Inline lucide icon utility (rendered by HA_Icons::svg)
   ---------------------------------------------------------- */
.ha-icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  vertical-align: middle;
}
.ha-icon--lg { width: 24px; height: 24px; }
.ha-icon--xl { width: 32px; height: 32px; }

/* ----------------------------------------------------------
   Accessibility
   ---------------------------------------------------------- */
*:focus-visible {
  outline: 2.5px solid var(--ha-color-primary-500);
  outline-offset: 2px;
  border-radius: var(--ha-radius-sm);
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

.ha-skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
}
.ha-skip-link:focus {
  left: 8px;
  background: var(--ha-color-primary-500);
  color: #fff;
  padding: 8px 14px;
  z-index: 9999;
  border-radius: var(--ha-radius-sm);
}

/* ----------------------------------------------------------
   Print
   ---------------------------------------------------------- */
@media print {
  body { color: #000; background: #fff; }
}
