/*
Theme Name: JTE Academy Clean
Theme URI: https://academia.jteautomation.es
Author: JTE Automation
Description: Tema propio limpio para una academia de automatizacion con MasterStudy LMS.
Version: 0.1.0
Text Domain: jte-academy-clean
*/

:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-2: #eef2ed;
  --text: #111827;
  --text-soft: #374151;
  --muted: #667085;
  --border: rgba(17, 24, 39, 0.12);
  --brand: #145c64;
  --brand-strong: #0d3d45;
  --accent: #d89b1d;
  --ok: #2f8f5b;
  --shadow: 0 18px 50px rgba(17, 24, 39, 0.10);
  --radius: 12px;
  --container: 1180px;
  --header-height: 76px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #090d18;
  --surface: #111827;
  --surface-2: #1a2435;
  --text: #f3f6fb;
  --text-soft: #d7deea;
  --muted: #a7b0bf;
  --border: rgba(226, 232, 240, 0.16);
  --brand: #6ed3cf;
  --brand-strong: #2fb4ad;
  --accent: #f2b84b;
  --ok: #7ddc9f;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.38);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--brand) 10%, transparent), transparent 420px),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

body.admin-bar .site-header {
  top: 32px;
}

@media (max-width: 782px) {
  body.admin-bar .site-header {
    top: 46px;
  }
}

a {
  color: var(--brand);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent);
}

img,
video,
iframe {
  max-width: 100%;
}

img {
  height: auto;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 0.55em;
  color: var(--text);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: 0;
  text-wrap: balance;
}

p {
  margin: 0 0 1.2em;
  color: var(--text-soft);
}

ul,
ol {
  color: var(--text-soft);
}

.site {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-main {
  flex: 1;
  width: 100%;
}

.container {
  width: min(var(--container), calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  min-height: var(--header-height);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
}

.header-inner {
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 24px;
}

.site-branding {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.custom-logo {
  display: block;
  max-height: 46px;
  width: auto;
}

.site-title {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
}

.site-description {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.2;
}

.primary-nav {
  margin-left: auto;
}

.primary-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.primary-menu li {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}

.primary-menu a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--text);
  font-size: 0.94rem;
  font-weight: 750;
  text-decoration: none;
}

.primary-menu a:hover,
.primary-menu .current-menu-item > a,
.primary-menu .current-menu-ancestor > a {
  background: var(--surface-2);
  color: var(--brand);
}

.primary-menu .sub-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}

.primary-menu li:hover > .sub-menu,
.primary-menu li:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle,
.menu-toggle {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 5px 12px 5px 6px;
  box-shadow: 0 8px 22px rgba(17, 24, 39, 0.08);
}

.theme-toggle-track {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #dce5df;
}

.theme-toggle-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 3px 10px rgba(17, 24, 39, 0.24);
  transition: transform 0.18s ease, background 0.18s ease;
}

html[data-theme="dark"] .theme-toggle-track {
  background: var(--brand-strong);
}

html[data-theme="dark"] .theme-toggle-thumb {
  transform: translateX(18px);
  background: var(--accent);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.menu-toggle-lines,
.menu-toggle-lines::before,
.menu-toggle-lines::after {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--text);
}

.menu-toggle-lines {
  position: relative;
}

.menu-toggle-lines::before,
.menu-toggle-lines::after {
  content: "";
  position: absolute;
  left: 0;
}

.menu-toggle-lines::before {
  top: -6px;
}

.menu-toggle-lines::after {
  top: 6px;
}

.site-content {
  padding-block: 54px 72px;
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
}

.entry,
.content-card,
.comments-area,
.widget,
.masterstudy-course-card,
.stm_lms_courses__single,
.masterstudy-single-course {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.entry {
  padding: clamp(24px, 4vw, 48px);
}

.page .entry,
.single-stm-courses .entry,
.elementor-page .entry {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.entry-header {
  margin-bottom: 28px;
}

.entry-title {
  color: var(--text);
  font-size: clamp(2rem, 5vw, 4rem);
}

.entry-meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.entry-content > *:first-child {
  margin-top: 0;
}

.entry-content > *:last-child {
  margin-bottom: 0;
}

.entry-content,
.entry-content p,
.entry-content li,
.elementor,
.elementor p,
.elementor li,
.masterstudy-single-course,
.masterstudy-single-course p,
.masterstudy-course-card,
.stm_lms_courses__single {
  color: var(--text-soft);
}

.entry-content h1,
.entry-content h2,
.entry-content h3,
.elementor-heading-title,
.masterstudy-course-card__title,
.masterstudy-single-course__title,
.stm_lms_courses__single--title {
  color: var(--text) !important;
}

.wp-block-button__link,
button,
input[type="submit"],
.button,
.btn,
.masterstudy-button,
.stm_lms_button {
  border-radius: 999px !important;
  background: var(--brand) !important;
  color: #ffffff !important;
  border: 0 !important;
  font-weight: 800 !important;
  text-decoration: none !important;
}

.wp-block-button__link:hover,
button:hover,
input[type="submit"]:hover,
.button:hover,
.btn:hover,
.masterstudy-button:hover,
.stm_lms_button:hover {
  background: var(--brand-strong) !important;
  color: #ffffff !important;
}

input,
textarea,
select {
  max-width: 100%;
  border: 1px solid var(--border) !important;
  border-radius: 10px !important;
  background: var(--surface) !important;
  color: var(--text) !important;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent) !important;
}

.course-grid,
.stm_lms_courses,
.masterstudy-courses,
.masterstudy-lms-courses {
  gap: 24px !important;
}

.masterstudy-course-card,
.stm_lms_courses__single {
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.masterstudy-course-card:hover,
.stm_lms_courses__single:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 62px rgba(17, 24, 39, 0.16);
}

.price,
.masterstudy-course-price,
.stm_lms_courses__single--price {
  color: var(--ok) !important;
  font-weight: 900 !important;
}

.masterstudy-curriculum-list,
.masterstudy-curriculum-list__section,
.masterstudy-course-player-content__wrapper,
.masterstudy-course-player-content__header,
.masterstudy-account-container,
.masterstudy-account-sidebar__wrapper {
  border-color: var(--border) !important;
  border-radius: var(--radius) !important;
  background: var(--surface) !important;
  color: var(--text) !important;
}

.post-list {
  display: grid;
  gap: 24px;
}

.pagination,
.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.page-numbers,
.nav-links a,
.nav-links span {
  display: inline-flex;
  min-width: 38px;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.page-numbers.current {
  background: var(--brand);
  color: #ffffff;
}

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding-block: 28px;
}

.footer-inner p {
  margin: 0;
  color: var(--muted);
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 920px) {
  .header-inner {
    gap: 12px;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .primary-nav {
    position: absolute;
    inset: calc(100% + 1px) 20px auto 20px;
    display: none;
    margin: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  body.nav-open .primary-nav {
    display: block;
  }

  .primary-menu {
    display: block;
    padding: 8px;
  }

  .primary-menu a {
    display: flex;
    width: 100%;
  }

  .primary-menu .sub-menu {
    position: static;
    display: block;
    margin-left: 12px;
    padding: 0 0 0 10px;
    border: 0;
    border-left: 1px solid var(--border);
    border-radius: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .theme-toggle-label {
    display: none;
  }
}

@media (max-width: 640px) {
  :root {
    --header-height: 66px;
  }

  .container {
    width: min(100% - 28px, var(--container));
  }

  .site-title {
    font-size: 0.9rem;
  }

  .site-description {
    display: none;
  }

  .site-content {
    padding-block: 34px 52px;
  }

  .entry {
    padding: 22px;
  }
}
