/*
Theme Name: upriver Child
Theme URI: https://doug.watkins.org
Description: Child theme for the upriver studio
Author: Doug watkins
Author URI: https://upriver.studio
Template: upriver
Version: 2.0.2.5g
*/

/* Import parent theme styles */
@import url("../upriver/style.css");

/* Add your custom CSS below this line */

/* Full width content area for the full-width template */
.full-width-content {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 0 2em 0;
}
.full-width-content .site-main {
    width: 100%;
    max-width: 100%;
    padding: 0 2vw;
}

/* Hide sidebar on full-width pages */
body.page-template-full-width #sidebar,
body.page-template-full-width .sidebar {
    display: none !important;
}

/* Let the TVK Manager Frontend table fill the content area */
body.page-template-full-width .tvk-manager-frontend,
body.page-template-full-width .wp-list-table {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Ensure the content area is wide and centered */
body.page-template-full-width .wrap,
body.page-template-full-width .content-area,
body.page-template-full-width .site-main {
    max-width: 1200px; /* or your theme's max width */
    width: 100%;
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
    box-sizing: border-box;
}

/* TVK Manager Frontend Table Column Formatting */
body.page-template-full-width .wp-list-table th,
body.page-template-full-width .wp-list-table td {
    vertical-align: middle;
    text-align: left;
}

body.page-template-full-width .wp-list-table th:nth-child(2),
body.page-template-full-width .wp-list-table td:nth-child(2) { /* Title */
    width: 22%;
    max-width: 22%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
body.page-template-full-width .wp-list-table th:nth-child(4),
body.page-template-full-width .wp-list-table td:nth-child(4) { /* Meta */
    width: 18%;
    max-width: 18%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
    padding: 4px 8px;
}
body.page-template-full-width .wp-list-table th:nth-child(5),
body.page-template-full-width .wp-list-table td:nth-child(5) { /* Edit */
    width: 90px;
    max-width: 90px;
    white-space: nowrap;
    text-align: center;
    vertical-align: middle;
    padding: 4px 8px;
}

body.page-template-full-width .wp-list-table th:nth-child(5) {
    word-break: keep-all;
    white-space: nowrap;
}

/* Force main content and blocks to use full width on full-width template pages */
body.page-template-full-width .entry-content,
body.page-template-full-width .post-content,
body.page-template-full-width .block-editor-block-list__layout,
body.page-template-full-width .wp-block {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box;
}

/* Thumb column (1st) - narrow and centered */
body.page-template-full-width .wp-list-table th:nth-child(1),
body.page-template-full-width .wp-list-table td:nth-child(1) {
    width: 60px;
    max-width: 60px;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    padding: 4px 6px;
}

/* Edit column (5th) - fixed width, nowrap */
body.page-template-full-width .wp-list-table th:nth-child(5),
body.page-template-full-width .wp-list-table td:nth-child(5) {
    width: 90px;
    max-width: 90px;
    white-space: nowrap;
    text-align: center;
    padding: 4px 6px;
}

/* Actions column (6th) - fixed width, nowrap */
body.page-template-full-width .wp-list-table th:nth-child(6),
body.page-template-full-width .wp-list-table td:nth-child(6) {
    width: 110px;
    max-width: 110px;
    white-space: nowrap;
    text-align: center;
    padding: 4px 6px;
}

/* Prevent word-break in Meta and Edit headers */
body.page-template-full-width .wp-list-table th:nth-child(4),
body.page-template-full-width .wp-list-table th:nth-child(5) {
    white-space: nowrap !important;
    word-break: normal !important;
    min-width: 80px;
    text-align: center;
    vertical-align: middle;
}

/* Optionally, make Meta column a bit wider for content */
body.page-template-full-width .wp-list-table td:nth-child(4) {
    min-width: 100px;
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Hide the main page title on all pages 

.page .entry-title,
.page-title,
#intro .page-title,
#intro {
    display: none !important;
}

*/


/* Hide page title when the hide-page-title class is present */
body.hide-page-title .entry-title,
body.hide-page-title .page-title,
body.hide-page-title #intro .page-title,
body.hide-page-title #intro {
    display: none !important;
}

/* Adjust content spacing when title is hidden */
body.hide-page-title #content {
    padding-top: 0 !important;
}

body.hide-page-title #content-core {
    padding-top: 0 !important;
}

.tvk-modal,
.tvk-modal[style*="display: block"] {
    z-index: 9999 !important;
    position: fixed !important;
    left: 0; top: 0; right: 0; bottom: 0;
}

.tvk-modal-content,
.tvk-modal .modal-content {
    z-index: 10000 !important;
    position: relative;
}

/* Lower z-index for header/nav elements so modals are always on top */
#header,
.site-header,
#header-sticky,
#header-core,
#pre-header,
#pre-header-core,
#header-links,
#header-links-inner,
#header-container,
#header-social,
#header-search,
.main-navigation,
#nav,
#masthead,
#top-bar,
#topbar,
#wpadminbar {
    z-index: 10 !important;
}

/* Force TVK Add Video modal to be on top of all theme elements */
#choiceModal.modal,
#youtubeModal.modal,
#upriverModal.modal,
#editVideoModal.modal,
#tvk-video-modal,
.tvk-modal,
.modal {
    z-index: 99999 !important;
    position: fixed !important;
    left: 0; top: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.45);
}
.modal .modal-content,
.tvk-modal .tvk-modal-content {
    z-index: 100000 !important;
    position: relative;
}
