/*
 * RI Free Press Wide Layout & Menu Polish v1.1.1
 * Surgical front-end overrides only.
 * Keeps the existing clean menu treatment; improves readability and usable width.
 */

:root {
    --rifp-wide-page-max: 1620px;
    --rifp-wide-gutter: 24px;
}

/* =====================================================
   DROPDOWN MENU READABILITY
   Preserve the existing text-menu look — no buttons.
   ===================================================== */
.main-navigation .primary-menu-container > ul > li > ul.sub-menu > li > a,
.main-navigation .primary-menu-container ul.sub-menu li a,
.site-header .main-navigation ul ul li a,
.site-header .primary-menu-container ul ul li a {
    font-size: 16px !important;
    line-height: 1.35 !important;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}

/* Give long labels a little more breathing room without making menus bulky. */
.main-navigation .primary-menu-container ul.sub-menu,
.site-header .main-navigation ul.sub-menu {
    min-width: 220px;
}

/* =====================================================
   HOME / LANDING PAGE WIDTH
   Let the editorial layout use the browser similarly to opened stories.
   ===================================================== */
body.home .site-container,
body.home .content-container,
body.home .content-area,
body.home #primary,
body.home .site-main,
body.home article.entry,
body.home .entry-content-wrap,
body.home .entry-content {
    width: 100% !important;
    max-width: var(--rifp-wide-page-max) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
}

body.home .content-container,
body.home .entry-content-wrap {
    padding-left: var(--rifp-wide-gutter) !important;
    padding-right: var(--rifp-wide-gutter) !important;
}

body.home .rifp-home,
body.home .rifp-home.rifp-home-320 {
    width: 100% !important;
    max-width: var(--rifp-wide-page-max) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
}

/* =====================================================
   CATEGORY LANDING PAGE WIDTH
   Preserve the 300px advertising rail while expanding editorial space.
   ===================================================== */
body.category .site-container,
body.category .content-container,
body.category .content-area,
body.category #primary,
body.category .site-main,
body.archive .site-container,
body.archive .content-container,
body.archive .content-area,
body.archive #primary,
body.archive .site-main {
    width: 100% !important;
    max-width: var(--rifp-wide-page-max) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
}

body.category .rifp-category-template-wrap,
body.archive .rifp-category-template-wrap {
    width: calc(100% - (var(--rifp-wide-gutter) * 2)) !important;
    max-width: var(--rifp-wide-page-max) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
}

body.category .rifp-category-layout,
body.archive .rifp-category-layout {
    grid-template-columns: minmax(0, 1fr) 300px !important;
    gap: 28px !important;
}

/* If an older category container is still being used, widen that path too. */
body.category .content-container.rifp-has-category-ad-rail,
body.archive .content-container.rifp-has-category-ad-rail {
    width: calc(100% - (var(--rifp-wide-gutter) * 2)) !important;
    max-width: var(--rifp-wide-page-max) !important;
}

/* =====================================================
   RESPONSIVE SAFETY
   ===================================================== */
@media (max-width: 1000px) {
    body.category .rifp-category-layout,
    body.archive .rifp-category-layout,
    body.category .content-container.rifp-has-category-ad-rail,
    body.archive .content-container.rifp-has-category-ad-rail {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 760px) {
    :root { --rifp-wide-gutter: 12px; }

    .main-navigation .primary-menu-container > ul > li > ul.sub-menu > li > a,
    .main-navigation .primary-menu-container ul.sub-menu li a,
    .site-header .main-navigation ul ul li a,
    .site-header .primary-menu-container ul ul li a {
        font-size: 15px !important;
        padding-top: 9px !important;
        padding-bottom: 9px !important;
    }
}


/* =====================================================
   v1.1.0 — H2O VIDEO STORY SINGLE-PAGE CLEANUP
   Keep the featured image available to Home/category cards,
   but do not show it as a separate hero on the opened story.
   The video is the visual lead for this article.
   ===================================================== */
body.single-post.rifp-h2o-story-page .post-thumbnail,
body.single-post.rifp-h2o-story-page .post-thumbnail-inner,
body.single-post.rifp-h2o-story-page figure.post-thumbnail,
body.single-post.rifp-h2o-story-page .kadence-post-image {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Remove any theme spacing left behind by the hidden featured image. */
body.single-post.rifp-h2o-story-page article.entry,
body.single-post.rifp-h2o-story-page .entry-content-wrap,
body.single-post.rifp-h2o-story-page .entry-content {
    margin-top: 0 !important;
}
body.single-post.rifp-h2o-story-page .entry-content-wrap {
    padding-top: 22px !important;
}

/* Let the embedded video own the reading column cleanly. */
body.single-post.rifp-h2o-story-page .rifp-h2o-story,
body.single-post.rifp-h2o-story-page .rifp-h2o-video-wrap {
    width: 100% !important;
    max-width: none !important;
}
body.single-post.rifp-h2o-story-page .rifp-h2o-video-wrap iframe {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    aspect-ratio: 16 / 9 !important;
    height: auto !important;
}

@media (max-width: 760px) {
    :root { --rifp-wide-gutter: 12px; }
    body.single-post.rifp-h2o-story-page .entry-content-wrap {
        padding-top: 14px !important;
    }
}


/* =====================================================
   v1.1.1 — FORCE CUSTOM CATEGORY TEMPLATE TO FULL WIDTH
   The RI Free Press category archive is rendered by its own
   .rifp-category-template-wrap, which can sit outside Kadence's
   normal category container. Target that wrapper directly.
   ===================================================== */
.rifp-category-template-wrap {
    width: min(var(--rifp-wide-page-max), calc(100vw - 48px)) !important;
    max-width: var(--rifp-wide-page-max) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
}
.rifp-category-template-wrap .rifp-category-layout {
    width: 100% !important;
    max-width: none !important;
    grid-template-columns: minmax(0, 1fr) 300px !important;
    gap: 28px !important;
}
.rifp-category-template-wrap .rifp-category-main {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
}
/* Make sure Kadence cannot re-constrain the archive outside the custom wrapper. */
body.category .site-content,
body.archive .site-content,
body.category .content-container,
body.archive .content-container {
    width: 100% !important;
    max-width: none !important;
}
@media (max-width: 1000px) {
    .rifp-category-template-wrap {
        width: calc(100vw - 24px) !important;
    }
    .rifp-category-template-wrap .rifp-category-layout {
        grid-template-columns: 1fr !important;
    }
}
