﻿:root {
  --bg: #070503;
  --bg-soft: #120d08;
  --panel: #1d1309;
  --panel-strong: #291707;
  --gold: #d8a13d;
  --gold-soft: #ffdda0;
  --copper: #a84e1c;
  --red: #781b14;
  --text: #fff4dd;
  --muted: #cbb98e;
  --line: rgba(216, 161, 61, 0.28);
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.46);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  width: 100%;
  max-width: 100%;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, rgba(168, 78, 28, 0.22), transparent 34rem),
    radial-gradient(circle at 88% 8%, rgba(216, 161, 61, 0.14), transparent 30rem),
    linear-gradient(180deg, #090604, var(--bg) 45%, #050302);
  color: var(--text);
  font-family: "Poppins", Arial, sans-serif;
  line-height: 1.6;
}

body.menu-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

img,
svg,
video,
canvas,
iframe {
  max-width: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 5, 3, 0.9);
  backdrop-filter: blur(16px);
}

.nav-shell {
  width: min(1200px, calc(100% - 32px));
  max-width: 100%;
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.logo-frame {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: linear-gradient(145deg, var(--red), var(--panel-strong));
  box-shadow: 0 0 28px rgba(216, 161, 61, 0.22);
}

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

.logo-image[hidden],
.brand-icon[hidden] {
  display: none;
}

.logo-frame .brand-icon {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.hero-logo-frame {
  width: 76px;
  height: 76px;
  margin-bottom: 18px;
}

.hero-logo-frame .brand-icon {
  font-size: 1.25rem;
}

.brand-icon {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: linear-gradient(145deg, var(--red), var(--panel-strong));
  color: var(--gold-soft);
  font-weight: 800;
  box-shadow: 0 0 28px rgba(216, 161, 61, 0.22);
}

.brand-copy {
  min-width: 0;
  display: grid;
}

.brand strong {
  overflow: hidden;
  color: var(--gold-soft);
  font-size: 1rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-links {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-links a {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--gold-soft);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 5px auto;
  border-radius: 2px;
  background: var(--gold-soft);
}

.section {
  width: min(1200px, calc(100% - 32px));
  max-width: 100%;
  margin: 0 auto;
  padding: 92px 0;
}

.hero {
  min-height: calc(100vh - 76px);
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  align-items: center;
  gap: clamp(42px, 6vw, 78px);
  overflow: hidden;
}

.hero-copy {
  min-width: 0;
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 100%;
  margin-bottom: 10px;
  color: var(--gold-soft);
  font-size: clamp(2.4rem, 4vw, 3.9rem);
  line-height: 1.08;
  overflow: visible;
  overflow-wrap: normal;
  word-break: normal;
  text-wrap: balance;
}

h2 {
  margin-bottom: 16px;
  color: var(--gold-soft);
  font-size: clamp(2rem, 4vw, 3.15rem);
  line-height: 1.12;
}

h3 {
  margin-bottom: 8px;
  color: var(--gold-soft);
  font-size: 1.08rem;
  line-height: 1.25;
}

.malayalam-line {
  margin-bottom: 16px;
  color: var(--gold);
  font-family: "Noto Serif Malayalam", serif;
  font-size: clamp(1.18rem, 2.4vw, 1.85rem);
  font-weight: 700;
}

.hero-text,
.section-title p,
.video-meta p,
.playlist-card p,
.about-copy p,
.contact-panel p,
.site-footer {
  color: var(--muted);
}

.hero-text {
  max-width: 620px;
  font-size: 1.06rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.btn {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gold);
  border-radius: 8px;
  padding: 12px 20px;
  font-weight: 800;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold), #f5ca72);
  color: #1a0e04;
}

.btn-outline {
  color: var(--gold-soft);
  background: rgba(216, 161, 61, 0.06);
}

.featured-video {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(29, 19, 9, 0.78);
  box-shadow: var(--shadow);
}

.featured-screen {
  position: relative;
  aspect-ratio: 16 / 9;
  min-height: 240px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(7, 5, 3, 0.06), rgba(7, 5, 3, 0.82)),
    radial-gradient(circle at 50% 30%, rgba(255, 221, 160, 0.24), transparent 32%),
    repeating-linear-gradient(90deg, rgba(216, 161, 61, 0.1) 0 1px, transparent 1px 48px),
    linear-gradient(135deg, #42170d, #8c2f18 48%, #1d1309);
}

.featured-screen::before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(255, 221, 160, 0.18);
  border-radius: 8px;
}

.play-button,
.play-dot {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gold-soft);
  box-shadow: 0 0 34px rgba(255, 221, 160, 0.42);
}

.play-button {
  width: 76px;
  height: 76px;
  border: 0;
}

.play-button::after,
.play-dot::after {
  content: "";
  width: 0;
  height: 0;
  margin-left: 4px;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  border-left: 17px solid #1b1005;
}

.video-badge,
.duration,
.count {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(216, 161, 61, 0.42);
  border-radius: 999px;
  background: rgba(7, 5, 3, 0.72);
  color: var(--gold-soft);
  font-size: 0.76rem;
  font-weight: 800;
}

.video-badge {
  position: absolute;
  left: 18px;
  top: 18px;
  padding: 7px 11px;
}

.featured-info {
  padding: 24px;
}

.featured-info p,
.video-meta span {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.featured-info h2 {
  font-size: clamp(1.35rem, 2.5vw, 2.05rem);
}

.featured-info span {
  color: var(--muted);
}

.section-title {
  max-width: 760px;
  margin-bottom: 34px;
}

.section-title.compact {
  max-width: 680px;
}

.video-grid,
.playlist-grid,
.gallery-grid {
  min-width: 0;
  display: grid;
  gap: 18px;
}

.video-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.video-card,
.playlist-card,
.contact-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(29, 19, 9, 0.72);
}

.video-card {
  overflow: hidden;
}

.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  min-height: 170px;
  display: block;
  overflow: hidden;
  background: var(--panel-strong);
}

.thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent, rgba(7, 5, 3, 0.84)),
    radial-gradient(circle at 50% 28%, rgba(255, 221, 160, 0.22), transparent 35%);
}

.thumb.temple {
  background: linear-gradient(135deg, #321009, #853019 50%, #201006);
}

.thumb.bhagavatham {
  background: linear-gradient(135deg, #251207, #7b1e18 45%, #4d2e0d);
}

.thumb.pooja {
  background: linear-gradient(135deg, #2f1608, #9c4a19 48%, #1d1309);
}

.duration {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 5px 9px;
}

.play-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 52px;
  height: 52px;
  transform: translate(-50%, -50%);
}

.play-dot::after {
  border-top-width: 8px;
  border-bottom-width: 8px;
  border-left-width: 13px;
}

.video-meta {
  padding: 20px;
}

.video-meta p {
  margin-bottom: 0;
}

.playlist-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.playlist-card {
  position: relative;
  min-height: 230px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 22px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(7, 5, 3, 0.06), rgba(7, 5, 3, 0.82)),
    linear-gradient(135deg, rgba(120, 27, 20, 0.72), rgba(41, 23, 7, 0.9));
}

.playlist-card::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(255, 221, 160, 0.14);
  border-radius: 8px;
  pointer-events: none;
}

.count {
  width: fit-content;
  margin-bottom: 16px;
  padding: 6px 10px;
}

.gallery-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 190px;
}

.gallery-item {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 5px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  overflow: hidden;
  background:
    linear-gradient(180deg, transparent, rgba(7, 5, 3, 0.88)),
    radial-gradient(circle at 50% 18%, rgba(255, 221, 160, 0.22), transparent 34%),
    linear-gradient(135deg, #35150c, #8e3119 48%, #1d1309);
}

.gallery-item.tall {
  grid-row: span 2;
}

.gallery-item.wide {
  grid-column: span 2;
}

.gallery-item span {
  color: var(--gold-soft);
  font-family: "Noto Serif Malayalam", serif;
  font-size: 1.35rem;
  font-weight: 700;
}

.gallery-item figcaption {
  color: var(--muted);
}

.about {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr);
  align-items: center;
  gap: 34px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.about-copy {
  min-width: 0;
  max-width: 760px;
}

.channel-stats {
  min-width: 0;
  display: grid;
  gap: 14px;
}

.channel-stats div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: rgba(29, 19, 9, 0.72);
}

.channel-stats strong,
.channel-stats span {
  display: block;
}

.channel-stats strong {
  color: var(--gold-soft);
  font-size: 1.35rem;
}

.channel-stats span {
  color: var(--muted);
}

.contact-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 34px;
  padding: clamp(22px, 4vw, 40px);
  background:
    linear-gradient(135deg, rgba(120, 27, 20, 0.34), rgba(29, 19, 9, 0.84)),
    rgba(29, 19, 9, 0.74);
}

.social-links,
.footer-links {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.social-links {
  margin-top: 22px;
}

.social-links a,
.footer-links a {
  color: var(--gold-soft);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.footer-links {
  justify-content: center;
  margin-top: 12px;
}

.contact-form {
  min-width: 0;
  display: grid;
  gap: 15px;
}

.contact-form label {
  display: grid;
  gap: 8px;
  color: var(--gold-soft);
  font-weight: 700;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 5, 3, 0.78);
  color: var(--text);
  padding: 13px 14px;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid rgba(216, 161, 61, 0.36);
}

.form-status {
  min-height: 24px;
  margin: 0;
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 26px 16px;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 980px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: fixed;
    top: 76px;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px 16px 18px;
    border-bottom: 1px solid var(--line);
    background: rgba(7, 5, 3, 0.98);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    display: block;
    padding: 13px 0;
  }

  .hero,
  .about,
  .contact-panel {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 72px;
  }

  .hero-copy {
    max-width: 760px;
  }

  .video-grid,
  .playlist-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .nav-shell,
  .section {
    width: min(100% - 24px, 1200px);
    max-width: calc(100% - 24px);
  }

  .brand-copy small {
    display: none;
  }

  .section {
    padding: 68px 0;
  }

  h1 {
    max-width: 100%;
    font-size: clamp(2rem, 8.6vw, 2.85rem);
    line-height: 1.08;
  }

  h2 {
    font-size: clamp(1.75rem, 8vw, 2.35rem);
  }

  .hero-actions,
  .btn {
    width: 100%;
  }

  .featured-screen {
    min-height: 200px;
  }

  .video-grid,
  .playlist-grid,
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-auto-rows: 210px;
  }

  .gallery-item.tall,
  .gallery-item.wide {
    grid-row: auto;
    grid-column: auto;
  }

  .featured-info,
  .video-meta,
  .playlist-card {
    padding: 18px;
  }
}

@media (max-width: 390px) {
  .brand strong {
    max-width: 190px;
  }

  h1 {
    font-size: clamp(1.75rem, 8.2vw, 2.25rem);
  }
}





/* Final logo fallback overrides keep the KM mark inside the image frame. */
.logo-frame .brand-icon {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.hero-logo-frame .brand-icon {
  font-size: 1.25rem;
}


/* Latest video thumbnail enhancements */
.video-card {
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.video-card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 221, 160, 0.48);
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.34);
}

.thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 260ms ease;
}

.video-card:hover .thumb img {
  transform: scale(1.045);
}

.thumb::before {
  z-index: 1;
  background: radial-gradient(circle at 50% 28%, rgba(255, 221, 160, 0.14), transparent 35%);
  pointer-events: none;
}

.thumb-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 5, 3, 0.06), rgba(7, 5, 3, 0.62));
  pointer-events: none;
}

.duration,
.play-dot {
  z-index: 2;
}

.play-dot {
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.video-card:hover .play-dot {
  transform: translate(-50%, -50%) scale(1.08);
  box-shadow: 0 0 42px rgba(255, 221, 160, 0.54);
}

/* Malayalam label helper text */
.nav-links small,
.eyebrow small {
  color: inherit;
  font-size: 0.7em;
  font-weight: 600;
  opacity: 0.78;
}

.nav-links small {
  margin-left: 4px;
}

.eyebrow small {
  margin-left: 6px;
}

/* YouTube API dynamic video states */
.featured-thumbnail {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.featured-screen .play-button,
.featured-screen .video-badge {
  z-index: 2;
}

.video-message {
  grid-column: 1 / -1;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(29, 19, 9, 0.72);
  color: var(--muted);
  padding: 22px;
  text-align: center;
}

.video-message.error {
  color: var(--gold-soft);
}
