/*
 Theme Name:   Kadence Child
 Theme URI:    https://www.kadencewp.com/
 Description:  Child theme for ESL Stages
 Author:       Chiara Fiorentini
 Template:     kadence
 Version:      1.0.0
*/

/* ========================================
   LEVEL COLOR SYSTEM
======================================== */

:root {
  --level-a1: #F7D1D1;
  --level-a2: #F9F08B;
  --level-b1: #E9A880;
  --level-b2: #DFC8DF;
  --level-c1: #A9DFBF;
  --level-c2: #8ACCEE;

  --badge-neutral-bg: #F3F4F6;
  --badge-neutral-text: #374151;
}

/* ========================================
   BADGE BASE STYLE
======================================== */

.badge {
  display: inline-block;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 999px;
  line-height: 1;
}

.lesson-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

/* ========================================
   LEVEL BADGE COLORS
======================================== */

.lesson-card-button,
.lesson-material,
.filter-pill span {
  transition:
    filter 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.level-a1 .badge-level { background: var(--level-a1); color: #111827; }
.level-a2 .badge-level { background: var(--level-a2); color: #111827; }
.level-b1 .badge-level { background: var(--level-b1); color: #111827; }
.level-b2 .badge-level { background: var(--level-b2); color: #111827; }
.level-c1 .badge-level { background: var(--level-c1); color: #111827; }
.level-c2 .badge-level { background: var(--level-c2); color: #111827; }

/* ========================================
   SKILL & CONTEXT BADGES
======================================== */

.badge-skill,
.badge-context {
  background: var(--badge-neutral-bg);
  color: var(--badge-neutral-text);
}

.badge-business {
  background: #FDE7EB;   /* light red background */
  color: #F02A4A;        /* strong brand red text */
}



/* ========================================
   MATERIAL BUTTON COLORS (LEVEL-BASED)
======================================== */

.level-a1 .lesson-material { background-color: var(--level-a1) !important; color: #111827 !important; }
.level-a2 .lesson-material { background-color: var(--level-a2) !important; color: #111827 !important; }
.level-b1 .lesson-material { background-color: var(--level-b1) !important; color: #111827 !important; }
.level-b2 .lesson-material { background-color: var(--level-b2) !important; color: #111827 !important; }
.level-c1 .lesson-material { background-color: var(--level-c1) !important; color: #111827 !important; }
.level-c2 .lesson-material { background-color: var(--level-c2) !important; color: #111827 !important; }

.level-a1 .lesson-material a, .level-a1 .lesson-material a:visited { color: #111827 !important; }
.level-a2 .lesson-material a, .level-a2 .lesson-material a:visited { color: #111827 !important; }
.level-b1 .lesson-material a, .level-b1 .lesson-material a:visited { color: #111827 !important; }
.level-b2 .lesson-material a, .level-b2 .lesson-material a:visited { color: #111827 !important; }
.level-c1 .lesson-material a, .level-c1 .lesson-material a:visited { color: #111827 !important; }
.level-c2 .lesson-material a, .level-c2 .lesson-material a:visited { color: #111827 !important; }

.lesson-material a,
.lesson-material a:visited,
.lesson-material a:hover,
.lesson-material a:active {
  text-decoration: none !important;
}

.lesson-material:hover {
  filter: brightness(1.05);
}


/* =====================================
   Lesson Materials – Base Styles
   ===================================== */

.lesson-material {
  display: inline-block;
  margin: 0;
  padding: 0.55rem 1.25rem;
  border-radius: 8px;
  font-weight: 500;
  text-decoration: none;
  line-height: 1.2;
  text-align: center;
  font-size: 0.9rem;
}

/* Primary CTA (upgrade / subscribe if present) */
.lesson-material.upgrade-material {
  background-color: #F02A4A;
  color: #ffffff;
}

/* Locked material state */
.lesson-material .locked-material {
  display: inline-block;
  opacity: 0.6;
  font-size: 0.9rem;
}

/* Make locked materials still feel clickable */
.lesson-material {
  cursor: pointer;
}

/* Locked material styling */
.lesson-material.is-locked {
  opacity: 0.6;
}

.lesson-material.is-locked::after {
  content: "🔒";
  margin-left: 0.5rem;
  font-size: 0.9em;
}

.lesson-single {
  background: #ffffff;
  padding-bottom: 2rem;
  margin-top: 0;
  padding-top: 0;
}

body.single-lesson {
  background: #ffffff;
}

.lesson-single > *:not(.lesson-featured-image) {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}


/* ========================================
   TOP LESSON LAYOUT
======================================== */

.lesson-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.lesson-top-right {
  border-left: 5px solid transparent;
  padding-left: 1.5rem;
}

.level-a1 .lesson-top-right { border-left-color: var(--level-a1); }
.level-a2 .lesson-top-right { border-left-color: var(--level-a2); }
.level-b1 .lesson-top-right { border-left-color: var(--level-b1); }
.level-b2 .lesson-top-right { border-left-color: var(--level-b2); }
.level-c1 .lesson-top-right { border-left-color: var(--level-c1); }
.level-c2 .lesson-top-right { border-left-color: var(--level-c2); }

.lesson-top-right img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  object-position: center;
  border-radius: 12px;
  display: block;
}

/* ============================
   Lesson Featured Image
   ============================ */

.lesson-featured-image {
  width: 100vw;
  max-width: 100vw;
  max-height: 420px;
  overflow: hidden;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

.lesson-featured-image img {
  width: 100%;
  height: 420px;
  object-fit: cover;
  display: block;
}

/* ============================
   Lesson content box
   ============================ */

.lesson-content-box {
  max-width: 960px;
  margin: 2rem auto 4rem auto;
  padding: 3rem 3.75rem;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .lesson-content-box {
    padding: 2rem;
  }
}

@media (max-width: 900px) {
  .lesson-top {
    grid-template-columns: 1fr;
  }

  .lesson-top-right {
    order: -1;
  }

}

/* ============================
   Lesson meta redesign
   ============================ */

.lesson-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 28px;
}

.lesson-description {
  margin-bottom: 32px;
}

.meta-item {
  display: flex;
  flex-direction: column;
}

.meta-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  margin-bottom: 0.25rem;
}

.meta-value {
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
}

.lesson-meta-secondary {
  display: flex;
  gap: 12px;
  font-size: 14px;
  color: #6B7280;
  align-items: center;
}

.lesson-duration {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.icon-clock {
  width: 16px;
  height: 16px;
}

/* ============================
   Lesson sections
   ============================ */

/* ============================
   Materials card row (below image)
   ============================ */

.lesson-materials-row {
  display: flex;
  flex-direction: column;
  gap: 32px;
  margin-top: 48px;
}

.material-card {
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.baseline-section.material-card {
  background: #ffffff;
  border: 1px solid #e8e8e8;
}

.premium-section.material-card {
  background: #f7f8fa;
  border: 1px solid #ececec;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lesson-section {
  margin-top: 0;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.section-locked-message {
  font-size: 0.95rem;
  color: #6b7280;
  margin-bottom: 0.75rem;
}

.materials-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.premium-section .materials-grid {
  gap: 8px;
}

.premium-section {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.premium-section a.upgrade-button,
.premium-section a.upgrade-button:link,
.premium-section a.upgrade-button:visited,
.baseline-section a.upgrade-button,
.baseline-section a.upgrade-button:link,
.baseline-section a.upgrade-button:visited {
  display: inline-block;
  background: #2563EB !important;
  color: #ffffff !important;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.82rem;
  text-decoration: none !important;
  border: none !important;
  box-shadow: none !important;
  outline: none;
  line-height: 1.4;
  text-align: center;
  white-space: nowrap;
  align-self: flex-start;
  margin-bottom: 1rem;
}

.premium-section a.upgrade-button:hover,
.premium-section a.upgrade-button:active,
.baseline-section a.upgrade-button:hover,
.baseline-section a.upgrade-button:active {
  background: #1d4ed8 !important;
  color: #ffffff !important;
  text-decoration: none !important;
}

.premium-section .section-title {
  font-weight: 600;
  margin-bottom: 10px;
}

.baseline-section .section-title {
  margin-bottom: 1.25rem;
}

.lesson-content-box h1 {
  margin-bottom: 16px;
}

.lesson-content-box p {
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.lesson-content-box h2,
.lesson-content-box h3 {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.lesson-section + .lesson-section {
  margin-top: 0;
}

.lesson-video-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 54px 20px 24px;
}

.lesson-video {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
}

.lesson-video iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  display: block;
}

body.post-type-archive-lesson,
body.post-type-archive-lesson #inner-wrap,
body.post-type-archive-lesson .content-area {
  background: #ffffff !important;
}

body.post-type-archive-lesson .content-area {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

body.post-type-archive-lesson .content-container,
body.page-template-page-lesson-packages .content-container {
  padding-top: 2rem !important;
}

/* ============================
   Lesson Archive Grid
============================ */

.lesson-archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 32px;
  max-width: 970px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

.lesson-archive-header {
  max-width: 970px;
  margin: 2.5rem auto 1.5rem;
  padding: 0 1.5rem;
}

.lesson-archive-title {
  font-size: 1.8rem;
  font-weight: 600;
  margin: 0;
}

/* UNIFIED FILTER BAR */

.lesson-filters {
  max-width: 970px;
  margin: 2.5rem auto 1.5rem;
  padding: 0 1.5rem;
}

.filter-search {
  display: flex;
  gap: 12px;
  align-items: stretch;
  max-width: 600px;
  margin: 0 auto;
}

.filter-search input {
  flex: 1;
  padding: 0 1rem;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  height: 44px;
  font-size: 0.95rem;
}

.filter-search button {
  height: 44px;
  padding: 0 1.4rem;
  border-radius: 999px;
  border: none;
  background: #2563EB;
  color: #ffffff;
  font-weight: 500;
  cursor: pointer;
}

/* FILTER PANEL – CLEAN VERTICAL */

.filters-panel {
  max-width: 800px;
  margin: 2.5rem auto 3rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

/* ========================================
   FILTER PILLS
======================================== */

.filter-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
}

.filter-pill {
  position: relative;
  cursor: pointer;
}

.filter-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.filter-pill span {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  background: #f3f4f6;
  color: #374151;
}

.filter-pill span:hover {
  background: #e5e7eb;
}

/* Checked state */
.filter-pill input:checked + span {
  background: #111827;
  color: #ffffff;
}

/* LEVEL FILTER COLORS */

.filter-pill.level-a1 input:checked + span { background: var(--level-a1); color: #111827; }
.filter-pill.level-a2 input:checked + span { background: var(--level-a2); color: #111827; }
.filter-pill.level-b1 input:checked + span { background: var(--level-b1); color: #111827; }
.filter-pill.level-b2 input:checked + span { background: var(--level-b2); color: #111827; }
.filter-pill.level-c1 input:checked + span { background: var(--level-c1); color: #111827; }
.filter-pill.level-c2 input:checked + span { background: var(--level-c2); color: #111827; }

.filter-pill input:checked + span:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.filter-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b7280;
  margin-right: 4px;
}

.filters-bottom-row {
  display: flex;
  align-items: center;
  gap: 32px;
}

/* Clear button aligned right */

.filter-clear {
  margin-left: auto;
}

.clear-filters {
  padding: 6px 14px;
  border-radius: 999px;
  background: transparent;
  color: #374151;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  transition: background 0.2s ease;
}

.clear-filters:hover {
  background: #e5e7eb;
  color: #374151;
}

@media (max-width: 640px) {
  .lesson-archive-hero h1 {
    font-size: 1.6rem !important;
  }

  .filters-bottom-row {
    flex-wrap: wrap;
    gap: 1.2rem;
  }

  .filter-clear {
    margin-left: 0;
    width: 100%;
  }
}

/* ============================
   Lesson Card Base
============================ */

.lesson-card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.lesson-card.level-a1 { border-top: 4px solid var(--level-a1); }
.lesson-card.level-a2 { border-top: 4px solid var(--level-a2); }
.lesson-card.level-b1 { border-top: 4px solid var(--level-b1); }
.lesson-card.level-b2 { border-top: 4px solid var(--level-b2); }
.lesson-card.level-c1 { border-top: 4px solid var(--level-c1); }
.lesson-card.level-c2 { border-top: 4px solid var(--level-c2); }

/* 16:9 image ratio */
.lesson-card-image {
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.lesson-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lesson-card-body {
  padding: 1.25rem 1.5rem;
  flex: 1;
}

.lesson-card-title {
  margin-top: 0.75rem;
}

.lesson-card-meta {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  margin-top: 0.75rem;
}

.lesson-card-meta .badge {
  margin: 0 !important;
}

.lesson-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 1rem 1.5rem 1.25rem;
}

.lesson-card-access-message {
  font-size: 0.9rem;
  color: #6b7280;
}

.lesson-card-button {
  display: inline-block;
  padding: 0.5rem 1.2rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none !important;
  border: none;
}

/* LEVEL-BASED BUTTON COLORS (SOFT VERSION) */

.level-a1 .lesson-card-button { background: var(--level-a1); color: #111827 !important; }
.level-a2 .lesson-card-button { background: var(--level-a2); color: #111827 !important; }
.level-b1 .lesson-card-button { background: var(--level-b1); color: #111827 !important; }
.level-b2 .lesson-card-button { background: var(--level-b2); color: #111827 !important; }
.level-c1 .lesson-card-button { background: var(--level-c1); color: #111827 !important; }
.level-c2 .lesson-card-button { background: var(--level-c2); color: #111827 !important; }

.lesson-card-button:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

/* ========================================
   AUTH MODAL
======================================== */

.esl-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.esl-modal[aria-hidden="true"] {
  display: none;
}

.esl-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.esl-modal-box {
  position: relative;
  background: #ffffff;
  border-radius: 16px;
  padding: 2rem;
  width: 100%;
  max-width: 420px;
  margin: 1rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.esl-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #6b7280;
  line-height: 1;
  padding: 0;
}

.esl-modal-close:hover {
  color: #111827;
}


.esl-form-row {
  margin-bottom: 0.75rem;
}

.esl-form-row input {
  width: 100%;
  padding: 0.6rem 0.2rem;
  border: none;
  border-bottom: 1.5px solid #d1d5db;
  border-radius: 0;
  font-size: 0.95rem;
  box-sizing: border-box;
  background: transparent;
}

.esl-form-row input::placeholder {
  color: #6b7280;
}

.esl-form-row input:focus {
  outline: none;
  border-bottom-color: #111827;
  box-shadow: none;
}

.esl-form-message {
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
  min-height: 1.25rem;
}

.esl-form-message.is-error {
  color: #dc2626;
}

.esl-submit-btn {
  width: 100%;
  padding: 0.65rem 1rem;
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
}

.esl-submit-btn:hover {
  background: #1d4ed8;
}

.esl-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ========================================
   LESSON PACKAGES PAGE
======================================== */

body.page-template-page-lesson-packages,
body.page-template-page-lesson-packages #inner-wrap,
body.page-template-page-lesson-packages .content-area {
  background: #ffffff !important;
}

body.page-template-page-lesson-packages .content-area {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.pack-archive-wrapper {
  max-width: 970px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.pack-archive-header {
  margin: 5rem auto 1.5rem;
  padding: 0 1.5rem;
}

.pack-archive-intro {
  max-width: 600px;
  margin: 0 auto 3rem;
  padding: 1rem 1.5rem;
  font-size: 1.05rem;
  color: #6b7280;
}

/* ── Grid ── */

.pack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}

/* ── Card ── */

.pack-card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  border-top: 5px solid #e5e7eb;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.pack-card:hover {
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.1);
  transform: translateY(-3px);
}

/* Level-colored top border */
.pack-card.level-a1 { border-top-color: var(--level-a1); }
.pack-card.level-a2 { border-top-color: var(--level-a2); }
.pack-card.level-b1 { border-top-color: var(--level-b1); }
.pack-card.level-b2 { border-top-color: var(--level-b2); }
.pack-card.level-c1 { border-top-color: var(--level-c1); }
.pack-card.level-c2 { border-top-color: var(--level-c2); }

.pack-card.is-owned {
  border-color: #a7f3d0;
  border-top-color: #34d399;
  background: #f0fdf4;
}

/* ── Thumbnail strip ── */

.pack-thumbnails {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  height: 140px;
  flex-shrink: 0;
}

.pack-thumb {
  position: relative;
  background-color: #e5e7eb;
  background-size: cover;
  background-position: center;
  overflow: hidden;
  text-decoration: none;
}

/* Subtle gap between thumbnails */
.pack-thumb + .pack-thumb {
  border-left: 2px solid #f9fafb;
}

/* Hover overlay */
.pack-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background 0.2s ease;
}

.pack-thumb:hover::after {
  background: rgba(0, 0, 0, 0.45);
}

/* Lesson name shown on hover */
.pack-thumb-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 8px 10px;
  font-size: 0.7rem;
  font-weight: 500;
  color: #ffffff;
  line-height: 1.3;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 1;
}

.pack-thumb:hover .pack-thumb-label {
  opacity: 1;
  transform: translateY(0);
}

/* ── Card body ── */

.pack-card-body {
  padding: 1.25rem 1.5rem 0.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pack-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pack-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #111827;
  margin: 0;
  line-height: 1.3;
}

/* Owned badge */
.pack-badge.owned {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: #d1fae5;
  color: #065f46;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

/* Description */
.pack-description {
  font-size: 0.88rem;
  color: #4b5563;
  line-height: 1.6;
  margin: 0;
}

/* ── Collapsible lesson list ── */

.pack-lessons {
  margin-top: 0.25rem;
}

.pack-lessons-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  font-size: 0.82rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 6px 0;
  border-top: 1px solid #f3f4f6;
  user-select: none;
}

.pack-lessons-toggle::-webkit-details-marker { display: none; }

.pack-lessons-toggle:hover {
  color: #374151;
}

.pack-chevron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.pack-lessons[open] .pack-chevron {
  transform: rotate(180deg);
}

.pack-lesson-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pack-lesson-item {
  border-bottom: 1px solid #f3f4f6;
}

.pack-lesson-item:last-child {
  border-bottom: none;
}

.pack-lesson-link {
  display: block;
  padding: 7px 2px;
  font-size: 0.875rem;
  color: #374151;
  text-decoration: none;
  transition: color 0.15s ease, padding-left 0.15s ease;
}

.pack-lesson-link:hover {
  color: #111827;
  padding-left: 6px;
}

/* ── Card footer ── */

.pack-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 1rem 1.5rem 1.4rem;
  margin-top: auto;
}

.pack-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
}

/* ── Buttons ── */

.pack-btn {
  display: inline-block;
  padding: 0.55rem 1.3rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none !important;
  transition: filter 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}

/* Buy button: level color by default, with fallback blue */
.pack-btn-buy {
  background: #2563eb;
  color: #ffffff !important;
}

.pack-card.level-a1 .pack-btn-buy { background: var(--level-a1); color: #111827 !important; }
.pack-card.level-a2 .pack-btn-buy { background: var(--level-a2); color: #111827 !important; }
.pack-card.level-b1 .pack-btn-buy { background: var(--level-b1); color: #111827 !important; }
.pack-card.level-b2 .pack-btn-buy { background: var(--level-b2); color: #111827 !important; }
.pack-card.level-c1 .pack-btn-buy { background: var(--level-c1); color: #111827 !important; }
.pack-card.level-c2 .pack-btn-buy { background: var(--level-c2); color: #111827 !important; }

.pack-btn-buy:hover {
  filter: brightness(0.93);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.pack-btn-owned {
  background: #d1fae5;
  color: #065f46 !important;
}

.pack-btn-owned:hover {
  filter: brightness(0.96);
}

/* ── Responsive ── */

@media (max-width: 640px) {
  .pack-grid {
    grid-template-columns: 1fr;
  }

  .pack-thumbnails {
    height: 120px;
  }
}

/* ========================================
   LEVEL GRID
======================================== */

.esl-level-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.esl-level-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 2rem 1.5rem;
  text-decoration: none;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.esl-level-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08) !important;
  transform: translateY(-2px) !important;
}

.esl-level-dot {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  margin-bottom: 1rem;
}

.level-a1 .esl-level-dot { background: var(--level-a1); }
.level-a2 .esl-level-dot { background: var(--level-a2); }
.level-b1 .esl-level-dot { background: var(--level-b1); }
.level-b2 .esl-level-dot { background: var(--level-b2); }
.level-c1 .esl-level-dot { background: var(--level-c1); }
.level-c2 .esl-level-dot { background: var(--level-c2); }

.esl-level-name {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #111827;
  margin: 0 0 0.5rem;
}

.esl-level-desc {
  font-size: 0.9rem;
  color: #6b7280;
  line-height: 1.5;
  margin: 0;
}

@media (max-width: 768px) {
  .esl-level-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .esl-level-grid {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   HOMEPAGE LESSON CAROUSEL
======================================== */

.esl-carousel {
  overflow: hidden;
}

.esl-carousel-track {
  display: flex;
  gap: 20px;
  transition: transform 0.35s ease;
  will-change: transform;
}

.esl-carousel-track .lesson-card {
  flex: 0 0 calc(50% - 10px);
  min-width: 0;
}

.esl-carousel-nav {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.esl-carousel-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.esl-carousel-btn:hover {
  background: #f3f4f6;
}

.esl-carousel-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ========================================
   PRICING TABLE
======================================== */

.esl-pricing-btn:hover {
  filter: brightness(0.88);
  transform: translateY(-1px);
}

@media (max-width: 767px) {
  .esl-pricing-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (min-width: 768px) and (max-width: 960px) {
  .esl-pricing-grid {
    gap: 16px !important;
    font-size: 14px;
  }
}

.page .entry,
.page .single-entry {
  box-shadow: none;
  border-radius: 0;
  background: transparent;
}



/* ========================================
   CONTACT FORM
======================================== */

.contact-form {
  max-width: 700px;
  margin: 0 auto;
  background: rgb(239, 246, 255);
  padding: 48px 56px;
}

.contact-form p {
  margin-bottom: 24px;
}

.contact-form label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
  color: #1e2a4a;
}

.contact-form abbr,
.contact-form .req-star {
  color: #e53e3e;
  text-decoration: none;
}

/* Acceptance checkbox */
.contact-form .wpcf7-acceptance label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.contact-form .wpcf7-acceptance input[type="checkbox"] {
  width: 1.2em;
  height: 1.2em;
  flex-shrink: 0;
  cursor: pointer;
}

.contact-form .wpcf7-acceptance .wpcf7-list-item-label {
  color: #111827;
}

.contact-form .wpcf7-acceptance a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: #111827;
}

.contact-form .wpcf7-acceptance a:hover {
  color: #6b7280;
  text-decoration-color: #6b7280;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 10px 0;
  border: none;
  border-bottom: 1px solid #1e2a4a;
  border-radius: 0;
  background: transparent;
  font-size: inherit;
  box-shadow: none;
}

.contact-form textarea {
  height: 80px !important;
  min-height: unset;
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-bottom-color: #3B82F6;
}

.contact-form input[type="submit"] {
  display: block;
  margin: 32px auto 0;
  background-color: #5b7be8;
  color: white;
  border: none;
  padding: 14px 36px;
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.01em;
}

.contact-form input[type="submit"]:hover {
  filter: brightness(1.08);
}

/* ========================================
   LESSON ARCHIVE PAGINATION
======================================== */

.lesson-pagination {
  margin: 2.5rem 0 1rem;
  display: flex;
  justify-content: center;
}

.lesson-pagination ul {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.lesson-pagination ul li a,
.lesson-pagination ul li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid #e5e7eb;
  color: #374151;
  background: #ffffff;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.lesson-pagination ul li a:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.lesson-pagination ul li span.current {
  background: #111827;
  color: #ffffff;
  border-color: #111827;
}