/*
Theme Name: Masafidhan Modern
Theme URI: https://masafidhan.com
Author: Masafidh
Author URI: https://masafidhan.com
Description: Tema kustom modern, cepat, bersih, dan responsif untuk ekosistem portofolio, aplikasi, dan blog Masafidhan.
Version: 1.0.0
Requires at least: 6.0
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: masafidhan-modern
*/

/* ==========================================================================
   1. DESIGN TOKENS & RESET
   ========================================================================== */
:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --accent: #0ea5e9;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border: #e2e8f0;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --container: 1120px;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

html {
  font-family: var(--font-sans);
  color: var(--text);
  background-color: var(--bg);
  line-height: 1.6;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-hover);
}

/* ==========================================================================
   2. TYPOGRAPHY & LAYOUT UTILITIES
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--container);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text);
  font-weight: 700;
  line-height: 1.25;
}

h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: 1.35rem; }

p {
  margin-bottom: 1rem;
}

.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }

/* ==========================================================================
   3. BUTTONS & BADGES
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background-color: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-outline:hover {
  background-color: var(--surface);
  border-color: var(--text-muted);
  color: var(--text);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  background-color: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(37, 99, 235, 0.15);
}

/* ==========================================================================
   4. SITE HEADER & NAVIGATION
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.2s;
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.site-logo {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.site-logo span {
  color: var(--primary);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
}

.nav-menu a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.15s ease;
}

.nav-menu a:hover,
.nav-menu .current-menu-item > a {
  color: var(--primary);
}

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  cursor: pointer;
  color: var(--text);
}

/* ==========================================================================
   5. HERO SECTION
   ========================================================================== */
.hero {
  padding: 5rem 0 4rem;
  background: radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 60%),
              radial-gradient(circle at top left, rgba(14, 165, 233, 0.06), transparent 50%);
  border-bottom: 1px solid var(--border);
}

.hero-content {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.hero-title {
  margin-top: 1.25rem;
  margin-bottom: 1.25rem;
  letter-spacing: -0.03em;
}

.hero-title .gradient-text {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   6. SECTIONS & CARDS
   ========================================================================== */
.section {
  padding: 4.5rem 0;
}

.section-alt {
  background-color: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-header {
  margin-bottom: 3rem;
  text-align: center;
}

.section-header p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-top: 0.5rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.75rem;
}

.card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(37, 99, 235, 0.3);
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background-color: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
}

.card-title {
  font-size: 1.25rem;
  margin-bottom: 0.6rem;
}

.card-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  flex-grow: 1;
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

.card-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ==========================================================================
   7. POST ARTICLE & CONTENT
   ========================================================================== */
.post-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.post-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background-color: var(--border);
}

.post-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.post-meta {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.post-title {
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
}

.post-title a {
  color: var(--text);
}

.post-title a:hover {
  color: var(--primary);
}

.post-excerpt {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  line-height: 1.6;
}

/* Single Post Content */
.single-article {
  max-width: 800px;
  margin: 3rem auto;
  background: var(--surface);
  padding: 2.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.single-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.article-content {
  font-size: 1.05rem;
  line-height: 1.8;
  color: #334155;
}

.article-content p {
  margin-bottom: 1.5rem;
}

.article-content h2, 
.article-content h3 {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.article-content pre, 
.article-content code {
  font-family: var(--font-mono);
  background-color: #f1f5f9;
  border-radius: var(--radius-sm);
}

.article-content pre {
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.article-content code {
  padding: 0.15rem 0.35rem;
  font-size: 0.9em;
}

/* ==========================================================================
   8. FOOTER
   ========================================================================== */
.site-footer {
  margin-top: auto;
  background-color: #0b1120;
  color: #94a3b8;
  padding: 3.5rem 0 2rem;
  border-top: 1px solid #1e293b;
}

.footer-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #1e293b;
}

.footer-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
}

.footer-brand span {
  color: var(--accent);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.footer-links a {
  color: #94a3b8;
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: #ffffff;
}

.footer-bottom {
  text-align: center;
  font-size: 0.85rem;
  color: #64748b;
}

/* ==========================================================================
   9. RESPONSIVE
   ========================================================================== */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background-color: var(--surface);
    flex-direction: column;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    gap: 1rem;
    align-items: flex-start;
  }

  .nav-menu.active {
    display: flex;
  }

  .single-article {
    padding: 1.5rem;
    margin: 1.5rem auto;
  }

  .footer-wrap {
    flex-direction: column;
    align-items: flex-start;
  }
}
