/* A site's own branding: the Logo and Custom domain settings in the analytics
   sidebar, and the site's name and logo on its public dashboard.
   Markup in src/utils/site-branding-html.ts. The sidebar is ~220px wide at
   1280 and full width in the phone drawer, so long values wrap anywhere. */

.branding-settings {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.branding-settings [hidden] {
    display: none !important;
}

.branding-title {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
}

.branding-block .badge-caption {
    margin: 4px 0 6px;
}

.branding-status {
    color: var(--color-danger) !important;
}

.branding-status:empty {
    display: none;
}

.branding-settings code {
    font-size: 11.5px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.logo-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.logo-preview {
    display: block;
    height: 32px;
    width: auto;
    max-width: 96px;
    object-fit: contain;
    padding: 2px;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 4px;
}

.branding-button {
    display: inline-block;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--color-primary);
    background: var(--color-white);
    border: 1px solid var(--color-primary);
    border-radius: 4px;
    padding: 4px 10px;
    cursor: pointer;
}

.branding-button:hover {
    background: #eff6ff;
}

.branding-button:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* The file input is visually hidden; its label is the button. */
#logo-file:focus-visible + .branding-button,
.logo-row:focus-within .branding-button {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.branding-remove {
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-danger);
    background: none;
    border: 0;
    padding: 4px 0;
    cursor: pointer;
    text-decoration: underline;
}

.branding-remove:hover {
    color: var(--color-danger-hover);
}

.branding-remove-confirm {
    text-decoration: none;
}

.custom-domain-row {
    display: flex;
    gap: 6px;
}

.custom-domain-input {
    flex: 1;
    min-width: 0;
    font: inherit;
    font-size: 13px;
    padding: 5px 8px;
    color: var(--color-text);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 4px;
}

.custom-domain-host {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 2px 0 4px;
    font-size: 13px;
}

.custom-domain-host strong {
    overflow-wrap: anywhere;
}

.custom-domain-pill {
    font-size: 11px;
    font-weight: 600;
    line-height: 1.5;
    padding: 0 8px;
    border-radius: 999px;
    color: #92400e;
    background: #fef3c7;
    white-space: nowrap;
}

.custom-domain-pill[data-status="active"] {
    color: #166534;
    background: #dcfce7;
}

.custom-domain-pill[data-status="failed"],
.custom-domain-pill[data-status="moved"] {
    color: #991b1b;
    background: #fee2e2;
}

.custom-domain-pill[data-status="creating"] {
    color: #374151;
    background: #e5e7eb;
}

.custom-domain-detail {
    color: var(--color-danger) !important;
}

.custom-domain-record .proof-dns > div {
    margin-bottom: 6px;
}

.custom-domain-snippet .proof-value code {
    font-size: 11px;
}

/* The public dashboard of a site that shows its own name and logo. */
.site-brand-header {
    display: flex;
    align-items: center;
    margin: 0 0 18px;
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: var(--color-text);
    text-decoration: none;
}

.site-brand-logo {
    display: block;
    height: 40px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
}

.site-brand-name {
    font-size: 20px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.powered-by {
    margin: 40px 0 8px;
    text-align: center;
    font-size: 13px;
}

.powered-by a {
    color: var(--color-text-tertiary);
    text-decoration: none;
}

.powered-by a:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

/* Empty on a branded public dashboard: the brand row above replaces it. */
.mobile-header[hidden] {
    display: none;
}
