/*
 * Myo Taw News — Custom Styles
 * Modern press-ready design with media-rich features
 */

/* =========================================
   Self-hosted Padauk Font
   ========================================= */
@font-face {
    font-family: 'Padauk';
    src: url("../fonts/Padauk-Regular.b59eb024a421.ttf") format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Padauk';
    src: url("../fonts/Padauk-Bold.bbe028bf01f2.ttf") format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* =========================================
   Font Families
   ========================================= */
body {
    font-family: 'Padauk', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.font-serif {
    font-family: 'Merriweather', serif;
}

/* =========================================
   Custom Scrollbar
   ========================================= */
.hide-scroll::-webkit-scrollbar {
    display: none;
}

.hide-scroll {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Styled scrollbar for desktop */
@media (min-width: 768px) {
    ::-webkit-scrollbar {
        width: 8px;
    }
    ::-webkit-scrollbar-track {
        background: #f1f1f1;
    }
    ::-webkit-scrollbar-thumb {
        background: #c4c4c4;
        border-radius: 4px;
    }
    ::-webkit-scrollbar-thumb:hover {
        background: #a0a0a0;
    }
}

/* =========================================
   Breaking News Ticker Animation
   ========================================= */
@keyframes slideUpFade {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    10% {
        opacity: 1;
        transform: translateY(0);
    }
    90% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-10px);
    }
}

.ticker-text {
    animation: slideUpFade 4s infinite;
}

/* =========================================
   News Card — Fully CSS-driven Layout & Hover
   ========================================= */

/* Card image wrapper */
.card-img-wrap {
    aspect-ratio: 16 / 10;
}

/* Category badge (pure CSS, no Tailwind arbitrary) */
.card-cat-badge {
    background-color: rgba(220, 38, 38, 0.9);
    backdrop-filter: blur(4px);
    font-size: 10px;
    line-height: 1.4;
    transition: background-color 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.card-cat-badge:hover {
    background-color: #b91c1c;
}
@media (min-width: 768px) {
    .card-cat-badge {
        font-size: 12px;
    }
}

/* Card meta (date) font size */
.card-meta {
    font-size: 10px;
}
@media (min-width: 768px) {
    .card-meta {
        font-size: 12px;
    }
}

/* =========================================
   Video Section
   ========================================= */
.video-play-btn {
    transition: transform 0.3s ease, background-color 0.3s ease;
}
.group:hover .video-play-btn {
    transform: scale(1.1);
}

/* =========================================
   Prose (Article body text improvements)
   ========================================= */
.prose p {
    margin-bottom: 1.25rem;
    line-height: 2;
}

.prose img {
    border-radius: 0.75rem;
    margin: 1.5rem 0;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.prose h2,
.prose h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.prose a {
    color: #dc2626;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.prose a:hover {
    color: #b91c1c;
}

.prose blockquote {
    border-left: 4px solid #dc2626;
    padding-left: 1rem;
    font-style: italic;
    color: #6b7280;
    margin: 1.5rem 0;
    background: #fef2f2;
    padding: 1rem 1.25rem;
    border-radius: 0 0.5rem 0.5rem 0;
}

.prose figure {
    margin: 1.5rem 0;
}

.prose figcaption {
    color: #6b7280;
    font-size: 0.875rem;
    text-align: center;
    margin-top: 0.5rem;
    font-style: italic;
}

/* =========================================
   Line Clamp (for truncating text)
   ========================================= */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* =========================================
   Responsive Video Embeds
   ========================================= */
.responsive-object iframe {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16/9 !important;
    border-radius: 0.75rem;
}

/* =========================================
   Animations
   ========================================= */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-down {
    animation: fadeInDown 0.35s ease-out;
}

@keyframes shimmer {
    0% { background-position: -468px 0; }
    100% { background-position: 468px 0; }
}

/* Skeleton loader for lazy images */
.skeleton-loader {
    background: linear-gradient(to right, #f0f0f0 8%, #e0e0e0 18%, #f0f0f0 33%);
    background-size: 800px 100%;
    animation: shimmer 1.5s infinite linear;
}

/* =========================================
   Wagtail Admin Overrides (for Myanmar font)
   ========================================= */
.richtext-editor,
.w-field__input textarea,
.w-field__input input {
    font-family: 'Padauk', sans-serif !important;
}

/* =========================================
   Mobile-First Responsive Enhancements
   ========================================= */
/* Prevent horizontal overflow */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}
img {
    max-width: 100%;
    height: auto;
}

/* Ensure grid items don't overflow */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Better touch targets on mobile */
@media (max-width: 767px) {
    .prose p {
        font-size: 1rem;
        line-height: 2;
    }
    /* Gallery slider: larger swipe target */
    .gallery-slider {
        border-radius: 0.5rem;
    }
    .gallery-btn {
        width: 36px;
        height: 36px;
    }
    /* Footer: stack columns */
    footer .grid {
        gap: 2rem;
    }
    /* Pagination spacing */
    nav .px-4 {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    /* Container padding */
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

/* Tablet tweaks */
@media (min-width: 768px) and (max-width: 1023px) {
    .container {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
}

/* Small phone (< 375px) */
@media (max-width: 374px) {
    .container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    /* Reduce heading sizes */
    h1 { font-size: 1.125rem !important; }
    h2 { font-size: 1rem !important; }
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Focus visible for accessibility */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #dc2626;
    outline-offset: 2px;
    border-radius: 2px;
}

/* =========================================
   Media-Rich Press Features
   ========================================= */

/* Image hover zoom for galleries */
.gallery-grid figure img {
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.gallery-grid figure:hover img {
    transform: scale(1.05);
}

/* Share buttons hover */
.share-btn {
    transition: all 0.2s ease;
}
.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Gradient text for headings (press vibe) */
.gradient-text {
    background: linear-gradient(135deg, #dc2626, #991b1b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Breaking badge pulse */
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
}

.pulse-glow {
    animation: pulse-glow 2s infinite;
}

/* Print styles for articles */
@media print {
    header, footer, nav, .ad-header, .ad-footer,
    #site-header, .share-btn, .gallery-dots,
    .gallery-btn, button { display: none !important; }
    
    body { font-size: 12pt; color: #000; background: #fff; }
    .prose { max-width: 100%; }
    img { max-width: 100%; page-break-inside: avoid; }
    h1, h2, h3 { page-break-after: avoid; }
    a { color: #000; text-decoration: none; }
    a[href]:after { content: " (" attr(href) ")"; font-size: 0.8em; }
}

/* =========================================
   Selection Color
   ========================================= */
::selection {
    background-color: rgba(220, 38, 38, 0.15);
    color: inherit;
}

