/* ============================================================
   MDOT Plans & ROW Records — site theme
   Styled to match the look of mdot.ms.gov: white header with
   uppercase navigation, MDOT red/blue accents, clean cards.
   ============================================================ */

:root {
    --mdot-red: #d6242c;
    --mdot-pink: #d81b8c;
    --mdot-navy: #123a6d;
    --mdot-blue: #2d6cc0;
    --mdot-blue-dark: #1f4e9c;
    --ink: #333940;
    --ink-soft: #5a6470;
    --line: #e4e7eb;
    --panel: #f5f6f8;
    --card-shadow: 0 1px 2px rgba(18, 58, 109, .06), 0 4px 14px rgba(18, 58, 109, .08);
    --radius: 10px;
    --font: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font);
    color: var(--ink);
    background: #fafbfc;
    font-size: 15px;
}

.mdot-app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---------------- header ---------------- */

.mdot-header {
    background: #fff;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 100;
}

.mdot-header-inner {
    max-width: none;
    margin: 0 auto;
    padding: 10px 24px;
    display: flex;
    align-items: center;
    gap: 28px;
    flex-wrap: wrap;
}

.mdot-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.mdot-logo { height: 44px; width: auto; }

.mdot-brand-text { display: flex; flex-direction: column; line-height: 1.05; }

.mdot-brand-name {
    color: var(--mdot-red);
    font-size: 27px;
    font-weight: 800;
    font-style: italic;
    letter-spacing: .5px;
}

.mdot-brand-sub {
    color: var(--mdot-navy);
    font-size: 8.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .55px;
}

.mdot-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    flex-wrap: wrap;
}

.mdot-nav a {
    color: #4a5058;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .4px;
    padding: 9px 13px;
    border-radius: 6px;
    transition: color .15s, background .15s;
}

.mdot-nav a:hover { color: var(--mdot-red); background: var(--panel); }

.mdot-nav a.active {
    color: #fff;
    background: var(--mdot-navy);
}

.mdot-nav .mdot-nav-ext { color: var(--mdot-blue); }

/* thin navy band under the header, echoing the parent site's hero strip */
.mdot-band {
    background: linear-gradient(90deg, var(--mdot-navy), var(--mdot-blue-dark) 60%, var(--mdot-blue));
    color: #d9e4f5;
}

.mdot-band-inner {
    max-width: none;
    margin: 0 auto;
    padding: 7px 24px;
    font-size: 12.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .8px;
}

/* ---------------- main ---------------- */

.mdot-main {
    flex: 1;
    width: 100%;
    max-width: none;
    margin: 0 auto;
    padding: 26px 24px 48px;
}

.mdot-page-title {
    color: var(--mdot-navy);
    font-size: 30px;
    font-weight: 800;
    margin: 6px 0 6px;
}

.mdot-page-lede {
    color: var(--ink-soft);
    max-width: 860px;
    margin: 0 0 18px;
}

/* ---------------- disclaimer ---------------- */

.mdot-disclaimer {
    background: #fdf7ec;
    border: 1px solid #f1e3c2;
    border-left: 4px solid #e5a93d;
    border-radius: 8px;
    padding: 0;
    margin: 0 0 20px;
    color: #6b5c39;
    font-size: 13.5px;
}

.mdot-disclaimer summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.mdot-disclaimer summary::-webkit-details-marker { display: none; }

.mdot-disclaimer summary svg { color: #e5a93d; flex: none; }

.mdot-disclaimer-more {
    margin-left: auto;
    color: var(--mdot-blue);
    font-weight: 600;
    white-space: nowrap;
}

.mdot-disclaimer[open] .mdot-disclaimer-more { visibility: hidden; }

.mdot-disclaimer p { margin: 0; padding: 0 14px 12px 40px; line-height: 1.55; }

/* ---------------- cards ---------------- */

.mdot-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    padding: 20px;
    margin-bottom: 22px;
}

/* ---------------- search panel ---------------- */

.mdot-search-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
    gap: 14px 18px;
}

.mdot-field { display: flex; flex-direction: column; gap: 5px; }

.mdot-field > span {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--mdot-navy);
}

.mdot-field-wide { grid-column: span 2; }

.mdot-search-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

/* DevExpress button accents → MDOT palette */
.mdot-search-actions .dxbl-btn-primary {
    background-color: var(--mdot-navy);
    border-color: var(--mdot-navy);
    font-weight: 600;
    padding-inline: 26px;
}

.mdot-search-actions .dxbl-btn-primary:hover:not(:disabled) {
    background-color: var(--mdot-blue-dark);
    border-color: var(--mdot-blue-dark);
}

/* ---------------- results ---------------- */

.mdot-results-header {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-bottom: 14px;
}

.mdot-results-header h2 {
    margin: 0;
    font-size: 19px;
    color: var(--mdot-navy);
}

.mdot-results-count { color: var(--ink-soft); font-size: 13px; }

/* DevExpress grid → MDOT look */
.mdot-grid { font-size: 13px; --dxbl-grid-border-radius: 8px; }

.mdot-grid .dxbl-grid-header-content,
.mdot-grid th {
    color: var(--mdot-navy);
    font-weight: 700;
}

.mdot-doclink { display: inline-flex; align-items: center; }
.mdot-doclink:hover { filter: brightness(1.12); }

/* ---------------- home page ---------------- */

.mdot-hero {
    background:
        linear-gradient(100deg, rgba(18, 58, 109, .92) 30%, rgba(45, 108, 192, .82) 70%, rgba(45, 108, 192, .55)),
        linear-gradient(180deg, #9ec7ee, #dceafc);
    border-radius: var(--radius);
    color: #fff;
    padding: 46px 42px;
    margin-bottom: 26px;
    box-shadow: var(--card-shadow);
}

.mdot-hero h1 {
    margin: 0 0 10px;
    font-size: 38px;
    font-weight: 800;
    letter-spacing: .3px;
}

.mdot-hero h1 em {
    color: #ff9ecf;
    font-style: italic;
}

.mdot-hero p {
    margin: 0;
    max-width: 640px;
    font-size: 16.5px;
    color: #e2ebf7;
    line-height: 1.55;
}

.mdot-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.mdot-tile {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #fff;
    border: 1px solid var(--line);
    border-top: 4px solid var(--mdot-red);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    padding: 24px 22px;
    text-decoration: none;
    color: var(--ink);
    transition: transform .15s, box-shadow .15s;
}

.mdot-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 22px rgba(18, 58, 109, .16);
}

.mdot-tile-title {
    color: var(--mdot-navy);
    font-size: 19px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.mdot-tile-desc { color: var(--ink-soft); font-size: 14px; line-height: 1.5; }

.mdot-tile-cta {
    margin-top: auto;
    padding-top: 10px;
    color: var(--mdot-red);
    font-weight: 700;
    font-size: 14px;
}

/* ---------------- footer ---------------- */

.mdot-footer {
    background: var(--mdot-navy);
    color: #c6d4e8;
    margin-top: auto;
}

.mdot-footer-inner {
    max-width: none;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 13px;
}

/* ---------------- responsive ---------------- */

@media (max-width: 720px) {
    .mdot-field-wide { grid-column: span 1; }
    .mdot-hero { padding: 32px 24px; }
    .mdot-hero h1 { font-size: 28px; }
    .mdot-nav { margin-left: 0; }
}

/* ---------------- native form controls ---------------- */

.mdot-input,
.mdot-select {
    width: 100%;
    min-height: 38px;
    border: 1px solid #c8d0da;
    border-radius: 7px;
    background-color: #fff;
    color: var(--ink);
    font: 500 14px/1.35 var(--font);
    padding: 8px 10px;
    outline: none;
    transition: border-color .15s, box-shadow .15s, background-color .15s;
}

.mdot-input::placeholder { color: #7d8792; font-weight: 400; }

.mdot-input:focus,
.mdot-select:focus {
    border-color: var(--mdot-blue);
    box-shadow: 0 0 0 3px rgba(45, 108, 192, .14);
}

.mdot-select {
    appearance: none;
    padding-right: 34px;
    cursor: pointer;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--mdot-navy) 50%),
        linear-gradient(135deg, var(--mdot-navy) 50%, transparent 50%),
        linear-gradient(to right, #eef2f6, #eef2f6);
    background-position:
        calc(100% - 18px) 16px,
        calc(100% - 12px) 16px,
        calc(100% - 34px) 0;
    background-size: 6px 6px, 6px 6px, 1px 100%;
    background-repeat: no-repeat;
}

.mdot-button {
    min-height: 36px;
    border-radius: 7px;
    border: 1px solid transparent;
    padding: 8px 20px;
    font: 700 13px/1 var(--font);
    cursor: pointer;
    transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s;
}

.mdot-button:disabled { opacity: .65; cursor: default; }

.mdot-button-primary {
    background: var(--mdot-navy);
    border-color: var(--mdot-navy);
    color: #fff;
    box-shadow: 0 2px 6px rgba(18, 58, 109, .16);
}

.mdot-button-primary:hover:not(:disabled) {
    background: var(--mdot-blue-dark);
    border-color: var(--mdot-blue-dark);
}

.mdot-button-outline {
    background: #fff;
    border-color: #b9c3cf;
    color: var(--mdot-navy);
}

.mdot-button-outline:hover {
    background: #f2f5f9;
    border-color: var(--mdot-blue);
}

/* ---------------- native result table ---------------- */

.mdot-table-wrap {
    border: 1px solid var(--line);
    border-radius: 9px;
    overflow: auto;
    max-width: 100%;
    background: #fff;
}

.mdot-table {
    width: 100%;
    min-width: 1280px;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    line-height: 1.35;
}

.mdot-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: linear-gradient(180deg, #f8fafc, #edf2f8);
    color: var(--mdot-navy);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .35px;
    text-align: left;
    padding: 10px 10px;
    border-bottom: 1px solid #cfd8e3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------------- column resize handle ---------------- */

.mdot-col-resizer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 8px;
    cursor: col-resize;
    touch-action: none;
    z-index: 2;
}

.mdot-col-resizer::after {
    content: "";
    position: absolute;
    top: 4px;
    bottom: 4px;
    right: 3px;
    width: 2px;
    background: transparent;
    border-radius: 1px;
}

.mdot-col-resizer:hover::after {
    background: var(--mdot-blue, #2f6fed);
}

/* Applied to <body> while a drag is in progress so the resize cursor and disabled text
   selection stay correct even if the pointer briefly leaves the handle mid-drag. */
body.mdot-col-resizing {
    cursor: col-resize !important;
    user-select: none;
}

body.mdot-col-resizing .mdot-table th,
body.mdot-col-resizing .mdot-table td {
    user-select: none;
}

.mdot-table td {
    padding: 9px 10px;
    border-bottom: 1px solid #edf1f5;
    vertical-align: top;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mdot-table tbody tr:nth-child(even) { background: #fbfcfe; }
.mdot-table tbody tr:hover { background: #f0f6ff; }
.mdot-table tbody tr:last-child td { border-bottom: 0; }

/* Column widths come from each table's <colgroup> (table-layout: fixed caps every
   column at that width, so one unusually long value can't blow the column out). */
.mdot-icon-col { text-align: center !important; }
.mdot-term-col { white-space: normal; overflow-wrap: break-word; }
.mdot-cell-center { text-align: center; }
.mdot-nowrap { white-space: nowrap; }

/* ---------------- pagination ---------------- */

.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 16px 0 8px;
    flex-wrap: wrap;
}

.pager button {
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pager button:hover:not(:disabled) {
    background: #f0f6ff;
    border-color: var(--mdot-blue);
}

.pager button.active {
    background: var(--mdot-navy);
    color: #fff;
    border-color: var(--mdot-navy);
}

.pager button:disabled {
    opacity: 0.4;
    cursor: default;
}

.pager .pager-dots {
    padding: 0 4px;
    color: var(--ink-soft);
    user-select: none;
}

.pager .pager-info {
    font-size: 12px;
    color: var(--ink-soft);
    margin: 0 8px;
}

/* ---------------- column header filters ---------------- */

/* Header cell layout: label text is the only part allowed to shrink (it gets an
   ellipsis when the column is tight); the sort arrow and filter icon are flex:none
   so they always render in full, next to the label, instead of drifting to the far
   right of the cell (space-between) or getting clipped mid-icon by the <th>'s own
   overflow:hidden when a narrow column runs out of room. */
.mdot-th-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.mdot-th-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mdot-col-filter-wrap {
    display: inline-flex;
    flex: none;
}

.mdot-col-filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #9aa5b1;
    cursor: pointer;
    transition: color .15s, background-color .15s;
}

.mdot-col-filter-btn:hover { color: var(--mdot-navy); background: #e4ecf6; }

.mdot-col-filter-btn.active { color: var(--mdot-navy); background: #dbe8fa; }

.mdot-col-filter-popover {
    position: fixed;
    z-index: 300;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(18, 58, 109, .18);
    padding: 12px;
    width: 230px;
    text-transform: none;
    letter-spacing: normal;
    font-weight: 400;
}

.mdot-col-filter-input { margin-bottom: 10px; }

.mdot-col-filter-actions { display: flex; gap: 8px; }

.mdot-button-sm { min-height: 30px; padding: 6px 14px; font-size: 12px; flex: 1; }

.mdot-empty-state {
    border: 1px dashed #cbd5e1;
    border-radius: 9px;
    background: #f8fafc;
    color: var(--ink-soft);
    padding: 22px;
    text-align: center;
}

@media (max-width: 720px) {
    .mdot-search-actions { flex-direction: column; align-items: stretch; }
    .mdot-button { width: 100%; }
}


/* ---------------- embedded / headerless mode ----------------
   Routes under /embed/... and /embedded/... hide the app chrome so
   the pages can sit inside the existing MDOT site without a duplicate
   header, blue band, or footer. */
.mdot-app-embedded {
    min-height: auto;
    display: block;
    background: transparent;
}

.mdot-app-embedded .mdot-main {
    max-width: none;
    padding: 16px 18px 28px;
}

.mdot-app-embedded .mdot-page-title {
    margin-top: 0;
}

@media (max-width: 720px) {
    .mdot-app-embedded .mdot-main { padding: 12px; }
}
