/* Restore image fixes — site-wide. Prevent distortion on recovered/remapped photos. */

/* Content images: cover-fit so remapped photos with differing aspect ratios
   are never stretched or geometrically distorted. */
img.wp-post-image,
img.attachment-full,
img.attachment-large,
img.attachment-medium,
img.attachment-medium_large,
img.attachment-thumbnail,
img.img-responsive,
.elementor-widget-image img,
.tpg-post-holder img,
article img,
.post img {
    object-fit: cover;
    object-position: center center;
    max-width: 100%;
    height: auto;
}

/* Cap very tall banners/sliders so a portrait fallback never balloons the layout. */
img.attachment-full[width="1200"][height="400"],
img.size-full[width="1200"][height="400"] {
    width: 100%;
    height: auto;
    max-height: 460px;
    object-fit: cover;
}

/* Logo / brand marks must keep natural aspect — never cover-crop. */
img.custom-logo,
.site-logo img,
.logo img,
img[src*="logo"],
img[src*="cropped-ton-logo"] {
    object-fit: contain !important;
    height: auto;
}

/* Square thumbnail tiles stay square and crop cleanly. */
img[width="800"][height="800"],
img[width="600"][height="600"],
img[width="400"][height="400"],
img[width="300"][height="300"] {
    object-fit: cover;
    aspect-ratio: 1 / 1;
    height: auto;
}

/* Recovered full-size banner photos are only ~500px wide in the archive.
   Cap their rendered width so they are never upscaled beyond ~1.3x (no soft
   stretching); centre them within the column instead of ballooning. */
.entry-content img.attachment-full.size-full,
.elementor-widget-image .attachment-full.size-full,
.post img.attachment-full.size-full {
    max-width: min(100%, 650px);
    height: auto;
    display: block;
    margin-left: auto;
    margin-right: auto;
    object-fit: cover;
}

/* De-linked dynamic targets render as inert text, not broken links. */
.dead-link { color: inherit; text-decoration: none; cursor: default; }
a[data-inert] { cursor: default; }
