/* Brand tokens — /theme.css (from the admin portal) overrides these */
:root {
  --primary: #0B7A75;
  --accent: #F2994A;
  --font-dv: 'SiteDhivehi', system-ui, sans-serif;
  --font-en: system-ui, sans-serif;

  --text: #FFFFFF;
  --muted: rgb(255 255 255 / .62);
  --faint: rgb(255 255 255 / .45);
  --line: rgb(255 255 255 / .14);
  --glass: rgb(255 255 255 / .08);
  --glass-strong: rgb(255 255 255 / .14);
  --glass-border: rgb(255 255 255 / .18);
  --blur: blur(28px) saturate(140%);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html, body { min-height: 100%; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: #3a2f2a;
  color: var(--text);
  font-family: var(--font-en);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
html[lang="dv"] body { font-family: var(--font-dv); font-size: 16px; line-height: 1.8; }

button, input { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { display: block; max-width: 100%; }

/* ---------- Photo backdrop ---------- */
.backdrop {
  position: fixed;
  inset: -60px;
  z-index: -1;
  background: url('../images/background.jpg') center / cover no-repeat;
  filter: blur(48px) saturate(115%);
}
.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgb(60 45 38 / .35), rgb(40 30 26 / .55));
}

/* ---------- Outer glass frame ---------- */
.frame {
  max-width: 1320px;
  margin: 20px auto;
  padding: 14px 20px 20px;
  border: 1px solid var(--glass-border);
  border-radius: 32px;
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: 0 30px 80px -30px rgb(0 0 0 / .45), inset 0 1px 0 rgb(255 255 255 / .12);
}

/* ---------- Header ---------- */
.header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 4px 0 14px;
}

.nav-pill {
  justify-self: start;
  display: flex;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: var(--glass);
}
.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: .87rem;
  font-weight: 500;
  color: rgb(255 255 255 / .9);
  cursor: default;
  transition: background-color .2s;
}
.nav-item i { font-size: 14px; opacity: .7; }
.nav-item:hover { background: var(--glass-strong); }

.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--primary);
  font-size: 18px;
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }
.brand-mark.has-logo { background: none; }
.brand-name { font-weight: 700; font-size: 1.2rem; letter-spacing: -.02em; }
html[lang="dv"] .brand-name { font-size: 1.35rem; letter-spacing: 0; }

.header-end { justify-self: end; display: flex; align-items: center; gap: 8px; }

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 260px;
  height: 40px;
  padding-inline: 14px;
  border-radius: 999px;
  background: var(--glass-strong);
}
.search i { font-size: 17px; color: var(--muted); }
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  font-size: .87rem;
}
.search input::placeholder { color: var(--faint); }

.round-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  min-width: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: var(--glass-strong);
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color .2s;
}
.round-btn i { font-size: 18px; }
.round-btn:hover { background: rgb(255 255 255 / .22); }
/* The language button shows the *other* language, so give it that font. */
html[lang="dv"] .lang-btn span { font-family: var(--font-en); }
html[lang="en"] .lang-btn span { font-family: var(--font-dv); font-size: .95rem; }

/* ---------- Layout ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
}

.panel {
  border: 1px solid var(--glass-border);
  border-radius: 26px;
  background: var(--glass);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .08);
}

.panel-main {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 28px;
  padding: 16px;
}

/* ---------- Feature ---------- */
.feature { display: flex; flex-direction: column; }
.feature-media {
  flex: 1;
  min-height: 280px;
  overflow: hidden;
  border-radius: 18px;
  background: rgb(0 0 0 / .2);
}
.feature-media img { width: 100%; height: 100%; object-fit: cover; }

.meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  font-size: .82rem;
  color: var(--muted);
}
.meta-tag { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-weight: 600; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.meta-sep { color: var(--faint); }

.feature-title {
  margin-top: 8px;
  font-size: clamp(1.9rem, 3.2vw, 2.6rem);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -.025em;
}
html[lang="dv"] .feature-title { font-weight: 400; line-height: 1.55; letter-spacing: 0; font-size: clamp(2rem, 3.6vw, 2.9rem); }

.feature-lead { margin-top: 10px; max-width: 46ch; color: var(--muted); font-size: 1rem; }
html[lang="dv"] .feature-lead { font-size: 1.1rem; }

/* ---------- Story list (shared by "what's coming") ---------- */
.coming { padding-top: 6px; }
.panel-heading { font-size: 1.05rem; font-weight: 600; letter-spacing: -.01em; }
html[lang="dv"] .panel-heading { font-weight: 400; font-size: 1.2rem; letter-spacing: 0; }

.story-list { margin-top: 8px; }
.story {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.story:last-child { border-bottom: 0; }
.story-body { flex: 1; min-width: 0; }
.story-meta { display: flex; gap: 6px; font-size: .74rem; color: var(--muted); }
.story-meta .cat { color: var(--text); font-weight: 500; }
.story-title { margin-top: 3px; font-size: .92rem; font-weight: 600; line-height: 1.35; }
html[lang="dv"] .story-meta { font-size: .85rem; }
html[lang="dv"] .story-title { font-size: 1.02rem; font-weight: 400; line-height: 1.6; }
.story-thumb {
  flex: none;
  width: 64px;
  height: 52px;
  border-radius: 10px;
  object-fit: cover;
  background: rgb(0 0 0 / .2);
}

/* ---------- Side panel ---------- */
.panel-side { display: flex; flex-direction: column; padding: 22px 20px 18px; }

.tabs { display: flex; gap: 18px; }
.tab { font-size: 1.05rem; font-weight: 600; color: var(--muted); }
.tab.is-active { color: var(--text); }
html[lang="dv"] .tab { font-weight: 400; font-size: 1.2rem; }

.countdown {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.cd-cell {
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--glass-strong);
}
.cd-num {
  display: block;
  font-family: var(--font-en);
  font-size: 1.9rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.cd-label { display: block; font-size: .78rem; color: var(--muted); }
html[lang="dv"] .cd-label { font-size: .9rem; }

.side-block { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.side-label { font-size: .74rem; color: var(--muted); }
.side-title { margin-top: 3px; font-size: .95rem; font-weight: 600; line-height: 1.4; }
html[lang="dv"] .side-label { font-size: .85rem; }
html[lang="dv"] .side-title { font-size: 1.05rem; font-weight: 400; line-height: 1.6; }

.notify { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.field {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding-inline: 14px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--glass-strong);
  transition: border-color .2s;
}
.field:focus-within { border-color: rgb(255 255 255 / .45); }
.field i { font-size: 17px; color: var(--muted); }
.field input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: .9rem; text-align: start; }
.field input::placeholder { color: var(--faint); }
html[lang="dv"] .field input:placeholder-shown { direction: rtl; font-family: var(--font-dv); }

.btn {
  height: 44px;
  border: 0;
  border-radius: 14px;
  background: #fff;
  color: #1d1916;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .2s, opacity .2s;
}
.btn:hover { background: rgb(255 255 255 / .88); }
.btn:disabled { opacity: .6; cursor: default; }

.form-msg { min-height: 1.4em; margin-top: 8px; font-size: .82rem; }
.form-msg.ok { color: #9BE3C7; }
.form-msg.err { color: #FFB4A8; }

.social-links { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.social-links a {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--glass-strong);
  font-size: 18px;
  transition: background-color .2s;
}
.social-links a:hover { background: rgb(255 255 255 / .24); }

.side-footer {
  margin-top: auto;
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: .78rem;
  color: var(--faint);
}
.side-footer a { display: inline-flex; align-items: center; gap: 4px; transition: color .2s; }
.side-footer a:hover { color: var(--text); }
html[lang="dv"] .side-footer { font-size: .85rem; }

/* ---------- Responsive ---------- */
/* Laptop-sized windows (e.g. 1920px screens at 150% scaling): show the full
   desktop design slightly smaller instead of letting it fill edge to edge. */
@media (min-width: 1181px) and (max-width: 1439px) {
  .frame { zoom: .88; }
}

@media (max-width: 1180px) {
  .search { width: 200px; }
  .layout { grid-template-columns: 1fr; }
  .panel-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; align-content: start; align-items: start; }
  .panel-side .tabs, .panel-side .countdown { grid-column: 1; }
  .panel-side .notify-block { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; padding-top: 0; border-top: 0; }
  .panel-side .countdown { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .social-block, .side-footer { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .nav-pill { display: none; }
  .header { grid-template-columns: auto 1fr; }
  .brand { justify-self: start; }
  .panel-main { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .frame { margin: 10px; padding: 10px 12px 12px; border-radius: 24px; }
  .search { display: none; }
  .panel-main { padding: 10px; border-radius: 20px; }
  .panel-side { display: flex; padding: 18px 16px 14px; border-radius: 20px; }
  .panel-side .notify-block { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
  .countdown { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .cd-cell { padding: 10px 6px; text-align: center; }
  .cd-num { font-size: 1.4rem; }
  .side-footer { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
