/*
    Version: 1.0.0
*/
/*
    Modernized styles for dclmasc plugin output
    Provides a simple, responsive card/grid layout for the
    existing `dclmasc_table`, `dclmasc_tablerow` and
    `dclmasc_tablecell` markup without requiring PHP changes.
*/

:root {
    --dcl-bg: #ffffff;
    --dcl-muted: #6b7280;
    --dcl-border: #e6e7ea;
    --dcl-accent: #1f6feb;
}

div.dclmasc_table {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

div.dclmasc_tablerow {
    display: flex;
    gap: 12px;
    align-items: start;
    flex-wrap: wrap;
}

div.dclmasc_tablecell {
    flex: 1 1 0;
    min-width: 0;
    padding: 10px 12px;
    background: var(--dcl-bg);
    border: 1px solid var(--dcl-border);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(16,24,40,0.02);
}

div.dclmasc_tablecell strong {
    display: block;
    margin-bottom: 6px;
    color: #111827;
    font-weight: 600;
}

/* Venue / address output — apply to common helpers */
.dclmasc-venue-address,
.dclmasc-address,
.dclmasc_location_address {
    display: block;
    color: var(--dcl-muted);
    font-size: 0.95rem;
    line-height: 1.4;
    margin-top: 4px;
}

/* Make the first table row look like a summary card */
div.dclmasc_tablerow:first-child div.dclmasc_tablecell {
    background: linear-gradient(180deg,#ffffff,#fbfdff);
    border-color: rgba(31,111,235,0.08);
}

/* Responsive two-column layout on wider screens */
@media (min-width: 720px) {
    div.dclmasc_table {
        gap: 16px;
    }
    div.dclmasc_tablerow {
        gap: 16px;
    }
    /* allow fixed-width left column when used */
    div.dclmasc_tablecell:first-child {
        flex: 0 0 180px;
    }
}

/* Small tweaks for images inside cells */
div.dclmasc_tablecell img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
}

/* Utility to highlight important inline data */
.dclmasc-value {
    color: var(--dcl-accent);
    font-weight: 600;
}

/* Lightweight reset to help older themes */
div.dclmasc_table, div.dclmasc_tablerow, div.dclmasc_tablecell { box-sizing: border-box; }

/* Support for legacy table-based outputs — make them look similar */
table.dclmasc_table {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 12px;
    margin: 0 0 12px 0;
}
table.dclmasc_table td,
table.dclmasc_table th {
    padding: 10px 12px;
    border: 1px solid var(--dcl-border);
    background: var(--dcl-bg);
    border-radius: 8px;
    vertical-align: top;
}
table.dclmasc_table th {
    text-align: left;
    font-weight: 600;
    background: linear-gradient(180deg,#ffffff,#fbfdff);
    border-color: rgba(31,111,235,0.06);
}

/* Venue address inside table rows */
.dclmasc-venue-address {
    display: inline-block;
    color: var(--dcl-muted);
    font-size: 0.95rem;
    margin-left: 6px;
}

/* Emphasise venue header rows and addresses */
table.dclmasc_table td[colspan],
table[style*="border: none"] td[colspan],
table[style*="table-layout:auto"] td[colspan] {
    /* Keep the cell in the table flow so colspan works correctly */
    display: table-cell;
    width: 100%;
    box-sizing: border-box;
    padding: 14px 16px !important;
    background: linear-gradient(90deg, rgba(31,111,235,0.03), rgba(255,255,255,0));
    border-left: 4px solid var(--dcl-accent);
    border-radius: 8px;
}

table.dclmasc_table td[colspan] strong,
table[style*="border: none"] td[colspan] strong,
table[style*="table-layout:auto"] td[colspan] strong {
    font-size: 1.05rem;
    color: #0f172a;
    font-weight: 700;
    letter-spacing: 0.2px;
}

/* Make address text slightly larger and clearer */
.dclmasc-venue-address,
table.dclmasc_table td[colspan] {
    color: var(--dcl-muted);
    font-size: 0.98rem;
}

/* Tighter spacing for the session header row following the venue header */
table.dclmasc_table tr + tr th,
table[style*="border: none"] tr + tr th {
    padding-top: 8px;
}

/* Fallback: style tables that use the old inline style attributes so users
   who still render plain <table> markup without classes will get the same look */
table[style*="border: none"],
table[style*="table-layout:auto"],
table[style*="table-layout: auto"] {
    width: 100%;
    border-collapse: separate;
    border-spacing: 12px;
    margin: 0 0 12px 0;
}
table[style*="border: none"] td,
table[style*="table-layout:auto"] td,
table[style*="table-layout: auto"] td {
    padding: 10px 12px;
    border: 1px solid var(--dcl-border) !important;
    background: var(--dcl-bg) !important;
    border-radius: 8px;
    vertical-align: top;
}
table[style*="border: none"] th,
table[style*="table-layout:auto"] th,
table[style*="table-layout: auto"] th {
    text-align: left;
    font-weight: 600;
    background: linear-gradient(180deg,#ffffff,#fbfdff) !important;
    border-color: rgba(31,111,235,0.06) !important;
}
