/**
 * Meanwhile at the Ranch - Post Template Styles
 *
 * Loaded only on posts with the 'meanwhile' tag.
 * Fonts: Libre Baskerville (headers), system sans (body), Caveat (handwritten accents)
 */

@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=Caveat:wght@400;500;600&display=swap');

/* ============================================
   Poster Mat Wrapper (matches site-wide pattern)
   ============================================ */

.meanwhile-wrapper {
    background: #f4efe6;
    min-height: 100vh;
    max-width: 1300px;
    margin: 20px auto;
    border: 24px solid #fff;
    padding: 36px;
    box-sizing: border-box;
    position: relative;
}

/* Subtle paper grain */
.meanwhile-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(90deg, rgb(0 0 0 / 2%), rgb(0 0 0 / 2%) 1px, transparent 1px, transparent 6px),
        repeating-linear-gradient(0deg, rgb(0 0 0 / 2%), rgb(0 0 0 / 2%) 1px, transparent 1px, transparent 6px);
    opacity: 0.18;
    pointer-events: none;
}

/* ============================================
   Base / Layout
   ============================================ */

.meanwhile-post {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 100px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.75;
    color: #444;
    background: #ffffff;
    position: relative;
}

.meanwhile-post *,
.meanwhile-post *::before,
.meanwhile-post *::after {
    box-sizing: border-box;
}

/* ============================================
   Header
   ============================================ */

.meanwhile-header {
    text-align: center;
    padding: 48px 0 0;
}

.meanwhile-date {
    font-family: 'Caveat', cursive;
    font-size: 17px;
    color: #999;
    margin: 0 0 8px;
    letter-spacing: 0.5px;
}

.meanwhile-title {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: clamp(28px, 5vw, 42px);
    font-weight: 700;
    color: #2d2d2d;
    margin: 0 0 8px;
    line-height: 1.2;
}

.meanwhile-subtitle {
    font-family: 'Caveat', cursive;
    font-size: 20px;
    color: #a08060;
    margin: 0 0 32px;
}

.meanwhile-header-rule {
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #c8b090, transparent);
    margin: 0 auto;
}

/* ============================================
   Sections - General
   ============================================ */

.meanwhile-content {
    padding: 40px 0;
}

.meanwhile-section {
    margin-bottom: 56px;
}

.meanwhile-section-header {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: 24px;
    font-weight: 700;
    color: #2d2d2d;
    margin: 0 0 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e8e0d8;
}

.meanwhile-section-content p {
    margin: 0 0 16px;
    line-height: 1.75;
}

.meanwhile-section-content p em {
    color: #777;
}

/* ============================================
   Divider
   ============================================ */

.meanwhile-divider {
    text-align: center;
    margin: 40px 0;
    font-size: 20px;
    letter-spacing: 8px;
    color: #d4c4b0;
}

/* ============================================
   Labels
   ============================================ */

.meanwhile-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #a08060;
    margin-bottom: 10px;
}

/* ============================================
   Story Section
   ============================================ */

.meanwhile-section--story .meanwhile-section-content {
    overflow: hidden; /* clear floats */
}

/* ============================================
   Polaroid Frames
   ============================================ */

.meanwhile-polaroid {
    background: #fff;
    padding: 12px 12px 40px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.08);
    display: inline-block;
    position: relative;
    max-width: 100%;
    transform: rotate(var(--rotation, 0deg));
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.meanwhile-polaroid:hover {
    transform: rotate(0deg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.meanwhile-polaroid--float {
    float: right;
    margin: 0 10px 20px 24px;
    max-width: 45%;
}

.meanwhile-polaroid-img {
    width: 100%;
    display: block;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.meanwhile-polaroid-caption {
    font-family: 'Caveat', cursive;
    font-size: 15px;
    color: #666;
    text-align: center;
    margin: 8px 0 -4px;
    position: absolute;
    bottom: 8px;
    left: 0;
    right: 0;
}

/* ============================================
   Security Report - Incident Cards
   ============================================ */

.meanwhile-incidents {
    margin-top: 16px;
}

.meanwhile-incident {
    display: flex;
    gap: 16px;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 12px;
    border-left: 4px solid;
}

.meanwhile-incident--legitimate {
    background: #f1f8e9;
    border-left-color: #2e7d32;
}

.meanwhile-incident--false-alarm {
    background: #fff8f0;
    border-left-color: #c0392b;
}

.meanwhile-incident-icon {
    font-size: 28px;
    flex-shrink: 0;
    line-height: 1;
}

.meanwhile-incident-body {
    flex: 1;
}

.meanwhile-incident-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.meanwhile-incident-label {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}

.meanwhile-incident-status {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 3px;
}

.meanwhile-incident--legitimate .meanwhile-incident-status {
    color: #2e7d32;
    background: #e8f5e9;
}

.meanwhile-incident--false-alarm .meanwhile-incident-status {
    color: #c0392b;
    background: #ffeedd;
}

.meanwhile-incident-text {
    font-size: 15px;
    color: #444;
    margin: 0;
    line-height: 1.65;
}

.meanwhile-security-tagline {
    font-family: 'Caveat', cursive;
    font-size: 20px;
    color: #a08060;
    text-align: center;
    margin: 24px 0 0;
}

/* ============================================
   Catch Up - Unified Card Grid
   ============================================ */

.meanwhile-catchup-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.meanwhile-catchup-card {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: 8px;
    overflow: hidden;
    background: #f4efe6;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.meanwhile-catchup-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.meanwhile-catchup-card-thumb {
    position: relative;
}

.meanwhile-catchup-card-thumb img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}

/* YouTube Shorts: vertical aspect ratio */
.meanwhile-catchup-card--short .meanwhile-catchup-card-thumb img {
    aspect-ratio: 9 / 16;
}

.meanwhile-catchup-card-placeholder {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e8e0d8;
    font-size: 36px;
}

.meanwhile-video-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.25);
    transition: background 0.3s ease;
}

.meanwhile-catchup-card:hover .meanwhile-video-overlay {
    background: rgba(0, 0, 0, 0.35);
}

.meanwhile-video-play {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.meanwhile-catchup-card-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #c0392b;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 3px;
    text-transform: uppercase;
}

.meanwhile-catchup-card-info {
    padding: 14px 16px;
}

.meanwhile-catchup-card-info h4 {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 6px;
    line-height: 1.3;
}

.meanwhile-catchup-card-info p {
    font-size: 13px;
    color: #777;
    margin: 0;
    line-height: 1.5;
}

/* ============================================
   Catch Up - Audio
   ============================================ */

.meanwhile-audio-section {
    margin-top: 20px;
}

.meanwhile-audio-wrap {
    background: linear-gradient(135deg, #3a3226 0%, #5c4a3a 100%);
    border-radius: 12px;
    padding: 20px 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

/* Style WordPress audio block within the meanwhile template */
.meanwhile-audio-wrap .wp-block-audio {
    margin: 0;
}

.meanwhile-audio-wrap audio {
    width: 100%;
    border-radius: 8px;
}

.meanwhile-audio-wrap figcaption {
    font-family: 'Caveat', cursive;
    font-size: 16px;
    color: #e8d5c0;
    text-align: left;
    margin-top: 8px;
}

/* ============================================
   Questionable Choice Award
   ============================================ */

.meanwhile-section--award {
    text-align: center;
}

.meanwhile-award-card {
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 2px dashed #d4c4b0;
}

.meanwhile-award-trophy {
    font-size: 32px;
    margin: 0 0 16px;
}

/* Two-column grid: media left, text right */
.meanwhile-award-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 28px;
    align-items: start;
    text-align: left;
}

.meanwhile-award-media {
    border-radius: 8px;
    overflow: hidden;
}

.meanwhile-award-media-link {
    display: block;
}

.meanwhile-award-video-thumb {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.meanwhile-award-video-thumb img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}

/* YouTube Shorts: vertical aspect ratio */
.meanwhile-award-video-thumb--short img {
    aspect-ratio: 9 / 16;
}

.meanwhile-award-media .meanwhile-polaroid {
    margin: 0;
    transform: none;
}

.meanwhile-award-content h2,
.meanwhile-award-content h3 {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: 22px;
    font-weight: 700;
    color: #2d2d2d;
    margin: 0 0 12px;
    border: none;
    padding: 0;
}

.meanwhile-award-content p {
    font-size: 15px;
    color: #555;
    line-height: 1.7;
    margin: 0 0 16px;
}

.meanwhile-award-content p em {
    font-family: 'Caveat', cursive;
    font-size: 19px;
    color: #a08060;
}

.meanwhile-award-content .meanwhile-polaroid {
    margin-bottom: 20px;
}

/* ============================================
   Sign-off
   ============================================ */

.meanwhile-section--signoff {
    text-align: center;
    padding: 24px 0 48px;
    border-top: 1px solid #e8e0d8;
    margin-bottom: 0;
}

.meanwhile-signoff-content p {
    font-style: italic;
    color: #888;
    line-height: 1.7;
    max-width: 520px;
    margin: 24px auto 0;
}

/* ============================================
   Responsive — Tablet
   ============================================ */

@media (max-width: 900px) {
    .meanwhile-wrapper {
        padding: 22px;
        border-width: 16px;
    }
}

/* ============================================
   Responsive — Mobile
   ============================================ */

@media (max-width: 768px) {
    .meanwhile-wrapper {
        padding: 12px;
        border-width: 12px;
        margin: 10px;
    }

    .meanwhile-header {
        padding-top: 32px;
    }

    .meanwhile-content {
        padding: 24px 0;
    }

    .meanwhile-section {
        margin-bottom: 40px;
    }

    .meanwhile-section-header {
        font-size: 20px;
    }

    .meanwhile-polaroid--float {
        float: none;
        margin: 0 auto 20px;
        max-width: 80%;
        display: block;
    }

    .meanwhile-post {
        padding: 0 20px;
    }

    .meanwhile-catchup-cards {
        grid-template-columns: 1fr;
    }

    .meanwhile-incident {
        flex-direction: column;
        gap: 10px;
    }

    .meanwhile-award-card {
        padding: 24px 16px;
    }

    .meanwhile-award-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .meanwhile-award-media {
        max-width: 280px;
        margin: 0 auto;
    }

    .meanwhile-divider {
        margin: 24px 0;
    }
}

/* ============================================
   Responsive — Small Mobile
   ============================================ */

@media (max-width: 480px) {
    .meanwhile-header {
        padding-top: 20px;
    }

    .meanwhile-subtitle {
        font-size: 18px;
        margin-bottom: 24px;
    }

    .meanwhile-incident {
        padding: 14px;
    }

    .meanwhile-incident-icon {
        font-size: 24px;
    }

    .meanwhile-blog-card-info h3 {
        font-size: 15px;
    }

    .meanwhile-video-info h4 {
        font-size: 14px;
    }

    .meanwhile-signoff-content p {
        font-size: 14px;
    }
}
