/*
Theme Name: Almuhajirin Modern
Theme URI: https://almuhajirin.co.id/
Description: Tema modern Al-Muhajirin untuk berita, pendidikan, pesantren, dan PPDB. Child theme dari Legal News.
Author: Al-Muhajirin
Version: 1.2.1
Template: legal-news
Text Domain: almuhajirin-modern
*/

:root {
  --am-green: #1f7a4d;
  --am-green-dark: #0b4f35;
  --am-green-soft: #eaf6ef;
  --am-gold: #e8ad35;
  --am-ink: #14241d;
  --am-muted: #66756e;
  --am-line: #dfe8e2;
  --am-surface: #ffffff;
  --am-bg: #f5f8f6;
  --am-radius: 22px;
  --am-shadow: 0 18px 50px rgba(10, 63, 42, .10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--am-ink);
  background: var(--am-bg);
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.admin-bar .am-header { top: 32px; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
.am-container { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.am-main { min-height: 60vh; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Header */
.am-topbar { background: var(--am-green-dark); color: #d9eee4; font-size: 13px; }
.am-topbar-inner { min-height: 36px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.am-topbar p { margin: 0; }
.am-header { position: sticky; z-index: 100; top: 0; background: rgba(255,255,255,.96); border-bottom: 1px solid rgba(20,36,29,.07); backdrop-filter: blur(18px); }
.am-header-inner { min-height: 82px; display: flex; align-items: center; gap: 30px; }
.am-brand { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.am-brand .custom-logo { width: auto; max-height: 57px; }
.am-brand-mark { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 15px; background: var(--am-green); color: #fff; font-weight: 900; }
.am-brand-copy strong { display: block; color: var(--am-green-dark); font-size: 19px; letter-spacing: -.3px; }
.am-brand-copy span { display: block; margin-top: 2px; color: var(--am-muted); font-size: 11px; }
.am-nav ul { display: flex; align-items: center; gap: 4px; padding: 0; margin: 0; list-style: none; }
.am-nav li { position: relative; }
.am-nav a { display: block; padding: 13px 12px; border-radius: 12px; font-size: 14px; font-weight: 700; }
.am-nav a:hover, .am-nav .current-menu-item > a, .am-nav .current_page_item > a { color: var(--am-green); background: var(--am-green-soft); }
.am-nav .sub-menu { position: absolute; z-index: 120; top: 100%; left: 0; display: none; width: 240px; margin: 0; padding: 8px; background: #fff; border: 1px solid var(--am-line); border-radius: 14px; box-shadow: var(--am-shadow); }
.am-nav li:hover > .sub-menu,
.am-nav li:focus-within > .sub-menu { display: block; }
.am-nav .sub-menu a { padding: 10px 12px; }
.am-nav .sub-menu .sub-menu { top: -1px; left: 100%; margin: 0; }
.am-nav .sub-menu li.menu-item-has-children > a { padding-right: 30px; }
.am-nav .sub-menu li.menu-item-has-children > a::after { content: "›"; position: absolute; right: 12px; font-size: 20px; line-height: 1; }
.am-header-actions { display: flex; align-items: center; gap: 8px; }
.am-icon-button, .am-menu-toggle { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--am-line); border-radius: 14px; background: #fff; color: var(--am-ink); cursor: pointer; }
.am-menu-toggle { display: none; }
.am-cta, .am-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border: 0; border-radius: 14px; color: #fff; background: var(--am-green); font-size: 14px; font-weight: 800; box-shadow: 0 10px 25px rgba(31,122,77,.18); }
.am-cta:hover, .am-button:hover { background: var(--am-green-dark); color: #fff; transform: translateY(-1px); }
.am-button-light { color: var(--am-green-dark); background: #fff; }
.am-search-panel { display: none; padding: 12px 0 18px; border-top: 1px solid var(--am-line); }
.am-search-panel.is-open { display: block; }
.am-search-panel form { display: flex; gap: 10px; }
.am-search-panel input { flex: 1; min-width: 0; height: 48px; padding: 0 16px; border: 1px solid var(--am-line); border-radius: 13px; font: inherit; }

/* Home hero */
.am-hero { padding: 54px 0 38px; overflow: hidden; background: radial-gradient(circle at 88% 10%, rgba(232,173,53,.18), transparent 28%), linear-gradient(135deg, #eaf6ef 0%, #f9fbfa 65%); }
.am-hero-grid { display: grid; grid-template-columns: 1.02fr .98fr; align-items: center; gap: 56px; }
.am-eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 18px; color: var(--am-green); font-size: 13px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.am-eyebrow::before { content: ""; width: 28px; height: 3px; border-radius: 3px; background: var(--am-gold); }
.am-hero h1 { max-width: 760px; margin: 0; color: var(--am-green-dark); font-family: Georgia, "Times New Roman", serif; font-size: clamp(39px, 4.8vw, 66px); line-height: 1.03; letter-spacing: -.04em; }
.am-hero-copy > p { max-width: 610px; margin: 24px 0 0; color: var(--am-muted); font-size: 18px; line-height: 1.75; }
.am-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.am-button-outline { color: var(--am-green-dark); background: transparent; border: 1px solid #aac9b8; box-shadow: none; }
.am-hero-stats { display: flex; gap: 28px; margin-top: 34px; }
.am-stat strong { display: block; color: var(--am-green-dark); font-size: 25px; }
.am-stat span { color: var(--am-muted); font-size: 12px; }
.am-hero-visual { position: relative; min-height: 510px; }
.am-hero-card { position: absolute; inset: 0 0 30px 40px; overflow: hidden; border-radius: 34px; box-shadow: var(--am-shadow); background: var(--am-green-dark); }
.am-hero-card img { width: 100%; height: 100%; object-fit: cover; opacity: .92; }
.am-hero-card::after { content: ""; position: absolute; inset: 50% 0 0; background: linear-gradient(transparent, rgba(0,0,0,.72)); }
.am-hero-story { position: absolute; z-index: 2; right: 28px; bottom: 58px; left: 70px; color: #fff; }
.am-hero-story .am-category { color: #fff; background: var(--am-green); }
.am-hero-story h2 { max-width: 500px; margin: 13px 0 10px; font-size: clamp(23px, 3vw, 36px); line-height: 1.14; }
.am-hero-story-meta { color: #dce9e2; font-size: 13px; }
.am-floating-badge { position: absolute; z-index: 3; left: 0; bottom: 0; width: 165px; padding: 20px; border-radius: 20px; background: #fff; box-shadow: var(--am-shadow); }
.am-floating-badge strong { display: block; color: var(--am-green-dark); font-size: 30px; }
.am-floating-badge span { display: block; margin-top: 4px; color: var(--am-muted); font-size: 12px; line-height: 1.45; }

/* Shared sections */
.am-section { padding: 76px 0; }
.am-section-white { background: #fff; }
.am-section-dark { color: #fff; background: var(--am-green-dark); }
.am-section-head { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 30px; }
.am-section-head h2 { margin: 0; color: var(--am-green-dark); font-family: Georgia, "Times New Roman", serif; font-size: clamp(30px, 4vw, 46px); line-height: 1.08; letter-spacing: -.035em; }
.am-section-head p { max-width: 580px; margin: 8px 0 0; color: var(--am-muted); line-height: 1.7; }
.am-link { color: var(--am-green); font-size: 14px; font-weight: 900; white-space: nowrap; }
.am-category { display: inline-flex; padding: 6px 10px; border-radius: 999px; color: var(--am-green-dark); background: var(--am-green-soft); font-size: 10px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.am-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--am-muted); font-size: 12px; }

.am-news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.am-card { overflow: hidden; border: 1px solid var(--am-line); border-radius: var(--am-radius); background: #fff; transition: transform .2s, box-shadow .2s; }
.am-card:hover { transform: translateY(-4px); box-shadow: var(--am-shadow); }
.am-card-media { display: block; position: relative; aspect-ratio: 16/10; overflow: hidden; background: #dfe9e3; }
.am-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.am-card:hover .am-card-media img { transform: scale(1.035); }
.am-card-body { padding: 20px; }
.am-card h3 { margin: 13px 0 11px; font-size: 20px; line-height: 1.28; letter-spacing: -.02em; }
.am-card h3 a:hover { color: var(--am-green); }
.am-card-excerpt { margin: 12px 0 0; color: var(--am-muted); font-size: 14px; line-height: 1.65; }

.am-units { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.am-unit { min-height: 185px; padding: 24px; border: 1px solid rgba(255,255,255,.14); border-radius: 20px; background: rgba(255,255,255,.07); }
.am-unit-icon { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 24px; border-radius: 14px; color: var(--am-green-dark); background: var(--am-gold); font-weight: 900; }
.am-unit h3 { margin: 0 0 8px; font-size: 19px; }
.am-unit p { margin: 0; color: #bcd3c7; font-size: 13px; line-height: 1.65; }

.am-cta-panel { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 30px; padding: 48px; overflow: hidden; border-radius: 30px; color: #fff; background: radial-gradient(circle at 90% 20%, rgba(232,173,53,.35), transparent 30%), var(--am-green); }
.am-cta-panel h2 { margin: 0 0 10px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(30px, 4vw, 48px); }
.am-cta-panel p { max-width: 700px; margin: 0; color: #dceee5; line-height: 1.7; }

/* Blog/archive */
.am-page-hero { padding: 62px 0 44px; color: #fff; background: linear-gradient(135deg, var(--am-green-dark), #16714c); }
.am-breadcrumb { margin-bottom: 22px; color: #bad8c8; font-size: 13px; }
.am-breadcrumb a { color: #fff; }
.am-page-hero h1 { max-width: 850px; margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(38px, 5vw, 62px); line-height: 1.02; letter-spacing: -.04em; }
.am-page-hero p { max-width: 700px; margin: 18px 0 0; color: #d7ebe0; font-size: 17px; line-height: 1.7; }
.am-filters { display: flex; gap: 9px; padding: 24px 0 4px; overflow-x: auto; scrollbar-width: none; }
.am-filter { flex: 0 0 auto; padding: 10px 15px; border: 1px solid var(--am-line); border-radius: 999px; color: var(--am-muted); background: #fff; font-size: 13px; font-weight: 800; }
.am-filter:hover, .am-filter.is-active { color: #fff; border-color: var(--am-green); background: var(--am-green); }
.am-archive-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 34px; padding: 38px 0 72px; }
.am-archive-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.am-sidebar { align-self: start; position: sticky; top: 115px; }
.am-widget { margin-bottom: 20px; padding: 22px; border: 1px solid var(--am-line); border-radius: 20px; background: #fff; }
.am-widget h2, .am-widget h3 { margin: 0 0 16px; color: var(--am-green-dark); font-size: 18px; }
.am-widget ul { padding: 0; margin: 0; list-style: none; }
.am-widget li { padding: 10px 0; border-bottom: 1px solid var(--am-line); font-size: 14px; }
.am-widget li:last-child { border-bottom: 0; }
.nav-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 30px; }
.nav-links .page-numbers { display: grid; place-items: center; min-width: 42px; height: 42px; padding: 0 12px; border: 1px solid var(--am-line); border-radius: 12px; background: #fff; font-weight: 800; }
.nav-links .current { color: #fff; border-color: var(--am-green); background: var(--am-green); }
.am-home-pagination { display: flex; justify-content: center; gap: 8px; margin-top: 34px; }
.am-home-pagination a, .am-home-pagination span { display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0 12px; border: 1px solid var(--am-line); border-radius: 12px; background: #fff; font-weight: 900; }
.am-home-pagination .is-current { color: #fff; border-color: var(--am-green); background: var(--am-green); }
.am-unit-static { cursor: default; }
.am-profile-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 30px 0; }
.am-profile-box { padding: 24px; border: 1px solid var(--am-line); border-radius: 18px; background: var(--am-bg); }
.am-profile-box h2 { margin-top: 0; font-size: 22px; }
.am-profile-columns { columns: 2; column-gap: 40px; }

/* Single/page */
.am-content-wrap { display: grid; grid-template-columns: minmax(0, 800px) 310px; justify-content: space-between; gap: 40px; padding: 55px 0 80px; }
.am-article { padding: clamp(22px, 5vw, 54px); border: 1px solid var(--am-line); border-radius: 26px; background: #fff; }
.am-article-header h1 { margin: 16px 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(34px, 5vw, 58px); line-height: 1.08; letter-spacing: -.04em; }
.am-featured { overflow: hidden; margin: 30px 0; border-radius: 22px; }
.am-featured img { display: block; width: 100%; }
.am-prose { color: #293c33; font-family: Georgia, "Times New Roman", serif; font-size: 18px; line-height: 1.9; }
.am-prose h2, .am-prose h3 { color: var(--am-green-dark); line-height: 1.25; }
.am-prose a { color: var(--am-green); text-decoration: underline; }
.am-prose blockquote { margin: 30px 0; padding: 4px 0 4px 24px; border-left: 4px solid var(--am-gold); color: var(--am-green-dark); font-size: 22px; }
.am-prose img { border-radius: 16px; }
.am-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 30px; }
.am-tags a { padding: 8px 12px; border-radius: 999px; color: var(--am-muted); background: var(--am-bg); font-size: 12px; }
.comments-area { margin-top: 28px; padding: 30px; border: 1px solid var(--am-line); border-radius: 22px; background: #fff; }
.comment-form input, .comment-form textarea { width: 100%; padding: 13px; border: 1px solid var(--am-line); border-radius: 12px; }
.comment-form .submit { width: auto; color: #fff; border: 0; background: var(--am-green); }

/* Footer and mobile nav */
.am-footer { padding: 65px 0 105px; color: #d2e3da; background: #082f21; }
.am-footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 50px; }
.am-footer-brand { color: #fff; font-size: 23px; font-weight: 900; }
.am-footer p { max-width: 500px; line-height: 1.7; }
.am-footer h3 { margin: 0 0 16px; color: #fff; font-size: 15px; }
.am-footer ul { padding: 0; margin: 0; list-style: none; }
.am-footer li { margin: 9px 0; font-size: 14px; }
.am-footer-bottom { margin-top: 45px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.12); font-size: 12px; }
.am-mobile-nav { display: none; }

@media (max-width: 1024px) {
  .am-nav, .am-header .am-cta { display: none; }
  .am-menu-toggle { display: grid; }
  .am-nav.is-open { display: block; position: absolute; top: 100%; right: 20px; left: 20px; padding: 12px; border: 1px solid var(--am-line); border-radius: 18px; background: #fff; box-shadow: var(--am-shadow); }
  .am-nav.is-open ul { display: block; }
  .am-nav.is-open .sub-menu, .am-nav.is-open .sub-menu .sub-menu { position: static; display: block; width: auto; margin-left: 14px; padding: 0; border: 0; box-shadow: none; }
  .am-nav.is-open .sub-menu li.menu-item-has-children > a::after { content: "⌄"; }
  .am-hero-grid { grid-template-columns: 1fr; }
  .am-hero-visual { min-height: 480px; }
  .am-news-grid { grid-template-columns: repeat(2, 1fr); }
  .am-units { grid-template-columns: repeat(2, 1fr); }
  .am-archive-layout, .am-content-wrap { grid-template-columns: 1fr; }
  .am-sidebar { position: static; }
  .am-profile-grid { grid-template-columns: 1fr; }
}

@media (max-width: 782px) {
  body.admin-bar .am-header { top: 46px; }
}

@media (max-width: 700px) {
  body { padding-bottom: calc(74px + env(safe-area-inset-bottom)); }
  .am-container { width: min(100% - 28px, 1180px); }
  .am-topbar { display: none; }
  .am-header-inner { min-height: 68px; gap: 8px; }
  .am-brand .custom-logo { max-width: 190px; max-height: 48px; }
  .am-brand-copy span { display: none; }
  .am-icon-button { display: none; }
  .am-hero { padding: 34px 0 26px; }
  .am-hero-grid { gap: 32px; }
  .am-hero h1 { font-size: 39px; }
  .am-hero-copy > p { font-size: 16px; line-height: 1.65; }
  .am-hero-stats { gap: 18px; }
  .am-hero-visual { min-height: 390px; }
  .am-hero-card { inset: 0 0 22px; border-radius: 24px; }
  .am-hero-story { right: 20px; bottom: 44px; left: 20px; }
  .am-floating-badge { display: none; }
  .am-section { padding: 54px 0; }
  .am-section-head { display: block; }
  .am-section-head .am-link { display: inline-block; margin-top: 15px; }
  .am-news-grid, .am-archive-grid, .am-units { grid-template-columns: 1fr; }
  .am-news-grid { gap: 16px; }
  .am-card { display: grid; grid-template-columns: 116px 1fr; border-radius: 16px; }
  .am-card-media { height: 100%; min-height: 142px; aspect-ratio: auto; }
  .am-card-body { padding: 15px; }
  .am-card h3 { margin: 9px 0 8px; font-size: 16px; }
  .am-card-excerpt { display: none; }
  .am-cta-panel { grid-template-columns: 1fr; padding: 30px 24px; }
  .am-page-hero { padding: 40px 0 30px; }
  .am-archive-layout, .am-content-wrap { padding: 26px 0 50px; }
  .am-article { border-radius: 20px; }
  .am-prose { font-size: 17px; }
  .am-profile-columns { columns: 1; }
  .am-footer-grid { grid-template-columns: 1fr; gap: 25px; }
  .am-mobile-nav { position: fixed; z-index: 999; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(5, 1fr); min-height: calc(68px + env(safe-area-inset-bottom)); padding: 7px 7px env(safe-area-inset-bottom); border-top: 1px solid var(--am-line); background: rgba(255,255,255,.97); box-shadow: 0 -12px 30px rgba(10,63,42,.10); backdrop-filter: blur(14px); }
  .am-mobile-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: #66756e; font-size: 10px; font-weight: 800; }
  .am-mobile-nav svg { width: 21px; height: 21px; }
  .am-mobile-nav a:nth-child(3) { align-self: end; height: 62px; margin-top: -17px; border-radius: 20px; color: #fff; background: var(--am-green); box-shadow: 0 9px 22px rgba(31,122,77,.28); }
  .am-mobile-nav .is-current { color: var(--am-green); }
}
