/* ---------- Global ---------- */
body {
  font-family: 'Open Sans', 'Noto Sans Sinhala', sans-serif;
}

/* ---------- HERO (teacher) ---------- */
.teacher-hero {
  padding: 80px 0 70px;
  background: linear-gradient(135deg, #f5fafe 0%, #e4f0ff 40%, #ffffff 100%);
  border-bottom: 1px solid #e5e5e5;
}

.teacher-hero .row {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -ms-flex-wrap: wrap;
      flex-wrap: wrap;
  -ms-align-items: center;
      align-items: center;
}

.teacher-hero h1 {
  font-family: 'Abhaya Libre', 'Noto Sans Sinhala', serif;
  font-weight: 700;
  margin-bottom: 10px;
}

.teacher-hero p {
  max-width: 520px;
  font-size: 16px;
  line-height: 1.7;
  color: #555;
}

.hero-text {
  padding-top: 10px;
}

.badge-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  background: #007bff;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

/* ---------- TEACHER PROFILE ---------- */
.teacher-section {
  padding: 50px 0;
  background-color: #fdfdfd;
}

.teacher-card {
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 12px 35px rgba(0,0,0,0.08);
  padding: 30px 30px 35px;
}

.teacher-photo-wrapper {
  text-align: center;
  margin-bottom: 20px;
}

.teacher-photo {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #ffffff;
  box-shadow: 0 8px 20px rgba(0,0,0,0.18);
}

.teacher-name {
  font-family: 'Abhaya Libre', 'Noto Sans Sinhala', serif;
  font-size: 22px;
  font-weight: 700;
  margin-top: 10px;
}

.teacher-title {
  font-size: 14px;
  color: #777;
}

.teacher-section h2 {
  font-family: 'Abhaya Libre', 'Noto Sans Sinhala', serif;
  font-weight: 700;
  margin-bottom: 15px;
}

.teacher-section p {
  font-size: 15px;
  line-height: 1.9;
  color: #555;
}

.teacher-section ul {
  padding-left: 18px;
  font-size: 15px;
  line-height: 1.9;
}

.teacher-highlight {
  background: #f6fbff;
  border-radius: 14px;
  padding: 18px 20px;
  border-left: 4px solid #0099ff;
  margin-bottom: 20px;
}

/* ---------- TIME TABLE ---------- */
.schedule-section {
  padding: 45px 0 50px;
  background: #f6f9fc;
}

.schedule-section h2 {
  font-family: 'Abhaya Libre', 'Noto Sans Sinhala', serif;
  font-weight: 700;
  margin-bottom: 8px;
  text-align: center;
}

.schedule-subtitle {
  text-align: center;
  margin-bottom: 25px;
  color: #666;
  font-size: 14px;
}

.table-schedule-wrapper {
  max-width: 900px;
  margin: 0 auto;
}

.table-schedule {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(0,0,0,0.06);
}

.table-schedule thead th {
  background: #0d6efd;
  color: #ffffff;
  font-weight: 600;
  padding: 12px 10px;
  font-size: 14px;
  text-align: center;
  white-space: nowrap;
}

.table-schedule tbody td {
  padding: 11px 10px;
  border-bottom: 1px solid #eaeaea;
  font-size: 14px;
  text-align: center;
}

.table-schedule tbody tr:nth-child(even) td {
  background: #f9fbff;
}

.table-schedule tbody tr:last-child td {
  border-bottom: none;
}

.schedule-note {
  margin-top: 12px;
  font-size: 13px;
  color: #777;
  text-align: center;
}

/* ---------- WhatsApp promo ---------- */
.wa-promo {
  padding: 40px 0 45px;
  background: #ffffff;
}

.wa-promo-inner {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
  background: #e9f7ef;
  border-radius: 18px;
  padding: 25px 20px 28px;
  box-shadow: 0 10px 26px rgba(0,0,0,0.05);
}

.wa-promo-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #25d366;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
  color: #fff;
  font-size: 26px;
}

.wa-promo-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
}

.wa-promo-sub {
  font-size: 14px;
  color: #444;
  max-width: 640px;
  margin: 0 auto 16px;
}

.wa-promo-buttons .btn-wa {
  display: inline-block;
  margin: 4px 6px;
  padding: 8px 16px;
  border-radius: 999px;
  background: #25d366;
  color: #fff;
  font-size: 13px;
  text-decoration: none;
  border: none;
}

.wa-promo-buttons .btn-wa:hover {
  background: #1eb656;
}

/* ---------- RESULTS (2 x 2 grid) ---------- */
.results-section {
  padding: 50px 0 60px;
  background: #f6f9fc;
}

.results-section h2 {
  text-align: center;
  margin-bottom: 10px;
  font-weight: 700;
}

.results-section .results-subtitle {
  text-align: center;
  margin-bottom: 30px;
  color: #666;
  font-size: 14px;
}

.result-card {
  background: #ffffff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(0,0,0,0.08);
  margin-bottom: 25px;
  transition: transform .2s ease, box-shadow .2s ease;
}

.result-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(0,0,0,0.12);
}

/* Auto same-size image area (no manual px height) */
.result-card a.fancybox{
  display: block;
  aspect-ratio: 4 / 5;          /* poster style. change to 1/1 or 3/4 if you want */
  background: #fff;             /* fills empty area nicely */
  overflow: hidden;
}

.result-card img{
  width: 100%;
  height: 100%;
  object-fit: contain;          /* ✅ keeps full poster visible (no crop) */
  display: block;
}


.result-card-body {
  padding: 10px 14px 12px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
}

/* ---------- Responsive tweaks ---------- */
@media (max-width: 991px) {
  .teacher-hero {
    padding: 60px 0 50px;
  }
}

@media (max-width: 767px) {
  .teacher-card {
    padding: 20px 18px 25px;
  }

  @media (max-width: 767px){
  .result-card a.fancybox{ aspect-ratio: 3 / 4; }
}


  .teacher-photo {
    width: 180px;
    height: 180px;
  }

  .teacher-hero {
    text-align: center;
  }

  .teacher-hero .row {
    display: block;
  }

  .hero-text {
    margin-top: 20px;
    text-align: center;
    padding-top: 0;
  }

  .teacher-hero p {
    margin: 0 auto;
  }

  .table-schedule thead th,
  .table-schedule tbody td {
    font-size: 13px;
    padding: 10px 6px;
  }
}

/* Mobile: show day and time in separate lines */
@media (max-width: 767px) {
  .table-schedule .slot-day,
  .table-schedule .slot-time {
    display: block;
    line-height: 1.4;
  }

  .table-schedule .slot-day {
    margin-bottom: 2px;
  }
}


/* =========================================================
   PRACTICAL GALLERY (Animated, modern, Bootstrap-friendly)
   ========================================================= */
.practical-gallery{
  position: relative;
  padding: 70px 0;
  overflow: hidden;
  background: radial-gradient(1200px 700px at 20% 15%, rgba(255,0,0,.06), transparent 55%),
              radial-gradient(900px 500px at 80% 30%, rgba(0,120,255,.08), transparent 55%),
              #0b0f18;
  color: #e9eefc;
}

.practical-gallery:before,
.practical-gallery:after{
  content:"";
  position:absolute;
  inset:-200px;
  background:
    conic-gradient(from 180deg at 50% 50%,
      rgba(255,255,255,.06), rgba(255,255,255,0) 25%,
      rgba(255,255,255,.05) 50%, rgba(255,255,255,0) 75%,
      rgba(255,255,255,.06));
  filter: blur(18px);
  opacity: .35;
  animation: spinGlow 18s linear infinite;
  pointer-events:none;
}
.practical-gallery:after{
  opacity:.22;
  animation-duration: 26s;
}

@keyframes spinGlow{
  0%{ transform: rotate(0deg) scale(1); }
  100%{ transform: rotate(360deg) scale(1); }
}

.gallery-head{
  text-align: center;
  margin-bottom: 28px;
}
.gallery-pill{
  display:inline-block;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.07);
  font-weight: 600;
  letter-spacing: .3px;
  font-size: 12px;
}
.gallery-head h2{
  margin: 14px 0 10px;
  font-size: 34px;
  line-height: 1.15;
  font-weight: 800;
  color: #ffffff;
}
.gallery-sub{
  max-width: 820px;
  margin: 0 auto;
  color: rgba(233,238,252,.78);
  font-size: 15px;
}

/* Masonry using CSS columns (no JS needed) */
.masonry{
  margin-top: 28px;
  column-count: 4;
  column-gap: 16px;
}
@media (max-width: 991px){
  .masonry{ column-count: 3; }
}
@media (max-width: 767px){
  .masonry{ column-count: 2; column-gap: 12px; }
}
@media (max-width: 420px){
  .masonry{ column-count: 1; }
}

.masonry-item{
  display: block;
  position: relative;
  margin: 0 0 16px;
  break-inside: avoid;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
  transform: translateY(10px) scale(.98);
  opacity: 0;
  animation: popIn .8s ease forwards;
}

/* Stagger animation */
.masonry-item:nth-child(1){ animation-delay: .05s; }
.masonry-item:nth-child(2){ animation-delay: .12s; }
.masonry-item:nth-child(3){ animation-delay: .18s; }
.masonry-item:nth-child(4){ animation-delay: .24s; }
.masonry-item:nth-child(5){ animation-delay: .30s; }
.masonry-item:nth-child(6){ animation-delay: .36s; }
.masonry-item:nth-child(7){ animation-delay: .42s; }
.masonry-item:nth-child(8){ animation-delay: .48s; }
.masonry-item:nth-child(9){ animation-delay: .54s; }
.masonry-item:nth-child(10){ animation-delay: .60s; }

@keyframes popIn{
  to{ transform: translateY(0) scale(1); opacity: 1; }
}

/* ===== FIXED RESPONSIVE GALLERY (16:9 + 9:16) ===== */
.pg-grid{
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

/* desktop: 3 per row */
.pg-card{
  grid-column: span 4;
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
  transform: translateY(10px);
  opacity: 0;
  animation: pgPop .8s ease forwards;
}

/* tablet: 2 per row */
@media (max-width: 991px){
  .pg-card{ grid-column: span 6; }
}

/* mobile: 1 per row */
@media (max-width: 600px){
  .pg-card{ grid-column: span 12; }
}

/* Auto aspect ratio classes (set by JS) */
.pg-card.is-landscape{ aspect-ratio: 16 / 9; }
.pg-card.is-portrait { aspect-ratio: 9 / 16; }
.pg-card.is-square   { aspect-ratio: 1 / 1; }

.pg-card img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(.85);
  transition: transform .55s ease;
}

/* dark overlay */
.pg-card:before{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 35%, rgba(0,0,0,.62) 100%);
  z-index: 1;
  opacity: .9;
  transition: opacity .35s ease;
}

/* caption */
.pg-cap{
  position:absolute;
  left: 14px; right: 14px; bottom: 12px;
  z-index: 2;
  font-weight: 800;
  font-size: 13px;
  color: rgba(255,255,255,.95);
  text-shadow: 0 10px 20px rgba(0,0,0,.45);
  display:flex;
  justify-content: space-between;
  align-items:center;
}
.pg-cap:after{ content:"↗"; opacity:.9; }

.pg-card:hover img{ transform: scale(1.12); }
.pg-card:hover:before{ opacity: .75; }
.pg-card:hover{ transform: translateY(-4px); border-color: rgba(255,255,255,.22); }

@keyframes pgPop{
  to{ transform: translateY(0); opacity: 1; }
}
