/* Own the portal frame and shared components without changing WordPress admin controls. */
@font-face {
    font-family: 'Roboto';
    src: url('../fonts/roboto-regular.ttf') format('truetype');
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: 'Roboto';
    src: url('../fonts/roboto-medium.ttf') format('truetype');
    font-style: normal;
    font-weight: 500;
    font-display: swap;
}
@font-face {
    font-family: 'Roboto Condensed';
    src: url('../fonts/roboto-condensed-bold.ttf') format('truetype');
    font-style: normal;
    font-weight: 700;
    font-display: swap;
}
body.hcsb-portal-page {
    margin: 0;
    background: #f6f8f9;
}
.hcsb-portal {
    --brand: #106272;
    --action: #106272;
    --ink: #20333c;
    --muted: #52656c;
    --border: #d9e1e5;
    --wash: color-mix(in srgb, var(--brand) 7%, white);
    color: var(--ink);
    background: #f6f8f9;
    font:
        400 16px/1.5 'Roboto',
        'Helvetica Neue',
        Arial,
        sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.hcsb-portal * {
    box-sizing: border-box;
}
.hcsb-portal [hidden] {
    display: none !important;
}
.hcsb-portal h1,
.hcsb-portal h2 {
    font-family: 'Roboto Condensed', 'Roboto', Arial, sans-serif;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 16px;
}
.hcsb-portal h1 {
    font-size: 32px;
}
.hcsb-portal h2 {
    font-size: 24px;
}
.hcsb-portal p {
    margin: 0 0 16px;
    max-width: 720px;
}
.hcsb-portal a {
    color: var(--action);
    text-underline-offset: 4px;
}
.hcsb-portal button,
.hcsb-portal input,
.hcsb-portal select,
.hcsb-portal textarea {
    font: inherit;
}
.hcsb-portal button {
    cursor: pointer;
}
.hcsb-portal button:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}
.hcsb-portal :is(a, button, input, select, textarea, summary):focus-visible {
    outline: 3px solid var(--action);
    outline-offset: 4px;
}
.hcsb-portal .skip-link {
    position: absolute;
    top: -100px;
    background: white;
    padding: 12px 24px;
    z-index: 100;
}
.hcsb-portal .skip-link:focus {
    top: 8px;
}
.hcsb-portal .portal-header {
    background: white;
    border-top: 4px solid var(--brand);
    border-bottom: 1px solid var(--border);
}
.hcsb-portal .header-inner {
    max-width: 1264px;
    min-height: 88px;
    padding: 16px 32px;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.hcsb-portal .identity {
    display: flex;
    align-items: center;
    gap: 24px;
    text-decoration: none;
    color: var(--ink);
    min-width: 0;
}
.hcsb-portal .brand-logo {
    width: 220px;
    height: 48px;
    object-fit: contain;
    object-position: left center;
}
.hcsb-portal .portal-name {
    border-left: 1px solid var(--border);
    padding-left: 24px;
    font-weight: 500;
}
.hcsb-portal .group-logo {
    font-size: 28px;
    font-weight: 500;
    letter-spacing: -1px;
    color: #106272;
    white-space: nowrap;
}
.hcsb-portal .group-logo span {
    font-weight: 400;
}
.hcsb-portal nav {
    display: flex;
    align-items: center;
    gap: 24px;
}
.hcsb-portal .nav-link {
    text-decoration: none;
}
.hcsb-portal .nav-link,
.hcsb-portal .text-button {
    border: 0;
    background: transparent;
    color: var(--action);
    padding: 8px 0;
    min-height: 44px;
    text-align: left;
    font-weight: 500;
}
.hcsb-portal :is(.text-button, .nav-link):hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}
.hcsb-portal .preview-badge {
    font-size: 12px;
    padding: 8px 12px;
    background: #edf1f3;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: #425760;
}
.hcsb-portal .portal-main {
    width: 100%;
    max-width: 1064px;
    margin: 0 auto;
    padding: 48px 32px 64px;
    flex: 1;
}
.hcsb-portal .guide {
    display: grid;
    grid-template-columns: 164px minmax(0, 1fr);
    gap: 32px;
    align-items: center;
    margin-bottom: 48px;
}
.hcsb-portal .avatar-frame {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    height: 190px;
}
.hcsb-portal .avatar-frame:before {
    content: '';
    position: absolute;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--brand) 13%, white);
    bottom: 0;
}
.hcsb-portal .avatar-frame img {
    position: relative;
    width: 164px;
    height: 190px;
    object-fit: contain;
    object-position: center bottom;
}
.hcsb-portal .speech-panel {
    position: relative;
    background: var(--wash);
    border: 1px solid color-mix(in srgb, var(--brand) 24%, white);
    border-radius: 8px;
    padding: 24px 32px;
}
.hcsb-portal .speech-panel:before {
    content: '';
    position: absolute;
    left: -12px;
    top: 64px;
    width: 20px;
    height: 20px;
    background: var(--wash);
    border-left: 1px solid color-mix(in srgb, var(--brand) 24%, white);
    border-bottom: 1px solid color-mix(in srgb, var(--brand) 24%, white);
    transform: rotate(45deg);
}
.hcsb-portal .eyebrow {
    font-size: 14px;
    font-weight: 500;
    color: var(--action);
    margin-bottom: 8px;
}
.hcsb-portal .speech-panel p:not(.eyebrow) {
    color: #405760;
    margin-bottom: 8px;
}
.hcsb-portal .entry-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}
.hcsb-portal .entry-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    color: var(--ink);
    box-shadow: 0 4px 16px #20333c05;
    transition:
        border-color 0.15s,
        box-shadow 0.15s;
}
.hcsb-portal .entry-card:hover {
    border-color: var(--brand);
    box-shadow: 0 8px 24px #20333c0d;
}
.hcsb-portal .card-icon {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    background: var(--wash);
    color: var(--action);
    border-radius: 8px;
    margin-bottom: 24px;
}
.hcsb-portal .entry-card h2 {
    margin-bottom: 12px;
}
.hcsb-portal .entry-card p {
    color: var(--muted);
    margin-bottom: 32px;
}
.hcsb-portal .card-link {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    color: var(--action);
    font-weight: 500;
    margin-top: auto;
}
.hcsb-portal .composer .back-button {
    margin-bottom: 16px;
}
.hcsb-portal .editor-panel {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 32px;
}
.hcsb-portal .field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
    min-width: 0;
}
.hcsb-portal label {
    font-weight: 500;
}
.hcsb-portal .optional {
    font-weight: 400;
    color: var(--muted);
}
.hcsb-portal :is(input, select, textarea) {
    width: 100%;
    min-height: 48px;
    border: 1px solid #91a3ad;
    border-radius: 8px;
    background: white;
    color: var(--ink);
    padding: 12px 16px;
}
.hcsb-portal textarea {
    resize: vertical;
    min-height: 224px;
    line-height: 1.6;
}
.hcsb-portal ::placeholder {
    color: #63757c;
    opacity: 1;
}
.hcsb-portal .field-meta {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    color: var(--muted);
    font-size: 14px;
}
.hcsb-portal .field-error {
    font-size: 14px;
    color: #a51c1c;
}
.hcsb-portal .field-error:empty {
    display: none;
}
.hcsb-portal [aria-invalid='true'] {
    border-color: #a51c1c;
}
.hcsb-portal .field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 24px;
}
.hcsb-portal .assignment {
    border-top: 1px solid var(--border);
    padding-top: 24px;
}
.hcsb-portal summary {
    font-weight: 500;
    cursor: pointer;
    min-height: 44px;
}
.hcsb-portal .assignment p {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 24px;
}
.hcsb-portal .form-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    border-top: 1px solid var(--border);
    padding-top: 24px;
}
.hcsb-portal .form-bottom p {
    font-size: 14px;
    color: var(--muted);
    max-width: 440px;
    margin: 0;
}
.hcsb-portal .primary-button {
    background: var(--action);
    color: white;
    border: 1px solid var(--action);
    border-radius: 8px;
    padding: 12px 24px;
    min-height: 48px;
    font-weight: 500;
    white-space: nowrap;
}
.hcsb-portal .primary-button:hover {
    filter: brightness(0.9);
}
.hcsb-portal .validation-result:not(:empty) {
    margin: 24px 0 0;
    padding: 16px;
    background: var(--wash);
    border-left: 4px solid var(--action);
}
.hcsb-portal .help-dialog {
    max-width: 600px;
    width: calc(100% - 32px);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 32px;
    color: var(--ink);
    background: white;
}
.hcsb-portal .help-dialog::backdrop {
    background: #102d3d66;
}
.hcsb-portal .help-dialog ol {
    padding-left: 24px;
    margin: 0 0 24px;
}
.hcsb-portal .help-dialog li {
    padding-left: 8px;
    margin-bottom: 12px;
}
.hcsb-portal .portal-footer {
    max-width: 1264px;
    width: 100%;
    padding: 24px 32px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid var(--border);
    font-size: 14px;
    color: var(--muted);
}
.hcsb-portal .directory > p {
    color: var(--muted);
}
.hcsb-portal .brand-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin: 32px 0;
}
.hcsb-portal .brand-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    padding: 32px;
    text-decoration: none;
    font-weight: 500;
}
.hcsb-portal .brand-card:hover {
    border-color: var(--action);
}
.hcsb-portal .brand-card img {
    width: 100%;
    max-width: 240px;
    height: 56px;
    object-fit: contain;
    object-position: left center;
}
.hcsb-portal .brand-card span {
    display: flex;
    justify-content: space-between;
}
.hcsb-portal .support-copy {
    font-size: 14px;
}
@media (max-width: 1023px) {
    .hcsb-portal .preview-badge {
        display: none;
    }
    .hcsb-portal .header-inner {
        gap: 16px;
    }
    .hcsb-portal .brand-logo {
        width: 180px;
    }
    .hcsb-portal .identity {
        gap: 16px;
    }
    .hcsb-portal .portal-name {
        padding-left: 16px;
    }
    .hcsb-portal .entry-grid {
        gap: 16px;
    }
    .hcsb-portal .entry-card {
        padding: 24px 16px;
    }
}
@media (max-width: 767px) {
    .hcsb-portal .header-inner {
        padding: 16px;
        flex-wrap: wrap;
        min-height: auto;
    }
    .hcsb-portal .brand-logo {
        width: 156px;
        height: 40px;
    }
    .hcsb-portal .portal-name {
        font-size: 14px;
    }
    .hcsb-portal .header-inner nav {
        display: none;
    }
    .hcsb-portal .portal-main {
        padding: 32px 16px;
    }
    .hcsb-portal .guide {
        grid-template-columns: 80px minmax(0, 1fr);
        gap: 16px;
        margin-bottom: 24px;
        align-items: start;
    }
    .hcsb-portal .avatar-frame {
        height: 104px;
        margin-top: 24px;
    }
    .hcsb-portal .avatar-frame img {
        width: 88px;
        height: 104px;
    }
    .hcsb-portal .avatar-frame:before {
        width: 80px;
        height: 80px;
    }
    .hcsb-portal .speech-panel {
        padding: 16px;
    }
    .hcsb-portal .speech-panel:before {
        top: 48px;
    }
    .hcsb-portal h1 {
        font-size: 28px;
    }
    .hcsb-portal .speech-panel .eyebrow {
        font-size: 12px;
    }
    .hcsb-portal .speech-panel p:not(.eyebrow) {
        font-size: 16px;
    }
    .hcsb-portal .entry-grid,
    .hcsb-portal .brand-grid,
    .hcsb-portal .field-grid {
        grid-template-columns: 1fr;
    }
    .hcsb-portal .entry-card {
        padding: 24px;
    }
    .hcsb-portal .entry-card .card-icon {
        margin-bottom: 16px;
    }
    .hcsb-portal .entry-card p {
        margin-bottom: 16px;
    }
    .hcsb-portal .editor-panel {
        padding: 24px 16px;
    }
    .hcsb-portal .form-bottom,
    .hcsb-portal .portal-footer {
        align-items: flex-start;
        flex-direction: column;
    }
    .hcsb-portal .primary-button {
        white-space: normal;
    }
    .hcsb-portal .form-bottom .primary-button {
        width: 100%;
    }
    .hcsb-portal .portal-footer {
        padding: 24px 16px;
    }
    .hcsb-portal .help-dialog {
        padding: 24px;
    }
}
@media (prefers-reduced-motion: reduce) {
    .hcsb-portal * {
        transition: none !important;
    }
}
