/* CourseLK — Metro "Start screen" home (v1.4) */
.metro-start {
  --gap: 8px;
  background: linear-gradient(160deg, #0F1C2E 0%, #14305a 100%);
  color: #fff;
  padding: 24px 0 40px;
  font-family: 'Segoe UI', 'Nirmala UI', 'Noto Sans Sinhala', system-ui, sans-serif;
}
.metro-start * { box-sizing: border-box; }

/* header */
.metro-head { display: flex; flex-direction: column; gap: 16px; margin-bottom: 28px; }
.metro-kicker { margin: 0 0 4px; font-size: 14px; letter-spacing: .08em; color: #F59E0B; font-weight: 600; }
.metro-title { margin: 0; font-size: 28px; line-height: 1.35; font-weight: 300; color: #fff; }
.metro-sub { margin: 6px 0 0; font-size: 15px; color: rgba(255,255,255,.75); }
.metro-search { display: flex; width: 100%; max-width: 520px; }
.metro-search input {
  flex: 1; min-width: 0; height: 44px; padding: 0 12px; border: 2px solid transparent; border-radius: 0;
  font: inherit; font-size: 15px; background: #fff; color: #0F1C2E;
}
.metro-search input:focus { outline: none; border-color: #F59E0B; }
.metro-search button {
  height: 44px; padding: 0 18px; border: 0; border-radius: 0; cursor: pointer;
  background: #F59E0B; color: #1f2937; font: inherit; font-weight: 700;
}
.metro-search button:hover { background: #fbbf24; }
.metro-search button:focus-visible, .metro-btn:focus-visible, .tile:focus-visible, .latest-tile:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

/* groups */
.metro-group { margin-bottom: 28px; }
.metro-group-title { margin: 0 0 12px; font-size: 20px; font-weight: 300; color: #fff; line-height: 1.4; }
.metro-group-title small { display: block; font-size: 13px; color: rgba(255,255,255,.6); font-weight: 400; }

/* grid: 2 cols mobile, 4 tablet, 6 desktop */
.metro-grid {
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 140px; grid-auto-flow: dense;
}
@media (min-width: 640px)  { .metro-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 150px; } .metro-title { font-size: 36px; } .metro-head { flex-direction: row; justify-content: space-between; align-items: flex-end; } }
@media (min-width: 960px)  { .metro-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: 165px; } }

/* tile base */
.tile {
  position: relative; display: block; overflow: hidden; color: #fff; text-decoration: none;
  padding: 0; border: 0; border-radius: 0; background: #1B4F8A;
  transition: transform .12s ease, box-shadow .12s ease;
}
a.tile:hover { transform: scale(1.02); box-shadow: 0 0 0 2px rgba(255,255,255,.55); }
a.tile:active { transform: scale(.97); }
.t-sm { grid-column: span 1; grid-row: span 1; }
.t-wide { grid-column: span 2; grid-row: span 1; }
.t-lg { grid-column: span 2; grid-row: span 2; }
.t-feature { grid-column: span 2; grid-row: span 3; }
@media (min-width: 640px) { .t-feature { grid-column: span 4; grid-row: span 2; } }
@media (min-width: 960px) { .t-feature { grid-column: span 4; grid-row: span 2; } }

/* colours (all >= 4.5:1 against text) */
.c-blue   { background: #1B4F8A; }
.c-green  { background: #047857; }
.c-purple { background: #6D28D9; }
.c-red    { background: #B91C1C; }
.c-teal   { background: #0E7490; }
.c-navy   { background: #334155; }
.c-amber  { background: #F59E0B; color: #1f2937; }
.c-amber-dark { background: #F59E0B; color: #1f2937; }

/* tile faces */
.tile-face { position: absolute; inset: 0; padding: 12px; display: flex; flex-direction: column; transition: transform .5s ease, opacity .5s ease; }
.tile-face-main { justify-content: center; align-items: center; text-align: center; }
.tile-icon { display: block; font-size: 30px; line-height: 1; margin-bottom: 8px; }
.t-lg .tile-icon { font-size: 48px; }
.tile-count { position: absolute; top: 8px; right: 12px; font-size: 26px; font-weight: 300; }
.t-lg .tile-count { font-size: 44px; }
.tile-label { display: block; }
.tile-si { display: block; font-size: 16px; font-weight: 600; line-height: 1.3; }
.tile-en { display: block; font-size: 12px; opacity: .85; }
.t-lg .tile-si { font-size: 22px; }
.tile-face-alt { transform: translateY(100%); opacity: 0; justify-content: center; align-items: center; text-align: center; background: inherit; }
.tile-alt-tag { font-size: 12px; opacity: .85; margin-bottom: 4px; }
.tile-alt-title { font-size: 15px; font-weight: 600; line-height: 1.4; }
.t-lg .tile-alt-title { font-size: 20px; }
.tile-alt-date { margin-top: 6px; font-size: 12px; opacity: .8; }
.tile-live .tile-face.is-active { transform: none; opacity: 1; }
.tile-live .tile-face.is-out { transform: translateY(-100%); opacity: 0; }
.tile-live .tile-face-main { transform: none; opacity: 1; }
.tile-live.js-live .tile-face-main:not(.is-active) { transform: translateY(-100%); opacity: 0; }
.tile-live.js-live .tile-face-main.is-active { transform: none; opacity: 1; }

/* feature tile */
.t-feature { padding: 18px; display: flex; flex-direction: column; justify-content: center; }
.t-feature { align-items: center; text-align: center; border: 4px solid #fff; box-shadow: 0 0 0 0 rgba(245,158,11,.7); animation: dk-glow 2.4s ease-in-out infinite; }
.feature-badge { display: inline-block; margin-bottom: 10px; padding: 4px 12px; background: #1f2937; color: #F59E0B; font-size: 13px; font-weight: 700; }
.feature-name { margin: 0 0 10px; display: flex; flex-direction: column; align-items: center; gap: 2px; color: #1f2937; }
.feature-name-en, .feature-name-si { display: block; font-size: 34px; font-weight: 800; line-height: 1.25; }
@media (min-width: 640px) { .feature-name-en, .feature-name-si { font-size: 44px; } }
@keyframes dk-glow { 0%,100% { box-shadow: 0 0 0 0 rgba(255,255,255,.0); } 50% { box-shadow: 0 0 0 6px rgba(255,255,255,.35); } }
.feature-desc { margin: 0 0 4px; font-size: 14px; line-height: 1.6; }
.feature-desc-en { margin: 0 0 12px; font-size: 12px; opacity: .8; }
.feature-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.metro-btn {
  display: inline-block; padding: 10px 18px; font-size: 14px; font-weight: 700; text-decoration: none; border-radius: 0;
  background: rgba(0,0,0,.2); color: #fff; border: 2px solid rgba(0,0,0,.35);
}
.c-amber-dark .metro-btn { background: transparent; color: #1f2937; border-color: #1f2937; }
.c-amber-dark .metro-btn-primary { background: #1f2937; color: #fff; }
.metro-btn:hover { filter: brightness(1.15); }

/* latest tiles */
.metro-latest { display: grid; gap: var(--gap); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .metro-latest { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.latest-tile { display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; min-height: 120px; padding: 12px; color: #fff; text-decoration: none; border-left: 4px solid rgba(255,255,255,.55); }
.latest-tile.c-amber { color: #1f2937; border-left-color: rgba(0,0,0,.4); }
.latest-tile:hover { filter: brightness(1.1); }
.latest-tag { font-size: 12px; font-weight: 700; opacity: .9; }
.latest-title { font-size: 14px; line-height: 1.45; margin: 6px 0; font-weight: 600; word-break: break-word; }
.latest-date { font-size: 12px; opacity: .8; }

/* ad slot spacing on dark bg */
.metro-start .ad-slot { background: #fff; color: #4A5568; margin-top: 8px; }

@media (prefers-reduced-motion: reduce) {
  .t-feature { animation: none; }
  .tile, .tile-face { transition: none !important; }
  a.tile:hover, a.tile:active { transform: none; }
}
