/* ============================================================
   YatmoDoc.Web — docs overlay
   Sits on top of v5/index.css (V5 design tokens)
   Adds: 3-column docs shell, sidebar, right TOC, code tabs,
         endpoint header, param table, callouts.
   ============================================================ */

/* -------------------------------------------------------
   Third-party Yatmo summary widgets
   The Yatmo summary / summary-text plugins inject their own HTML into these
   containers and bring their own stylesheet (summarystyle.css). V5's base
   styles (img { display: block; max-width: 100% }, p { margin: 0 0 14px })
   bleed into that DOM and break the row layout — undo here.
   ------------------------------------------------------- */
/* Travel-mode icons (next to each pill) must stay inline so they sit beside
   the time label. The category icons in the first cell are left alone so
   the plugin's own `display: block` stacks them vertically (one POI per line). */
#summarySample .imgTravel,
#summaryTextSample .imgTravel {
    display: inline-block;
    vertical-align: middle;
    max-width: none;
}

/* All other images inside the widget keep their natural width (the V5 base
   sets max-width: 100% which can clip the Yatmo logo etc.) */
#summarySample img,
#summaryTextSample img {
    max-width: none;
}

#summarySample table,
#summaryTextSample table {
    width: auto;
    border-collapse: collapse;
}

#summarySample p,
#summaryTextSample p {
    margin: 0;
}

/* Travel-time pills wrap as a whole unit (never split their inner text
   across two lines) and keep a small breathing margin on every side so
   they don't sit flush against the cell border. */
#summarySample .sumTag,
#summaryTextSample .sumTag {
    display: inline-block;
    white-space: nowrap;
    margin: 3px 5px;
}

/* -------------------------------------------------------
   Doc-site logo override
   The doc-site logo asset has a different aspect ratio than the V5
   marketing logo; bump its rendered height so it doesn't look tiny.
   ------------------------------------------------------- */
.v5-navbar .v5-logo img {
    height: 56px;
}

.v5-footer .v5-footer-logo {
    height: 48px;
    margin-bottom: 20px;
}

/* -------------------------------------------------------
   3-column shell
   ------------------------------------------------------- */
.v5-docs-shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr) 220px;
    gap: 40px;
    max-width: 1320px;
    margin: 0 auto;
    padding: 32px 24px 80px;
}

.v5-docs-main {
    min-width: 0;
    font-size: 15px;
    color: var(--v5-text);
}

.v5-docs-main h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--v5-dark);
    margin: 8px 0 12px;
    letter-spacing: -0.02em;
}

.v5-docs-main h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--v5-dark);
    margin: 36px 0 12px;
    scroll-margin-top: 80px;
}

.v5-docs-main h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--v5-dark);
    margin: 24px 0 8px;
    scroll-margin-top: 80px;
}

.v5-docs-main p {
    margin: 0 0 14px;
    line-height: 1.65;
}

.v5-docs-main ul,
.v5-docs-main ol {
    margin: 0 0 14px 22px;
    list-style: revert;
}

.v5-docs-main li {
    margin: 4px 0;
    line-height: 1.6;
}

.v5-docs-main :is(p, li, h2, h3) a {
    color: var(--v5-accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color var(--v5-transition);
}

.v5-docs-main :is(p, li, h2, h3) a:hover {
    border-bottom-color: var(--v5-accent);
}

.v5-docs-main code {
    background: var(--v5-bg-dark);
    color: var(--v5-dark);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.v5-docs-main .v5-lead {
    font-size: 17px;
    color: var(--v5-text-light);
    line-height: 1.6;
    margin-bottom: 28px;
}

/* -------------------------------------------------------
   Sidebar
   ------------------------------------------------------- */
.v5-docs-sidebar {
    position: sticky;
    top: 80px;
    align-self: start;
    max-height: calc(100vh - 96px);
    overflow-y: auto;
    padding-right: 8px;
    font-size: 14px;
}

.v5-docs-sidebar-group {
    margin-bottom: 24px;
}

.v5-docs-sidebar-group-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--v5-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
    padding-left: 10px;
}

.v5-docs-sidebar-items {
    display: flex;
    flex-direction: column;
}

.v5-docs-sidebar-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    border-radius: 6px;
    color: var(--v5-text);
    font-weight: 500;
    line-height: 1.4;
    transition: background var(--v5-transition), color var(--v5-transition);
}

.v5-docs-sidebar-item:hover {
    background: var(--v5-bg);
    color: var(--v5-accent);
}

.v5-docs-sidebar-item--active {
    background: var(--v5-accent-light);
    color: var(--v5-accent);
}

.v5-docs-sidebar-item--child {
    padding-left: 22px;
    font-weight: 400;
    font-size: 13.5px;
}

.v5-docs-sidebar-badge {
    font-size: 9.5px;
    font-weight: 700;
    background: var(--v5-amber-light);
    color: var(--v5-amber);
    padding: 2px 6px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* -------------------------------------------------------
   Right TOC
   ------------------------------------------------------- */
.v5-docs-toc {
    position: sticky;
    top: 80px;
    align-self: start;
    max-height: calc(100vh - 96px);
    overflow-y: auto;
    padding-left: 16px;
    border-left: 1px solid var(--v5-border);
    font-size: 13px;
}

.v5-docs-toc-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--v5-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
}

.v5-docs-toc-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.v5-docs-toc-item {
    color: var(--v5-text-light);
    padding: 4px 0;
    line-height: 1.4;
    border-left: 2px solid transparent;
    padding-left: 10px;
    margin-left: -12px;
    transition: color var(--v5-transition), border-color var(--v5-transition);
}

.v5-docs-toc-item--h3 {
    padding-left: 22px;
    font-size: 12.5px;
}

.v5-docs-toc-item:hover {
    color: var(--v5-accent);
}

.v5-docs-toc-item--active {
    color: var(--v5-accent);
    border-left-color: var(--v5-accent);
    font-weight: 600;
}

/* -------------------------------------------------------
   Code tabs
   ------------------------------------------------------- */
.v5-codetabs {
    margin: 16px 0 24px;
    border: 1px solid var(--v5-border);
    border-radius: var(--v5-radius-sm);
    overflow: hidden;
    background: #0F172A;
}

.v5-codetabs-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #1E293B;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding: 0 8px;
}

.v5-codetabs-tabs {
    display: flex;
    gap: 2px;
}

.v5-codetabs-tab {
    background: transparent;
    color: rgba(255,255,255,0.6);
    padding: 10px 14px;
    font-size: 12.5px;
    font-weight: 600;
    border-bottom: 2px solid transparent;
    transition: color var(--v5-transition), border-color var(--v5-transition);
}

.v5-codetabs-tab:hover {
    color: #fff;
}

.v5-codetabs-tab--active {
    color: #fff;
    border-bottom-color: var(--v5-accent);
}

.v5-codetabs-copy {
    background: transparent;
    color: rgba(255,255,255,0.6);
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 4px;
    transition: background var(--v5-transition), color var(--v5-transition);
}

.v5-codetabs-copy:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.v5-codetabs-copy--copied {
    color: var(--v5-green);
}

.v5-codetabs-panels {
    background: #0F172A;
}

.v5-codetabs-panel {
    display: none;
    margin: 0;
    padding: 16px 18px;
    color: #E2E8F0;
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    line-height: 1.55;
    overflow-x: auto;
}

.v5-codetabs-panel--active {
    display: block;
}

.v5-codetabs-panel code {
    background: transparent;
    color: inherit;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
}

/* Standalone (single-language) code block */
.v5-codeblock {
    margin: 16px 0 24px;
    background: #0F172A;
    color: #E2E8F0;
    padding: 16px 18px;
    border-radius: var(--v5-radius-sm);
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    line-height: 1.55;
    overflow-x: auto;
}

/* -------------------------------------------------------
   Endpoint header
   ------------------------------------------------------- */
.v5-endpoint {
    background: var(--v5-bg);
    border: 1px solid var(--v5-border);
    border-radius: var(--v5-radius);
    padding: 16px 18px;
    margin: 18px 0 24px;
}

.v5-endpoint-line {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.v5-endpoint-method {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    letter-spacing: 0.04em;
}

.v5-endpoint-method--GET    { background: #DBEAFE; color: #1D4ED8; }
.v5-endpoint-method--POST   { background: #DCFCE7; color: #15803D; }
.v5-endpoint-method--PUT    { background: #FEF3C7; color: #B45309; }
.v5-endpoint-method--DELETE { background: #FEE2E2; color: #B91C1C; }
.v5-endpoint-method--PATCH  { background: #FEF3C7; color: #B45309; }

.v5-endpoint-path {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 14px;
    font-weight: 600;
    color: var(--v5-dark);
}

.v5-endpoint-pill {
    font-size: 11.5px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 10px;
    background: white;
    border: 1px solid var(--v5-border);
    color: var(--v5-text-light);
}

.v5-endpoint-description {
    color: var(--v5-text-light);
    font-size: 14px;
    margin: 0;
}

/* -------------------------------------------------------
   Param table
   ------------------------------------------------------- */
.v5-param-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    margin: 12px 0 24px;
}

.v5-param-table th {
    text-align: left;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--v5-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 8px 10px;
    border-bottom: 1px solid var(--v5-border);
}

.v5-param-table td {
    padding: 10px 10px;
    border-bottom: 1px solid var(--v5-border);
    vertical-align: top;
}

.v5-param-table tr:last-child td {
    border-bottom: none;
}

.v5-param-name {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-weight: 600;
    color: var(--v5-dark);
}

.v5-param-required {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 700;
    color: #B91C1C;
    margin-left: 6px;
}

.v5-param-type {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    color: var(--v5-text-light);
}

.v5-param-in {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 600;
    color: var(--v5-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 6px;
    background: var(--v5-bg);
    border-radius: 3px;
}

/* -------------------------------------------------------
   Response shape
   ------------------------------------------------------- */
.v5-response {
    margin: 16px 0 24px;
}

.v5-response-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.v5-response-status {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    background: #DCFCE7;
    color: #15803D;
}

.v5-response-status--error {
    background: #FEE2E2;
    color: #B91C1C;
}

.v5-response-media {
    font-size: 12.5px;
    color: var(--v5-text-light);
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* -------------------------------------------------------
   Callouts
   ------------------------------------------------------- */
.v5-callout {
    border-left: 3px solid var(--v5-accent);
    background: var(--v5-accent-light);
    padding: 12px 16px;
    border-radius: var(--v5-radius-sm);
    margin: 16px 0;
    font-size: 14px;
}

.v5-callout-title {
    font-weight: 700;
    color: var(--v5-dark);
    margin-bottom: 4px;
}

.v5-callout-body {
    color: var(--v5-text);
}

.v5-callout--warning {
    border-color: var(--v5-amber);
    background: var(--v5-amber-light);
}

.v5-callout--tip {
    border-color: var(--v5-green);
    background: var(--v5-green-light);
}

/* -------------------------------------------------------
   Side-by-side example rows (shortcode + screenshot)
   ------------------------------------------------------- */
.v5-example-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: start;
    padding: 18px 0;
    border-top: 1px solid var(--v5-border);
}

.v5-example-row:first-of-type {
    border-top: none;
}

.v5-example-row pre,
.v5-example-row .v5-codeblock {
    margin: 0;
}

.v5-example-row img {
    border: 1px solid var(--v5-border);
    border-radius: var(--v5-radius-sm);
}

@media (max-width: 700px) {
    .v5-example-row {
        grid-template-columns: 1fr;
    }
}

/* Demo iframes inside plugin pages */
.v5-demo-iframe {
    width: 100%;
    border: 1px solid var(--v5-border);
    border-radius: var(--v5-radius-sm);
    background: var(--v5-bg);
}

/* Coverage table (countries & languages) */
.v5-coverage-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0 24px;
    font-size: 14px;
}

.v5-coverage-table th,
.v5-coverage-table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--v5-border);
}

.v5-coverage-table th {
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--v5-text-muted);
    font-weight: 700;
}

.v5-coverage-table td:first-child {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-weight: 600;
    color: var(--v5-dark);
    width: 80px;
}

/* -------------------------------------------------------
   Audience picker (landing)
   ------------------------------------------------------- */
.v5-audience {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin: 32px 0;
}

.v5-audience-card {
    display: block;
    background: white;
    border: 1px solid var(--v5-border);
    border-radius: var(--v5-radius);
    padding: 28px 24px;
    color: var(--v5-text);
    overflow: hidden;
    transition: border-color var(--v5-transition), transform var(--v5-transition), box-shadow var(--v5-transition);
}

.v5-audience-card:hover {
    color: var(--v5-text);
    border-color: var(--v5-accent);
    transform: translateY(-2px);
    box-shadow: var(--v5-shadow-md);
}

.v5-audience-card h3 {
    margin-top: 0;
}

.v5-audience-card-eyebrow {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--v5-accent);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}

/* -------------------------------------------------------
   Responsive
   ------------------------------------------------------- */
@media (max-width: 1100px) {
    .v5-docs-shell {
        grid-template-columns: 240px minmax(0, 1fr);
    }
    .v5-docs-toc {
        display: none;
    }
}

@media (max-width: 768px) {
    .v5-docs-shell {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 16px;
    }
    .v5-docs-sidebar {
        position: static;
        max-height: none;
        order: 2;
        margin-top: 32px;
        border-top: 1px solid var(--v5-border);
        padding-top: 24px;
    }
    .v5-docs-main {
        order: 1;
    }
    .v5-audience {
        grid-template-columns: 1fr;
    }
}
