/* ============================================================================
   Clip Maker Pro v5.0 - Newspaper Edition Stylesheet
   ============================================================================ */

/* Post Entry Button */
.cm-button-wrapper {
    text-align: center;
    margin: 20px 0;
}
.cm-view-clipping-btn {
    display: inline-block;
    padding: 10px 22px;
    background-color: #062147;
    color: #ffffff !important;
    text-decoration: none;
    font-weight: 700;
    border-radius: 5px;
    transition: background-color 0.2s ease, transform 0.15s ease;
    font-family: 'Roboto', Arial, sans-serif;
}
.cm-view-clipping-btn:hover {
    background-color: #990000;
    transform: translateY(-1px);
}

/* Page Navigation Header (Outside Clip) */
.cm-custom-header {
    background-color: #ffffff;
    padding: 12px 24px;
    border-bottom: 1px solid #dcdcdc;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}
.cm-custom-header a {
    color: #111111;
    font-size: 22px;
    font-weight: 800;
    text-decoration: none;
    font-family: 'Roboto', Arial, sans-serif;
}
.cm-custom-header a:hover {
    color: #990000;
}

body {
    margin: 0;
    padding: 0 0 90px 0;
    background: #e9ebee;
    --cm-column-count: 2;
}

/* Outer Page Wrapper */
.cm-page-wrapper {
    background-color: transparent;
    margin: 22px auto;
    padding: 0;
    width: var(--cm-clip-width, 960px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
    position: relative;
    box-sizing: border-box;
}

.cm-page-wrapper.cm-has-outer-frame {
    background-color: var(--cm-clip-bg, #ffffff);
    padding: 20px;
    border-radius: 8px;
}
.cm-page-wrapper.cm-has-outer-frame::before {
    content: "";
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border: 7px solid var(--cm-outer-border, #2f4f4f);
    border-radius: 10px;
    pointer-events: none;
    z-index: -1;
}

/* Main Clipping Canvas */
.cm-clipping-style {
    position: relative;
    background-color: var(--cm-clip-bg, #ffffff);
    padding: 18px 22px 14px 22px;
    border: var(--cm-border-width, 3px) solid var(--cm-clip-border, #111111);
    font-family: var(--cm-content-font) !important;
    font-weight: 400;
    color: var(--cm-content-color, #111111);
    overflow: hidden;
    box-sizing: border-box;
}

/* Border Styles */
.cm-clipping-style.cm-border-double {
    border-style: double;
    border-width: max(4px, var(--cm-border-width, 4px));
}
.cm-clipping-style.cm-border-top_bottom {
    border-left: none;
    border-right: none;
    border-top: var(--cm-border-width, 4px) solid var(--cm-clip-border, #111111);
    border-bottom: var(--cm-border-width, 4px) solid var(--cm-clip-border, #111111);
}

/* Subtle Newsprint Paper Texture */
.cm-clipping-style.cm-texture-subtle_newsprint {
    background-image:
        radial-gradient(rgba(0, 0, 0, 0.025) 1px, transparent 0),
        radial-gradient(rgba(0, 0, 0, 0.018) 1px, transparent 0);
    background-size: 14px 14px;
    background-position: 0 0, 7px 7px;
}

/* ============================================================================
   WATERMARK LAYER (INSIDE CLIP)
   ============================================================================ */
.cm-watermark-layer {
    position: absolute;
    pointer-events: none;
    opacity: var(--cm-watermark-opacity, 0.10);
    user-select: none;
    -webkit-user-select: none;
    overflow: hidden;
}
.cm-watermark-layer.cm-wm-hidden {
    display: none !important;
}
.cm-watermark-layer.cm-wm-layer-behind {
    z-index: 1;
}
.cm-watermark-layer.cm-wm-layer-over {
    z-index: 10;
}

/* Center / Diagonal Single */
.cm-watermark-layer.cm-wm-pos-center,
.cm-watermark-layer.cm-wm-pos-diagonal {
    top: 50%;
    left: 50%;
    width: var(--cm-watermark-size, 48%);
    transform: translate(-50%, -50%) rotate(var(--cm-watermark-angle, -25deg));
    text-align: center;
}
.cm-watermark-layer.cm-wm-pos-top_center {
    top: 16%;
    left: 50%;
    width: var(--cm-watermark-size, 48%);
    transform: translate(-50%, 0) rotate(var(--cm-watermark-angle, 0deg));
    text-align: center;
}
.cm-watermark-layer.cm-wm-pos-bottom_center {
    bottom: 16%;
    left: 50%;
    width: var(--cm-watermark-size, 48%);
    transform: translate(-50%, 0) rotate(var(--cm-watermark-angle, 0deg));
    text-align: center;
}

/* Tiled / Repeating Newspaper Grid */
.cm-watermark-layer.cm-wm-pos-tiled {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: center;
    justify-items: center;
    gap: 44px 28px;
    padding: 36px 20px;
    box-sizing: border-box;
}
.cm-watermark-layer.cm-wm-pos-tiled .cm-wm-item {
    width: 100%;
    text-align: center;
    transform: rotate(var(--cm-watermark-angle, -25deg));
}
.cm-watermark-layer.cm-wm-pos-tiled .cm-wm-item img {
    width: calc(var(--cm-watermark-size, 48%) * 1.15);
    max-width: 190px;
    height: auto;
    margin: 0 auto;
    display: block;
}
.cm-watermark-layer.cm-wm-pos-tiled .cm-wm-text {
    font-size: calc(var(--cm-watermark-text-size, 48px) * 0.52);
}

.cm-watermark-layer img {
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}
.cm-wm-text {
    display: inline-block;
    font-family: 'Playfair Display', 'Roboto', Georgia, serif;
    font-size: var(--cm-watermark-text-size, 48px);
    font-weight: 900;
    letter-spacing: 3px;
    color: var(--cm-watermark-text-color, #000000);
    text-transform: uppercase;
    white-space: nowrap;
}

.cm-clip-inner-content {
    position: relative;
    z-index: 2;
}

/* ============================================================================
   LAYOUT POSITION SLOTS (ALL 7 MODES)
   ============================================================================ */
.cm-slot {
    display: none;
}

/* 1. Bottom Right (Exact Reference Newspaper Image Style) */
.cm-layout-bottom_right .cm-slot-bottom-split {
    display: flex;
    flex-direction: row;
}

/* 2. Bottom Left */
.cm-layout-bottom_left .cm-slot-bottom-split {
    display: flex;
    flex-direction: row-reverse;
}
.cm-layout-bottom_left .cm-slot-bottom-split .cm-split-brand-col {
    border-left: none;
    border-right: 1.5px solid var(--cm-footer-border, #222222);
    padding-left: 0;
    padding-right: 14px;
}

/* 3. Top Only */
.cm-layout-top_only .cm-slot-top-full {
    display: flex;
}
.cm-layout-top_only .cm-slot-bottom-simple {
    display: flex;
}

/* 4. Top & Bottom (Dual Branding) */
.cm-layout-top_and_bottom .cm-slot-top-full {
    display: flex;
}
.cm-layout-top_and_bottom .cm-slot-bottom-branded {
    display: flex;
}

/* 5. Top Right */
.cm-layout-top_right .cm-slot-top-split {
    display: flex;
    flex-direction: row;
}
.cm-layout-top_right .cm-slot-bottom-simple {
    display: flex;
}

/* 6. Top Left */
.cm-layout-top_left .cm-slot-top-split {
    display: flex;
    flex-direction: row-reverse;
}
.cm-layout-top_left .cm-slot-top-split .cm-split-brand-col {
    border-left: none;
    border-right: 1.5px solid var(--cm-footer-border, #222222);
    padding-left: 0;
    padding-right: 14px;
}
.cm-layout-top_left .cm-slot-bottom-simple {
    display: flex;
}

/* 7. Bottom Only (Full Banner at Bottom) */
.cm-layout-bottom_only .cm-slot-bottom-full {
    display: flex;
}

/* ============================================================================
   SLOT COMPONENT STYLING
   ============================================================================ */

/* Top Full Banner */
.cm-slot-top-full {
    flex-direction: column;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 0;
}
.cm-slot-top-full .cm-banner-img,
.cm-slot-bottom-full .cm-banner-img {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    margin-bottom: 8px;
    image-rendering: -webkit-optimize-contrast;
}

/* Top Split Compact Header (Top Right / Top Left) */
.cm-slot-top-split {
    align-items: stretch;
    gap: 14px;
    border-bottom: 2px solid var(--cm-footer-border, #222222);
    padding-bottom: 10px;
    margin-bottom: 14px;
}
.cm-split-subline {
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--cm-footer-text, #333333);
    text-transform: uppercase;
    margin-top: 6px;
}

/* Details Bar (Navy Date | Digital Edition Strip) */
.cm-details-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: var(--cm-details-bg, #062147);
    color: var(--cm-details-text, #ffffff);
    padding: 7px 14px;
    font-size: var(--cm-details-size, 15px);
    font-family: var(--cm-details-font) !important;
    font-weight: 600;
    width: 100%;
    box-sizing: border-box;
    line-height: 1.25;
}
.cm-date,
.cm-editor {
    display: inline-block;
    white-space: nowrap;
    margin: 0;
}
.cm-meta-sep {
    opacity: 0.75;
    font-weight: 400;
}

/* Brand Masthead Block (Compact Logo or Newspaper Serif Typography) */
.cm-split-meta-col {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.cm-split-brand-col {
    flex: 0 0 auto;
    min-width: 240px;
    max-width: 320px;
    border-left: 1.5px solid var(--cm-footer-border, #222222);
    padding-left: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cm-brand-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
}
.cm-brand-logo-img {
    max-height: var(--cm-brand-logo-height, 68px);
    max-width: 100%;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
}
.cm-brand-text-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}
.cm-brand-name {
    font-family: 'Playfair Display', 'PT Serif', Georgia, serif;
    font-size: 27px;
    font-weight: 900;
    letter-spacing: 0.4px;
    line-height: 1.05;
    color: var(--cm-brand-text-color, #111111);
    text-transform: uppercase;
    border-bottom: 2px solid var(--cm-brand-text-color, #111111);
    padding-bottom: 4px;
    margin-bottom: 5px;
    white-space: nowrap;
}
.cm-brand-tagline {
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.65px;
    color: var(--cm-brand-text-color, #111111);
    text-transform: uppercase;
    white-space: nowrap;
}

/* ============================================================================
   HEADLINE & ARTICLE BODY (AUTHENTIC NEWSPAPER TYPOGRAPHY)
   ============================================================================ */
.cm-clipping-title,
.cm-clipping-title font {
    font-family: var(--cm-title-font) !important;
    font-weight: var(--cm-title-weight, 800) !important;
    text-align: var(--cm-title-align, center) !important;
    color: var(--cm-title-color, #990000) !important;
    line-height: var(--cm-title-lh, 1.22);
    margin: 4px 0 16px 0;
    padding: 0;
    font-size: var(--cm-title-size, 46px) !important;
    word-break: break-word;
    letter-spacing: 0px !important;
}

.cm-layout-top_only .cm-clipping-title,
.cm-layout-top_and_bottom .cm-clipping-title,
.cm-layout-top_right .cm-clipping-title,
.cm-layout-top_left .cm-clipping-title {
    margin-top: 10px;
}

.cm-has-title-divider .cm-clipping-title {
    padding-bottom: 10px;
    border-bottom: 1.5px solid var(--cm-col-divider-color, #b8b8b8);
}

/* Featured Image */
.cm-featured-image-wrapper {
    text-align: center !important;
    margin: 0 0 12px 0;
    box-sizing: border-box;
    float: none;
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    break-inside: avoid;
    page-break-inside: avoid;
    -webkit-column-break-inside: avoid;
}
.cm-imgborder-none .cm-featured-image-wrapper {
    border: none;
    padding: 0;
    background: transparent;
}
.cm-imgborder-thin .cm-featured-image-wrapper {
    border: 1px solid #999999;
    padding: 0;
    background: #ffffff;
}
.cm-imgborder-framed .cm-featured-image-wrapper {
    border: 1px solid #cccccc;
    padding: 5px;
    background: #ffffff;
}
.cm-featured-image-wrapper.cm-featured-full {
    margin: 0 0 16px 0;
}
.cm-featured-image-wrapper img {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Multi-Column Article Body + Crisp Vertical Newspaper Rules */
.cm-article-body-wrap {
    position: relative;
    margin-top: 6px;
}

.cm-col-dividers {
    position: absolute;
    top: 2px;
    bottom: 2px;
    left: 0;
    right: 0;
    pointer-events: none;
    z-index: 3;
}
.cm-col-divider-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 0;
    border-left: var(--cm-col-divider-width, 1px) var(--cm-col-divider-style, solid) var(--cm-col-divider-color, #b8b8b8);
}

.cm-article-body {
    min-height: calc(5 * 1.2em);
    column-count: var(--cm-column-count, 2);
    column-gap: 28px;
    column-fill: balance;
    font-family: var(--cm-content-font) !important;
    font-size: var(--cm-content-size, 18px) !important;
    text-align: var(--cm-content-align, justify) !important;
    text-justify: inter-word !important;
    letter-spacing: 0px !important;
    word-spacing: normal !important;
    font-kerning: normal;
    hyphens: none !important;
    color: var(--cm-content-color, #111111);
}

/* Newspaper Subheadings Inside Article (H2, H3, H4) */
.cm-article-body h2,
.cm-article-body h3,
.cm-article-body h4,
.cm-article-body h5 {
    font-family: var(--cm-subheading-font) !important;
    font-size: var(--cm-subheading-size, 21px) !important;
    font-weight: 700 !important;
    color: var(--cm-subheading-color, #b30000);
    line-height: 1.3;
    margin: 12px 0 5px 0;
    padding: 0;
    text-align: left !important;
    text-indent: 0 !important;
    break-after: avoid;
    page-break-after: avoid;
}

.cm-article-body p,
.cm-article-body li,
.cm-article-body div:not(.cm-featured-image-wrapper) {
    font-family: var(--cm-content-font) !important;
    font-size: var(--cm-content-size, 18px) !important;
    line-height: var(--cm-content-lh, 1.46);
    letter-spacing: 0px !important;
    word-spacing: normal !important;
    text-align: var(--cm-content-align, justify) !important;
    text-justify: inter-word !important;
    text-align-last: left;
    margin: 0 0 9px 0;
    padding: 0;
}

.cm-article-body p {
    text-indent: var(--cm-para-indent, 24px);
}
.cm-article-body p:empty {
    display: none;
}

.cm-article-body ul,
.cm-article-body ol {
    margin: 0 0 10px 0;
    padding-left: 20px;
}

.cm-article-body span,
.cm-article-body font,
.cm-article-body strong,
.cm-article-body b,
.cm-jword {
    font-family: inherit !important;
    letter-spacing: 0px !important;
    word-spacing: normal !important;
    text-indent: 0 !important;
    display: inline !important;
}

.cm-article-body img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
    margin: 10px auto;
    object-fit: contain;
    break-inside: avoid;
}

/* ============================================================================
   FOOTER STRIPS (BOTTOM RIGHT / BOTTOM LEFT / DUAL / SIMPLE / FULL)
   ============================================================================ */
.cm-slot-bottom-split {
    border-top: 1.5px solid var(--cm-footer-border, #222222);
    margin-top: 16px;
    padding-top: 10px;
    align-items: stretch;
    gap: 14px;
}

.cm-bottom-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 2px 2px 2px;
}

.cm-slot-bottom-branded {
    border-top: 1.5px solid var(--cm-footer-border, #222222);
    margin-top: 16px;
    padding-top: 10px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}
.cm-bottom-branded-left {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.cm-slot-bottom-full {
    flex-direction: column;
    border-top: 1.5px solid var(--cm-footer-border, #222222);
    margin-top: 16px;
    padding-top: 12px;
}

.cm-slot-bottom-simple {
    border-top: 1.5px solid var(--cm-footer-border, #222222);
    margin-top: 16px;
    padding-top: 10px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.cm-footer-text {
    font-family: var(--cm-details-font), 'Roboto', Arial, sans-serif;
    font-size: 14.5px;
    color: var(--cm-footer-text, #111111);
    line-height: 1.35;
}
.cm-editor-extra {
    margin: 0 0 3px 0;
    font-size: 13.5px;
    opacity: 0.9;
}
.cm-copyright-line {
    font-weight: 700;
}

/* CMYK Print Registration Dots */
.cm-printer-marks {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.cm-dot {
    display: block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    margin-left: 5px;
}

/* ============================================================================
   FLOATING LIVE CONTROLS TOOLBAR
   ============================================================================ */
.cm-actions-float {
    position: fixed;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    bottom: 16px;
    right: 16px;
    left: 16px;
    max-width: 1120px;
    margin: 0 auto;
    padding: 8px 12px;
    background: rgba(18, 24, 38, 0.92);
    border-radius: 8px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
    z-index: 1000;
    box-sizing: border-box;
}
.cm-actions-float select,
.cm-actions-float button {
    padding: 8px 12px;
    font-size: 14px;
    font-family: 'Roboto', Arial, sans-serif;
    font-weight: 600;
    cursor: pointer;
    background-color: #2b354a;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 5px;
    margin: 0;
    transition: background-color 0.18s ease, border-color 0.18s ease;
    height: 38px;
    box-sizing: border-box;
}
.cm-actions-float select:hover,
.cm-actions-float button:hover {
    background-color: #062147;
    border-color: rgba(255, 255, 255, 0.45);
}
#cm-download-btn {
    background-color: #990000;
    border-color: #c21b1b;
}
#cm-download-btn:hover {
    background-color: #b80000;
}
.cm-actions-float .cm-ctrl-hidden {
    display: none !important;
}

.cm-mobile-buttons .cm-actions-float {
    bottom: 8px;
    right: 8px;
    left: 8px;
    padding: 8px;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
}
.cm-mobile-buttons .cm-actions-float select,
.cm-mobile-buttons .cm-actions-float button {
    height: 44px;
    min-width: 115px;
    flex: 0 0 auto;
}

/* ============================================================================
   PRINT STYLESHEET
   ============================================================================ */
@media print {
    body {
        background: #ffffff !important;
        padding: 0 !important;
    }
    .cm-custom-header,
    .cm-actions-float {
        display: none !important;
    }
    .cm-page-wrapper {
        margin: 0 !important;
        box-shadow: none !important;
        max-width: none !important;
        width: 100% !important;
        padding: 0 !important;
        border-radius: 0 !important;
    }
    .cm-page-wrapper::before {
        display: none !important;
    }
}
