@import url("/css/murcia-theme.css");

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--page); color: var(--ink); font: 1rem/1.55 var(--font-ui); }
img, video { max-width: 100%; }
a { color: var(--brand-deep); text-underline-offset: .18em; }
a:hover { color: var(--brand); }
h1, h2, h3 { font-family: var(--font-heading); line-height: 1.2; letter-spacing: -.015em; }
h1 { font-size: clamp(1.85rem, 3vw, 2.7rem); margin: 0 0 .8rem; }
h2 { font-size: clamp(1.35rem, 2vw, 1.8rem); margin: 0 0 1rem; }
h3 { font-size: 1.2rem; }
p { max-width: 75ch; }
small { color: var(--muted); }
code, pre, output { overflow-wrap: anywhere; }
.workspace-deletion { overflow-wrap: anywhere; }

header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem 1.6rem; padding: .65rem max(1rem, calc((100vw - 1320px)/2)); background: white; border-top: 6px solid var(--brand); border-bottom: 1px solid var(--line); box-shadow: 0 2px 16px #23191d0d; }
.brand-mark { flex: 0 0 auto; padding: .25rem .65rem .25rem .15rem; background: white; }
.brand-mark img { display: block; width: 144px; height: auto; aspect-ratio: 579 / 302; object-fit: contain; }
header > a { font-weight: 700; text-decoration: none; font-size: .98rem; }
header nav { display: flex; align-items: center; flex-wrap: wrap; gap: .2rem .35rem; margin-left: auto; }
header nav a, header nav button.link { display: inline-flex; align-items: center; min-height: 40px; padding: .45rem .7rem; border-radius: .4rem; color: var(--ink); background: transparent; font-weight: 600; text-decoration: none; }
header nav a:hover, header nav a[aria-current="page"], header nav button.link:hover { color: var(--brand-deep); background: var(--brand-soft); }
header nav form, .inline { display: inline; margin: 0; }
header nav button.link { border: 0; box-shadow: none; }

main { width: min(100% - 2rem, 1240px); margin: 2.4rem auto 5rem; }
main > p:first-child > a { display: inline-flex; align-items: center; min-height: 38px; font-weight: 650; text-decoration: none; }
main > h1 + p { color: var(--muted); font-size: 1.04rem; }
section, .card, .login { background: white; border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.15rem, 2vw, 1.8rem); margin: 1.15rem 0; box-shadow: var(--shadow); }
section > :first-child, .card > :first-child { margin-top: 0; }
section > :last-child, .card > :last-child { margin-bottom: 0; }
section > form + form { margin-top: .9rem; }
.cards, .public-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 265px), 1fr)); gap: 1rem; margin: 1.2rem 0; }
.card, .public-card { display: flex; flex-direction: column; gap: .5rem; margin: 0; color: inherit; text-decoration: none; }
.card:hover, .public-card:hover { border-color: var(--brand); box-shadow: 0 9px 26px #32191f1a; transform: translateY(-1px); }
.card strong { color: var(--brand-deep); font-size: 1.15rem; }
.card span { color: var(--muted); }
.card .actions a { display: inline-flex; align-items: center; min-height: 38px; padding: .3rem .55rem; border: 1px solid var(--line); border-radius: .4rem; text-decoration: none; font-weight: 650; }
.card .actions a:hover { background: var(--brand-soft); border-color: var(--brand); }
.workspace-context { border-left: 5px solid var(--brand); background: var(--brand-soft); padding: .8rem 1.1rem; margin: 0 0 1.4rem; }
.workspace-context p { margin: 0 0 .4rem; }
.workspace-context .actions { align-items: center; }
.workspace-context .actions a { font-weight: 700; }
.workspace-context details { background: white; max-width: 32rem; }
.upload-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); gap: 1rem; }
.upload-card { align-items: flex-start; }
.upload-card h3, .upload-card p { margin: 0; }
.upload-card .upload-phase { color: var(--brand-deep); }
.upload-card .upload-links { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; }
#upload progress { display: block; width: min(100%, 650px); height: 1.1rem; margin-top: 1.2rem; }
#upload-status { color: var(--brand-deep); font-size: 1.18rem; font-weight: 750; }
tr:target { outline: 3px solid var(--brand); background: #fff2e8; }
.editorial-links a { display: inline-block; margin-right: .7rem; }
.public-card { padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: var(--shadow); }
.public-card a { display: block; color: inherit; text-decoration: none; }
.public-card img { display: block; width: 100%; height: clamp(110px, 15vw, 160px); object-fit: cover; }
.public-card:has(.tag) h3 { margin: .25rem 0; }
.public-card div { padding: 1.1rem; }
.public-card h2 { font-size: 1.25rem; }
.empty-state { padding: 2.5rem; text-align: center; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: white; color: var(--muted); }

form { max-width: 100%; }
form label { display: flex; flex-direction: column; gap: .35rem; margin: .85rem 0; font-weight: 650; }
input, select, textarea, button, .button { font: inherit; }
input, select, textarea { display: block; width: 100%; min-height: 44px; padding: .68rem .8rem; color: var(--ink); background: white; border: 1px solid var(--line-strong); border-radius: .48rem; }
input[type="checkbox"], input[type="radio"] { display: inline; width: auto; min-height: auto; accent-color: var(--brand); }
form label.restream-confirmation { flex-direction: row; align-items: center; gap: .6rem; font-weight: 500; }
input[type="hidden"] { display: none; }
input[type="file"] { padding: .5rem; }
input:disabled, select:disabled, textarea:disabled { background: var(--page); color: var(--muted); }
textarea { min-height: 8rem; resize: vertical; }
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; padding: .62rem 1rem; background: var(--brand); color: white; border: 1px solid var(--brand); border-radius: .48rem; font-weight: 700; text-decoration: none; cursor: pointer; transition: background .12s, border-color .12s, box-shadow .12s; }
button:hover, .button:hover { color: white; background: var(--brand-deep); border-color: var(--brand-deep); }
button:disabled, .button[aria-disabled="true"] { background: var(--disabled); border-color: var(--disabled); cursor: not-allowed; }
button.link { color: var(--brand-deep); background: transparent; border: 0; box-shadow: none; }
button.link:hover { color: var(--brand); text-decoration: underline; }
.danger { background: #842734; border-color: #842734; }
.danger:hover { background: #631a25; border-color: #631a25; }
.inline-form, .actions, .share-panel { display: flex; flex-wrap: wrap; align-items: end; gap: .7rem; }
.inline-form label { min-width: min(100%, 190px); flex: 1 1 190px; }
.actions form { margin: 0; }
.actions .button, .actions button { white-space: normal; }
.stacked-form { max-width: 760px; }
.check { flex-direction: row; align-items: center; }
.saml { display: flex; width: 100%; margin: 1rem 0; text-align: center; }

table { width: 100%; border-collapse: collapse; background: white; font-variant-numeric: tabular-nums; }
th, td { padding: .78rem .85rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
th { color: var(--muted); background: var(--page); font-size: .81rem; letter-spacing: .055em; text-transform: uppercase; }
tbody tr:hover { background: var(--brand-soft); }
dl { display: grid; grid-template-columns: minmax(9rem, 13rem) minmax(0, 1fr); gap: .5rem 1rem; }
dt { color: var(--muted); font-weight: 700; }
dd { margin: 0; overflow-wrap: anywhere; }
.state-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: .7rem; }
.state-grid div { display: flex; flex-direction: column; gap: .35rem; padding: .9rem; background: var(--page); border-left: 3px solid var(--brand); border-radius: .3rem; }
.state-grid span { color: var(--muted); font-size: .85rem; }
.state-grid strong { font-size: 1rem; }
.tag { display: inline-block; padding: .22rem .56rem; margin: .15rem; background: var(--brand-soft); color: var(--brand-deep); border-radius: 999px; font-size: .88rem; font-weight: 700; }
.status { font-weight: 750; }
.ok { color: #14633a; }
.off { color: #842734; }
.notice, .alert, .warning, .error { max-width: 100%; padding: .85rem 1rem; border-radius: .4rem; border-left: 4px solid; }
.notice { color: #16452b; background: #e7f3eb; border-color: #27784c; }
.alert, .error { color: #751d2d; background: #f9e9eb; border-color: #a32b3c; }
.warning { color: #65440b; background: #fff4dc; border-color: #b7790b; }
.token-once { border: 3px solid #a96a08; background: #fff8e8; }
.token-once output { display: block; padding: 1rem; background: white; font-family: ui-monospace, monospace; font-size: 1.05rem; }
.columns { columns: 2; }
.share-panel { align-items: center; }
.share-panel h2 { flex-basis: 100%; }
.share-panel a { padding: .5rem .75rem; border: 1px solid var(--brand); border-radius: .4rem; text-decoration: none; }
.public-site main { max-width: 1120px; }
#arm-live-video, .arm-portal-player, video { width: min(100%, 900px); aspect-ratio: 16 / 9; background: #171719; object-fit: contain; }
.arm-portal-player.video-js, .video-js.arm-portal-player { width: min(100%, 900px); aspect-ratio: 16 / 9; }
.video-js.arm-portal-player.vjs-fluid { height: 0; padding-top: 56.25%; }
.arm-portal-player .vjs-tech, .video-js.arm-portal-player .vjs-tech { object-fit: contain; }
[data-cms-public-player], [data-vod-player], [data-event-player] { max-width: 900px; }
.video-with-points { display: grid; grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr); gap: 1.1rem; align-items: start; }
.video-with-points [data-cms-public-player], .video-with-points [data-vod-player] { min-width: 0; }
.point-list { list-style: none; padding: 0; margin: .5rem 0; max-height: 30rem; overflow: auto; }
.point-list li { margin: .35rem 0; }
.point-list button { width: 100%; justify-content: flex-start; text-align: left; background: white; color: var(--brand-deep); }
.point-list button:hover, .point-list button[aria-current="true"] { color: white; background: var(--brand); }
.point-editor { border-top: 1px solid var(--line); padding: .7rem 0; }
.cover-current, [data-cover-preview] { display: block; width: min(100%, 500px); aspect-ratio: 16 / 9; object-fit: contain; background: #171719; margin: .5rem 0; }
.announcement-poster { display: block; width: min(100%, 640px); aspect-ratio: 16 / 9; object-fit: contain; background: #171719; }
.cover-editor { min-width: min(100%, 290px); }
@media (max-width: 800px) { .video-with-points { grid-template-columns: 1fr; } }
details { padding: .8rem; border: 1px solid var(--line); border-radius: .5rem; margin: .6rem 0; }
summary { cursor: pointer; font-weight: 700; color: var(--brand-deep); }
pre { white-space: pre-wrap; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
[data-local-preview] { display: block; color: var(--muted); font-size: .9rem; margin-top: .35rem; }
:focus-visible { outline: 3px solid var(--focus) !important; outline-offset: 3px; }

.login { max-width: 470px; margin: clamp(2rem, 8vh, 6rem) auto; padding: 2rem; }
.login-brand { display: block; width: 200px; height: auto; margin: 0 auto 1.4rem; }
.login h1 { margin-bottom: .25rem; }
.login > p { color: var(--muted); }
.login button:not(.link) { width: 100%; }

@media (max-width: 800px) {
  header { padding: .6rem 1rem; }
  header nav { flex-basis: 100%; margin: 0; flex-wrap: wrap; }
  header nav a, header nav button.link { white-space: nowrap; }
  main { width: min(100% - 1.2rem, 1240px); margin: 1.3rem auto 3rem; }
  section { padding: 1.1rem; }
  table { display: block; overflow-x: auto; white-space: nowrap; }
  td, th { min-width: 7rem; }
  td:first-child, th:first-child { position: sticky; left: 0; background: white; }
  th:first-child { background: var(--page); }
  dl { grid-template-columns: 1fr; gap: .15rem; }
  dt:not(:first-child) { margin-top: .7rem; }
  .columns { columns: 1; }
}
@media (max-width: 480px) {
  .brand-mark img { width: 112px; }
  header > a { font-size: .9rem; }
  .login { margin: 1rem auto; padding: 1.25rem; }
  .actions, .inline-form { align-items: stretch; }
  .actions > *, .inline-form > * { flex: 1 1 100%; }
  .actions button, .actions .button { width: 100%; }
}

/* Keep the archive consequences readable before confirmation on narrow screens. */
.workspace-archive { white-space: normal; max-width: 40rem; min-width: 18rem; }
@media (max-width: 800px) {
  .workspace-list thead { display: none; }
  .workspace-list, .workspace-list tbody, .workspace-list tr, .workspace-list td { display: block; white-space: normal; min-width: 0; }
  .workspace-list td:first-child { position: static; }
  .workspace-archive { min-width: 0; }
}

/* Operational catalogues: readable headers, bounded horizontal scrolling on small screens. */
.catalog-scroll { overflow-x:auto; max-width:100%; }
.catalog-table { table-layout:auto; min-width:720px; }
.catalog-table th { white-space:nowrap; overflow-wrap:normal; word-break:normal; }
.catalog-table td { vertical-align:top; overflow-wrap:normal; word-break:normal; }
.catalog-table td:first-child { min-width:180px; }
.catalog-table .nowrap { white-space:nowrap; }
.catalog-actions { display:flex; flex-wrap:wrap; gap:.6rem; min-width:130px; }

/* Clip rows refresh independently of the player; actions retain a usable width. */
.clip-list { width:100%; table-layout:fixed; }
.clip-list th:nth-child(1) { width:26%; }
.clip-list th:nth-child(2) { width:34%; }
.clip-list th:nth-child(3) { width:19%; }
.clip-list th:nth-child(4) { width:21%; min-width:11rem; }
.clip-list td { overflow-wrap:anywhere; vertical-align:top; }
.clip-list-actions .actions { display:flex; flex-direction:column; align-items:flex-start; gap:.5rem; }
.clip-list-actions .actions a, .clip-list-actions button { word-break:normal; }
.clip-list .secondary { color:var(--brand-deep); background:white; border-color:var(--line-strong); }
.clip-list .secondary:hover { background:var(--brand-soft); border-color:var(--brand); }
.clip-list [hidden] { display:none !important; }
.clip-list-actions .button { max-width:100%; box-sizing:border-box; }
.clip-list details { margin-top:.5rem; }
@media (max-width:700px) {
 .clip-list thead { display:none; }
 .clip-list, .clip-list tbody, .clip-list tr, .clip-list td { display:block; width:auto; }
 .clip-list tr { margin-bottom:1rem; border:1px solid #cbd5e1; border-radius:.3rem; padding:.5rem; }
 .clip-list td::before { content:attr(data-label); display:block; font-weight:600; margin-bottom:.25rem; }
 .clip-list td { border:0; padding:.5rem; }
 .clip-list-actions .actions { flex-direction:row; flex-wrap:wrap; }
}

/* Operational controls stay compact; their reasons remain readable on touch screens. */
#event-workflow + p { margin-top: .5rem; }
#event-workflow-container .actions > form { margin: 0; padding: 0; border: 0; background: transparent; flex: 0 1 auto; }
.blocked-action { display: inline-flex; max-width: 100%; border-radius: .48rem; }
.blocked-action button { white-space: normal; }
.event-actions > p { flex-basis: 100%; margin: .2rem 0; }
fieldset { min-width: 0; border: 1px solid var(--line); }
