/* AdPix Status public page on the AdPix tokens (tokens.css: colours, Roboto/Vazirmatn, radii, shadows).
   Logical properties only (RTL-correct), light + dark, 360 px safe. Class names are the ones public.ts,
   subscribers.ts and the router error page emit; see docs/design-system.md. */
@import url("/assets/tokens.css");

body.public, body.error-page { font-size: var(--fs-base); line-height: 1.6; background: var(--surface-canvas); overflow-wrap: anywhere; }
body:lang(fa) { line-height: var(--leading-fa); }
a { color: var(--text-link); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.35; margin-block: 0 .5em; color: var(--text-strong); font-weight: 500; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.15rem; margin-block-start: 1.75rem; } h3, .h3 { font-size: 1rem; }
p { margin-block: 0 .6em; }
.wrap { max-inline-size: 56rem; margin-inline: auto; padding-inline: 16px; }
.muted { color: var(--text-muted); }
.small { font-size: var(--fs-small); }
.empty { color: var(--text-muted); }
.skip { position: absolute; inset-inline-start: 1rem; inset-block-start: -10rem; z-index: 10; background: var(--surface-card); color: var(--text-strong); padding: .5rem 1rem; border-radius: var(--radius-md); box-shadow: var(--shadow-menu); }
.skip:focus { inset-block-start: 1rem; }
main { padding-block: 24px 40px; outline: none; }

/* ------------------------------------------------------------ header + footer */
.site-head { background: var(--surface-card); border-block-end: 1px solid var(--border); }
.head-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; min-block-size: var(--shell-topbar); padding-block: 8px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text-strong); text-decoration: none; white-space: nowrap; }
.brand img { display: block; inline-size: auto; }
.logo-en { block-size: 24px; }
.logo-fa { display: inline-flex; align-items: center; gap: 8px; }
.logo-mark { block-size: 24px; }
.logo-word { block-size: 27px; margin-block-start: 3px; }
.brand-sub { font-size: var(--fs-lg); font-weight: 500; color: var(--text-muted); }
.brand-sub::before { content: ""; display: inline-block; inline-size: 1px; block-size: 18px; background: var(--border); margin-inline-end: 10px; vertical-align: -3px; }

/* language switch = DS SegmentedControl */
.segmented { display: inline-flex; gap: 2px; padding: 2px; border-radius: var(--radius-pill); background: var(--grey-100); }
.segmented a { display: inline-flex; align-items: center; justify-content: center; min-block-size: 32px; padding: 0 14px; border-radius: var(--radius-pill); color: var(--text-muted); font-size: var(--fs-small); text-decoration: none; white-space: nowrap; transition: background var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard); }
.segmented a:hover { color: var(--text-strong); }
.segmented a[aria-current] { background: var(--surface-card); color: var(--brand-text); font-weight: 600; box-shadow: var(--shadow-raised); }
@media (prefers-color-scheme: dark) { .segmented { background: var(--surface-sunken); } .segmented a[aria-current] { background: var(--surface-raised); } }

/* page nav: tabs with an orange underline on the current page */
.main-nav { display: flex; flex-wrap: wrap; gap: 4px; }
.main-nav a { position: relative; display: inline-flex; align-items: center; min-block-size: 44px; padding: 0 12px; color: var(--text-muted); text-decoration: none; font-weight: 500; font-size: var(--fs-body); border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.main-nav a:hover { color: var(--text-strong); background: var(--surface-sunken); }
.main-nav a[aria-current] { color: var(--brand-text); }
.main-nav a[aria-current]::after { content: ""; position: absolute; inset-inline: 8px; inset-block-end: -1px; block-size: 3px; border-radius: 3px 3px 0 0; background: var(--brand); }
.site-foot { border-block-start: 1px solid var(--border); padding-block: 20px 32px; font-size: var(--fs-small); }
.site-foot nav, .more { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.site-foot a { color: var(--text-muted); }
.site-foot a:hover { color: var(--text-link); }
.more { margin-block: 24px; }

/* ------------------------------------------------------------ cards */
.card { background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-card); padding: var(--pad-card); margin-block-end: 12px; }
.card h3, .card .h3 { margin-block-end: .35em; }
.card h3 a, .card .h3 a { color: var(--text-strong); text-decoration: none; }
.card h3 a:hover, .card .h3 a:hover { color: var(--text-link); text-decoration: underline; }
.meta { color: var(--text-muted); font-size: var(--fs-small); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.body-text { white-space: pre-line; }
.list, .timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; border-inline-start: 2px solid var(--border); padding-inline-start: 18px; padding-block-end: 16px; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: -6px; inset-block-start: .55em; inline-size: 10px; block-size: 10px; border-radius: 50%; background: var(--surface-card); border: 2px solid var(--border-strong); }
.timeline li:first-child::before { border-color: var(--brand); background: var(--brand); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 16px; }
.facts dt { color: var(--text-muted); }
.facts dd { margin: 0; }
.pager { display: flex; justify-content: space-between; gap: 16px; margin-block-start: 16px; }
.incident { border-inline-start: 4px solid var(--st-degraded); }
.incident.impact-none { border-inline-start-color: var(--st-nodata); }
.incident.impact-major { border-inline-start-color: var(--st-partial); }
.incident.impact-critical { border-inline-start-color: var(--st-major); }
.maintenance { border-inline-start: 4px solid var(--st-maintenance); }

/* ------------------------------------------------------------ status banner (colour + text label, never colour alone) */
.headline { position: relative; border-radius: var(--radius-md); padding: 18px 20px; margin-block-end: 16px; border: 1px solid transparent; background: var(--neutral-bg); }
.headline h1 { display: flex; align-items: center; gap: 12px; margin: 0 0 4px; font-size: 1.35rem; font-weight: 500; }
.headline h1::before { content: ""; flex: none; inline-size: 14px; block-size: 14px; border-radius: 50%; background: var(--c, var(--neutral-fill)); box-shadow: 0 0 0 4px var(--surface-card); }
.headline p { margin: 0; }
.headline p + p { margin-block-start: 6px; }
.h-unknown { --c: var(--neutral-fill); background: var(--neutral-bg); }
.h-operational { --c: var(--st-operational); background: var(--positive-bg); }
.h-maintenance { --c: var(--st-maintenance); background: var(--brand-tint); }
.h-degraded, .h-reachability_impaired { --c: var(--st-degraded); background: var(--warning-bg); }
.h-partial_outage { --c: var(--st-partial); background: var(--partial-bg); }
.h-major_outage { --c: var(--st-major); background: var(--negative-bg); }
.banner { display: flex; gap: 10px; align-items: flex-start; border-radius: var(--radius-md); padding: 10px 14px; margin-block-end: 16px; background: var(--warning-bg); color: var(--text-body); font-size: var(--fs-small); }
.banner.info, .history-note { background: var(--info-bg); }
.history-note { border-radius: var(--radius-md); padding: 10px 14px; margin-block: 0 16px; font-size: var(--fs-small); color: var(--text-body); }

/* ------------------------------------------------------------ badges: dot + text */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--radius-pill); font-size: var(--fs-caption); font-weight: 600; line-height: 1.5; color: var(--text-muted); background: var(--neutral-bg); white-space: nowrap; }
.badge::before { content: ""; inline-size: 7px; block-size: 7px; border-radius: 50%; background: var(--c, var(--neutral-fill)); flex: none; }
.s-operational, .inc-resolved, .mw-completed { --c: var(--st-operational); color: var(--positive-text); background: var(--positive-bg); }
.s-maintenance, .mw-scheduled, .mw-in_progress { --c: var(--st-maintenance); color: var(--brand-text); background: var(--brand-tint); }
.s-degraded, .inc-monitoring { --c: var(--st-degraded); color: var(--warning-text); background: var(--warning-bg); }
.s-partial_outage, .inc-investigating, .inc-identified { --c: var(--st-partial); color: var(--partial-text); background: var(--partial-bg); }
.s-major_outage { --c: var(--on-negative); color: var(--on-negative); background: var(--negative); }
.s-nodata, .mw-cancelled { --c: var(--neutral-fill); color: var(--text-muted); background: var(--neutral-bg); }

/* ------------------------------------------------------------ components + 90-day bars */
.group { margin-block-end: 20px; }
.group h3 { color: var(--text-muted); font-size: var(--fs-small); font-weight: 500; margin-block-end: 8px; }
.comps { list-style: none; margin: 0; padding: 0; background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-card); }
.comp { padding: 14px 18px; }
.comp + .comp { border-block-start: 1px solid var(--divider); }
.comp-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; }
.comp-name { font-weight: 500; color: var(--text-strong); }
.comp-desc { margin-block: 2px 0; }
.bars { display: block; inline-size: 100%; block-size: 28px; margin-block-start: 10px; }
.bars rect { fill: var(--st-nodata); }
.bars rect:hover { opacity: .7; }
.bars .d-operational { fill: var(--st-operational); } .bars .d-maintenance { fill: var(--st-maintenance); } .bars .d-degraded { fill: var(--st-degraded); }
.bars .d-partial_outage { fill: var(--st-partial); } .bars .d-major_outage { fill: var(--st-major); }
.bar-legend { display: flex; justify-content: space-between; gap: 8px; margin-block-start: 4px; }
.bar-legend .uptime { text-align: center; overflow-wrap: normal; }
.bar-legend span:first-child, .bar-legend span:last-child { white-space: nowrap; flex: none; }
.issue-days { margin-block-start: 4px; }
.issue-days summary { cursor: pointer; color: var(--text-link); }
.issue-days ul { margin: 4px 0 0; padding-inline-start: 20px; }

/* ------------------------------------------------------------ forms (subscribe) */
.subscribe-box { margin-block-start: 24px; }
.subscribe { display: grid; gap: 12px; max-inline-size: 28rem; }
.field { display: grid; gap: 6px; }
label { font-weight: 500; font-size: var(--fs-small); color: var(--text-muted); }
input, select, button { font: inherit; inline-size: 100%; min-block-size: 44px; border-radius: var(--radius-md); }
input, select { padding: 8px 12px; border: 1px solid var(--border-strong); background: var(--surface-card); color: var(--text-body); transition: border-color var(--dur-fast) var(--ease-standard), box-shadow var(--dur-fast) var(--ease-standard); }
input:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: inset 0 -2px 0 0 var(--brand); }
input[aria-invalid="true"] { border-color: var(--negative); }
input[type=checkbox], input[type=radio] { inline-size: 18px; min-block-size: 18px; accent-color: var(--brand); }
button { padding: 8px 20px; border: 1px solid var(--brand-solid); background: var(--brand-solid); color: var(--on-brand-solid); font-weight: 500; cursor: pointer; transition: background var(--dur-fast) var(--ease-standard), transform var(--dur-fast) var(--ease-standard); }
button:hover { background: var(--brand-solid-hover); border-color: var(--brand-solid-hover); }
button:active { transform: scale(.98); }
.inline-form button { inline-size: auto; }
.form-error { color: var(--negative-text); font-weight: 500; margin: 0; }
.message h1 { font-size: 1.3rem; }
.message .other-lang { border-block-start: 1px solid var(--border); margin-block-start: 16px; padding-block-start: 16px; color: var(--text-muted); }
.message .other-lang h2 { font-size: 1rem; margin-block-start: 0; }

/* ------------------------------------------------------------ history table: the region scrolls, never the page */
.table-wrap { overflow-x: auto; background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-card); }
table.history { border-collapse: collapse; inline-size: 100%; font-size: var(--fs-small); font-variant-numeric: tabular-nums; }
.history th, .history td { padding: 8px 10px; text-align: start; white-space: nowrap; border-block-end: 1px solid var(--divider); }
.history thead th { color: var(--text-muted); font-weight: 500; border-block-end-color: var(--border); }
.history tbody th { font-weight: 500; position: sticky; inset-inline-start: 0; background: var(--surface-card); }
.history tbody tr:last-child > * { border-block-end: 0; }

/* ------------------------------------------------------------ router error page (src/app/app.ts) */
body.error-page { display: grid; place-items: center; min-block-size: 100vh; padding: 16px; }
.error-page main { background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: 32px; max-inline-size: 30rem; inline-size: 100%; text-align: center; }
.error-page h1 { font-size: 2.5rem; font-weight: 400; letter-spacing: var(--tracking-display); margin: 0; color: var(--text-muted); }

/* ------------------------------------------------------------ page-specific (public area) */
.card > :first-child, .card > h2:first-child { margin-block-start: 0; }
.card > :last-child { margin-block-end: 0; }
.bars .pre { fill: var(--border); }
.bars .pre:hover { opacity: 1; }
.history-note { display: flex; gap: 10px; align-items: baseline; }
.history-note::before { content: ""; flex: none; inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--info, var(--neutral-fill)); transform: translateY(-1px); }
.empty { background: var(--surface-card); border: 1px dashed var(--border-strong); border-radius: var(--radius-md); padding: 20px; text-align: center; margin-block-end: 12px; }
.incident-detail .facts { background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-card); padding: var(--pad-card); margin-block-end: 8px; }
.incident-detail .timeline { margin-block-start: 12px; }
.incident-detail .timeline li > .body-text { margin-block-end: 0; }
.subscribe-box { margin-block-start: 32px; }
.subscribe-box > p.muted { margin-block-end: 16px; }
.subscribe .form-error, .subscribe .adpix-captcha { grid-column: 1 / -1; }
.subscribe button { white-space: nowrap; }
@media (min-width: 640px) {
  .subscribe { max-inline-size: none; grid-template-columns: minmax(0, 1fr) 11rem auto; align-items: end; }
  .subscribe button { inline-size: auto; }
}
.subscribe-box > p.small { margin-block: 12px 0; }

@media (max-width: 480px) {
  h1 { font-size: 1.3rem; }
  .card, .comp { padding: 12px 14px; }
  .headline { padding: 14px 16px; }
  .brand-sub { font-size: var(--fs-base); }
  .bar-legend span:first-child, .bar-legend span:last-child { font-size: .75rem; }
  .main-nav a { padding: 0 10px; }
}
