/* Separate CSS for Post/Page layout with right sidebar */

/***** Make the entire page white for these templates *****/
body.single,
body.page-template-page-right-sidebar,
body.single .site,
body.page-template-page-right-sidebar .site {
    background: #fff !important;
}

/* Use white background across this layout */
.post-layout-right-sidebar {
    background: #fff;
}

/* Wrapper centers the two-column block horizontally and constrains width */
.post-layout-right-sidebar {
    display: flex;
    justify-content: center; /* center the grid in the viewport */
    align-items: flex-start;
    width: 100%;
}

/* Container */
.post-layout-right-sidebar .post-layout-container {
    max-width: 1400px; /* wider canvas */
    width: 100%;
    margin: 24px auto; /* ensure centered with auto margins */
    padding: 0 16px;
    display: grid;
    /* fixed content width similar to reference for perfect centering */
    grid-template-columns: 960px 360px; /* content + sidebar (wider) */
    gap: 36px; /* spacing */
    align-items: start;
    justify-content: center; /* center the grid tracks within container */
}

/* Allow content to shrink on smaller screens before stacking */
@media (max-width: 1100px) {
    .post-layout-right-sidebar .post-layout-container {
        grid-template-columns: minmax(0, 680px) 320px;
    }
}

/* Content */
.post-layout-right-sidebar .post-layout-content {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    padding: 24px;
}

.post-layout-right-sidebar .entry-title {
    margin: 0 0 10px 0;
    font-size: 30px;
    color: #1e4a72;
}

.post-layout-right-sidebar .entry-thumbnail img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 12px 0 18px 0;
}

.post-layout-right-sidebar .entry-content {
    color: #333;
    line-height: 1.7;
}

.post-layout-right-sidebar .entry-content p { margin: 0 0 1em 0; }
.post-layout-right-sidebar .entry-content h2 { margin-top: 1.2em; }
.post-layout-right-sidebar .entry-content ul { padding-left: 18px; }

.post-layout-right-sidebar .entry-footer {
    margin-top: 20px;
    padding-top: 12px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 12px;
    flex-direction: column;
    color: #666;
}

/* Sidebar */
.post-layout-right-sidebar .post-layout-sidebar {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    padding: 16px;
}

.post-layout-right-sidebar .widget { margin-bottom: 18px; }
.post-layout-right-sidebar .widgettitle {
    font-size: 16px;
    margin: 0 0 10px 0;
    background: #1e4a72; /* brand blue */
    color: #fff;         /* white text */
    padding: 10px 14px;
    border-radius: 6px;
}

/* Media handling inside content */
.post-layout-right-sidebar .entry-content img,
.post-layout-right-sidebar .entry-content video,
.post-layout-right-sidebar .entry-content iframe,
.post-layout-right-sidebar .entry-content embed {
    max-width: 100%;
    height: auto;
}

/* Responsive tables */
.post-layout-right-sidebar .entry-content table {
    width: 100% !important;
    border-collapse: collapse;
    display: block;
    overflow-x: auto;
}
.post-layout-right-sidebar .entry-content th,
.post-layout-right-sidebar .entry-content td {
    padding: 8px;
}

/* Long code blocks scroll on small screens */
.post-layout-right-sidebar .entry-content pre {
    overflow: auto;
    max-width: 100%;
}

/* Responsive */
@media (max-width: 1320px) {
    .post-layout-right-sidebar .post-layout-container { max-width: 1240px; }
}
@media (max-width: 992px) {
    .post-layout-right-sidebar .post-layout-container {
        grid-template-columns: 1fr; /* stack */
    }
    .post-layout-right-sidebar .post-layout-sidebar {
        order: 2;
    }
}
@media (max-width: 600px) {
    .post-layout-right-sidebar .post-layout-content { padding: 18px; }
    .post-layout-right-sidebar .entry-title { font-size: 24px; }
}

/* ===================== Enhanced Styles (New) ===================== */
.post-layout-right-sidebar.enhanced .post-layout-container {
    /* Keep grid; allow a little more breathing room */
    gap: 32px;
}

/* Breadcrumbs */
.post-layout-right-sidebar .breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-bottom: 8px;
    color: #6b7280; /* gray-500 */
    font-size: 13px;
}
.post-layout-right-sidebar .breadcrumbs a {
    color: #1e4a72;
    text-decoration: none;
}
.post-layout-right-sidebar .breadcrumbs a:hover { text-decoration: underline; }
.post-layout-right-sidebar .breadcrumbs .sep { color: #9ca3af; }

/* Entry meta chips */
.post-layout-right-sidebar .entry-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 6px;
}
.post-layout-right-sidebar .entry-meta .meta-sep { color: #cbd5e1; }
.post-layout-right-sidebar .entry-meta .meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #f1f5f9;
    border-radius: 999px;
    color: #475569; /* slate-600 */
    font-size: 12px;
}
.post-layout-right-sidebar .entry-meta .category { background: #e6f0f8; color: #1e4a72; text-decoration: none; }
.post-layout-right-sidebar .entry-meta .category:hover { background: #d9e9f6; }

/* Share buttons */
.post-layout-right-sidebar .share-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.post-layout-right-sidebar .share-row .label { color: #475569; font-weight: 600; }
.post-layout-right-sidebar .share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 0 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    color: #fff;
}
.post-layout-right-sidebar .share-btn.x  { background: #111827; }
.post-layout-right-sidebar .share-btn.fb { background: #1877F2; }
.post-layout-right-sidebar .share-btn.li { background: #0A66C2; }
.post-layout-right-sidebar .share-btn:hover { opacity: 0.9; }

/* Post navigation */
.post-layout-right-sidebar .post-nav {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px dashed #e5e7eb;
}
.post-layout-right-sidebar .post-nav a { color: #1e4a72; text-decoration: none; }
.post-layout-right-sidebar .post-nav a:hover { text-decoration: underline; }

/* Sticky sidebar on desktop */
@media (min-width: 993px) {
    .post-layout-right-sidebar.enhanced .post-layout-sidebar {
        position: sticky;
        top: 24px;
        height: max-content;
    }
}

/* Sidebar toggle (mobile only) */
.post-layout-right-sidebar .sidebar-toggle {
    display: none;
}
@media (max-width: 992px) {
    .post-layout-right-sidebar .sidebar-toggle {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        margin: 0 0 12px 0;
        padding: 10px 14px;
        background: #1e4a72;
        color: #fff;
        border: none;
        border-radius: 6px;
        cursor: pointer;
        font-size: 14px;
        position: sticky;
        top: 8px;
        z-index: 30;
    }
    .post-layout-right-sidebar .sidebar-toggle__icon { font-size: 16px; }
}

/* Sidebar below content on mobile */
@media (max-width: 992px) {
    .post-layout-right-sidebar .post-layout-sidebar {
        position: static;
        right: auto;
        top: auto;
        height: auto;
        width: 100%;
        max-width: none;
        transform: none !important;
        transition: none;
        z-index: auto;
        overflow: visible;
        border-radius: 8px;
        order: 2;
        margin-top: 0;
    }
    .post-layout-right-sidebar .sidebar-toggle { display: none !important; }
    .post-layout-right-sidebar .sidebar-backdrop { display: none !important; }
    body.sidebar-open .post-layout-right-sidebar .post-layout-sidebar { transform: none !important; }
}

/* Force wider layout (high specificity, important) */
body .post-layout-right-sidebar .post-layout-container {
    max-width: 1400px !important;
    grid-template-columns: 960px 360px !important;
    gap: 36px !important;
}

/* Ensure single/page stacks on mobile even against forced widths */
@media (max-width: 992px) {
  body .post-layout-right-sidebar .post-layout-container { grid-template-columns: 1fr !important; }
  body .post-layout-right-sidebar .post-layout-sidebar { order: 2; width: 100%; }
}

/* Mobile-friendly refinements for single/page layout */
@media (max-width: 768px) {
  .post-layout-right-sidebar .post-layout-container { padding: 0 12px; margin: 16px auto; gap: 20px; }
  .post-layout-right-sidebar .post-layout-content { padding: 16px; }
  .post-layout-right-sidebar .entry-title { font-size: 22px; line-height: 1.25; }
  .post-layout-right-sidebar .entry-meta { gap: 6px; }
  .post-layout-right-sidebar .entry-meta .meta-chip { padding: 5px 8px; font-size: 11px; }
  .post-layout-right-sidebar .share-row { flex-wrap: wrap; gap: 8px; }
  .post-layout-right-sidebar .share-btn { height: 28px; padding: 0 10px; font-size: 12px; }
  .post-layout-right-sidebar .post-nav { flex-direction: column; gap: 8px; }
  .post-layout-right-sidebar .post-layout-sidebar { margin-top: 16px; padding: 14px; }
  .post-layout-right-sidebar .widgettitle { font-size: 15px; }
}
@media (max-width: 480px) {
  .post-layout-right-sidebar .entry-title { font-size: 20px; }
  .post-layout-right-sidebar .entry-content { font-size: 15px; line-height: 1.6; }
}