/* Open Graph Generator , tool-specific styles. Composes shared
 * tools.css primitives (.tool-form-card, .mode-toggle, .text-input,
 * .primary-btn, .ghost-btn, .results-region, .quota-chip, .history-*,
 * .toast, .errors-region). Only overrides + tool-specific widgets
 * live here. */

/* ---------------------------------------------------------------
 * Form header: title + subtitle on the left, primary actions on
 * the right. Keeps "Save and share" above the fold so users don't
 * have to scroll past every field to commit their work.
 * --------------------------------------------------------------- */
.ogg-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 4px;
}
.ogg-form-header-title {
    flex: 1 1 auto;
    min-width: 0;
}
.ogg-form-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--ink-800);
}
.ogg-form-subtitle {
    margin: 3px 0 0;
    font-size: 13px;
    color: var(--ink-500);
}
.ogg-form-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex: 0 0 auto;
}

/* ---------------------------------------------------------------
 * Share bar: appears below the form header after Save and persists
 * (with a Copy share URL button) so users can copy the link
 * anytime, not just for the few seconds a toast would live.
 * --------------------------------------------------------------- */
.ogg-share-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0 4px;
    padding: 10px 14px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 8px;
}
.ogg-share-bar[hidden] {
    display: none;
}
.ogg-share-label {
    font-size: 12px;
    font-weight: 700;
    color: #047857;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex: 0 0 auto;
}
.ogg-share-url {
    flex: 1 1 auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px;
    color: #064e3b;
    background: rgba(255, 255, 255, 0.65);
    padding: 5px 9px;
    border-radius: 4px;
    overflow-x: auto;
    white-space: nowrap;
    text-overflow: ellipsis;
    cursor: text;
    user-select: all;
}
.ogg-share-copy-btn {
    flex: 0 0 auto;
}
.ogg-share-copy-btn.is-success {
    background: #10b981;
}
@media (max-width: 700px) {
    .ogg-share-bar {
        flex-wrap: wrap;
    }
    .ogg-share-url {
        flex: 1 1 100%;
        order: 3;
    }
}

/* ---------------------------------------------------------------
 * URL row
 * --------------------------------------------------------------- */
.ogg-url-row {
    margin-top: 12px;
    padding: 12px 14px;
    background: var(--ink-50);
    border-radius: 8px;
}
.ogg-url-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-700);
    margin-bottom: 8px;
}
.ogg-url-controls {
    display: flex;
    gap: 10px;
}
.ogg-url-controls .text-input {
    flex: 1 1 auto;
}
.ogg-url-help {
    margin: 8px 0 0;
    color: var(--ink-500);
    font-size: 13px;
}

/* ---------------------------------------------------------------
 * Form grid. Two-column when fields are .ogg-field-half, single-
 * column otherwise.
 * --------------------------------------------------------------- */
.ogg-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 14px;
}
.ogg-field {
    grid-column: span 2;
    display: flex;
    flex-direction: column;
}
.ogg-field-half {
    grid-column: span 1;
}
.ogg-field .text-input {
    /* Override the shared 1 1 320px flex-basis so the input doesn't
       blow up to 320 px tall inside the column-flex parent (see
       [[text-input-flex-basis-height]]). */
    flex: 0 0 auto;
}
.ogg-field-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-700);
    margin-bottom: 6px;
}
.ogg-counter {
    font-size: 11px;
    font-weight: 500;
    color: var(--ink-500);
    background: var(--ink-100);
    padding: 2px 7px;
    border-radius: 99px;
    transition: background 0.15s, color 0.15s;
}
.ogg-counter.is-warn   { background: #fef3c7; color: #92400e; }
.ogg-counter.is-danger { background: #fee2e2; color: #991b1b; }
.ogg-counter-helper {
    font-weight: 400;
    color: var(--ink-400);
    font-size: 12px;
}

.ogg-verify-btn {
    margin-left: auto;
    font-size: 12px;
    color: var(--brand-600);
    background: none;
    border: 1px solid var(--brand-200);
    padding: 3px 10px;
    border-radius: 99px;
    cursor: pointer;
    font-weight: 500;
}
.ogg-verify-btn:hover {
    background: var(--brand-50);
}
.ogg-verify-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ogg-image-status {
    margin-top: 6px;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 6px;
    background: var(--ink-100);
    color: var(--ink-700);
}
.ogg-image-status.is-loading { background: var(--ink-100); }
.ogg-image-status.is-success { background: #d1fae5; color: #065f46; }
.ogg-image-status.is-warn    { background: #fef3c7; color: #92400e; }
.ogg-image-status.is-danger  { background: #fee2e2; color: #991b1b; }
.ogg-img-warn {
    background: #fef3c7;
    color: #92400e;
    padding: 1px 6px;
    border-radius: 99px;
    font-weight: 600;
}

/* ---------------------------------------------------------------
 * Collapsible details sections (Twitter + Extras)
 * --------------------------------------------------------------- */
.ogg-section {
    margin-top: 10px;
    border: 1px solid var(--ink-100);
    border-radius: 8px;
    padding: 0 14px;
    background: var(--paper, #fff);
}
.ogg-section[open] {
    padding-bottom: 12px;
}
.ogg-section > summary {
    padding: 9px 0;
    cursor: pointer;
    font-weight: 600;
    color: var(--ink-700);
    font-size: 13px;
}
.ogg-section > summary:focus {
    outline: 2px solid var(--brand-200);
    outline-offset: 2px;
    border-radius: 4px;
}


/* ---------------------------------------------------------------
 * Results region: card-stack layout (not a results-table). Per
 * [[results-region-card-stack-inner-padding]], the shared
 * .results-region has NO inner padding by design; tools that render
 * a card-stack inside MUST add their own padding to the content
 * wrapper or the inner sections stick to the outer border.
 * --------------------------------------------------------------- */
.ogg-result-body {
    padding: 18px 22px 4px;
}
.ogg-result-body > section:last-child {
    margin-bottom: 18px;
}

.ogg-section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--ink-800);
    margin: 0 0 10px;
}

.ogg-issues-pill {
    display: flex;
    gap: 6px;
    align-items: center;
}
.ogg-pill {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 99px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.ogg-pill-high { background: #fee2e2; color: #991b1b; }
.ogg-pill-warn { background: #fef3c7; color: #92400e; }
.ogg-pill-info { background: #dbeafe; color: #1e3a8a; }
.ogg-pill-ok   { background: #d1fae5; color: #065f46; }

.ogg-issues-section {
    margin-bottom: 22px;
}
.ogg-issues-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.ogg-issue {
    display: grid;
    grid-template-columns: 60px 1fr;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: background 0.12s;
}
.ogg-issue:hover {
    background: var(--ink-50);
}
.ogg-issue-empty {
    cursor: default;
    color: var(--ink-500);
    background: #f0fdf4;
    grid-template-columns: 1fr;
}
.ogg-issue-sev {
    font-size: 10px;
    font-weight: 700;
    text-align: center;
    padding: 3px 0;
    border-radius: 4px;
    text-transform: uppercase;
}
.ogg-issue-high .ogg-issue-sev { background: #fee2e2; color: #991b1b; }
.ogg-issue-warn .ogg-issue-sev { background: #fef3c7; color: #92400e; }
.ogg-issue-info .ogg-issue-sev { background: #dbeafe; color: #1e3a8a; }
.ogg-issue-msg {
    font-size: 13px;
    color: var(--ink-700);
}

/* ---------------------------------------------------------------
 * Multi-platform previews grid
 * --------------------------------------------------------------- */
.ogg-previews-section {
    margin-bottom: 22px;
}
.ogg-previews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}
.ogg-card {
    border: 1px solid var(--ink-100);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.ogg-card-header {
    background: var(--ink-50);
    padding: 6px 12px;
    border-bottom: 1px solid var(--ink-100);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ink-500);
}
.ogg-card-name { color: var(--ink-700); }
.ogg-card-body {
    flex: 1 0 auto;
}
.ogg-card-meta {
    padding: 10px 14px;
}

/* Image wrappers */
.ogg-img-wrap {
    background: var(--ink-100);
    position: relative;
    overflow: hidden;
}
.ogg-img-wrap.ogg-img-wide {
    aspect-ratio: 1.91 / 1;
}
.ogg-img-wrap.ogg-img-square {
    aspect-ratio: 1 / 1;
    width: 80px;
    flex: 0 0 80px;
    border-radius: 4px;
}
.ogg-img-wrap.ogg-img-wa {
    width: 65px;
    flex: 0 0 65px;
    aspect-ratio: 1 / 1;
    border-radius: 4px;
}
.ogg-img-wrap .ogg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.ogg-img-fallback {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    background: var(--ink-100);
    color: var(--ink-400);
    font-size: 12px;
}
.ogg-img-broken .ogg-img { display: none; }
.ogg-img-broken .ogg-img-fallback { display: flex; }
.ogg-img-empty {
    aspect-ratio: 1.91 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-400);
    background: linear-gradient(135deg, var(--ink-100) 0%, var(--ink-50) 100%);
}
.ogg-img-empty-label {
    font-size: 12px;
    color: var(--ink-400);
    font-style: italic;
}

/* Facebook */
.ogg-card-facebook {
    border-color: #d3d6da;
}
.ogg-fb-domain {
    font-size: 11px;
    text-transform: uppercase;
    color: #65676b;
    margin-bottom: 4px;
    letter-spacing: 0.02em;
}
.ogg-fb-title {
    font-size: 16px;
    font-weight: 600;
    color: #050505;
    margin-bottom: 4px;
    line-height: 1.3;
}
.ogg-fb-desc {
    font-size: 13px;
    color: #65676b;
    line-height: 1.4;
}

/* Twitter / X */
.ogg-card-twitter {
    border-color: #cfd9de;
}
.ogg-card-twitter--small .ogg-tw-row {
    display: flex;
    padding: 12px;
    gap: 12px;
    align-items: stretch;
}
.ogg-card-twitter--small .ogg-card-meta {
    padding: 0;
    flex: 1 1 auto;
}
.ogg-tw-domain {
    font-size: 12px;
    color: #536471;
    margin-bottom: 3px;
}
.ogg-tw-title {
    font-size: 15px;
    font-weight: 600;
    color: #0f1419;
    line-height: 1.3;
    margin-bottom: 3px;
}
.ogg-tw-desc {
    font-size: 13px;
    color: #536471;
    line-height: 1.4;
}

/* LinkedIn */
.ogg-card-linkedin {
    border-color: #c7d0d5;
}
.ogg-li-title {
    font-size: 15px;
    font-weight: 700;
    color: #000;
    line-height: 1.3;
    margin-bottom: 4px;
}
.ogg-li-desc {
    font-size: 13px;
    color: #5f6b7a;
    line-height: 1.4;
    margin-bottom: 6px;
}
.ogg-li-domain {
    font-size: 12px;
    color: #80878f;
}

/* Discord */
.ogg-card-discord {
    border-color: #36393f;
    background: #2f3136;
    color: #dcddde;
}
.ogg-card-discord .ogg-card-header {
    background: #292b2f;
    color: #b9bbbe;
    border-bottom-color: #36393f;
}
.ogg-card-discord .ogg-card-name { color: #dcddde; }
.ogg-dc-row {
    display: flex;
    padding: 12px;
    gap: 0;
}
.ogg-dc-bar {
    width: 4px;
    background: #5865f2;
    border-radius: 4px 0 0 4px;
    flex: 0 0 4px;
}
.ogg-dc-content {
    flex: 1 1 auto;
    background: #2f3136;
    padding: 8px 12px;
}
.ogg-dc-site {
    font-size: 12px;
    color: #b9bbbe;
    margin-bottom: 3px;
}
.ogg-dc-title {
    font-size: 15px;
    font-weight: 600;
    color: #00aff4;
    line-height: 1.3;
    margin-bottom: 3px;
}
.ogg-dc-desc {
    font-size: 13px;
    color: #dcddde;
    line-height: 1.4;
    margin-bottom: 8px;
}
.ogg-dc-img.ogg-img-wrap {
    margin-top: 8px;
    border-radius: 4px;
}

/* Slack */
.ogg-card-slack {
    border-color: #e1e1e1;
}
.ogg-sl-row {
    display: flex;
    padding: 12px;
}
.ogg-sl-bar {
    width: 4px;
    background: #b1b1b1;
    border-radius: 4px;
    flex: 0 0 4px;
}
.ogg-sl-content {
    flex: 1 1 auto;
    padding-left: 12px;
}
.ogg-sl-site {
    font-size: 12px;
    color: #616061;
    margin-bottom: 3px;
}
.ogg-sl-title {
    font-size: 15px;
    font-weight: 700;
    color: #1264a3;
    line-height: 1.3;
    margin-bottom: 3px;
}
.ogg-sl-desc {
    font-size: 13px;
    color: #1d1c1d;
    line-height: 1.4;
    margin-bottom: 8px;
}
.ogg-sl-img.ogg-img-wrap {
    margin-top: 8px;
    border-radius: 4px;
}

/* WhatsApp */
.ogg-card-whatsapp {
    border-color: #c5d2c8;
    background: #ece5dd;
}
.ogg-wa-bubble {
    margin: 12px;
    background: #d9fdd3;
    border-radius: 8px;
    padding: 8px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.ogg-wa-meta {
    flex: 1 1 auto;
}
.ogg-wa-title {
    font-size: 13px;
    font-weight: 600;
    color: #111b21;
    line-height: 1.3;
    margin-bottom: 3px;
}
.ogg-wa-desc {
    font-size: 12px;
    color: #54656f;
    line-height: 1.4;
    margin-bottom: 3px;
}
.ogg-wa-url {
    font-size: 11px;
    color: #027eb5;
    text-transform: lowercase;
}

/* ---------------------------------------------------------------
 * Output panel
 * --------------------------------------------------------------- */
.ogg-output-section {
    margin-bottom: 12px;
}
.ogg-output-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}
.ogg-output-toggles {
    display: flex;
    align-items: center;
    gap: 12px;
}
.ogg-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--ink-700);
    cursor: pointer;
}
.ogg-toggle input {
    margin: 0;
}
.ogg-output-pre {
    background: #1e1e1e;
    color: #d4d4d4;
    border-radius: 6px;
    padding: 14px 16px;
    overflow-x: auto;
    margin: 0 0 8px;
    max-height: 360px;
}
.ogg-output-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}
.ogg-output-hint {
    margin: 0;
    font-size: 12px;
    color: var(--ink-500);
}
.ogg-output-hint a {
    color: var(--brand-600);
}

/* ---------------------------------------------------------------
 * History row , reuses shared .history-item shape. Inline X delete
 * sibling needs a wee bit of styling because we have it as a
 * sibling of the li in our markup (matches existing tools).
 * --------------------------------------------------------------- */
.history-list {
    position: relative;
}
.history-item-delete {
    position: absolute;
    right: 14px;
    opacity: 0;
    transition: opacity 0.15s;
}
.history-item:hover + .history-item-delete,
.history-item-delete:hover,
.history-item-delete:focus {
    opacity: 1;
}

/* ---------------------------------------------------------------
 * Narrow viewport: collapse the two-column grid.
 * --------------------------------------------------------------- */
@media (max-width: 700px) {
    .ogg-form-grid {
        grid-template-columns: 1fr;
    }
    .ogg-field-half {
        grid-column: span 1;
    }
    .ogg-result-body {
        padding: 14px 16px 4px;
    }
    .ogg-result-body > section:last-child {
        margin-bottom: 14px;
    }
}
