/* RN Soft UI v0.1.1
 * Conservative rounded-corner layer for Root-Nation / Newspaper.
 * Only active when <body> has the rn-soft-ui class.
 */

body.rn-soft-ui {
    --rn-radius-card: 8px;
    --rn-radius-image: 8px;
    --rn-radius-small: 5px;
    --rn-radius-button: 4px;
}

/* -------------------------------------------------------------------------
 * ARTICLE / MODULE CARDS
 * Keep this intentionally narrow. Do NOT round whole td_block_wrap wrappers:
 * Newspaper block titles often sit on their edges and can be clipped.
 * ---------------------------------------------------------------------- */
body.rn-soft-ui .td_module_wrap,
body.rn-soft-ui .td_module_wrap .td-module-container,
body.rn-soft-ui .tdb_module_loop .td-module-container {
    border-radius: var(--rn-radius-card);
}

/* Cards that use a background on the full module need clipping so the
 * thumbnail + text background share the same outer shape. */
body.rn-soft-ui .td_module_wrap:has(.td-module-thumb),
body.rn-soft-ui .tdb_module_loop .td-module-container:has(.td-module-thumb) {
    overflow: hidden;
}

/* -------------------------------------------------------------------------
 * THUMBNAILS / CONTENT IMAGES
 * ---------------------------------------------------------------------- */
body.rn-soft-ui .td-module-thumb,
body.rn-soft-ui .td-module-thumb > a,
body.rn-soft-ui .td-module-thumb img,
body.rn-soft-ui img.entry-thumb,
body.rn-soft-ui .entry-thumb img,
body.rn-soft-ui .td-post-featured-image,
body.rn-soft-ui .td-post-featured-image img,
body.rn-soft-ui .td-post-content .wp-caption,
body.rn-soft-ui .td-post-content .wp-caption img,
body.rn-soft-ui .td-post-content figure,
body.rn-soft-ui .td-post-content figure > img,
body.rn-soft-ui .td-post-content > p > img,
body.rn-soft-ui .wp-block-image img,
body.rn-soft-ui .wp-block-gallery img,
body.rn-soft-ui .wp-block-media-text img {
    border-radius: var(--rn-radius-image);
}

body.rn-soft-ui .td-module-thumb,
body.rn-soft-ui .td-module-thumb > a,
body.rn-soft-ui .td-post-featured-image,
body.rn-soft-ui .td-post-content .wp-caption,
body.rn-soft-ui .td-post-content figure,
body.rn-soft-ui .wp-block-image {
    overflow: hidden;
}

/* -------------------------------------------------------------------------
 * VIDEO / EMBEDS
 * Only known content wrappers — never every iframe globally.
 * ---------------------------------------------------------------------- */
body.rn-soft-ui .td_video_playlist_video,
body.rn-soft-ui .td-video-playlist-class,
body.rn-soft-ui .td_block_video_youtube,
body.rn-soft-ui .wp-block-embed-youtube,
body.rn-soft-ui .wp-block-embed-vimeo,
body.rn-soft-ui .wp-video,
body.rn-soft-ui .wp-video-shortcode {
    border-radius: var(--rn-radius-image);
    overflow: hidden;
}

/* -------------------------------------------------------------------------
 * SMALL CONTENT UI
 * ---------------------------------------------------------------------- */
body.rn-soft-ui .td-post-category,
body.rn-soft-ui .td-tag-wrap a,
body.rn-soft-ui .tagcloud a,
body.rn-soft-ui .wp-block-tag-cloud a {
    border-radius: var(--rn-radius-small);
}

body.rn-soft-ui .td-post-content blockquote,
body.rn-soft-ui .td-post-content table,
body.rn-soft-ui .wp-block-table,
body.rn-soft-ui .wp-block-pullquote,
body.rn-soft-ui pre {
    border-radius: var(--rn-radius-small);
}

/* Easy Table of Contents — round the box, not its heading label. */
body.rn-soft-ui .toc_container,
body.rn-soft-ui .ez-toc-container {
    border-radius: var(--rn-radius-card);
    overflow: hidden;
}

/* Forms / ordinary CTA buttons. Header controls are explicitly excluded
 * below, so menu/search behaviour stays exactly as Newspaper expects. */
body.rn-soft-ui .td-post-content button,
body.rn-soft-ui .td-post-content input[type="button"],
body.rn-soft-ui .td-post-content input[type="submit"],
body.rn-soft-ui .comment-respond input[type="submit"],
body.rn-soft-ui .comment-respond textarea,
body.rn-soft-ui .comment-respond input[type="text"],
body.rn-soft-ui .comment-respond input[type="email"],
body.rn-soft-ui .comment-respond input[type="url"],
body.rn-soft-ui .wp-block-button__link,
body.rn-soft-ui .td-social-sharing-button {
    border-radius: var(--rn-radius-button);
}

/* -------------------------------------------------------------------------
 * RN custom product/affiliate boxes (only if these classes are present).
 * ---------------------------------------------------------------------- */
body.rn-soft-ui .rn-product-catalog-card,
body.rn-soft-ui .rn-product-box,
body.rn-soft-ui .rn-affiliate-box {
    border-radius: var(--rn-radius-card);
    overflow: hidden;
}

/* -------------------------------------------------------------------------
 * HARD EXCLUSIONS: HEADER / NAVIGATION / SEARCH / BRANDING
 * These must stay geometrically untouched. This also fixes the v0.1.0
 * clipped search/menu issue and the rounded Root Nation logo.
 * ---------------------------------------------------------------------- */
body.rn-soft-ui .td-header-wrap,
body.rn-soft-ui .td-header-wrap *,
body.rn-soft-ui .td-header-menu-wrap,
body.rn-soft-ui .td-header-menu-wrap *,
body.rn-soft-ui .td-mobile-header-wrap,
body.rn-soft-ui .td-mobile-header-wrap *,
body.rn-soft-ui .td-menu-background,
body.rn-soft-ui .td-menu-background *,
body.rn-soft-ui .td-search-background,
body.rn-soft-ui .td-search-background *,
body.rn-soft-ui .td-search-wrap-mob,
body.rn-soft-ui .td-search-wrap-mob *,
body.rn-soft-ui .td-drop-down-search,
body.rn-soft-ui .td-drop-down-search *,
body.rn-soft-ui .td-header-sp-logo,
body.rn-soft-ui .td-header-sp-logo *,
body.rn-soft-ui .td-main-menu-logo,
body.rn-soft-ui .td-main-menu-logo * {
    border-radius: 0 !important;
}

/* Do not allow any Soft UI parent to clip Newspaper's header layers. */
body.rn-soft-ui .td-header-wrap,
body.rn-soft-ui .td-header-menu-wrap,
body.rn-soft-ui .td-mobile-header-wrap,
body.rn-soft-ui .td-menu-background,
body.rn-soft-ui .td-search-background,
body.rn-soft-ui .td-search-wrap-mob,
body.rn-soft-ui .td-drop-down-search {
    overflow: visible !important;
}

/* Logos, flags, menu/search icons and avatars remain untouched even if they
 * also match a generic image class somewhere in the theme. */
body.rn-soft-ui .td-header-wrap img,
body.rn-soft-ui .td-mobile-header-wrap img,
body.rn-soft-ui .td-header-sp-logo img,
body.rn-soft-ui .td-main-menu-logo img,
body.rn-soft-ui .gtranslate_wrapper img,
body.rn-soft-ui .pll-switcher-select img,
body.rn-soft-ui img.avatar,
body.rn-soft-ui .avatar img {
    border-radius: 0 !important;
}

/* -------------------------------------------------------------------------
 * BLOCK HEADINGS
 * Keep Newspaper section-title geometry exactly as designed.
 * ---------------------------------------------------------------------- */
body.rn-soft-ui .td-block-title,
body.rn-soft-ui .td-block-title > *,
body.rn-soft-ui .tdb-block-title,
body.rn-soft-ui .tdb-block-title > *,
body.rn-soft-ui .td_block_template_1 .td-block-title,
body.rn-soft-ui .td_block_template_8 .td-block-title,
body.rn-soft-ui .td_block_template_11 .td-block-title,
body.rn-soft-ui .td_block_template_14 .td-block-title,
body.rn-soft-ui .td_block_template_15 .td-block-title {
    border-radius: 0 !important;
}

/* -------------------------------------------------------------------------
 * LARGE SINGLE-POST HERO
 * v0.1.1 deliberately keeps full-bleed Newspaper hero layouts square.
 * Ordinary article images below the hero remain rounded.
 * ---------------------------------------------------------------------- */
body.rn-soft-ui .tdb_single_featured_image,
body.rn-soft-ui .tdb_single_featured_image *,
body.rn-soft-ui .tdb-single-featured-image,
body.rn-soft-ui .tdb-single-featured-image *,
body.rn-soft-ui .tdb_single_bg_featured_image,
body.rn-soft-ui .tdb_single_bg_featured_image *,
body.rn-soft-ui .tdb-sfi-stretch,
body.rn-soft-ui .tdb-sfi-stretch *,
body.rn-soft-ui .tdb-sfi-stretch-bg,
body.rn-soft-ui .tdb-sfi-stretch-bg * {
    border-radius: 0 !important;
}
