/* ============================================================
   assets/css/newspaper.css
   Newspaper / Flipbook styles — เพิ่มใน <head> ของ index.php
   ============================================================ */

/* ── RIGHT SECTION ── */
.right {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    height: 100%;
    overflow-y: auto;
    padding: 16px 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}

/* ── NEWSPAPER HEADER ── */
.newspaper-header {
    margin-bottom: 14px;
}

.newspaper-rule {
    border: none;
    border-top: 3px double rgba(255,255,255,0.6);
    margin: 4px 0;
}
.newspaper-rule.thin {
    border-top: 1px solid rgba(255,255,255,0.25);
    margin: 3px 0;
}

.newspaper-title-block {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    padding: 4px 0 2px;
}

/* ── Row placing the news column beside the food menu column ── */
.right-body {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}
.news-column {
    flex: 0 0 356px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ── FOOD MENU COLUMN — own header, separate from MRT MONTHLY BULLETIN ──
   Column shrink-wraps the image (no forced stretch/fill) so its width
   matches the image instead of leaving blank space beside it. */
.food-menu-column {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.food-menu-header {
    width: 100%;
    margin-bottom: 14px;
}

/* Panel hugs the image's natural size (scaled down if needed) — click to enlarge */
.food-menu-panel {
    position: relative;
    display: inline-block;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(6px);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.food-menu-panel:hover {
    transform: translateY(-3px);
    border-color: rgba(0,245,255,0.6);
    box-shadow: 0 8px 24px rgba(0,0,0,0.35), 0 0 20px rgba(0,245,255,0.15);
}
.food-menu-panel img {
    display: block;
    width: auto;
    height: auto;
    max-width: min(30vw, 520px);
    max-height: 70vh;
    object-fit: contain;
}
.food-menu-panel-label {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 6px 8px;
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    font-size: 0.6rem;
    letter-spacing: 0.05em;
    color: #fff;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.75) 100%);
}

.newspaper-label {
    font-family: 'Orbitron', 'Times New Roman', serif;
    font-size: 1.6rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: 0.12em;
    text-shadow: 0 0 20px rgba(0,245,255,0.5);
}

.newspaper-edition {
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    font-size: 0.55rem;
    color: rgba(0,245,255,0.7);
    letter-spacing: 0.25em;
    text-transform: uppercase;
    border-left: 1px solid rgba(255,255,255,0.3);
    padding-left: 8px;
}

.newspaper-dateline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.5rem;
    color: rgba(255,255,255,0.45);
    letter-spacing: 0.1em;
    padding: 3px 0;
    text-transform: uppercase;
}
.newspaper-dot { color: rgba(0,245,255,0.5); font-size: 0.4rem; }

/* ── FLIPBOOK GRID ── */
.flipbook-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

/* ── NEWSPAPER CARD ── */
.newspaper-card {
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    overflow: hidden;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(6px);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    animation: cardFadeIn 0.4s ease both;
}

@keyframes cardFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.newspaper-card:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 30px rgba(0,0,0,0.5), 0 0 0 1px rgba(0,245,255,0.3);
    border-color: rgba(0,245,255,0.3);
}

/* ── CARD IMAGE ── */
.newspaper-card-img {
    position: relative;
    width: 100%;
    aspect-ratio: 3/4;
    overflow: hidden;
    background: #0a0a12;
}

.newspaper-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
    filter: sepia(20%) contrast(1.05);
}

.newspaper-card:hover .newspaper-card-img img {
    transform: scale(1.06);
}

/* ── PLACEHOLDER (no cover image) ── */
.newspaper-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #0d0d1a 0%, #141420 100%);
    padding: 10px 8px;
    position: relative;
}

.placeholder-lines {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}
.pl-thick  { height: 3px; background: rgba(255,255,255,0.5); border-radius: 2px; }
.pl-thin   { height: 2px; background: rgba(255,255,255,0.2); border-radius: 2px; }
.pl-half   { height: 2px; width: 60%; background: rgba(255,255,255,0.2); border-radius: 2px; }
.pl-block  { height: 28px; background: rgba(255,255,255,0.06); border-radius: 3px; margin: 4px 0; }
.placeholder-logo {
    font-size: 1.6rem;
    opacity: 0.5;
    position: absolute;
    bottom: 10px;
    right: 10px;
}

/* ── OVERLAY ON HOVER ── */
.newspaper-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,10,20,0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    backdrop-filter: blur(2px);
}
.newspaper-card:hover .newspaper-card-overlay { opacity: 1; }
.read-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.6rem;
    color: #00f5ff;
    letter-spacing: 0.15em;
    border: 1px solid rgba(0,245,255,0.5);
    padding: 4px 8px;
    border-radius: 2px;
}

/* ── CARD INFO ── */
.newspaper-card-info {
    padding: 6px 8px 8px;
    border-top: 1px solid rgba(255,255,255,0.07);
}
.newspaper-card-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    line-height: 1.3;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.newspaper-card-sub {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.5rem;
    color: rgba(255,255,255,0.4);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.newspaper-card-date {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.48rem;
    color: rgba(0,245,255,0.5);
    margin-top: 3px;
}

.no-flipbooks {
    grid-column: 1 / -1;
    text-align: center;
    color: rgba(255,255,255,0.3);
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    padding: 30px 0;
}
.no-flipbooks span { font-size: 2rem; display: block; margin-bottom: 8px; }

/* ============================================================
   FLIPBOOK MODAL
   ============================================================ */
.flipbook-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,4,12,0.88);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.flipbook-overlay.active {
    opacity: 1;
    pointer-events: all;
}
.flipbook-overlay.active .flipbook-modal {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.flipbook-modal {
    width: min(90vw, 1000px);
    height: min(90vh, 700px);
    background: #080d14;
    border: 1px solid rgba(0,245,255,0.2);
    border-radius: 10px;
    box-shadow: 0 0 60px rgba(0,0,0,0.8), 0 0 0 1px rgba(0,245,255,0.1), inset 0 0 40px rgba(0,245,255,0.02);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.94) translateY(20px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(.34,1.56,.64,1), opacity 0.3s ease;
}

.flipbook-modal-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: linear-gradient(90deg, rgba(0,245,255,0.05) 0%, transparent 100%);
    border-bottom: 1px solid rgba(0,245,255,0.15);
    flex-shrink: 0;
}

.flipbook-modal-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(0,245,255,0.9);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.flipbook-modal-controls {
    display: flex;
    gap: 6px;
}
.flipbook-modal-controls button {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.7);
    width: 30px;
    height: 30px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.flipbook-modal-controls button:hover {
    background: rgba(0,245,255,0.12);
    border-color: rgba(0,245,255,0.4);
    color: #00f5ff;
}

.flipbook-modal-body {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #050810;
}
.flipbook-modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* ============================================================
   FOOD MENU LIGHTBOX
   ============================================================ */
.food-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,4,12,0.88);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.food-menu-overlay.active {
    opacity: 1;
    pointer-events: all;
}
.food-menu-overlay.active .food-menu-modal {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.food-menu-modal {
    position: relative;
    max-width: min(90vw, 700px);
    max-height: 90vh;
    background: #080d14;
    border: 1px solid rgba(0,245,255,0.2);
    border-radius: 10px;
    box-shadow: 0 0 60px rgba(0,0,0,0.8), 0 0 0 1px rgba(0,245,255,0.1), inset 0 0 40px rgba(0,245,255,0.02);
    overflow: hidden;
    transform: scale(0.94) translateY(20px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(.34,1.56,.64,1), opacity 0.3s ease;
}

.food-menu-modal img {
    display: block;
    max-width: min(90vw, 700px);
    max-height: 80vh;
    object-fit: contain;
}

.food-menu-modal-title {
    padding: 10px 16px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(0,245,255,0.9);
    letter-spacing: 0.05em;
    background: linear-gradient(90deg, rgba(0,245,255,0.05) 0%, transparent 100%);
    border-top: 1px solid rgba(0,245,255,0.15);
}

.food-menu-modal-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    border-radius: 5px;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}
.food-menu-modal-close:hover {
    background: rgba(0,245,255,0.15);
    border-color: rgba(0,245,255,0.4);
    color: #00f5ff;
}

/* ── Responsive .main layout ── */
.main {
    display: flex;
    gap: 0;
}
@media (max-width: 768px) {
    .right { display: none; }
}