/* ============================================================
   GAMBIT CHESS CLUB — LANG.CSS
   Bilingual (AR/EN) + New Features Styles
   ============================================================ */

/* ===== FONT OVERRIDES ===== */
/* Headings: Montserrat Bold (EN) / Cairo (AR) */
/* Body: Inter Regular (EN) / Tajawal (AR) */

:root {
  --font-heading-en: 'Montserrat', sans-serif;
  --font-body-en: 'Inter', sans-serif;
  --font-heading-ar: 'Cairo', 'Tajawal', sans-serif;
  --font-body-ar: 'Tajawal', sans-serif;
}

/* Arabic (default) */
h1,
h2,
h3,
h4,
h5,
h6,
.section-title,
.section-title-dark,
.hero-title,
.ht-line,
.pres-name,
.ph-title,
.th-title {
  font-family: var(--font-heading-ar) !important;
}

body,
p,
span,
li,
a,
button,
input,
textarea {
  font-family: var(--font-body-ar) !important;
}

/* English mode */
html[lang="en"] h1,
html[lang="en"] h2,
html[lang="en"] h3,
html[lang="en"] h4,
html[lang="en"] h5,
html[lang="en"] h6,
html[lang="en"] .section-title,
html[lang="en"] .section-title-dark,
html[lang="en"] .hero-title,
html[lang="en"] .ht-line,
html[lang="en"] .pres-name,
html[lang="en"] .ph-title,
html[lang="en"] .th-title {
  font-family: var(--font-heading-en) !important;
  font-weight: 800 !important;
  margin-left: 0px;
  ;
}

html[lang="en"] body,
html[lang="en"] p,
html[lang="en"] span,
html[lang="en"] li,
html[lang="en"] a,
html[lang="en"] button {
  font-family: var(--font-body-en) !important;
}

/* ===== LANGUAGE TOGGLE BUTTON ===== */
.lang-toggle {
  background: transparent;
  border: 1.5px solid rgba(201, 162, 39, 0.5);
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  margin-inline-start: 8px;
  white-space: nowrap;
}

.lang-toggle:hover {
  background: var(--gold);
  color: var(--black);
  border-color: var(--gold);
}

/* Show/hide based on language */
.lt-en {
  display: none;
}

.lt-ar {
  display: inline;
}

html[lang="en"] .lt-en {
  display: inline;
}

html[lang="en"] .lt-ar {
  display: none;
}

.lang-mobile {
  display: none;
}

/* Nav right group for mobile lang + hamburger */
.nav-right-group {
  display: none;
  align-items: center;
  gap: 10px;
}

/* ===== LTR FLIP for EN ===== */
html[lang="en"] {
  direction: ltr;
}

/* Flip arrow icons in LTR */
html[lang="en"] .icon-flip-ltr {
  transform: scaleX(-1);
}

html[lang="en"] .home-timeline::before {
  content: '';
  position: absolute;
  right: 33px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--gold), rgba(201, 162, 39, .15));
  border-radius: 2px
}

html[lang="en"] .htl-piece {
  position: absolute;
  top: 16px;
  left: 956px;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 8, 8, .92);
  color: var(--gold);
  font-size: 28px;
  box-shadow: 0 10px 24px rgba(8, 8, 8, .18);
  border: 1px solid rgba(201, 162, 39, .2)
}

/* ===== ABOUT IMAGE SECTION ===== */
.about-image-wrap {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
}

.about-main-img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  border-radius: 20px;
  display: block;
  position: relative;
  z-index: 1;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.about-img-glow {
  position: absolute;
  inset: -20px;
  background: radial-gradient(ellipse at center, rgba(201, 162, 39, 0.15), transparent 70%);
  z-index: 0;
  pointer-events: none;
}

.about-img-fallback {
  display: none;
  position: relative;
  border-radius: 20px;
  overflow: hidden;
}

.about-img-fallback .fallback-board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  width: 100%;
  aspect-ratio: 1;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid rgba(201, 162, 39, 0.3);
}

.fallback-board .cell {
  aspect-ratio: 1;
}

.fallback-board .cell.dark {
  background: rgba(201, 162, 39, 0.15);
}

.fallback-board .cell.light {
  background: rgba(201, 162, 39, 0.04);
}

/* ===== TESTIMONIALS SLIDER ===== */
.testimonials {
  position: relative;
  overflow: hidden;
}

.testimonials .section-title-dark {
  text-align: center;
}

.testimonials .section-tag-dark {
  text-align: center;
}

.testi-slider {
  position: relative;
  margin-top: 48px;
  overflow: hidden;
}

.testi-track {
  display: flex;
  gap: 0;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.testi-slide {
  min-width: 33.333%;
  padding: 0 12px;
  box-sizing: border-box;
}

.testi-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--r-lg);
  padding: 32px 28px;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.testi-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(201, 162, 39, 0.15);
}

.testi-quote {
  font-size: 36px;
  color: var(--gold);
  line-height: 1;
  opacity: 0.4;
}

.testi-text {
  color: var(--gray-600);
  font-size: 15px;
  line-height: 1.8;
  flex: 1;
}

.testi-author {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
}

.testi-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-d));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--black);
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.testi-author strong {
  display: block;
  color: var(--dark-text);
  font-size: 14px;
  font-weight: 700;
}

.testi-author span {
  display: block;
  color: var(--gray-600);
  font-size: 12px;
}

.testi-stars {
  color: var(--gold);
  font-size: 14px;
  letter-spacing: 2px;
}

.testi-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 32px;
}

.testi-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid rgba(201, 162, 39, 0.4);
  background: transparent;
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.testi-btn:hover {
  background: var(--gold);
  color: var(--black);
  border-color: var(--gold);
}

.testi-dots {
  display: flex;
  gap: 8px;
  align-items: center;
}

.testi-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gray-200);
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
}

.testi-dot.active {
  background: var(--gold);
  width: 24px;
  border-radius: 4px;
}

/* EN: flip prev/next buttons */
html[lang="en"] .testi-prev i,
html[lang="en"] .testi-next i {
  transform: scaleX(-1);
}

html[lang="en"] .testi-prev {
  order: 3;
}

html[lang="en"] .testi-controls {
  flex-direction: row;
}

@media (max-width: 900px) {
  .testi-slide {
    min-width: 50%;
  }
}

@media (max-width: 600px) {
  .testi-slide {
    min-width: 100%;
  }
}

/* ===== PHOTO GALLERY (achievements.html) ===== */
.photo-gallery-section {
  background: var(--off-white);
  padding: 80px 0;
}

.gallery-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  justify-content: center;
  flex-wrap: wrap;
}

.gallery-tab {
  padding: 8px 20px;
  border-radius: 30px;
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-600);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.gallery-tab.active,
.gallery-tab:hover {
  background: var(--gold);
  color: var(--black);
  border-color: var(--gold);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.gallery-item {
  border-radius: var(--r);
  overflow: hidden;
  position: relative;
  aspect-ratio: 4/3;
  cursor: pointer;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: flex-end;
  padding: 16px;
}

.gallery-item:hover .gallery-item-overlay {
  opacity: 1;
}

.gallery-item-label {
  color: var(--white);
  font-size: 13px;
  font-weight: 600;
}

/* Gallery placeholder (no real images) */
.gallery-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--gray-100), var(--gray-200));
  color: var(--gray-400);
  font-size: 32px;
}

.gallery-placeholder span {
  font-size: 12px;
  margin-top: 8px;
  color: var(--gray-600);
  font-weight: 600;
}

/* Gallery lightbox */
.gallery-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.gallery-lightbox.open {
  display: flex;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  /* changes with dir */
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  color: white;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: 12px;
  object-fit: contain;
}

/* ===== RESPONSIVE NAV LANG TOGGLE ===== */
@media (max-width: 900px) {
  .nav-links .lang-toggle {
    display: none;
  }

  .nav-right-group {
    display: flex;
  }

  .lang-mobile {
    display: flex;
  }
}

/* ===== RTL/LTR ADJUSTMENTS ===== */
html[lang="en"] .nav-inner {
  flex-direction: row;
}

html[lang="en"] .footer-bot-inner {
  flex-direction: row;
}

html[lang="en"] .testi-prev {
  order: 1;
}

html[lang="en"] .testi-next {
  order: 3;
}

html[lang="en"] .testi-dots {
  order: 2;
}