:root {
  --ink: #1c1607;
  --ink-soft: #655426;
  --royal-blue: #12315f;
  --deep-blue: #211800;
  --gold: #d7a51e;
  --gold-strong: #b77b00;
  --gold-soft: #fff1b8;
  --red: #8f1d16;
  --paper: #fffdf5;
  --white: #ffffff;
  --line: rgba(183, 123, 0, 0.18);
  --shadow: 0 22px 60px rgba(117, 79, 0, 0.18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, #fffdf5 0%, #fff7d7 45%, #ffffff 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 50% 12%, rgba(215,165,30,.18), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.94), rgba(255,249,226,.95)),
    url('/static/nmas-tv-background.jpg') center top / min(980px, 120vw) auto no-repeat;
  z-index: -2;
}
a { color: inherit; text-decoration: none; }
img, video, iframe { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(16px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(215, 165, 30, 0.32);
}
.topbar {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand { display: inline-flex; align-items: center; gap: .7rem; min-width: 210px; }
.brand img {
  width: 46px;
  height: 46px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--gold);
}
.brand span { display: grid; line-height: 1.1; }
.brand strong { color: var(--deep-blue); font-size: .98rem; letter-spacing: .02em; }
.brand small { color: var(--gold); font-weight: 700; text-transform: uppercase; font-size: .72rem; letter-spacing: .13em; }
.main-menu { display: flex; gap: .35rem; align-items: center; list-style: none; margin: 0; padding: 0; }
.main-menu a {
  display: inline-flex;
  padding: .65rem .72rem;
  color: var(--deep-blue);
  border-radius: 999px;
  font-size: .88rem;
  font-weight: 700;
}
.main-menu a:hover, .main-menu a.active { background: rgba(216, 170, 66, .16); color: var(--red); }
.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(216,170,66,.45);
  border-radius: 12px;
  background: var(--white);
  color: var(--deep-blue);
}

.hero-section {
  position: relative;
  min-height: 74vh;
  display: grid;
  place-items: center;
  padding: 5rem 1rem;
  overflow: hidden;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(215,165,30,.16) 1px, transparent 1px),
    linear-gradient(0deg, rgba(215,165,30,.12) 1px, transparent 1px),
    radial-gradient(circle at 50% 12%, rgba(255,255,255,.96) 0 10%, rgba(255,225,95,.78) 11% 31%, transparent 58%),
    linear-gradient(135deg, rgba(255,255,255,.94), rgba(255,241,168,.9), rgba(255,255,255,.84)),
    url('/static/nmas-tv-background.jpg') center / cover no-repeat;
  background-size: 38px 38px, 38px 38px, auto, auto, cover;
}
.hero-section::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(120deg, transparent 0 44%, rgba(255,255,255,.35) 49%, transparent 54%);
  animation: royal-scan 8s linear infinite;
  opacity: .5;
}
.hero-section::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 150px;
  background: linear-gradient(0deg, #fffdf5, transparent);
}
@keyframes royal-scan {
  0% { transform: translateX(-70%); }
  100% { transform: translateX(70%); }
}
.page-hero {
  min-height: 42vh;
  padding: 4rem 1rem;
}
.page-hero::after { height: 90px; }
.royal-symbols {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 0;
}
.crown-symbol {
  position: absolute;
  top: clamp(.45rem, 2.4vw, 2rem);
  width: min(92vw, 680px);
  opacity: .94;
  filter: drop-shadow(0 0 24px rgba(215,165,30,.62)) drop-shadow(0 26px 30px rgba(117,79,0,.22));
}
.crown-symbol svg { width: 100%; }
.crown-symbol path:not(.circuit), .crown-symbol circle { fill: rgba(215,165,30,.78); stroke: #fff7c8; stroke-width: 3; }
.crown-symbol .circuit { fill: none; stroke: #ffffff; stroke-width: 4; stroke-linecap: round; opacity: .92; }
.ankh-symbol {
  position: absolute;
  top: 48%;
  left: 50%;
  z-index: 1;
  transform: translate(-50%, -50%);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(19rem, 58vw, 42rem);
  font-weight: 900;
  line-height: 1;
  color: rgba(183,123,0,.52);
  -webkit-text-stroke: clamp(1px, .28vw, 4px) rgba(255,255,255,.84);
  text-shadow: 0 0 18px rgba(255,255,255,.92), 0 0 36px rgba(255,214,86,.86), 0 0 95px rgba(215,165,30,.62);
  mix-blend-mode: multiply;
}
.ankh-crest {
  width: clamp(88px, 18vw, 150px);
  height: clamp(88px, 18vw, 150px);
  display: inline-grid;
  place-items: center;
  margin: 0 auto .7rem;
  border-radius: 50%;
  border: 3px solid rgba(183,123,0,.72);
  background: radial-gradient(circle, rgba(255,255,255,.98) 0 45%, rgba(255,232,115,.88) 46% 72%, rgba(183,123,0,.18));
  color: #8f1d16;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(4.8rem, 12vw, 8rem);
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 0 0 8px rgba(255,255,255,.45), 0 0 34px rgba(215,165,30,.55), inset 0 0 24px rgba(183,123,0,.12);
  text-shadow: 0 2px 0 #fff7c8, 0 0 22px rgba(215,165,30,.72);
}
.royal-home-hero .hero-content { margin-top: clamp(9rem, 20vw, 15rem); }
.hero-content {
  position: relative;
  z-index: 3;
  max-width: 820px;
  text-align: center;
  padding: 2rem;
  border: 1px solid rgba(215, 165, 30, .38);
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(255,255,255,.9), rgba(255,251,234,.78));
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255,255,255,.65);
  outline: 3px solid rgba(255,255,255,.45);
}
.eyebrow, .section-kicker {
  display: inline-flex;
  color: var(--gold-strong);
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-size: .74rem;
}
.hero-content h1 {
  margin: .65rem 0;
  font-size: clamp(2.25rem, 8vw, 5.25rem);
  line-height: .96;
  font-family: Georgia, "Times New Roman", serif;
  text-wrap: balance;
}
.hero-subtitle {
  max-width: 700px;
  margin: 0 auto 1.5rem;
  color: var(--ink-soft);
  font-size: clamp(1rem, 2.5vw, 1.25rem);
}
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .8rem; }
.primary-action, .secondary-action, .admin-login button, .editor-card button, .admin-toolbar button {
  border: 0;
  border-radius: 999px;
  padding: .85rem 1.2rem;
  font-weight: 900;
  cursor: pointer;
}
.primary-action, .admin-login button, .editor-card button[type="submit"] {
  background: linear-gradient(135deg, #ffe36c, var(--gold), #fff3a5);
  color: #1b1301;
  box-shadow: 0 0 0 1px rgba(255,255,255,.7) inset, 0 12px 28px rgba(183,123,0,.22);
}
.secondary-action, .admin-toolbar button, #reset-content-form {
  border: 1px solid rgba(183,123,0,.32);
  background: rgba(255,255,255,.82);
  color: var(--gold-strong);
}

.content-section, .admin-section, .contact-section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 4.5rem 1rem;
}
.alternate {
  max-width: none;
  padding-left: max(1rem, calc((100vw - 1180px) / 2 + 1rem));
  padding-right: max(1rem, calc((100vw - 1180px) / 2 + 1rem));
  background: rgba(255,255,255,.58);
  border-block: 1px solid rgba(216,170,66,.16);
}
.section-heading { max-width: 760px; margin-bottom: 1.6rem; }
.section-heading h2, .contact-card h2, .social-card h2, .admin-section h2 {
  margin: .35rem 0;
  color: var(--deep-blue);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 5vw, 3rem);
  line-height: 1.05;
}
.section-heading p, .contact-card p { color: var(--ink-soft); margin: 0; }
.section-heading .section-kicker, .contact-card .section-kicker, .social-card .section-kicker { color: var(--red); }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.2rem; }
.quick-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.quick-grid a {
  display: grid;
  gap: .45rem;
  padding: 1.2rem;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(216,170,66,.23);
  border-radius: 22px;
  box-shadow: 0 10px 35px rgba(5,18,42,.08);
  color: var(--deep-blue);
}
.quick-grid i { color: var(--gold); font-size: 1.7rem; }
.quick-grid strong { font-family: Georgia, "Times New Roman", serif; font-size: 1.15rem; }
.quick-grid span { color: var(--ink-soft); }
.article-card, .media-card, .contact-card, .social-card, .editor-card, .admin-login {
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(216, 170, 66, .23);
  border-radius: 22px;
  box-shadow: 0 10px 35px rgba(5, 18, 42, .08);
  overflow: hidden;
}
.article-card img { width: 100%; height: 190px; object-fit: cover; background: #eee; }
.article-body { padding: 1rem; }
.article-meta { color: var(--red); font-size: .84rem; font-weight: 800; }
.article-card h3 { margin: .4rem 0; color: var(--deep-blue); line-height: 1.15; font-size: 1.18rem; }
.article-text { color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.share-button, .edit-button, .delete-button {
  margin-top: .8rem;
  border: 1px solid rgba(11,46,104,.15);
  border-radius: 999px;
  padding: .55rem .8rem;
  color: var(--gold-strong);
  background: #fffdf5;
  cursor: pointer;
  font-weight: 800;
  transition: transform .18s ease, box-shadow .18s ease;
}
.share-button:hover, .edit-button:hover, .delete-button:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(183,123,0,.14); }
.delete-button { color: #9b111e; }
.edit-button { color: #0b2e68; }

.media-tabs { display: flex; gap: .55rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.media-tab {
  border: 1px solid rgba(11,46,104,.14);
  background: var(--white);
  color: var(--deep-blue);
  border-radius: 999px;
  padding: .65rem 1rem;
  font-weight: 900;
  cursor: pointer;
}
.media-tab.active { background: linear-gradient(135deg, var(--gold), #fff1a8); color: #211800; }
.media-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.media-card { padding: .75rem; }
.media-card img, .media-card iframe, .media-card video {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 16px;
  border: 0;
  background: #111;
}
.media-card h3 { margin: .75rem .2rem .2rem; color: var(--deep-blue); font-size: 1rem; }
.media-card p { margin: 0 .2rem .3rem; color: var(--ink-soft); font-size: .92rem; }

.contact-section { display: grid; grid-template-columns: 1.35fr .9fr; gap: 1rem; }
.contact-card, .social-card { padding: 1.4rem; }
.email-link, .social-card a {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-top: .9rem;
  padding: .9rem 1rem;
  border-radius: 16px;
  background: rgba(11,46,104,.06);
  color: var(--deep-blue);
  font-weight: 900;
  overflow-wrap: anywhere;
}
.social-card a i.fa-youtube { color: #c00; }
.social-card a i.fa-facebook { color: #1877f2; }

.admin-section { padding-top: 3.5rem; }
.admin-heading { margin-inline: auto; text-align: center; }
.admin-login, .admin-panel { max-width: 980px; margin: 0 auto; }
.admin-login, .editor-card { padding: 1.2rem; }
.admin-login { display: grid; gap: .85rem; max-width: 520px; }
.hidden { display: none !important; }
.admin-panel { display: grid; gap: 1rem; }
.admin-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.2rem;
  background: linear-gradient(135deg, #2a1c00, #b77b00);
  color: var(--white);
  border-radius: 22px;
}
.editor-card h3 { margin-top: 0; color: var(--deep-blue); }
.editor-card, .admin-login { display: grid; gap: .8rem; }
.admin-login label, .editor-card label { display: grid; gap: .35rem; font-weight: 800; color: var(--deep-blue); }
.admin-login input, .editor-card input, .editor-card select, .editor-card textarea {
  width: 100%;
  border: 1px solid rgba(11,46,104,.16);
  border-radius: 14px;
  padding: .8rem .9rem;
  background: #fff;
  color: var(--ink);
}
.form-actions { display: flex; flex-wrap: wrap; gap: .7rem; }
.form-message { min-height: 1.3rem; color: var(--red); font-weight: 800; margin: .25rem 0 0; }
.form-message.success { color: #0f7b36; }
.upload-hint { margin: -.2rem 0 .2rem; color: var(--ink-soft); font-size: .9rem; }
.admin-list { display: grid; gap: .75rem; }
.admin-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .8rem;
  align-items: center;
  padding: .85rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}
.admin-row p { margin: .1rem 0 0; color: var(--ink-soft); font-size: .9rem; }
.admin-row-actions { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: end; }

.share-toast {
  position: fixed;
  left: 50%;
  bottom: 1.2rem;
  transform: translate(-50%, 18px);
  z-index: 70;
  padding: .85rem 1rem;
  border-radius: 999px;
  background: #1c1607;
  color: #fff7d7;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: .2s ease;
  font-weight: 900;
  text-align: center;
}
.share-toast.visible { opacity: 1; transform: translate(-50%, 0); }

.site-footer {
  padding: 2rem 1rem;
  text-align: center;
  color: #fff8da;
  background: linear-gradient(135deg, #2a1c00, #8a6100);
}
.site-footer p { margin: .2rem; }
.back-to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--gold);
  color: #191200;
  box-shadow: var(--shadow);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: .2s ease;
}
.back-to-top.visible { opacity: 1; pointer-events: auto; }
.empty-state {
  padding: 1.2rem;
  color: var(--ink-soft);
  background: rgba(255,255,255,.8);
  border: 1px dashed rgba(11,46,104,.22);
  border-radius: 18px;
}

@media (max-width: 960px) {
  .menu-toggle { display: inline-grid; place-items: center; }
  .main-menu {
    position: absolute;
    left: 1rem;
    right: 1rem;
    top: 72px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: .75rem;
    background: rgba(255,255,255,.98);
    border: 1px solid rgba(216,170,66,.25);
    border-radius: 20px;
    box-shadow: var(--shadow);
  }
  .main-menu.open { display: flex; }
  .main-menu a { width: 100%; }
  .card-grid, .media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact-section { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .topbar { padding: .55rem .8rem; }
  .brand { min-width: auto; }
  .brand strong { font-size: .86rem; }
  .brand small { font-size: .62rem; }
  .brand img { width: 40px; height: 40px; }
  .hero-section { min-height: 72vh; padding: 4rem .85rem; }
  .hero-content { padding: 1.25rem; border-radius: 22px; }
  .hero-actions a { width: 100%; justify-content: center; text-align: center; }
  .content-section, .admin-section, .contact-section { padding: 3rem .85rem; }
  .card-grid, .media-grid, .quick-grid { grid-template-columns: 1fr; }
  .page-hero { min-height: 36vh; }
  .crown-symbol { width: min(92vw, 380px); top: 1rem; }
  .ankh-symbol { font-size: clamp(12rem, 72vw, 22rem); top: 43%; }
  .royal-home-hero .hero-content { margin-top: 8.5rem; }
  .article-card img { height: 205px; }
  .admin-toolbar, .admin-row { grid-template-columns: 1fr; display: grid; }
  .admin-row-actions { justify-content: start; }
}
