/*
 * Viral24 E-Paper — classic Hindi newspaper layout
 * Compatible with Laravel 6 Blade templates (no build tools required).
 * CSS applies to the newspaper, its modal and the standalone cutting only.
 */

.epaper-reader,
.epaper-cutting-page {
    font-family: 'Noto Serif Devanagari', 'Noto Sans Devanagari', Georgia, serif;
    color: #201b18;
}

.epaper-reader {
    max-width: 1170px;
    margin: 20px auto 40px;
    padding: 0 10px;
}

.epaper-sheet {
    padding: 30px 33px 20px;
    margin: 0 auto 25px;
    background: #fffdf8;
    border: 1px solid #d0c9ba;
    box-shadow: 0 8px 26px rgba(52, 30, 16, .09);
}

.epaper-masthead {
    text-align: center;
    border-top: 4px double #272321;
    border-bottom: 4px double #272321;
    padding: 10px 5px 8px;
    background: #fff;
}

.epaper-brand {
    font: 900 clamp(40px, 7vw, 76px)/1 Arial, sans-serif;
    letter-spacing: -3px;
    color: #191514;
}

.epaper-brand span,
.epaper-cutting-header span {
    color: #a92b20;
}

.epaper-tagline {
    margin: 6px 0;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: .5px;
}

.epaper-date {
    border-top: 1px solid #c9bfaf;
    padding-top: 5px;
    font-size: 13px;
    color: #ffffff;
    background: #a92b20;
}

.epaper-date span,
.epaper-cutting-meta span {
    padding: 0 5px;
}

.epaper-panchang {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-around;
    gap: 8px 16px;
    background: #f7eddb;
    border-bottom: 2px solid #bd883e;
    padding: 11px 15px;
    font-size: 14px;
}

.epaper-panchang strong {
    color: #812b1d;
}

.epaper-news-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 12px;
}

.epaper-story {
    min-width: 0;
    padding: 12px 14px;
    border-right: 1px solid #c7bfb4;
    border-bottom: 1px solid #e4dcd0;
    cursor: pointer;
    overflow-wrap: anywhere;
    transition: background-color .15s ease;
}

.epaper-story:nth-child(3n) {
    border-right: 0;
}

.epaper-story:hover,
.epaper-story:focus-visible {
    background: #faf1e4;
}

.epaper-story:focus-visible {
    outline: 2px solid #a83426;
    outline-offset: -3px;
}

.epaper-story.epaper-lead {
    grid-column: span 2;
    border-right: 1px solid #c7bfb4;
}

.epaper-section {
    border-bottom: 1px solid #b02b1c;
    color: #a22a1c;
    padding-bottom: 3px;
    font-size: 13px;
    font-weight: 800;
}

.epaper-story h2 {
    margin: 9px 0 10px;
    font-size: 21px;
    line-height: 1.35;
    font-weight: 900;
    letter-spacing: -.2px;
}

.epaper-story.epaper-lead h2 {
    font-size: 35px;
    line-height: 1.3;
}

.epaper-flow,
.epaper-cutting-text {
    display: flow-root;
    font-size: 14px;
    line-height: 1.7;
    text-align: justify;
}

.epaper-flow p,
.epaper-cutting-text p {
    margin: 0;
}

.epaper-flow img,
.epaper-cutting-text img {
    float: left;
    display: block;
    width: 48%;
    height: auto;
    margin: 4px 12px 7px 0;
    max-width: 100%;
}

.epaper-story.epaper-lead .epaper-flow img {
    width: 50%;
}

/*
 * Actual transparency-driven wrap, NOT rectangular image wrapping.
 * It requires an alpha-channel PNG/WebP with a same-origin image URL.
 * Because the image itself is floated, the text occupies transparent regions
 * up to the silhouette as permitted by CSS Shapes support.
 */
.epaper-flow img.epaper-alpha-image,
.epaper-cutting-text img.epaper-alpha-image {
    shape-image-threshold: .08;
    shape-margin: 7px;
    object-fit: contain;
    max-height: none;
    margin-left: 0;
    margin-right: 0;
}

.epaper-story.epaper-lead .epaper-flow img.epaper-alpha-image {
    width: 50%;
}

.epaper-cut-action {
    clear: both;
    padding-top: 9px;
    color: #9d2b1e;
    font: 700 12px Arial, sans-serif;
    text-align: right;
}

.epaper-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 2px solid #25201d;
    padding: 9px 3px 0;
    margin-top: 16px;
    font: 12px Arial, sans-serif;
}

.epaper-cmyk {
    display: inline-flex;
    gap: 4px;
}

.epaper-cmyk i {
    width: 12px;
    height: 12px;
    display: block;
    border-radius: 50%;
}

.epaper-cmyk i:nth-child(1) { background: #00adee; }
.epaper-cmyk i:nth-child(2) { background: #ec008c; }
.epaper-cmyk i:nth-child(3) { background: #ffe000; }
.epaper-cmyk i:nth-child(4) { background: #151515; }

.epaper-empty {
    text-align: center;
    padding: 75px 25px;
    color: #766657;
}

/* Admin standalone preview: only the paper; no website chrome. */
.epaper-standalone-preview .epaper-reader {
    margin-top: 10px;
}

/* One article-click dialog. Cutting iframe has NO website layout. */
body.epaper-modal-open {
    overflow: hidden !important;
}

.epaper-popup[hidden] {
    display: none !important;
}

.epaper-popup {
    position: fixed;
    z-index: 999999;
    inset: 0;
    background: rgba(18, 15, 13, .79);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 14px;
}

.epaper-popup-panel {
    width: min(850px, 100%);
    height: min(92vh, 1050px);
    background: #fffcf5;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,.34);
}

.epaper-popup-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
    background: #8a291e;
    color: #fff;
    font: 600 13px Arial, sans-serif;
    min-height: 41px;
}

.epaper-popup-top span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.epaper-popup-top button {
    border: 0;
    background: none;
    color: #fff;
    cursor: pointer;
    font-size: 24px;
}

#epaper-popup-frame {
    width: 100%;
    min-height: 0;
    flex: 1;
    border: 0;
    background: #fffcf5;
}

/* Standalone news cutting — no header/footer inherited from the news site. */
html:has(.epaper-cutting-body),
.epaper-cutting-body {
    margin: 0;
    padding: 0;
    background: #ece7df;
}

.epaper-cutting-page {
    max-width: 750px;
    margin: 0 auto;
    padding: 15px 13px 26px;
}

.epaper-cutting {
    display: flow-root;
    background: #fffefa;
    padding: 28px 28px 22px;
    border: 1px solid #d6cabb;
    box-shadow: 0 4px 13px rgba(63, 37, 24, .08);
}

.epaper-cutting-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    border-bottom: 3px double #191514;
    padding-bottom: 6px;
}

.epaper-cutting-header b {
    font: 900 36px/1 Arial, sans-serif;
    letter-spacing: -2px;
}

.epaper-cutting-header small {
    font-size: 14px;
    color: #6b584a;
}

.epaper-cutting-meta {
    margin: 9px 0 5px;
    font-size: 12px;
    color: #8c3c27;
}

.epaper-cutting h1 {
    font-size: 28px;
    line-height: 1.4;
    font-weight: 900;
    margin: 6px 0 16px;
}

.epaper-cutting-text {
    font-size: 16px;
    line-height: 1.85;
}

.epaper-cutting-text img {
    width: 44%;
    margin-right: 14px;
}

.epaper-cutting-text img.epaper-alpha-image {
    margin-right: 0;
}

.epaper-cutting-footer {
    display: flex;
    justify-content: space-between;
    clear: both;
    margin-top: 18px;
    padding-top: 9px;
    border-top: 1px solid #51463c;
    font: 12px Arial, sans-serif;
}

.epaper-cutting-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 12px 0 5px;
}

.epaper-cutting-actions button,
.epaper-cutting-actions a {
    font: 700 12px Arial, sans-serif;
    text-decoration: none;
    border: 1px solid #973122;
    background: #912c20;
    color: #fff;
    border-radius: 4px;
    padding: 9px 12px;
    cursor: pointer;
}

.epaper-cutting-actions button:hover,
.epaper-cutting-actions a:hover {
    background: #6f2219;
    color: #fff;
}

.epaper-draft-warning {
    font: 12px Arial, sans-serif;
    padding: 9px;
}

#epaper-error {
    margin: 8px 2px 0;
    color: #9b2819;
    font: 12px Arial, sans-serif;
}

@media (max-width: 750px) {
    .epaper-sheet { padding: 13px; }
    .epaper-brand { font-size: 47px; }
    .epaper-news-grid { grid-template-columns: 1fr; }
    .epaper-story,
    .epaper-story:nth-child(3n),
    .epaper-story.epaper-lead { grid-column: auto; border-right: 0; }
    .epaper-story.epaper-lead h2 { font-size: 29px; }
    .epaper-popup { padding: 3px; }
    .epaper-popup-panel { height: 97vh; border-radius: 3px; }
    .epaper-cutting-page { padding: 10px 7px 20px; }
    .epaper-cutting { padding: 16px; }
    .epaper-cutting h1 { font-size: 23px; }
    .epaper-cutting-text { font-size: 14px; }
}
