/*
Theme Name: MSM News Theme
Theme URI: https://example.com/msm-news-theme
Author: Yoel Liem & ChatGPT
Author URI: https://example.com
Description: Lightweight, responsive news/magazine WordPress theme with a dynamic layout inspired by large Indonesian news portals. Mobile-first, fast, and SEO-friendly.
Version: 1.2.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: msm-news
Tags: news, magazine, blog, two-columns, custom-logo, custom-menu, featured-images, sticky-post, responsive-layout
*/

/* WordPress resets & helpers */
.alignleft { float:left; margin-right:1rem; }
.alignright { float:right; margin-left:1rem; }
.aligncenter { display:block; margin-left:auto; margin-right:auto; }
.screen-reader-text { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip:rect(1px, 1px, 1px, 1px); white-space:nowrap; border:0; }
.clearfix::after { content:""; display:block; clear:both; }

/* Base */
:root {
  --primary: #0b63f6;
  --accent: #ff3b30;
  --bg: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --container: 1200px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Layout */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 16px;
}

.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
}

.logo a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  letter-spacing: .2px;
  font-size: 1.25rem;
}

.search-form {
  margin-left: auto;
  display: none;
}

.navbar {
  border-top: 1px solid var(--border);
}

.navbar .menu {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 20px;
  padding: 10px 0;
  margin: 0;
  list-style: none;
}

.navbar .menu a {
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}
.navbar .menu a:hover { color: var(--primary); }

/* Mobile nav */
.hamburger {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
.mobile-menu {
  display: none;
  border-top: 1px solid var(--border);
}
.mobile-menu.open { display: block; }
.mobile-menu ul { list-style: none; margin: 0; padding: 8px 0; }
.mobile-menu li a { display:block; padding: 10px 0; border-bottom:1px solid var(--border); text-decoration:none; color:var(--text); }

/* Breaking news ticker */
.ticker {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.ticker-label {
  font-size: .8rem;
  font-weight: 800;
  color: #fff;
  background: var(--accent);
  padding: 6px 10px;
  border-radius: 6px;
}
.ticker-items {
  flex: 1;
  display: flex;
  overflow-x: auto;
  gap: 16px;
}
.ticker-items a {
  text-decoration: none;
  color: var(--text);
  white-space: nowrap;
}
.ticker-items a:hover { color: var(--primary); }

/* Grids */
.grid {
  display: grid;
  gap: 16px;
}
.grid-cols-1 { grid-template-columns: 1fr; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (min-width: 640px) {
  .search-form { display: block; }
  .grid-sm-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-sm-3 { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
  .grid-lg-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-lg-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Cards */
.card {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.card-img {
  display:block;
  width:100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background:#f3f4f6;
}
.card-body { padding: 12px; }
.card-title { margin:0 0 8px 0; font-size: 1.05rem; line-height:1.3; }
.card-title a { color: var(--text); text-decoration:none; }
.card-title a:hover { color: var(--primary); }
.card-meta { font-size:.85rem; color: var(--muted); }

/* Content */
.main { padding: 16px 0 32px; }
.content { }
.sidebar { }

@media (min-width: 1024px) {
  .layout {
    display: grid;
    grid-template-columns: 2.2fr 1fr;
    gap: 24px;
  }
}

/* Post content */
.entry-content img { max-width:100%; height:auto; }
.entry-content a { color: var(--primary); }
.entry-header h1 { margin:.2em 0 .5em 0; font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.2rem); }
.post-meta { color: var(--muted); font-size:.9rem; margin-bottom: 14px; }

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 24px 0 40px;
  color: var(--muted);
  font-size: .95rem;
}
.footer .cols { display:grid; gap:16px; }
@media (min-width: 640px){ .footer .cols { grid-template-columns: repeat(3, 1fr);} }

/* Widgets */
.widget { padding: 12px 0; border-bottom: 1px solid var(--border); }
.widget-title { font-weight:800; margin: 0 0 8px 0; }

/* Pagination */
.pagination { display:flex; gap:10px; justify-content:center; margin: 24px 0; }
.pagination a, .pagination span {
  padding:8px 12px; border:1px solid var(--border); border-radius:8px; text-decoration:none; color:var(--text);
}
.pagination .current { background: var(--primary); color:#fff; border-color: var(--primary); }

/* Ads (placeholders) */
.ad-slot { border:1px dashed var(--border); padding:8px; text-align:center; font-size:.85rem; color:var(--muted); border-radius:8px; }

/* Accessibility focus */
a:focus { outline: 2px dashed var(--primary); outline-offset: 2px; }
*/


/* Breadcrumbs */
.breadcrumbs { font-size:.9rem; margin: 4px 0 12px; color: var(--muted); }
.breadcrumbs ol { list-style:none; display:flex; gap:8px; padding:0; margin:0; flex-wrap: wrap; }
.breadcrumbs li::after { content:"/"; margin-left:8px; color: var(--border); }
.breadcrumbs li:last-child::after { content:""; }
.breadcrumbs a { text-decoration:none; color: var(--muted); }
.breadcrumbs a:hover { color: var(--primary); }

/* FAQ & HowTo styles */
.faq-block .faq-item { margin-bottom:12px; }
.faq-q { display:block; cursor:pointer; }
.faq-a { margin-top:6px; }
.howto-block .howto-step { margin-bottom:14px; }
