/* Ghost Nuke Theme - Screen CSS */
@import url('https://fonts.googleapis.com/css2?family=VT323&family=Verdana&display=swap');

:root {
    /* User Light Theme Colors - FORCED UPDATE */
    --primary: #5c0303; /* Dark Red Accent (from border-primary) */
    --primary-foreground: #fffaed;
    --secondary: #FEEDD4; /* Light Cream Secondary Background */
    --secondary-foreground: #5B0B08;
    --accent: #ff0000; /* Bright Red Alert */
    --accent-foreground: #ffffff;
    
    --background: #fffaed; /* Light Cream Background */
    --foreground: #000000; /* Black Text */
    
    --card: #ffffff; /* White Card Background */
    --card-foreground: #000000;
    
    --muted: #f0f0f0;
    --muted-foreground: #666666;
    
    --border: #5c0303; /* Dark Red Border */
    
    --font-header: 'VT323', monospace;
    --font-body: 'Verdana', sans-serif;
}

/* Reset & Base */
body {
    background-color: var(--background);
    color: var(--foreground);
    font-family: var(--font-body);
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Layout */
.gh-viewport {
    min-height: 100vh;
    padding: 1rem;
    max-width: 1200px; /* Reduced from 1400px for tighter retro feel */
    margin: 0 auto;
    background-color: var(--background); /* Ensure background fills viewport */
    box-shadow: 0 0 20px rgba(0,0,0,0.1); /* Subtle shadow to separate from ultra-wide bg */
}

/* Ultra-wide background wrapper */
body {
    background-color: #E0D0B6; /* Darker cream/parchment for outside the viewport */
    background-image: url('../img/bg-pattern.png'); /* Optional: Add a pattern if available */
}

.gh-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 768px) {
    .gh-grid {
        grid-template-columns: 3fr 6fr 3fr;
    }
}

/* Header */
.nuke-header {
    margin-bottom: 1rem;
    border: 4px solid var(--border);
    background-color: var(--secondary);
    padding: 1rem;
    box-shadow: 6px 6px 0px 0px rgba(0,0,0,1);
}

.header-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

@media (min-width: 768px) {
    .header-content {
        flex-direction: row;
        justify-content: space-between;
    }
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    width: 4rem;
    height: 4rem;
    background-color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border);
    font-size: 2.5rem;
}

.site-title {
    font-family: var(--font-header);
    font-size: 2.5rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: -0.05em;
    margin: 0;
    line-height: 1;
}

.site-title span {
    color: var(--foreground);
}

.site-desc {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0;
}

.header-status {
    background-color: var(--card);
    border: 2px solid var(--border);
    padding: 0.5rem;
    text-align: center;
    font-family: var(--font-header);
    font-size: 1.25rem;
}

.status-live {
    color: #ff0000;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .5; }
}

/* Navigation */
.nuke-nav {
    margin-top: 1rem;
    border-top: 2px solid var(--border);
    padding-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.nav-item {
    font-family: var(--font-header);
    font-size: 1.125rem;
    text-transform: uppercase;
    background-color: transparent;
    border: 2px solid var(--border);
    padding: 0.25rem 1rem;
    cursor: pointer;
    box-shadow: 2px 2px 0px 0px rgba(0,0,0,1);
    transition: all 0.1s;
}

.nav-item:hover {
    background-color: var(--primary);
    color: var(--primary-foreground);
    transform: translateY(-2px);
    box-shadow: 4px 4px 0px 0px rgba(0,0,0,1);
}

.nav-item:active {
    transform: translateY(2px);
    box-shadow: none;
}

/* Blocks */
.nuke-block {
    border: 2px solid var(--border);
    background-color: var(--card);
    margin-bottom: 1rem;
    box-shadow: 4px 4px 0px 0px rgba(0,0,0,0.5);
}

.block-header {
    background-color: var(--primary);
    color: var(--primary-foreground);
    padding: 0.25rem 0.5rem;
    font-family: var(--font-header);
    font-size: 1.125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.block-controls {
    display: flex;
    gap: 0.25rem;
}

.control-dot {
    width: 0.5rem;
    height: 0.5rem;
    background-color: var(--accent);
}

.block-content {
    padding: 0.5rem;
    font-size: 0.875rem;
}

/* Sidebar Lists */
.sidebar-menu li a {
    display: block;
    padding: 0.25rem;
    border: 1px solid transparent;
}

.sidebar-menu li a:hover {
    background-color: var(--secondary);
    border-color: var(--border);
    color: var(--primary);
}

/* Main Content Area */
.post-card {
    border: 2px solid var(--border);
    background-color: var(--card);
    box-shadow: 4px 4px 0px 0px rgba(0,0,0,0.5);
    margin-bottom: 1rem;
}

.post-header {
    background-color: var(--secondary);
    border-bottom: 2px solid var(--border);
    padding: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.post-title {
    font-family: var(--font-header);
    font-size: 1.5rem;
    color: var(--primary);
    margin: 0;
}

.post-meta-badge {
    font-size: 0.75rem;
    font-family: monospace;
    background-color: var(--background);
    border: 1px solid var(--border);
    padding: 0 0.25rem;
}

.post-content {
    padding: 1rem;
}

.post-image {
    width: 100%;
    height: auto;
    border: 2px solid var(--border);
    margin-bottom: 1rem;
    filter: grayscale(100%);
    transition: filter 0.3s;
}

.post-image:hover {
    filter: grayscale(0%);
}

.post-meta {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.post-excerpt {
    margin-bottom: 1rem;
}

.btn {
    display: inline-block;
    border: 2px solid var(--border);
    padding: 0.25rem 1rem;
    font-family: var(--font-header);
    text-transform: uppercase;
    background-color: transparent;
    cursor: pointer;
    box-shadow: 2px 2px 0px 0px rgba(0,0,0,1);
    font-size: 1rem;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 3px 3px 0px 0px rgba(0,0,0,1);
}

/* Footer */
.nuke-footer {
    margin-top: 2rem;
    border-top: 4px solid var(--border);
    background-color: var(--secondary);
    padding: 1rem;
    text-align: center;
    font-size: 0.875rem;
}

.footer-stats {
    margin-top: 0.5rem;
    font-family: monospace;
    font-size: 0.75rem;
}

/* Ghost Specifics */
.gh-content {
    line-height: 1.6;
}

.gh-content h1, .gh-content h2, .gh-content h3 {
    font-family: var(--font-header);
    color: var(--primary);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.gh-content blockquote {
    border-left: 4px solid var(--accent);
    background-color: var(--secondary);
    padding: 1rem;
    margin: 1rem 0;
    font-style: italic;
}

/* Ghost Koenig Editor Support */
.kg-width-wide {
    grid-column: wide-start / wide-end;
}

.kg-width-full {
    grid-column: full-start / full-end;
}

.kg-gallery-container {
    display: flex;
    flex-direction: column;
    max-width: 100%;
    width: 100%;
}

.kg-gallery-row {
    display: flex;
    flex-direction: row;
    justify-content: center;
}

.kg-gallery-image img {
    display: block;
    margin: 0;
    width: 100%;
    height: 100%;
}

/* Add support for other Koenig cards */
.kg-bookmark-card,
.kg-embed-card,
.kg-gallery-card,
.kg-image-card {
    margin: 1.5rem 0;
    width: 100%;
    max-width: 100%;
}

/* Responsive Video Embeds */
.kg-embed-card iframe {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
}

.kg-bookmark-container {
    display: flex;
    flex-direction: row;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--foreground);
    text-decoration: none;
    box-shadow: 2px 2px 0px 0px rgba(0,0,0,0.2);
    overflow: hidden; /* Prevent overflow */
    min-height: 140px;
}

.kg-bookmark-content {
    flex-grow: 1;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0; /* Allow text truncation */
}

.kg-bookmark-title {
    font-weight: bold;
    font-size: 1.1rem;
    line-height: 1.3;
}

.kg-bookmark-description {
    font-size: 0.9rem;
    margin-top: 0.5rem;
    color: var(--muted-foreground);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kg-bookmark-metadata {
    margin-top: 1rem;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
}

.kg-bookmark-thumbnail {
    position: relative;
    flex-shrink: 0; /* Prevent shrinking */
    width: 33%;
    min-width: 120px;
    max-width: 180px;
    border-left: 1px solid var(--border); /* Add border between text and image */
}

.kg-bookmark-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

/* Navigation Styling Fixes */
.nuke-nav .nav-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.nuke-nav .nav-item a {
    display: block;
    padding: 0.5rem 1rem;
    background: var(--card);
    border: 2px solid var(--foreground);
    color: var(--foreground);
    text-decoration: none;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9rem;
    box-shadow: 2px 2px 0px 0px rgba(0,0,0,0.2);
    transition: all 0.1s;
}

.nuke-nav .nav-item a:hover {
    background: var(--primary);
    color: var(--primary-foreground);
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0px 0px rgba(0,0,0,0.2);
}

.nuke-nav .nav-current a {
    background: var(--primary);
    color: var(--primary-foreground);
    box-shadow: inset 2px 2px 0px 0px rgba(0,0,0,0.2);
}

/* Sidebar Menu Styling (Separate from Header) */
.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    margin-bottom: 0.5rem;
}

.sidebar-menu li a {
    text-decoration: none;
    color: var(--foreground);
    font-weight: 500;
    display: block;
    padding: 2px 0;
}

.sidebar-menu li a:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* Ghost Bookmark Card Styling */
.kg-bookmark-card {
    width: 100%;
    background: var(--card);
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.kg-bookmark-container {
    display: flex;
    text-decoration: none;
    color: var(--foreground);
    min-height: 148px;
}

.kg-bookmark-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    flex-grow: 1;
}

.kg-bookmark-title {
    font-weight: bold;
    font-size: 1.1rem;
    line-height: 1.3em;
}

.kg-bookmark-description {
    font-size: 0.9rem;
    line-height: 1.4em;
    margin-top: 10px;
    color: var(--muted-foreground);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.kg-bookmark-metadata {
    display: flex;
    align-items: center;
    margin-top: 15px;
    font-size: 0.8rem;
    color: var(--muted-foreground);
}

.kg-bookmark-icon {
    width: 22px;
    height: 22px;
    margin-right: 8px;
}

.kg-bookmark-author:after {
    content: "•";
    margin: 0 6px;
}

.kg-bookmark-publisher {
    font-weight: bold;
}

.kg-bookmark-thumbnail {
    position: relative;
    min-width: 33%;
    max-height: 100%;
}

.kg-bookmark-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Fix Image Sizing Issues */
.gh-content img {
    max-width: 100%;
    height: auto;
}

/* Disable wide/full breakouts to strictly enforce 3-column layout */
.kg-width-wide,
.kg-width-full {
    grid-column: auto !important;
    max-width: 100% !important;
    width: 100% !important;
}

/* Ensure gallery images don't overflow */
.kg-gallery-container {
    max-width: 100%;
}

.kg-gallery-row {
    max-width: 100%;
}

/* Fix bookmark card sizing */
.kg-bookmark-card {
    width: 100%;
    max-width: 100%;
}

.kg-bookmark-thumbnail {
    max-width: 33%; /* Prevent thumbnail from taking over */
}

/* Footer Navigation */
.footer-nav {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px dashed var(--border);
}

.footer-nav .secondary-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-nav .secondary-nav li a {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--foreground);
    text-decoration: none;
    font-weight: bold;
}

.footer-nav .secondary-nav li a:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* Sidebar Navigation Updates */
.sidebar-menu li.nav-current a {
    font-weight: bold;
    color: var(--primary);
    background-color: var(--secondary);
}

/* Horizontal Footer Navigation */
.footer-nav .secondary-nav {
    display: flex;
    flex-direction: row; /* Force horizontal layout */
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem; /* Increase gap for better spacing */
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-nav .secondary-nav li {
    display: inline-block; /* Ensure items are inline */
}

/* Site Logo Styling */
.site-logo {
    max-height: 80px; /* Limit logo height */
    width: auto;
    display: block;
}

/* Header Status Buttons */
.status-btn {
    text-decoration: none;
    color: var(--foreground);
    font-weight: bold;
    text-transform: uppercase;
    font-size: 1rem;
}

.status-btn:hover {
    color: var(--primary);
    text-decoration: underline;
}

.status-highlight {
    color: #ff0000; /* Red for Subscribe/Sign Up */
}

.status-highlight:hover {
    color: #cc0000;
}

/* Navigation Styling Updates */

/* Sidebar Navigation (Vertical) */
.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    margin-bottom: 0.25rem;
}

.sidebar-menu li a {
    display: block;
    padding: 0.25rem 0.5rem;
    text-decoration: none;
    color: var(--foreground);
    border-left: 3px solid transparent;
}

.sidebar-menu li a:hover {
    background-color: var(--secondary);
    color: var(--primary);
    border-left-color: var(--primary);
}

.sidebar-menu li.nav-current a {
    font-weight: bold;
    color: var(--primary);
    background-color: var(--secondary);
    border-left-color: var(--accent);
}

/* Footer Navigation (Horizontal) */
.footer-nav-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-nav-list li {
    display: inline-block;
}

.footer-nav-list li a {
    font-size: 0.85rem;
    text-transform: uppercase;
    font-weight: bold;
    color: var(--foreground);
    text-decoration: none;
}

.footer-nav-list li a:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* FORCE Horizontal Footer Navigation */
.footer-nav-list {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 1.5rem !important;
    width: 100% !important;
}

.footer-nav-list li {
    display: inline-block !important;
    width: auto !important;
    margin: 0 !important;
}

/* 
   FIX: STRICT IMAGE SIZING FOR HOMEPAGE
   These rules ensure images in the new layout structure do not overflow.
*/

/* 1. Featured Story Image */
.featured-story .post-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 400px; /* Cap height to prevent massive vertical images */
    object-fit: cover; /* Crop nicely if aspect ratio is off */
    display: block;
    margin: 0 auto 1rem auto;
    border: 2px solid var(--border);
}

/* 2. Standard Story Thumbnails */
.standard-story .story-thumb {
    flex: 0 0 150px; /* Fixed width for thumbnail container */
    max-width: 150px;
    margin-right: 1rem;
}

.standard-story .story-thumb img {
    width: 100%;
    height: 100px; /* Fixed height for uniformity */
    object-fit: cover;
    border: 1px solid var(--border);
    display: block;
}

/* 3. Story Grid Layout */
.story-grid {
    display: flex;
    align-items: flex-start;
}

/* Mobile Responsiveness for Story Grid */
@media (max-width: 600px) {
    .story-grid {
        flex-direction: column;
    }
    
    .standard-story .story-thumb {
        flex: none;
        width: 100%;
        max-width: 100%;
        margin-right: 0;
        margin-bottom: 1rem;
    }
    
    .standard-story .story-thumb img {
        height: auto;
        max-height: 200px;
        width: 100%;
    }
}

/* 4. General Safety Net for Content Images */
.block-content img {
    max-width: 100%;
    height: auto;
}

/* 5. Fix for Ghost's injected figure elements */
.kg-image-card img {
    max-width: 100%;
    height: auto;
}

/* Visibility Badges (Public/Members/Paid) */
.visibility-badge {
    display: inline-block;
    padding: 2px 6px;
    font-size: 0.75rem;
    font-family: var(--font-header);
    text-transform: uppercase;
    border: 1px solid var(--border);
    margin-left: 0.5rem;
    vertical-align: middle;
    background-color: var(--background);
    color: var(--foreground);
}

.visibility-badge-small {
    display: inline-block;
    padding: 1px 4px;
    font-size: 0.65rem;
    font-family: var(--font-header);
    text-transform: uppercase;
    border: 1px solid var(--border);
    margin-left: 0.5rem;
    background-color: var(--background);
    color: var(--foreground);
}

/* Badge Colors */
.visibility-public {
    border-color: var(--foreground);
    color: var(--foreground);
}

.visibility-members {
    border-color: var(--primary);
    color: var(--primary);
    background-color: rgba(92, 3, 3, 0.1); /* Slight tint of primary */
}

.visibility-paid {
    border-color: var(--accent);
    color: var(--accent);
    background-color: rgba(255, 0, 0, 0.1); /* Slight tint of accent */
}

.visibility-tiers {
    border-color: var(--primary);
    color: var(--primary);
}

/* Robust Ghost Editor Card Styling */

/* Galleries */
.kg-gallery-container {
    display: flex;
    flex-direction: column;
    max-width: 100%;
    width: 100%;
}

.kg-gallery-row {
    display: flex;
    flex-direction: row;
    justify-content: center;
}

.kg-gallery-image img {
    display: block;
    margin: 0;
    width: 100%;
    height: 100%;
}

/* Callout Cards */
.kg-callout-card {
    display: flex;
    padding: 1.5rem;
    border-radius: 4px;
    background-color: var(--secondary);
    border: 1px solid var(--border);
    margin: 1.5rem 0;
}

.kg-callout-card-emoji {
    padding-right: 1rem;
    font-size: 1.5rem;
    line-height: 1;
}

.kg-callout-card-text {
    font-size: 1rem;
    color: var(--foreground);
}

/* Toggle Cards */
.kg-toggle-card {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1rem;
    margin: 1.5rem 0;
}

.kg-toggle-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: bold;
}

.kg-toggle-content {
    margin-top: 1rem;
}

/* Button Cards */
.kg-btn {
    display: inline-block;
    background-color: var(--primary);
    color: var(--primary-foreground);
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    transition: opacity 0.2s;
}

.kg-btn:hover {
    opacity: 0.9;
}

.kg-btn-accent {
    background-color: var(--accent);
    color: var(--accent-foreground);
}

/* ==========================================================================
   News Ticker
   ========================================================================== */
.nuke-ticker-container {
    display: flex;
    align-items: center;
    background: var(--background);
    border: 2px solid var(--border);
    margin-bottom: 1rem;
    height: 32px;
    overflow: hidden;
    box-shadow: 3px 3px 0 rgba(0,0,0,0.1);
}

.ticker-label {
    background: var(--primary);
    color: var(--primary-foreground);
    padding: 0 1rem;
    height: 100%;
    display: flex;
    align-items: center;
    font-weight: bold;
    font-size: 0.8rem;
    text-transform: uppercase;
    white-space: nowrap;
    z-index: 2;
}

.ticker-wrap {
    flex-grow: 1;
    overflow: hidden;
    height: 100%;
    position: relative;
    background: var(--secondary-bg);
}

.ticker-move {
    display: flex;
    white-space: nowrap;
    /* Speed: 40s for a smoother, readable pace */
    animation: ticker 40s linear infinite;
    height: 100%;
    line-height: 28px;
    width: fit-content;
}

.ticker-move:hover {
    animation-play-state: paused;
}

.ticker-item {
    display: inline-block;
    padding: 0 1.5rem; /* Increased padding for better separation */
    font-size: 0.85rem;
}

.ticker-date {
    color: var(--primary);
    font-weight: bold;
    margin-right: 0.25rem;
    font-size: 0.75rem;
}

.ticker-item a {
    color: var(--foreground);
    text-decoration: none;
}

.ticker-item a:hover {
    text-decoration: underline;
    color: var(--primary);
}

.ticker-separator {
    color: var(--muted-foreground);
    margin-left: 1rem;
    font-weight: bold;
}

@keyframes ticker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); } /* Move only 50% because content is doubled */
}


/* Shoutbox Failsafe: Hide UI when inside iframe */
body.is-iframe-embed .nuke-header,
body.is-iframe-embed .nuke-footer,
body.is-iframe-embed .left-sidebar,
body.is-iframe-embed .right-sidebar,
body.is-iframe-embed .retro-join-btn {
    display: none !important;
}

body.is-iframe-embed .gh-viewport {
    padding: 0;
    max-width: 100%;
}

body.is-iframe-embed .gh-grid {
    display: block;
}

body.is-iframe-embed .main-content {
    width: 100%;
    padding: 0;
}

body.is-iframe-embed .post-card {
    border: none;
    box-shadow: none;
    margin: 0;
}

body.is-iframe-embed .post-header,
body.is-iframe-embed .post-image,
body.is-iframe-embed .post-content {
    display: none; /* Hide post content, show only comments */
}

/* Ensure comments are visible and styled for the widget */
body.is-iframe-embed .gh-comments {
    display: block !important;
    padding: 10px;
}


/* Shoutbox Failsafe: Reveal comments only in iframe mode */
body.is-iframe-embed .shoutbox-comments {
    display: block !important;
    padding: 10px;
    background: #fff;
}


/* Shoutbox Safety: Prevent long comments from breaking layout */
body.is-iframe-embed .gh-comments {
    overflow-x: hidden;
    word-wrap: break-word;
}

/* Optional: Limit height of individual comments if needed */
body.is-iframe-embed .gh-comment-content {
    max-height: 200px;
    overflow-y: auto;
}

/* 
   V93 UPDATE: COMPACT LIST STYLES
   Restores the "Wide & Thin" layout for the Latest News feed.
*/

/* Grid Container for List Mode */
.story-grid {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    align-items: flex-start;
}

/* Thumbnail Container */
.story-thumb {
    flex: 0 0 120px; /* Fixed width */
    max-width: 120px;
}

.story-thumb img {
    width: 100%;
    height: 90px; /* Fixed height for consistency */
    object-fit: cover;
    border: 1px solid var(--border);
    display: block;
}

/* Text Details Container */
.story-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Smaller Meta Bar for List Mode */
.post-meta-bar.small {
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px dashed var(--border);
}

/* Smaller Excerpt for List Mode */
.post-excerpt.small {
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

/* Text-only Read More Button */
.btn-text {
    font-family: var(--font-header);
    font-size: 0.85rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: bold;
}

.btn-text:hover {
    text-decoration: underline;
    color: var(--accent);
}

/* Mobile Responsiveness for List Mode */
@media (max-width: 600px) {
    .story-grid {
        flex-direction: column;
    }
    
    .story-thumb {
        flex: none;
        width: 100%;
        max-width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .story-thumb img {
        width: 100%;
        height: auto;
        max-height: 200px;
    }
}

/* 
   V94 UPDATE: HONOR ROLL WIDGET STYLES
*/

.honor-roll-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.honor-roll-item {
    padding: 0.25rem 0;
    border-bottom: 1px dashed var(--border);
    font-family: var(--font-header);
    font-size: 1rem;
    color: var(--primary);
}

.honor-roll-item:last-child {
    border-bottom: none;
}

.honor-roll-item:before {
    content: "";
    margin-right: 0;
}

/* 
   V95 UPDATE: EVENTS WIDGET STYLES
*/

.events-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.event-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--foreground);
    line-height: 1.3;
}

.event-item:last-child {
    border-bottom: none;
}

.event-item:hover {
    background-color: var(--secondary);
    color: var(--primary);
}

/* 
   V95 UPDATE: ENHANCED EVENTS WIDGET
   Matches the "Calendar Box" style from jawaclan.com
*/

.event-item-enhanced {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--border);
}

.event-item-enhanced:last-child {
    border-bottom: none;
}

.event-date-box {
    background-color: var(--card);
    border: 1px solid var(--border);
    width: 40px;
    height: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    flex-shrink: 0;
    box-shadow: 2px 2px 0px 0px rgba(0,0,0,0.1);
}

.event-month {
    font-size: 0.6rem;
    text-transform: uppercase;
    background-color: var(--primary);
    color: var(--primary-foreground);
    width: 100%;
    text-align: center;
    line-height: 1;
    padding: 2px 0;
    font-weight: bold;
}

.event-day {
    font-size: 1rem;
    font-weight: bold;
    color: var(--foreground);
    line-height: 1;
    padding: 2px 0;
}

.event-details {
    flex-grow: 1;
}

.event-title {
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--primary);
    line-height: 1.2;
    display: block;
}

.event-item-enhanced:hover .event-title {
    text-decoration: underline;
    color: var(--accent);
}

/* Mobile Layout Optimization (v122) */
/* Reorder content: Menu -> Content -> Widgets */

@media (max-width: 767px) {
    /* Redefine grid areas for mobile */
    .gh-grid {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-areas:
            "main"
            "left-sidebar"
            "right-sidebar";
        gap: 1rem;
    }

    /* Assign areas */
    .main-content {
        grid-area: main;
    }

    .left-sidebar {
        grid-area: left-sidebar;
    }

    .right-sidebar {
        grid-area: right-sidebar;
    }

    /* Ensure Navigation (in Header) stays at top */
    /* The header is outside .gh-grid, so it naturally stays at the top. */
    /* The user wants "Main Menu" (Navigation) -> "Main Content" -> "Widgets" */
    
    /* Since Navigation is inside <header class="nuke-header"> which is above .gh-grid, 
       it will naturally appear first. 
       The default grid behavior without areas is source order: Left Sidebar -> Main Content -> Right Sidebar.
       
       By using grid-template-areas, we force Main Content to be first in the grid, 
       followed by Left Sidebar, then Right Sidebar.
    */
}
