/*
Theme Name: NewsMu Pro
Theme URI: https://github.com/cakipin/theme-newsmu
Author: Cak iPin LabMu
Author URI: https://labmu.id
Description: Tema Khusus Muhammadiyah Custom
Version: 0.01.15
Requires at least: 5.9
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: newsmu-pro
Tags: blog, news, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, right-sidebar, grid-layout
*/

/* Tambahkan CSS global di bawah ini jika diperlukan */
body { background: #fff; color: #333; }

/* ==========================================================================
   1. VARIABLES & RESET (Konsistensi)
   ========================================================================== */
:root {
    --nm-font-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    --nm-color-primary: #009c48;
    --nm-color-dark: #1a1a1a;
    --nm-color-text: #444444;
    --nm-color-light: #f4f4f4;
    --nm-border: #e5e5e5;
    /* Support HP Poni (Notch) */
    --nm-safe-area-left: env(safe-area-inset-left);
    --nm-safe-area-right: env(safe-area-inset-right);
}

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

html {
    -webkit-text-size-adjust: 100%; /* Mencegah font berubah ukuran sendiri di iOS */
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent; /* Hilangkan highlight abu-abu saat tap */
}

body {
    margin: 0; padding: 0; width: 100%;
    font-family: var(--nm-font-base);
    background-color: #f9f9f9;
    color: var(--nm-color-text);
    font-size: 16px; 
    line-height: 1.7;
    text-rendering: optimizeLegibility; /* Font lebih tajam */
    -webkit-font-smoothing: antialiased;
    padding-left: var(--nm-safe-area-left);
    padding-right: var(--nm-safe-area-right);
}

/* ==========================================================================
   2. TYPOGRAPHY (SEO Heading Structure)
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    color: var(--nm-color-dark);
    font-weight: 700;
    line-height: 1.3;
    margin-top: 1.5em;
    margin-bottom: 0.6em;
}

/* Fluid Typography (Ukuran menyesuaikan layar) */
h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.75rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; text-transform: uppercase; letter-spacing: 1px; color: #777; }

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}
a:hover, a:focus { color: var(--nm-color-primary); }

/* AKSESIBILITAS (Navigasi Keyboard) */
:focus-visible {
    outline: 2px solid var(--nm-color-primary);
    outline-offset: 3px;
}

/* ==========================================================================
   3. MEDIA & CONTENT (Responsive Images)
   ========================================================================== */
img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
}

/* Video Embed Responsif */
iframe, object, embed, video {
    max-width: 100%;
    border-radius: 6px;
}

/* Video Play Overlay Badge */
.nm-card-thumb,
.nm-list-thumb,
.nm-card-hero,
.nm-rel-thumb,
.nm-ec-hero-thumb,
.nm-ec-list-thumb {
    position: relative;
}

.nm-play-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 46px;
    height: 46px;
    background: rgba(0, 0, 0, 0.65);
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff !important;
    font-size: 16px;
    pointer-events: none;
    transition: transform 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    z-index: 3;
}
.nm-play-badge i {
    margin-left: 3px;
    line-height: 1;
}
.nm-card:hover .nm-play-badge,
.nm-list-item:hover .nm-play-badge,
.nm-card-hero:hover .nm-play-badge,
.nm-card-thumb:hover .nm-play-badge,
.nm-list-thumb:hover .nm-play-badge {
    background: #e62117;
    border-color: #ffffff;
    transform: translate(-50%, -50%) scale(1.12);
}

/* ==========================================================================
   4. FORM ELEMENTS (Touch Friendly)
   ========================================================================== */
input, textarea, select, button {
    font-family: inherit;
    font-size: 16px; /* PENTING: Mencegah zoom-in otomatis di iPhone */
}

input[type="text"],
input[type="email"],
input[type="search"],
input[type="password"],
input[type="url"],
textarea,
select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    margin-bottom: 15px;
    outline: none;
    appearance: none; /* Reset style bawaan browser HP */
    -webkit-appearance: none;
    transition: border 0.3s, box-shadow 0.3s;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--nm-color-primary);
    box-shadow: 0 0 0 3px rgba(0, 156, 72, 0.1);
}

button, input[type="submit"] {
    cursor: pointer;
    font-weight: 600;
}

/* ==========================================================================
   5. WordPress Standard Classes (Content Alignment & Required Elements)
   ========================================================================== */
.sticky { }
.gallery-caption { font-size: 13px; color: #666; font-style: italic; margin-top: 4px; text-align: center; }
.bypostauthor { }

.aligncenter { display: block; margin: 20px auto; clear: both; }
.alignleft { float: left; margin: 5px 20px 20px 0; }
.alignright { float: right; margin: 5px 0 20px 20px; }
.alignnone { margin-bottom: 20px; }

/* Mobile Reset untuk Alignment */
@media (max-width: 600px) {
    .alignleft, .alignright { float: none; display: block; margin: 20px auto; width: 100%; }
}

/* Caption Gambar */
.wp-caption {
    max-width: 100%;
    background: #fff;
    border: 1px solid #eee;
    padding: 6px;
    margin-bottom: 25px;
    text-align: center;
    border-radius: 6px;
}
.wp-caption img { margin: 0 auto; width: 100%; }
.wp-caption-text {
    font-size: 13px; color: #777; margin: 10px 0 5px 0; line-height: 1.4;
}

/* Blockquote Modern */
blockquote {
    margin: 25px 0;
    padding: 20px 25px;
    border-left: 5px solid var(--nm-color-primary);
    background: #fff;
    font-style: italic;
    color: #555;
    font-size: 1.1em;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

/* Table Responsive (Scrollable di HP) */
table { 
    width: 100%; border-collapse: collapse; margin-bottom: 25px; 
    display: block; overflow-x: auto; white-space: nowrap; /* Trik agar bisa discroll */
}
th, td { border: 1px solid #ddd; padding: 12px 15px; text-align: left; }
th { background: #f8f9fa; font-weight: 700; color: var(--nm-color-dark); }
tr:nth-child(even) { background: #fcfcfc; }

/* ==========================================================================
   6. WIDGET STYLES (Default Fallback)
   ========================================================================== */
.widget { margin-bottom: 35px; overflow-wrap: break-word; }
.widget select { max-width: 100%; }
.widget ul { list-style: none; padding: 0; margin: 0; }
.widget ul li {
    padding: 10px 0;
    border-bottom: 1px dashed var(--nm-border);
    display: flex; justify-content: space-between; align-items: center;
    font-size: 15px;
}
.widget ul li a { color: var(--nm-color-text); font-weight: 500; }
.widget ul li:last-child { border-bottom: none; }

/* Calendar Widget */
.widget_calendar table { display: table; width: 100%; white-space: normal; } /* Reset display block */
.widget_calendar th { background: transparent; text-align: center; color: var(--nm-color-primary); }
.widget_calendar td { border: none; text-align: center; padding: 8px; }
.widget_calendar #today { background: var(--nm-color-primary); color: #fff; border-radius: 50%; font-weight: bold; }

/* ==========================================================================
   7. UTILITIES
   ========================================================================== */
.screen-reader-text {
    border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
    height: 1px; margin: -1px; overflow: hidden; padding: 0;
    position: absolute; width: 1px; word-wrap: normal !important;
}

.clearfix::after { content: ""; clear: both; display: table; }

/* Entry Content Mobile Fix (Mencegah layout jebol karena teks panjang/url) */
.entry-content {
    overflow-wrap: break-word;
    word-break: break-word;
}

.entry-content img,
.entry-content iframe,
.entry-content video {
    max-width: 100%;
}
