/* Salsabeel Academy - accessibility, Tamil/Arabic typography and touch-target refinements.
   Plain CSS, loaded after styles.min.css. It does not require rebuilding Tailwind. */

/* ---- Skip link: hidden until it receives keyboard focus ---- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10000;
  padding: 0.75rem 1.25rem;
  background: #04272C;
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 0 0 0.75rem 0;
  text-decoration: none;
}
.skip-link:focus {
  left: 0;
}
main:focus {
  outline: none;
}

/* ---- Visible keyboard focus fallback (elements with their own focus styles keep them) ---- */
:where(a, button, input, select, textarea, summary, [tabindex]:not([tabindex="-1"])):focus-visible {
  outline: 2px solid #08535c;
  outline-offset: 2px;
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.9);
}

/* ---- Tamil and Arabic text (elements tagged with lang by the server) ---- */
[lang="ta"] {
  font-family: "Noto Sans Tamil", "Noto Serif Tamil", sans-serif;
  line-height: 1.65;
  letter-spacing: normal;
  text-transform: none;
}
h1[lang="ta"], h2[lang="ta"], h3[lang="ta"],
:is(h1, h2, h3) [lang="ta"] {
  font-family: "Noto Serif Tamil", "Noto Sans Tamil", serif;
}
[lang="ar"] {
  font-family: "Amiri", "Traditional Arabic", serif;
  line-height: 1.9;
  letter-spacing: normal;
  text-transform: none;
}

/* ---- Disabled course-action labels ("Archive Unavailable", "Enrolment Closed", ...) ----
   They keep their grey/translucent "inactive" box, but the text now reaches at least 4.5:1
   (was about 2.3:1 on light cards and 3.1:1 on the dark course-page hero). Wording is unchanged. */
button[disabled][aria-disabled="true"] {
  color: #5B6573;
}
button[disabled][aria-disabled="true"].bg-white\/20 {
  color: rgba(255, 255, 255, 0.92);
}
button[disabled][aria-disabled="true"] i {
  color: inherit;
  opacity: 0.85;
}

/* ---- Closed mobile drawer: its large shadow leaked onto the left edge of every page ---- */
#mobileDrawer.-translate-x-full {
  box-shadow: none;
}

/* ---- Filter pills (category, medium, status): 44px tap targets on phones and touch screens ---- */
@media (max-width: 639.98px), (pointer: coarse) {
  .category-pill,
  .language-pill,
  .status-tab {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* ---- About page: Mission/Vision columns sized to their text so the shorter card is not half empty ---- */
@media (min-width: 768px) {
  .about-mission-vision {
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  }
}

/* ---- Touch devices: comfortable tap targets for small icon buttons ---- */
@media (pointer: coarse) {
  #mobileDrawerOpenBtn,
  #mobileDrawerCloseBtn,
  #closeMemberGiftBtn,
  #closeForgotModalBtn,
  .modal-close,
  .toggle-pwd-btn {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .course-pill {
    min-height: 40px;
  }
}

/* ---- Phones: 16px form text prevents iOS Safari from zooming the page on focus ---- */
@media (max-width: 640px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]),
  select,
  textarea {
    font-size: 16px;
  }
}

/* ---- Decorative section dividers (home + About; aria-hidden, no content) ----
   Zero-height wrapper sits on the seam between two sections; the ornament straddles it. */
.section-divider {
  position: relative;
  z-index: 2;
  height: 0;
  overflow: visible;
  pointer-events: none;
}
.section-divider > * {
  position: absolute;
  top: 0;
}
.section-divider__rule {
  left: 50%;
  width: min(9rem, 28vw);
  height: 1px;
  margin-left: calc(-1 * (min(9rem, 28vw) + 0.75rem));
  transform: translateY(-0.5px);
  background: linear-gradient(to right, rgba(183, 138, 67, 0), rgba(183, 138, 67, 0.7));
}
.section-divider__rule--end {
  margin-left: 0.75rem;
  transform: translateY(-0.5px);
  background: linear-gradient(to left, rgba(183, 138, 67, 0), rgba(183, 138, 67, 0.7));
}
.section-divider__star {
  left: 50%;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  margin-top: -7px;
  fill: #F7F4EC;
  stroke: #B78A43;
  stroke-width: 1;
}

/* ---- "Book spine" course cards (/courses and the home featured grid) ---- */
#coursesContainer .course-card,
#featuredCourses .course-card {
  border-left: 3px solid #174C4B;
  background-color: #FFFEFA;
}
#coursesContainer .course-card:hover,
#coursesContainer .course-card:focus-within,
#featuredCourses .course-card:hover,
#featuredCourses .course-card:focus-within {
  border-left-color: #B78A43;
}
@media (prefers-reduced-motion: no-preference) {
  #coursesContainer .course-card,
  #featuredCourses .course-card {
    transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
  }
  #coursesContainer .course-card:hover,
  #featuredCourses .course-card:hover {
    transform: translateY(-2px);
  }
}
@media (prefers-reduced-motion: reduce) {
  #coursesContainer .course-card,
  #featuredCourses .course-card {
    transition: none;
    transform: none;
  }
}
