/* Shared portal behavior that complements the existing Tailwind theme. */
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }
.site-header-inner, main, .site-footer-inner { min-width: 0; }
.site-brand { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.site-brand img { flex: 0 0 auto; }
.site-brand span { font-size: 1rem; font-weight: 600; line-height: 1.4; }
.site-header-inner { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: center; }
.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; margin-left: auto; }
.site-nav a, .site-nav button { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: .5rem .75rem; border-radius: .75rem; font: inherit; }
.site-nav a:hover, .site-nav button:hover { background: #f1f5f9; }
.site-nav form { margin: 0; }
.site-nav button { width: 100%; }
.site-nav a[aria-current="page"] { background: #e0e7ff; color: #3730a3; font-weight: 600; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible { outline: 3px solid #4f46e5; outline-offset: 3px; }
.skip-link { position: absolute; left: 1rem; top: -100px; z-index: 100; background: white; padding: .75rem; border: 2px solid #4f46e5; }
.skip-link:focus { top: 1rem; }
main { overflow-wrap: anywhere; }
main input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]), main select, main button { min-height: 44px; font-size: 1rem; }
main input, main select { max-width: 100%; min-width: 0; }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; }
.breadcrumbs a { display: inline-flex; align-items: center; min-height: 44px; }
.auth-card { width: 100%; max-width: 28rem; margin: 0 auto; }
.auth-form label { display: block; margin-bottom: .375rem; font-weight: 500; color: #475569; }
.auth-form input:not([type="hidden"]) { display: block; width: 100%; border: 1px solid #cbd5e1; border-radius: .75rem; padding: .625rem .75rem; background: white; }
.auth-form .helptext { margin-top: .5rem; font-size: .875rem; color: #475569; }
.auth-form .helptext ul { list-style: disc; padding-left: 1.25rem; }
.auth-form .errorlist { color: #b91c1c; margin-top: .5rem; font-size: .875rem; }
.primary-action { display: inline-flex; justify-content: center; align-items: center; min-height: 44px; padding: .625rem 1rem; border-radius: .75rem; background: #4f46e5; color: white; font-weight: 600; }
.primary-action:hover { background: #4338ca; }
.contact-link { display: inline-flex; align-items: center; min-height: 44px; max-width: 100%; color: #4338ca; text-decoration: underline; overflow-wrap: anywhere; }
.report-filters { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.report-table { width: 100%; }
.report-table td { overflow-wrap: anywhere; }
.report-label { display: none; }
.search-status { min-height: 1.5rem; }
.search-status.htmx-indicator { visibility: hidden; opacity: 1; }
.htmx-request .search-status.htmx-indicator, .search-status.htmx-request { visibility: visible; }
@media (max-width: 767px) {
    .site-nav { width: 100%; margin-left: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .site-nav a, .site-nav button { padding: .5rem .25rem; }
    .site-brand span { font-size: .9375rem; }
    main { padding-top: 1.25rem !important; padding-bottom: 1.25rem !important; }
    main h1 { font-size: 1.625rem; }
    .auth-card .primary-action { width: 100%; }
    /* Keep each report record readable without sideways scrolling. */
    .report-table, .report-table tbody { display: block; width: 100%; }
    .report-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .report-table tr { display: block; padding: .75rem 0; }
    .report-table tr + tr { border-top: 1px solid #e2e8f0; }
    .report-table td { display: grid; grid-template-columns: minmax(5rem, 30%) minmax(0, 1fr); gap: .75rem; padding: .375rem 0; border: 0; }
    .report-label { display: block; color: #64748b; font-weight: 500; }
    .report-table td > div { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
.site-footer-inner { overflow-wrap: anywhere; }
.primary-action { flex-shrink: 0; white-space: nowrap; }
.contact-link { font-size: .875rem; line-height: 1.5; }

.family-card-header { display: flex; align-items: center; gap: 1rem; }
.family-card-heading { min-width: 0; }
.family-thumbnail { display: block; flex: 0 0 112px; width: 112px; height: 84px; object-fit: contain; border-radius: .75rem; background: #f1f5f9; }
.family-thumbnail-placeholder { display: flex; align-items: center; justify-content: center; padding: .5rem; color: #64748b; font-size: .75rem; text-align: center; }
@media (max-width: 374px) {
    .family-card-header { gap: .75rem; }
    .family-thumbnail { flex-basis: 88px; width: 88px; height: 66px; }
}
