/*
 * TechNews English edition (/en).
 * Standalone: English pages don't load the Dhivehi site's frontend.css or
 * frontend.js. Served with year-long caching by English\AssetController
 * (/en/assets/english.css?v=<modified time>).
 * Dark mode follows the site-wide `html.mode-dark` class.
 *
 * Type: a news grotesque for headlines and interface (Schibsted Grotesk) over
 * a screen serif for reading (Source Serif 4), the pairing most tech news
 * sites use (Vox: Balto + Harriet, The Verge: PolySans + FK Roman, Medium:
 * Söhne + Source Serif). Both are OFL fonts, self-hosted in /fonts/english,
 * latin subset, variable weight; italics only download when a page uses them.
 */

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/en/assets/schibsted-grotesk-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/en/assets/schibsted-grotesk-latin-wght-italic.woff2") format("woff2");
  font-weight: 400 900;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("/en/assets/source-serif-4-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Dhivehi words on English pages (the language switch, "read the original").
   Thaana range only, so it downloads only when such text is on the page. */
@font-face {
  font-family: "TN Thaana";
  src: url("/en/assets/mv-faseyha.otf") format("opentype");
  font-display: swap;
  unicode-range: U+0780-07BF, U+FDF2, U+FDFD;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("/en/assets/source-serif-4-latin-wght-italic.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --en-bg: #ffffff;
  --en-text: #111111;
  --en-body: #222426;
  --en-dek: #4b5056;
  --en-muted: #6b6f75;
  --en-line: rgba(0, 0, 0, 0.1);
  --en-soft: #f4f4f2;
  --en-accent: #fc3b17;
  --en-accent-text: #d42e0f;
  --en-sans: "Schibsted Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --en-serif: "Source Serif 4", Charter, "Iowan Old Style", Georgia, serif;
  --en-thaana: "TN Thaana", MV_Faseyha, var(--en-sans);
}

/* ---------- Reset (instead of the Dhivehi site's Tailwind build) ---------- */

*, ::before, ::after { box-sizing: border-box; border: 0 solid; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; tab-size: 4; }
body { margin: 0; }
h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, ul, ol, pre, hr { margin: 0; }
h1, h2, h3, h4, h5, h6 { font-size: inherit; font-weight: inherit; }
ul, ol { list-style: none; padding: 0; }
img, svg, video, iframe { vertical-align: middle; }
img, video { max-width: 100%; height: auto; }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; margin: 0; }
button { background: transparent; padding: 0; cursor: pointer; }
input::placeholder { color: var(--en-muted); opacity: 1; }
[hidden] { display: none !important; }

html.mode-dark {
  --en-bg: #000000;
  --en-text: #ededed;
  --en-body: #d0d0d0;
  --en-dek: #a9adb3;
  --en-muted: #8b8f96;
  --en-line: rgba(255, 255, 255, 0.12);
  --en-soft: #101215;
  --en-accent-text: #ff6a4d;
}

body.en {
  background: var(--en-bg);
  color: var(--en-text);
  font-family: var(--en-sans);
  font-size: 16px;
  line-height: 1.5;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.en ::selection { background: rgba(252, 59, 23, 0.2); }

.en a { color: inherit; text-decoration: none; }
.en a:hover { color: var(--en-accent-text); }
.en :focus-visible { outline: 2px solid var(--en-accent); outline-offset: 2px; }

/* Dhivehi fragments (author names not yet romanised, image credits) */
.en .en-thaana { font-family: var(--en-thaana); }

.en-wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
}
@media (min-width: 768px) {
  .en-wrap { padding: 0 32px; }
}

/* ---------- Header ---------- */

.en-header {
  border-bottom: 1px solid var(--en-line);
  position: relative;
}
.en-header__bar {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 72px;
}
.en-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.en .en-brand:hover { color: inherit; }
.en-brand img { width: 32px; height: 32px; border-radius: 6px; }
.en-brand__name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.en-brand--small img { width: 24px; height: 24px; border-radius: 5px; }
.en-brand--small .en-brand__name { font-size: 18px; }

.en-nav {
  display: none;
  gap: 22px;
  font-size: 15px;
  font-weight: 600;
}
.en-nav a { padding: 24px 0; border-bottom: 2px solid transparent; }
.en-nav a.is-active { border-bottom-color: var(--en-accent); }

.en-header__tools {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.en-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  color: var(--en-text);
  background: transparent;
  border: 0;
  cursor: pointer;
}
.en-icon-btn:hover { background: var(--en-soft); }
.en-icon-btn:focus { outline: none; }
.en-theme-light { display: none; }
html.mode-dark .en-theme-light { display: block; }
html.mode-dark .en-theme-dark { display: none; }

.en-lang {
  font-family: var(--en-thaana);
  font-size: 15px;
  border: 1px solid var(--en-line);
  border-radius: 999px;
  padding: 4px 14px 6px;
  margin-left: 6px;
  white-space: nowrap;
}
.en .en-lang:hover { border-color: var(--en-accent); }

@media (min-width: 900px) {
  .en-nav { display: flex; }
  .en-menu-btn { display: none; }
}

/* Phones: tighter header; the theme switch moves into the menu. */
@media (max-width: 639px) {
  .en-header__bar { gap: 10px; height: 64px; }
  .en-brand { gap: 8px; }
  .en-brand img { width: 28px; height: 28px; }
  .en-brand__name { font-size: 20px; }
  .en-header__tools { gap: 2px; }
  .en-header__tools #theme { display: none; }
  .en-icon-btn { width: 34px; height: 34px; }
  .en-lang { margin-left: 2px; padding: 3px 10px 5px; font-size: 14px; }
}
.en-mobile-nav button {
  font: inherit;
  font-weight: 600;
  color: inherit;
  background: none;
  border: 0;
  padding: 6px 0;
  cursor: pointer;
}

.en-mobile-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  padding: 8px 16px 16px;
  font-weight: 600;
  border-top: 1px solid var(--en-line);
}
.en-mobile-nav a { padding: 6px 0; }

.en-search {
  border-top: 1px solid var(--en-line);
  padding: 14px 0;
}
.en-search input,
.en-search-form input {
  width: 100%;
  font-size: 22px;
  font-weight: 600;
  background: transparent;
  color: var(--en-text);
  border: 0;
  outline: none;
  padding: 6px 0;
}

/* ---------- Shared bits ---------- */

.en-kicker {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--en-accent-text);
  margin: 0 0 12px;
}
.en .en-kicker--link:hover { text-decoration: underline; }

.en-meta {
  font-size: 13px;
  color: var(--en-muted);
  margin: 6px 0 0;
}
.en .en-meta a:hover { color: var(--en-accent-text); }

.en-button {
  display: inline-block;
  font-weight: 700;
  font-size: 15px;
  padding: 10px 22px;
  border-radius: 999px;
  background: var(--en-text);
  color: var(--en-bg) !important;
  border: 1px solid var(--en-text);
  cursor: pointer;
}
.en-button:hover { background: var(--en-accent); border-color: var(--en-accent); }
.en-button--ghost {
  background: transparent;
  color: var(--en-text) !important;
}

.en-panel { margin-bottom: 36px; }

.en-empty {
  padding: 96px 0;
  text-align: center;
  max-width: 560px;
  margin: 0 auto;
}
.en-empty h1 { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 12px; }
.en-empty p { color: var(--en-muted); font-size: 18px; }
.en-empty a { color: var(--en-accent-text); font-family: var(--en-thaana); }
.en-empty-note { color: var(--en-muted); padding: 32px 0; }
.en-empty-note a { color: var(--en-accent-text); }

/* ---------- Stories ---------- */

.en-story__title {
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.18;
  margin: 0;
  text-wrap: balance;
}
.en-story__title a { transition: color 0.15s ease; }
.en-story__image img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--en-soft);
}

.en-story--lead .en-story__image img { aspect-ratio: 700 / 450; object-fit: cover; }
.en-story--lead .en-story__title { font-size: 30px; line-height: 1.08; margin-top: 18px; letter-spacing: -0.025em; }
.en-story--lead .en-story__dek {
  font-family: var(--en-serif);
  color: var(--en-dek);
  font-size: 18px;
  line-height: 1.45;
  margin: 10px 0 0;
  text-wrap: pretty;
}
@media (min-width: 768px) {
  .en-story--lead .en-story__title { font-size: 40px; }
  .en-story--lead .en-story__dek { font-size: 19px; }
}

.en-story--row,
.en-story--compact {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.en-story--row {
  padding: 18px 0;
  border-bottom: 1px solid var(--en-line);
}
.en-story--row .en-story__image { flex: 0 0 120px; }
.en-story--row .en-story__title { font-size: 18px; }
@media (min-width: 768px) {
  .en-story--row .en-story__image { flex-basis: 200px; }
  .en-story--row .en-story__title { font-size: 22px; letter-spacing: -0.02em; }
}
.en-story--row .en-story__image img,
.en-story--compact .en-story__image img { aspect-ratio: 200 / 130; object-fit: cover; }

.en-story--compact { padding: 12px 0; }
.en-story--compact .en-story__image { flex: 0 0 112px; }
.en-story--compact .en-story__title { font-size: 17px; }
.en-story__body { min-width: 0; flex: 1; }

.en-story--mini .en-story__title { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }

.en-ranked {
  list-style: none;
  counter-reset: rank;
  margin: 0;
  padding: 0;
}
.en-ranked li {
  counter-increment: rank;
  display: flex;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--en-line);
}
.en-ranked li::before {
  content: counter(rank);
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  color: var(--en-accent-text);
  min-width: 18px;
}

/* ---------- Home ---------- */

.en-front {
  padding: 24px 0 8px;
  border-bottom: 1px solid var(--en-line);
}
@media (min-width: 768px) {
  .en-front { display: flex; gap: 32px; padding-top: 32px; }
  .en-front__lead { flex: 0 0 60%; padding-right: 32px; border-right: 1px solid var(--en-line); padding-bottom: 24px; }
  .en-front__top { flex: 1; }
}
.en-front__top { padding-top: 12px; }
@media (min-width: 768px) { .en-front__top { padding-top: 0; } }
.en-front__top .en-story--compact + .en-story--compact { border-top: 1px solid var(--en-line); }

.en-columns { padding: 32px 0 16px; }
@media (min-width: 768px) {
  .en-columns { display: flex; gap: 48px; }
  .en-columns__main { flex: 0 0 60%; }
  .en-columns__side { flex: 1; }
}
.en-columns__side { padding-top: 24px; }
@media (min-width: 768px) { .en-columns__side { padding-top: 0; } }
.en-about p { color: var(--en-muted); font-size: 15px; }
.en-more { padding: 28px 0 0; text-align: center; }

/* ---------- Lists (tag, author, latest, search) ---------- */

.en-list { padding-bottom: 32px; max-width: 820px; }
.en-list__header { padding: 40px 0 12px; border-bottom: 2px solid var(--en-text); }
.en-list__header h1 { font-size: 40px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.08; margin: 0; text-wrap: balance; }
.en-list__header h1.en-thaana { font-size: 30px; }
.en-list__intro { color: var(--en-muted); margin: 10px 0 0; max-width: 600px; }
.en-pager { display: flex; justify-content: space-between; padding: 28px 0 0; }
.en-search-form { display: flex; gap: 12px; align-items: center; }
.en-search-form input { border-bottom: 1px solid var(--en-line); }

/* ---------- Article ---------- */

/* The reading column: about 70 characters a line at 20px (Medium: 680px). */
.en-narrow {
  max-width: 728px;
  margin: 0 auto;
  padding: 0 16px;
}
@media (min-width: 768px) { .en-narrow { padding: 0 24px; } }

.en-preview {
  background: #fff4d6;
  color: #5c4400;
  font-size: 14px;
  text-align: center;
  padding: 10px 16px;
}
.en-preview a { text-decoration: underline; margin-left: 6px; }

.en-article-head { padding: 36px 16px 28px; }
@media (min-width: 768px) { .en-article-head { padding: 56px 24px 32px; } }
.en-article-title {
  font-size: 34px;
  line-height: 1.06;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0;
  text-wrap: balance;
}
@media (min-width: 768px) { .en-article-title { font-size: 48px; letter-spacing: -0.03em; } }
.en-article-dek {
  font-family: var(--en-serif);
  font-size: 20px;
  line-height: 1.4;
  color: var(--en-dek);
  margin: 16px 0 0;
  text-wrap: pretty;
}
@media (min-width: 768px) { .en-article-dek { font-size: 23px; } }
.en-article-head .en-meta { font-size: 14px; margin-top: 20px; }
.en-article-head .en-meta a { color: var(--en-text); font-weight: 600; }

.en-article-image {
  max-width: 1024px;
  margin: 0 auto 8px;
}
.en-article-image img { display: block; width: 100%; height: auto; background: var(--en-soft); }
/* frontend.css sets every figcaption to the Thaana font, centred, at half opacity. */
.en-article-image figcaption {
  font-family: var(--en-sans);
  font-size: 13px;
  line-height: 1.4;
  color: var(--en-muted);
  opacity: 1;
  text-align: left;
  padding: 8px 16px 0;
}

.en-translated-note {
  font-size: 14px;
  color: var(--en-muted);
  border-left: 3px solid var(--en-accent);
  padding: 2px 0 2px 12px;
  margin: 28px 0 4px;
}
.en .en-translated-note a {
  color: var(--en-text);
  text-decoration: underline;
  text-decoration-color: var(--en-accent);
  text-underline-offset: 0.18em;
}

/* Article text: 18px on phones, 20px from tablets, 1.6 line height (Vox, The Verge, Medium). */
.en-article {
  font-family: var(--en-serif);
  font-size: 18px;
  line-height: 1.65;
  letter-spacing: -0.003em;
  color: var(--en-body);
  overflow-wrap: break-word;
}
@media (min-width: 768px) { .en-article { font-size: 20px; line-height: 1.6; } }
.en-article p { margin: 0 0 1.2em; }
.en-article > :first-child { margin-top: 1.1em; }
.en-article b, .en-article strong { font-weight: 650; }
/* The editor stores inline font sizes meant for Thaana; ignore them here. */
.en-article [style*="font-size"] { font-size: inherit !important; }
.en-article [dir="rtl"] { direction: ltr; unicode-bidi: plaintext; text-align: left; }
/* Links read as text with an accent underline (Vox, The Verge), not as red text. */
.en .en-article a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--en-accent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
  text-decoration-skip-ink: auto;
  transition: color 0.15s ease;
}
.en .en-article a:hover { color: var(--en-accent-text); }
.en-article h2,
.en-article h3 {
  font-family: var(--en-sans);
  color: var(--en-text);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin: 1.8em 0 0.5em;
  text-wrap: balance;
}
.en-article h2 { font-size: 23px; }
.en-article h3 { font-size: 20px; }
@media (min-width: 768px) {
  .en-article h2 { font-size: 27px; }
  .en-article h3 { font-size: 22px; }
}
.en-article ul, .en-article ol { margin: 0 0 1.2em; padding-left: 1.3em; }
.en-article ul { list-style: disc; }
.en-article ol { list-style: decimal; }
.en-article li { margin: 0.35em 0; padding-left: 0.2em; }
.en-article li::marker { color: var(--en-muted); }
.en-article blockquote:not(.twitter-tweet):not(.instagram-media) {
  border-left: 3px solid var(--en-accent);
  margin: 1.6em 0;
  padding: 0 0 0 20px;
  font-size: 1.1em;
  line-height: 1.5;
  font-style: italic;
  color: var(--en-text);
}
.en-article img { max-width: 100%; height: auto; }
.en-article figure { margin: 1.6em 0; }
.en-article figcaption {
  font-family: var(--en-sans);
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: 0;
  color: var(--en-muted);
  text-align: center;
  margin-top: 8px;
  opacity: 1;
}
.en-article iframe { max-width: 100%; }
.en-video { position: relative; padding-bottom: 56.25%; height: 0; margin: 1.4em 0; }
.en-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; }
.en-article .medium-insert-buttons { display: none; }
/* Images the editor floated left or right sit beside the text on wide screens. */
@media (min-width: 640px) {
  .en-article .medium-insert-images-left { float: left; width: 45%; margin: 0.3em 1.5em 0.8em 0; }
  .en-article .medium-insert-images-right { float: right; width: 45%; margin: 0.3em 0 0.8em 1.5em; }
  .en-article .medium-insert-images-left figure,
  .en-article .medium-insert-images-right figure { margin: 0; }
}
.en-article::after { content: ""; display: table; clear: both; }

.en-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 32px 0 20px;
  font-size: 14px;
}
.en-share span { color: var(--en-muted); margin-right: 4px; }
.en-share a {
  border: 1px solid var(--en-line);
  border-radius: 999px;
  padding: 4px 12px;
  font-weight: 600;
}

.en-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0 0 32px;
}
.en-tags a {
  display: inline-block;
  background: var(--en-soft);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 14px;
  font-weight: 600;
}

.en-author-box {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--en-soft);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 40px;
}
.en-author-box img { width: 56px; height: 56px; border-radius: 999px; object-fit: cover; flex-shrink: 0; }
.en-author-box__name { font-weight: 800; font-size: 17px; }
.en-author-box p { margin: 6px 0 0; color: var(--en-muted); font-size: 15px; }

.en-columns--after { border-top: 1px solid var(--en-line); }

/* ---------- Footer ---------- */

.en-footer {
  border-top: 1px solid var(--en-line);
  margin-top: 40px;
  padding: 32px 0 48px;
  font-size: 14px;
  color: var(--en-muted);
}
.en-footer__inner { display: flex; flex-direction: column; gap: 20px; }
@media (min-width: 768px) {
  .en-footer__inner { flex-direction: row; justify-content: space-between; align-items: flex-start; }
  .en-footer__inner > div:first-child { max-width: 460px; }
}
.en-footer .en-brand { color: var(--en-text); margin-bottom: 10px; }
.en-footer p a { text-decoration: underline; }
.en-footer__links { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; }
.en-footer__links a[lang="dv"] { font-family: var(--en-thaana); }
