:root {
  --ink: #141414;
  --muted: #626262;
  --paper: #fffdf8;
  --surface: #ffffff;
  --line: #e7e0d7;
  --accent: #b8182b;
  --accent-dark: #84101e;
  --green: #0e6b4f;
  --teal: #0a6172;
  --gold: #d49b24;
  --shadow: 0 18px 45px rgba(20, 20, 20, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Noto Sans Malayalam", "Manjari", sans-serif;
  line-height: 1.65;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 253, 248, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.topbar,
.navbar,
main > section,
.footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  color: var(--muted);
  font-size: 13px;
}

.topbar a {
  color: var(--accent);
  font-weight: 700;
}

.gold-rate {
  color: var(--accent);
  font-weight: 800;
  white-space: nowrap;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  border-radius: 8px;
  letter-spacing: 0;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 19px;
  line-height: 1.2;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.navlinks {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 14px;
  font-weight: 700;
}

.navlinks a {
  padding: 8px 0;
  border-bottom: 2px solid transparent;
}

.navlinks a:hover {
  border-color: var(--accent);
}

.menu-button {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  font-size: 22px;
}

.hero {
  position: relative;
  width: 100%;
  min-height: 600px;
  overflow: hidden;
  display: grid;
  align-items: end;
  color: #fff;
}

.hero-image,
.hero-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-image {
  object-fit: cover;
}

.hero-overlay {
  background:
    linear-gradient(90deg, rgba(12, 14, 13, 0.86), rgba(12, 14, 13, 0.42) 48%, rgba(12, 14, 13, 0.12)),
    linear-gradient(0deg, rgba(12, 14, 13, 0.76), transparent 48%);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
  padding: 112px 0 116px;
}

.eyebrow,
.section-heading p {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #ffd166;
}

.hero h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(34px, 5vw, 70px);
  line-height: 1.08;
}

.hero p {
  max-width: 650px;
  font-size: 18px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.primary-btn,
.ghost-btn,
.tip-form button,
.search-box button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.primary-btn,
.tip-form button,
.search-box button {
  background: var(--accent);
  color: #fff;
}

.ghost-btn {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.08);
}

.hero-card {
  position: absolute;
  right: max(16px, calc((100% - 1180px) / 2));
  bottom: 32px;
  z-index: 3;
  width: min(360px, calc(100% - 32px));
  padding: 20px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  border-left: 5px solid var(--gold);
  box-shadow: var(--shadow);
}

.hero-card span,
.hero-card small,
.news-card span,
.category-grid span,
.gulf-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.hero-card strong {
  display: block;
  margin: 6px 0;
  font-size: 18px;
  line-height: 1.35;
}

.ticker {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-top: 22px;
  padding: 12px 0;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.ticker strong {
  flex: 0 0 auto;
  position: relative;
  z-index: 2;
  background: var(--ink);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
}

.ticker-mask {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.ticker-track {
  display: flex;
  gap: 32px;
  width: max-content;
  white-space: nowrap;
  animation: slide 22s linear infinite;
}

@keyframes slide {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-45%);
  }
}

.ad-slot {
  display: block;
  min-height: 92px;
  margin-top: 24px;
  border: 1px solid var(--line);
  background: #fff8e8;
  border-radius: 8px;
  overflow: hidden;
}

.ad-slot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  padding: 48px 0 32px;
}

.section-heading h2 {
  margin: 0 0 18px;
  font-size: clamp(26px, 3vw, 42px);
  line-height: 1.2;
}

.lead-story {
  position: relative;
  padding: 28px;
  background: var(--surface);
  border-top: 5px solid var(--accent);
  box-shadow: var(--shadow);
}

.story-badge {
  display: inline-block;
  margin-bottom: 10px;
  padding: 4px 10px;
  color: #fff;
  background: var(--accent);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
}

.lead-story h3,
.news-card h3,
.category-grid h3,
.notice-list h3,
.gulf-card h3 {
  margin: 0 0 10px;
  line-height: 1.35;
}

.lead-story h3 {
  font-size: clamp(24px, 3vw, 34px);
}

.lead-story p,
.news-card p,
.category-grid p,
.split-section p,
.notice-list p,
.footer p {
  color: var(--muted);
}

.story-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.story-meta span,
.route-pills span {
  padding: 7px 10px;
  background: #f0ebe3;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.article-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.news-card,
.category-grid article,
.notice-list article,
.weather-widget,
.emergency-box,
.currency-widget,
.search-box,
.popular-box,
.gulf-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}

.news-card .category {
  color: var(--accent);
}

.news-card a {
  color: var(--accent);
  font-weight: 800;
}

.sidebar {
  display: grid;
  gap: 18px;
  align-content: start;
}

.weather-widget {
  background: var(--teal);
  color: #fff;
}

.weather-widget span,
.weather-widget p {
  color: rgba(255, 255, 255, 0.78);
}

.weather-widget strong {
  display: block;
  font-size: 46px;
  line-height: 1;
}

.emergency-box {
  border-top: 5px solid var(--accent);
}

.emergency-box h2 {
  margin: 0 0 14px;
  font-size: 22px;
  line-height: 1.2;
}

.emergency-box a {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.emergency-box a:first-of-type {
  border-top: 0;
}

.emergency-box span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.emergency-box strong {
  color: var(--accent);
  font-size: 24px;
  line-height: 1;
}

.emergency-box small {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.currency-widget {
  border-top: 5px solid var(--green);
}

.currency-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}

.currency-head span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.currency-head h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.currency-head button {
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--green);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.currency-list {
  display: grid;
  gap: 8px;
}

.currency-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.currency-row:first-child {
  border-top: 0;
}

.currency-code {
  color: var(--ink);
  font-weight: 800;
}

.currency-name {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
}

.currency-rate {
  color: var(--accent);
  font-weight: 800;
  white-space: nowrap;
}

.currency-widget small,
.currency-loading {
  display: block;
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.search-box label {
  display: block;
  margin-bottom: 8px;
  font-weight: 800;
}

.search-box div {
  display: flex;
  gap: 8px;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  font: inherit;
  background: #fff;
}

.search-box input {
  flex: 1;
}

.search-box small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
}

.popular-box h2 {
  margin-top: 0;
}

.popular-box ol {
  margin: 0;
  padding-left: 24px;
}

.popular-box li + li {
  margin-top: 10px;
}

.ad-box {
  min-height: 250px;
  margin-top: 0;
}

.ad-wide {
  height: 120px;
}

.ad-box img {
  aspect-ratio: 1.2 / 1;
}

.category-band,
.split-section,
.notice-section,
.submit-section {
  padding: 54px 0;
}

.category-band {
  border-top: 1px solid var(--line);
}

.category-grid,
.notice-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.category-grid article:nth-child(1) {
  border-top: 4px solid var(--accent);
}

.category-grid article:nth-child(2) {
  border-top: 4px solid var(--green);
}

.category-grid article:nth-child(3) {
  border-top: 4px solid var(--gold);
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  align-items: stretch;
  border-top: 1px solid var(--line);
}

.route-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.gulf-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--green);
  color: #fff;
}

.gulf-card span,
.gulf-card p {
  color: rgba(255, 255, 255, 0.78);
}

.notice-section {
  border-top: 1px solid var(--line);
}

.notice-list time {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.submit-section {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(300px, 0.7fr);
  gap: 28px;
  align-items: start;
  background: #f4efe6;
  width: 100%;
}

.submit-section > * {
  width: min(560px, calc(100% - 32px));
}

.submit-section > div {
  margin-left: max(16px, calc((100vw - 1180px) / 2));
  justify-self: end;
}

.tip-form {
  display: grid;
  gap: 14px;
  margin-right: max(16px, calc((100vw - 1180px) / 2));
}

.tip-form label {
  display: grid;
  gap: 6px;
  font-weight: 800;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  padding: 34px 0 50px;
  border-top: 2px solid var(--ink);
}

.footer strong {
  font-size: 20px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-content: start;
  align-items: center;
  justify-content: flex-end;
}

.footer-links a {
  color: var(--accent);
  font-weight: 800;
}

.footer-links .social-icon {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.footer-links .social-icon:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.footer-links .social-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.footer-links .social-icon:nth-child(2) svg path {
  fill: currentColor;
  stroke: none;
}

.admin-body {
  background: #f7f4ed;
}

.admin-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 54px;
}

.admin-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: stretch;
  padding: 34px 0;
}

.admin-hero h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1.1;
}

.admin-hero p {
  max-width: 720px;
  color: var(--muted);
}

.admin-status,
.admin-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(20, 20, 20, 0.07);
}

.admin-status {
  display: grid;
  align-content: center;
  padding: 22px;
  border-top: 5px solid var(--accent);
}

.admin-status span,
.admin-status small,
.preview-article small,
.draft-item small {
  color: var(--muted);
  font-size: 13px;
}

.admin-status strong {
  display: block;
  font-size: 22px;
}

.admin-status strong.is-connected {
  color: var(--green);
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 24px;
  align-items: start;
}

.admin-form,
.admin-preview {
  display: grid;
  gap: 18px;
}

.admin-card {
  padding: 22px;
}

.admin-card h2,
.drafts-header h2 {
  margin: 0 0 16px;
  line-height: 1.2;
}

.admin-form label,
.admin-preview label {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  font-weight: 800;
}

.admin-form small {
  color: var(--muted);
  font-weight: 400;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.seo-panel summary {
  cursor: pointer;
  font-weight: 800;
}

.seo-panel[open] summary {
  margin-bottom: 16px;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.publish-status {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.publish-status a {
  color: var(--accent);
  font-weight: 800;
}

.admin-actions button,
.secondary-btn,
.draft-item button {
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.admin-actions button[type="submit"] {
  background: var(--accent);
  color: #fff;
}

.secondary-btn,
.draft-item button {
  background: #fff;
  color: var(--accent);
  border-color: var(--line);
}

.publish-btn {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.preview-article .category,
.full-article .category {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.preview-article h3 {
  margin: 0 0 8px;
  line-height: 1.25;
}

.preview-article p {
  color: var(--muted);
}

#generated-html {
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
}

.drafts-panel {
  margin-top: 24px;
}

.drafts-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.draft-list {
  display: grid;
  gap: 12px;
}

.draft-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
}

.draft-item strong,
.draft-item small {
  display: block;
}

.empty-state {
  color: var(--muted);
}

.article-page {
  width: min(860px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 70px;
}

.full-article {
  padding: 30px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.full-article h1 {
  margin: 0 0 14px;
  font-size: clamp(32px, 5vw, 54px);
  line-height: 1.14;
}

.article-summary {
  font-size: 19px;
  color: var(--muted);
}

.featured-image,
.preview-featured-image {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 8px;
  margin: 18px 0;
  border: 1px solid var(--line);
}

.back-link {
  display: inline-block;
  margin-bottom: 20px;
  color: var(--accent);
  font-weight: 800;
}

@media (max-width: 880px) {
  .topbar {
    flex-direction: column;
    gap: 4px;
  }

  .menu-button {
    display: block;
  }

  .navlinks {
    position: absolute;
    left: 16px;
    right: 16px;
    top: 104px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
  }

  .navlinks.open {
    display: flex;
  }

  .hero {
    min-height: 680px;
  }

  .hero-content {
    padding: 96px 0 210px;
  }

  .hero-card {
    left: 16px;
    right: 16px;
  }

  .content-grid,
  .split-section,
  .submit-section,
  .admin-hero,
  .admin-grid {
    grid-template-columns: 1fr;
  }

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

  .submit-section > div,
  .tip-form {
    margin-left: auto;
    margin-right: auto;
    justify-self: center;
  }
}

@media (max-width: 680px) {
  .topbar,
  .navbar,
  main > section,
  .footer {
    width: min(100% - 24px, 1180px);
  }

  .brand strong {
    font-size: 16px;
  }

  .brand small {
    font-size: 11px;
  }

  .hero h1 {
    font-size: 34px;
  }

  .hero p {
    font-size: 16px;
  }

  .ticker {
    width: 100%;
    padding-left: 12px;
    padding-right: 12px;
    gap: 10px;
  }

  .article-list,
  .category-grid,
  .notice-list,
  .sidebar {
    grid-template-columns: 1fr;
  }

  .search-box div {
    flex-direction: column;
  }

  .footer {
    flex-direction: column;
  }

  .footer-links {
    justify-content: flex-start;
  }

  .form-row,
  .draft-item {
    grid-template-columns: 1fr;
  }

  .draft-item {
    align-items: stretch;
    flex-direction: column;
  }
}
