/* TGL Embed — Instagram + Facebook iframe embed shell.
 *
 * The server emits either:
 *   - <div.tgl-embed> > <iframe class="tgl-embed__iframe">
 *   - <div.tgl-embed data-consent-required> > <div.tgl-embed__placeholder>
 *
 * Both flavours use the same outer wrapper geometry so the page layout
 * stays stable when the placeholder swaps to the iframe.
 *
 * Override the theme's `.wp-block-embed__wrapper` 16:9 rule for OUR
 * provider only — that rule is right for YouTube/Vimeo (fixed video
 * aspect), but Instagram + Facebook are content-sized.
 */

.wp-block-embed.is-provider-embed-handler .wp-block-embed__wrapper,
.wp-block-embed.wp-block-embed-embed-handler .wp-block-embed__wrapper {
    aspect-ratio: auto;
    overflow: visible;
    border-radius: 0;
    margin: 0;
    height: auto;
    background: transparent;
    display: flex;
    justify-content: center;
}

.tgl-embed {
    max-width: 540px;
    width: 100%;
    margin: 1.5em auto;
    position: relative;
    display: block;
}

/* The iframe from Meta's own /embed/ endpoint. IG's returns ~600-700px
 * of content, so start at 700 and let it grow via postMessage if
 * possible. FB's iframe reports its own height too. */
.tgl-embed__iframe {
    display: block;
    width: 100%;
    max-width: 540px;
    margin: 0 auto;
    border: 0;
    background: transparent;
    border-radius: 24px;
}

/* Placeholder — on-brand, matches the newsletter block feel. */
.tgl-embed__placeholder {
    background: #EAE0DE;
    border-radius: 24px;
    padding: 2rem 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    min-height: 300px;
    box-sizing: border-box;
}
.tgl-embed__icon {
    font-size: 2.5rem;
    line-height: 1;
}
.tgl-embed__title {
    font-family: 'Libre Franklin', system-ui, sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    color: #122806;
    font-size: 1rem;
    margin: 0;
}
.tgl-embed__meta {
    font-family: 'Crimson Pro', Georgia, serif;
    font-size: 0.95rem;
    color: #122806;
    margin: 0;
    word-break: break-word;
    max-width: 100%;
}
.tgl-embed__meta a {
    color: #122806;
    text-decoration: underline;
    text-underline-offset: 0.15em;
}
.tgl-embed__meta a:hover { text-decoration: none; }

.tgl-embed__load {
    background: #122806;
    color: #fff;
    border: 0;
    border-radius: 24px;
    padding: 0.55rem 1.25rem;
    font-family: 'Libre Franklin', system-ui, sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.15s ease;
}
.tgl-embed__load:hover { color: #CFD877; }
.tgl-embed__load:focus-visible {
    outline: 2px solid #CFD877;
    outline-offset: 2px;
}

.tgl-embed__consent-note {
    font-family: 'Open Sans', sans-serif;
    font-size: 0.75rem;
    color: #122806;
    margin: 0;
    max-width: 32ch;
}
