/**
 * Generated Dashboard Styles
 * 2-column sectioned grid layout
 */

/* ========================================
   Hide Astra Default Header & Chrome
   The dashboard uses header-briefing.php instead
   ======================================== */

.briefing-page .ast-above-header-wrap,
.briefing-page .ast-below-header-wrap,
.briefing-page .ast-main-header-wrap,
.briefing-page #ast-desktop-header,
.briefing-page #ast-mobile-header,
.briefing-page .ast-desktop-header-content,
.briefing-page .ast-mobile-header-content,
.briefing-page .main-header-bar,
.briefing-page .ast-primary-header-bar,
.briefing-page .ast-header-break-point .ast-mobile-header-wrap,
.briefing-page .site-header:not(.briefing-header),
.briefing-page header:not(.briefing-header):not(#masthead),
.briefing-page .ast-builder-layout-element,
.briefing-page [data-section="section-header-builder"],
.briefing-page .ast-hfb-header,
.briefing-page .site-primary-header-wrap {
    display: none !important;
}

/* ========================================
   Briefing Header — dashboard-specific overrides
   Base styles are in briefing.css
   ======================================== */

/* Auto-hide header: transition is controlled by JS
   (1:1 tracking on scroll-down, smooth ease on scroll-up) */

/* ========================================
   Page Body Offset for Fixed Header
   ======================================== */

.dashboard-generated {
    padding-top: 60px !important;
    margin-top: 0 !important;
}

.admin-bar .dashboard-generated {
    padding-top: 60px !important;
}

/* Zero out Astra theme spacing on wrappers ABOVE .dashboard-generated */
.briefing-page .site-content,
.briefing-page #primary.content-area {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* ========================================
   Section Header Row (with Customize button)
   ======================================== */

.dg-section-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    grid-column: 1 / -1;
    padding: 24px 0 8px;
    border-bottom: 1px solid var(--color-border, #e5e7eb);
    margin-bottom: 0;
}

.dg-section-header-row .dg-section-header {
    padding: 0;
    border-bottom: none;
    margin-bottom: 0;
}

.dg-customize-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: none;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: var(--radius-button, 6px);
    color: var(--color-text-tertiary, #9ca3af);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.dg-customize-btn:hover {
    border-color: var(--color-text-tertiary, #9ca3af);
    color: var(--color-text-secondary, #6b7280);
}

.dg-customize-btn:focus,
.dg-customize-btn:active {
    color: var(--color-text-tertiary, #9ca3af);
}

.dg-customize-btn.active {
    border-color: var(--color-primary, #046BD2);
    color: var(--color-primary, #046BD2);
}

.dg-customize-btn svg {
    flex-shrink: 0;
}

/* ========================================
   Customize Panel (compact dropdown, not full-screen)
   ======================================== */

.dg-customize-panel {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    z-index: 999;
    background: var(--color-surface, #fff);
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 16px 24px;
}

.admin-bar .dg-customize-panel {
    top: 92px;
}

@media screen and (max-width: 782px) {
    .admin-bar .dg-customize-panel {
        top: 106px;
    }
}

/* Backdrop overlay for click-outside-to-close */
.dg-customize-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 998;
    background: rgba(0, 0, 0, 0.15);
}

.dg-customize-backdrop.show {
    display: block;
}

.dg-customize-inner {
    max-width: 1320px;
    margin: 0 auto;
}


.dg-customize-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280 !important;
    margin: 0 0 10px;
}

.dg-customize-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.dg-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border: 1.5px solid var(--color-border);
    border-radius: 20px;
    background: var(--color-surface) !important;
    color: #4b5563 !important;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.dg-chip:hover {
    border-color: var(--color-text-tertiary);
    color: #374151 !important;
}

.dg-chip:focus,
.dg-chip:active {
    color: #4b5563 !important;
}

.dg-chip.selected {
    border-color: var(--color-primary);
    background: rgba(4, 107, 210, 0.06) !important;
    color: #046BD2 !important;
}

.dg-customize-actions {
    display: flex;
    align-items: center;
}

.dg-change-location {
    font-size: 13px;
    color: var(--color-text-secondary);
    text-decoration: none;
}

.dg-change-location:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

/* ========================================
   Sections Container
   ======================================== */

.dg-sections {
    max-width: 1320px;
    margin: 0 auto;
    padding: 4px 24px 48px;
}

/* ========================================
   Section
   ======================================== */

.dg-section {
    margin-bottom: 32px;
}

.dg-section-header {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-tertiary);
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border);
}

/* ========================================
   Dashboard Grid Override
   Uses .chart-grid from grid-view.css with 2-column default
   ======================================== */

.dg-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: var(--grid-gap, 24px);
}

.dg-grid .chart-cell {
    min-width: 0 !important; /* Override grid-view.css 375px min for narrower 1100px container */
}

.dg-grid .chart-cell .chart-container {
    width: 100%;
    height: 100%;
}

/* Section error message */
.dg-section-error {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--color-text-tertiary);
    font-size: 14px;
    padding: 24px;
}

/* ========================================
   Explore CTA
   ======================================== */

.dg-explore-cta {
    text-align: center;
    padding: 32px 24px;
    max-width: 1320px;
    margin: 0 auto;
}

.dg-explore-cta p {
    font-size: 14px;
    color: var(--color-text-tertiary);
    margin: 0 0 8px;
}

.dg-explore-link {
    display: inline-flex;
    align-items: center;
    padding: 10px 24px;
    border: 1.5px solid var(--color-border);
    border-radius: 10px;
    color: var(--color-text);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.dg-explore-link:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 900px) {
    .dg-grid {
        gap: 12px !important;
    }

    .dg-sections {
        padding: 16px 16px 40px;
    }
}

@media (max-width: 700px) {
    /* Switch to single column at 700px (matches explore page) */
    .dg-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .dg-sections {
        padding: 12px 12px 32px;
    }

    /* Customize panel: compact on mobile, not full-screen */
    .dg-customize-panel {
        padding: 12px 16px;
    }

    .dg-customize-chips {
        gap: 6px;
    }

    .dg-chip {
        font-size: 12px;
        padding: 5px 12px;
    }

    /* Section header row: tighter spacing on mobile */
    .dg-section-header-row {
        padding: 16px 0 6px;
    }

    .dg-customize-btn {
        font-size: 11px;
        padding: 4px 10px;
    }
}

/* ========================================
   Sign-in Prompt (subtitle inside first section header)
   ======================================== */

.dg-signin-prompt {
    display: block;
    font-size: 11px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: var(--color-text-tertiary, #8E8EA0);
    line-height: 1.3;
    margin-top: 2px;
}


/* ========================================
   Pinned Section
   ======================================== */

.dg-section-pinned .dg-section-header .fa-thumbtack {
    color: var(--color-primary, #046BD2);
}

/* ========================================
   City Front Page (/dashboard/{city}/) — server-rendered head,
   briefing sentences, and the "more data" footer link hub.
   ======================================== */

.dg-city-head {
    max-width: 1320px;
    margin: 0 auto;
    padding: 8px 24px 0;
}

.dg-city-title {
    margin: 0 0 10px;
    font-size: 26px;
    font-weight: 700;
    color: var(--color-text-primary, #1a1a1a);
    letter-spacing: -0.01em;
}

/* Briefing band — the automated commentary as a card of icon+sentence chips,
   sitting between the H1 and the chart grid. Same card language as the chart
   cells so the text reads as data, not prose. */
.dg-briefing-band {
    max-width: 1320px;
    margin: 0 auto 20px;
    padding: 16px 20px;
    background: var(--color-surface, #fff);
    border: 1px solid var(--color-border, #e2e6ea);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.dg-briefing-title {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-tertiary, #6b7280);
}

.dg-briefing-chips {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 8px 24px;
}

.dg-briefing-chip {
    display: flex;
    align-items: baseline;
    gap: 8px;
    text-decoration: none;
    font-size: 15px;
    line-height: 1.45;
    color: var(--color-text-primary, #1a1a1a);
    border-radius: 6px;
    padding: 2px 4px;
    transition: background 0.15s ease;
}

.dg-briefing-chip:hover {
    background: var(--color-surface-alt, #eef2f6);
    color: var(--color-primary, #046BD2);
}

.dg-briefing-icon {
    flex: 0 0 auto;
    font-size: 16px;
}

.dg-briefing-text {
    min-width: 0;
}

/* Footer link hub */
.dg-city-links {
    max-width: 1320px;
    margin: 24px auto 0;
    padding: 20px 24px 0;
    border-top: 1px solid var(--color-border, #e2e6ea);
}

.dg-city-links-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-tertiary, #6b7280);
    margin: 0 0 12px;
}

.dg-city-links-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.dg-city-link {
    display: inline-block;
    padding: 6px 12px;
    background: var(--color-surface-alt, #eef2f6);
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    color: var(--color-primary, #046BD2);
    transition: background 0.2s ease;
}

.dg-city-link:hover {
    background: var(--color-border, #dbe2ea);
}

@media (max-width: 768px) {
    .dg-briefing-band { margin-left: 12px; margin-right: 12px; padding: 12px 14px; }
    .dg-briefing-chips { grid-template-columns: 1fr; gap: 6px; }
    .dg-city-title { font-size: 22px; }
}
