/* SPDX-License-Identifier: AGPL-3.0-or-later */
/* Arial throughout (the GOV.UK font is licensed for GOV.UK services only). */
body, .phaema-header, .phaema-stat { font-family: arial, sans-serif; }
/* Wider pages than GOV.UK's 960px, as PHAEMA is a back-office tool with large tables. */
.govuk-width-container { max-width: 1200px; }
/* PHAEMA's own header: deliberately not the GOV.UK header or crown. */
.phaema-header { background: #1d3557; color: #fff; border-bottom: 8px solid #457b9d; }
.phaema-header__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding: 14px 0; }
.phaema-header__brand { color: #fff; font-weight: 700; font-size: 1.5rem; text-decoration: none; letter-spacing: .05em; }
.phaema-header__brand:focus { color: #0b0c0c; background: #fd0; box-shadow: 0 -2px #fd0, 0 4px #0b0c0c; outline: none; }
.phaema-header__org { font-size: 1rem; opacity: .9; }
.phaema-header__nav { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; }
.phaema-header__nav a, .phaema-header__logout button { color: #fff; font: inherit; font-weight: 700; font-size: 1rem; }
.phaema-header__nav a:focus { color: #0b0c0c; background: #fd0; outline: none; }
.phaema-header__logout { margin: 0; }
.phaema-menu { position: relative; }
.phaema-menu > summary { color: #fff; font-weight: 700; font-size: 1rem; cursor: pointer; text-decoration: underline; list-style: none; }
.phaema-menu > summary::-webkit-details-marker { display: none; }
.phaema-menu > summary::after { content: " \25BE"; text-decoration: none; display: inline-block; margin-left: 2px; }
.phaema-menu > summary:focus { color: #0b0c0c; background: #fd0; outline: none; }
.phaema-menu__panel { position: absolute; z-index: 20; top: calc(100% + 6px); left: -12px; min-width: 210px; background: #1d3557; border: 1px solid #457b9d; padding: 8px 12px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 4px 10px rgba(0,0,0,.25); }
@media (max-width: 640px) { .phaema-menu__panel { position: static; box-shadow: none; border: 0; padding: 6px 0 0 12px; } }
.phaema-header__logout button { background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }
.phaema-stat { border-left: 5px solid #1d3557; padding-left: 15px; margin-bottom: 20px; }
.phaema-stat__value { font-size: 2.5rem; font-weight: 700; line-height: 1.1; display: block; }
.phaema-filters { background: #f3f2f1; padding: 15px; margin-bottom: 20px; }
.phaema-filters .govuk-form-group { margin-bottom: 15px; }

/* Text size setting (GOV.UK Frontend uses rem units, so this scales all text). */
html.phaema-text-smaller { font-size: 87.5%; }
html.phaema-text-large { font-size: 125%; }
html.phaema-text-largest { font-size: 150%; }
.phaema-text-size { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: flex-end; align-items: baseline; padding-top: 10px; }
.phaema-text-size .govuk-body-s { margin: 0; }
.phaema-text-size__current { font-weight: 700; }
.phaema-text-size__smaller { font-size: 0.8rem; }
.phaema-text-size__large { font-size: 1.1rem; }
.phaema-text-size__largest { font-size: 1.3rem; }

/* Sortable table headings */
.phaema-sort { color: #0b0c0c; text-decoration: none; }
.phaema-sort:hover { text-decoration: underline; }
.phaema-sort:focus { background: #fd0; outline: none; box-shadow: 0 4px #0b0c0c; }
.phaema-sort[data-sort="ascending"]::after { content: " ▲"; }
.phaema-sort[data-sort="descending"]::after { content: " ▼"; }

/* Photo gallery */
.phaema-gallery { margin: 0 0 30px; }
.phaema-gallery__main { display: block; width: 100%; max-height: 480px; object-fit: contain; background: #f3f2f1; }
.phaema-gallery__thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; padding: 0; list-style: none; }
.phaema-gallery__thumbs a { display: block; border: 3px solid transparent; }
.phaema-gallery__thumbs a[aria-current="true"] { border-color: #1d3557; }
.phaema-gallery__thumbs a:focus { border-color: #fd0; outline: 3px solid #0b0c0c; }
.phaema-gallery__thumbs img { display: block; width: 96px; height: 72px; object-fit: cover; }

/* Area breakdown */
.phaema-indent-1 { padding-left: 0; }
.phaema-indent-2 { padding-left: 20px !important; }
.phaema-indent-3 { padding-left: 40px !important; }
.phaema-indent-4 { padding-left: 60px !important; }
.phaema-lettable { font-weight: 700; }

/* Maps */
.phaema-map { width: 100%; border: 1px solid #b1b4b6; background: #f3f2f1; }
.phaema-map__info { min-height: 1.5em; margin: 5px 0; }
.phaema-map__controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 0; margin-bottom: 20px; }
.phaema-map__controls .govuk-select { min-width: 0; }
.phaema-map .ol-attribution { max-width: 90%; font-size: 12px; }
.phaema-map .ol-attribution ul { white-space: normal; }
.phaema-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 0; list-style: none; }
.phaema-legend li::before { content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px; background: var(--c); }
.phaema-header__user { font-size: 0.9rem; opacity: .9; }
.govuk-link.phaema-overdue:link, .govuk-link.phaema-overdue:visited { color: #d4351c; font-weight: 700; }
.phaema-code { font-family: monospace; word-break: break-all; font-size: 1rem; }
.phaema-link-button { background: none; border: 0; padding: 0; color: #1d70b8; text-decoration: underline; cursor: pointer; font-family: inherit; }
.phaema-inline-fields { display: flex; flex-wrap: wrap; gap: 10px 20px; }
.phaema-table-scroll { overflow-x: auto; position: relative; } /* relative keeps visually hidden text inside the scroll area */
.phaema-table-scroll:focus { outline: 3px solid #ffdd00; outline-offset: 0; }
.phaema-report .govuk-table__cell, .phaema-report .govuk-table__header { font-size: 1rem; padding-right: 15px; }
.phaema-total-row .govuk-table__cell { border-top: 2px solid var(--ph-text, #0b0c0c); }
.phaema-compact .govuk-table__cell { padding-top: 4px; padding-bottom: 4px; }
.phaema-downloads { margin-bottom: 10px; }
.phaema-help-link { margin-right: auto !important; }
.phaema-help-link a::before { content: "? "; font-weight: bold; }
.phaema-search-row { display: flex; gap: 5px; }
.phaema-help-nav a[aria-current="page"] { font-weight: bold; text-decoration: none; }
.phaema-on-this-page { border-left: 4px solid var(--ph-border, #b1b4b6); padding-left: 15px; margin-bottom: 20px; }
.phaema-manual code { font-family: monospace; background: var(--ph-panel, #f3f2f1); padding: 0 4px; }
.phaema-manual img { max-width: 100%; border: 1px solid var(--ph-border, #b1b4b6); }
.phaema-hint { margin-bottom: 15px; }
.phaema-glossary dt { font-weight: 700; margin-top: 20px; }
.phaema-glossary dd { margin: 5px 0 0; }
.phaema-subnav { display: flex; flex-wrap: wrap; gap: 8px 20px; border-bottom: 1px solid var(--ph-border, #b1b4b6); padding-bottom: 10px; }
.phaema-subnav a[aria-current="page"] { font-weight: 700; text-decoration: none; }
@media print {
  .phaema-header, .phaema-settings-bar, .govuk-phase-banner, .phaema-subnav, .govuk-details, .govuk-footer { display: none !important; }
}
.phaema-stages { display: flex; flex-wrap: wrap; list-style: none; padding: 0; margin: 0 0 30px; counter-reset: stage; }
.phaema-stages li { flex: 1 1 120px; padding: 8px 10px; border-bottom: 5px solid var(--ph-border, #b1b4b6); font-size: 1rem; color: var(--ph-secondary, #505a5f); }
.phaema-stages li::before { counter-increment: stage; content: counter(stage) ". "; }
.phaema-stages li.done { border-color: var(--ph-accent, #00703c); color: var(--ph-text, #0b0c0c); }
.phaema-stages li.current { border-color: var(--ph-link, #1d70b8); font-weight: 700; color: var(--ph-text, #0b0c0c); }
.phaema-tasks li { display: flex; gap: 10px; align-items: baseline; }
.phaema-tick { width: 24px; height: 24px; flex: none; border: 2px solid var(--ph-text, #0b0c0c); background: var(--ph-input-bg, #fff); color: var(--ph-text, #0b0c0c); font-weight: 700; cursor: pointer; padding: 0; line-height: 18px; text-align: center; display: inline-block; }
.phaema-tick.done { background: var(--ph-accent, #00703c); border-color: var(--ph-accent, #00703c); color: #fff; }
.phaema-done { text-decoration: line-through; color: var(--ph-secondary, #505a5f); }
.phaema-timeline li { border-left: 3px solid var(--ph-border, #b1b4b6); padding: 0 0 15px 15px; margin-bottom: 5px; }
.phaema-timeline__when { display: block; color: var(--ph-secondary, #505a5f); }
.phaema-email-text { white-space: normal; font-size: 1rem; max-height: 300px; overflow-y: auto; }
.phaema-doc-preview { border: 1px solid var(--ph-border, #b1b4b6); padding: 30px 35px; background: var(--ph-surface, #fff); max-height: 1100px; overflow: auto; }
.phaema-doc-preview .govuk-body { font-size: 1rem; }
.phaema-blank { background: #fff2a8; color: #0b0c0c; padding: 0 2px; }
.phaema-doc-number span { display: inline-block; min-width: 2em; }

/* Hand over work: the receiver menus shrink to fit a phone screen. */
.phaema-handover .govuk-select { min-width: 0; width: 100%; max-width: 20em; }

/* WCAG 2.2 target size: menu and display-setting links are at least 24px tall, with room between rows. */
.phaema-header__nav > a, .phaema-header__nav > .phaema-menu > summary, .phaema-header__nav button,
.phaema-settings-bar a { display: inline-block; min-height: 24px; line-height: 24px; }
.phaema-header__nav { row-gap: 8px; }
