/*
Theme Name: Relawan.id
Theme URI: https://relawan.id
Author: Relawan.id Team
Author URI: https://relawan.id
Description: Theme WordPress modern untuk platform sosial Relawan.id — menampilkan program bantuan, kegiatan relawan, transparansi, dan sistem pendaftaran relawan. Humanis, sederhana, terpercaya, transparan, aman. Dibangun dengan security-by-design.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: relawan-id
Tags: community, volunteering, social-impact, responsive, custom-post-types, accessibility-ready
*/

/* ============ Design Tokens ============ */
:root {
  --brand-primary: #0d9488;
  --brand-primary-hover: #0f766e;
  --brand-primary-light: #ccfbf1;
  --brand-accent: #f59e0b;
  --brand-accent-hover: #d97706;
  --brand-bg: #fafaf9;
  --brand-surface: #ffffff;
  --brand-text: #1c1917;
  --brand-text-muted: #57534e;
  --brand-border: #e7e5e4;
  --brand-success: #16a34a;
  --brand-warning: #ea580c;
  --brand-danger: #dc2626;
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.04), 0 1px 3px rgba(0,0,0,.06);
  --shadow: 0 4px 6px -1px rgba(0,0,0,.05), 0 2px 4px -2px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 20px rgba(0,0,0,.06), 0 4px 8px rgba(0,0,0,.04);
}

/* ============ Reset & Base ============ */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--brand-bg);
  color: var(--brand-text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--brand-primary-hover); }
button { cursor: pointer; font-family: inherit; }
h1,h2,h3,h4,h5,h6 { margin: 0 0 .5em; line-height: 1.25; font-weight: 700; color: var(--brand-text); }
h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); }
h3 { font-size: clamp(1.15rem, 2.5vw, 1.5rem); }
p { margin: 0 0 1em; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
@media (min-width: 768px) { .container { padding: 0 1.5rem; } }

main { flex: 1 0 auto; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .625rem 1.25rem; border-radius: var(--radius);
  font-weight: 600; font-size: .95rem; border: 1px solid transparent;
  transition: all .2s; text-decoration: none; cursor: pointer;
}
.btn-primary { background: var(--brand-primary); color: #fff; }
.btn-primary:hover { background: var(--brand-primary-hover); color: #fff; transform: translateY(-1px); }
.btn-outline { background: transparent; border-color: var(--brand-border); color: var(--brand-text); }
.btn-outline:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
.btn-ghost { background: transparent; color: var(--brand-text-muted); }
.btn-ghost:hover { background: var(--brand-bg); color: var(--brand-text); }
.btn-accent { background: var(--brand-accent); color: #fff; }
.btn-accent:hover { background: var(--brand-accent-hover); color: #fff; }
.btn-lg { padding: .875rem 1.75rem; font-size: 1rem; }
.btn-sm { padding: .375rem .75rem; font-size: .85rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

/* ============ Navbar ============ */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.95); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--brand-border);
}
.navbar-inner { display: flex; align-items: center; justify-content: space-between; padding: .875rem 0; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 800; font-size: 1.25rem; color: var(--brand-text); }
.brand-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--brand-primary); color: #fff; }
.nav-menu { display: flex; gap: .5rem; align-items: center; }
.nav-menu a { padding: .5rem .85rem; border-radius: 8px; color: var(--brand-text); font-weight: 500; font-size: .95rem; }
.nav-menu a:hover, .nav-menu a.active { background: var(--brand-primary-light); color: var(--brand-primary); }
.nav-actions { display: flex; gap: .5rem; align-items: center; }
.nav-toggle { display: none; background: none; border: none; padding: .5rem; color: var(--brand-text); }

@media (max-width: 880px) {
  .nav-menu, .nav-actions { display: none; }
  .nav-toggle { display: block; }
  .nav-open .nav-menu {
    display: flex; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; padding: 1rem; border-bottom: 1px solid var(--brand-border); gap: .25rem;
  }
  .nav-open .nav-actions {
    display: flex; flex-direction: column; position: absolute; top: calc(100% + 240px); left: 0; right: 0;
    background: #fff; padding: 1rem; border-bottom: 1px solid var(--brand-border);
  }
}

/* ============ Hero ============ */
.hero {
  position: relative; padding: 5rem 0 4rem;
  background: linear-gradient(135deg, #f0fdfa 0%, #fef3c7 100%);
  overflow: hidden;
}
.hero::before { content:''; position:absolute; top:-50%; right:-10%; width:600px; height:600px; background: radial-gradient(circle, rgba(13,148,136,.12), transparent 70%); border-radius:50%; }
.hero-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; align-items: center; position: relative; }
@media (min-width: 768px) { .hero-grid { grid-template-columns: 1.2fr 1fr; } }
.hero h1 { margin-bottom: 1rem; color: var(--brand-text); }
.hero-sub { font-size: 1.125rem; color: var(--brand-text-muted); max-width: 560px; margin-bottom: 2rem; }
.hero-cta { display: flex; gap: .75rem; flex-wrap: wrap; }
.hero-visual { position: relative; aspect-ratio: 4/3; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); }
.hero-visual img { width: 100%; height: 100%; object-fit: cover; }
.hero-badge {
  position: absolute; bottom: 1rem; left: 1rem;
  background: rgba(255,255,255,.95); backdrop-filter: blur(6px);
  padding: .75rem 1.125rem; border-radius: var(--radius); box-shadow: var(--shadow);
  font-weight: 600; font-size: .875rem;
}

/* ============ Stats Band ============ */
.stats-band { background: var(--brand-primary); color: #fff; padding: 2.5rem 0; }
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; text-align: center; }
@media (min-width: 768px) { .stats-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-card .stat-num { font-size: 2rem; font-weight: 800; line-height: 1.2; }
.stat-card .stat-label { font-size: .9rem; opacity: .9; margin-top: .25rem; }

/* ============ Section ============ */
.section { padding: 4rem 0; }
.section-header { text-align: center; margin-bottom: 2.5rem; }
.section-header .eyebrow { color: var(--brand-primary); font-weight: 600; font-size: .875rem; text-transform: uppercase; letter-spacing: .08em; }
.section-header h2 { margin: .5rem 0; }
.section-header p { color: var(--brand-text-muted); max-width: 600px; margin: 0 auto; }

/* ============ Cards ============ */
.card-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 600px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .card-grid { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: var(--brand-surface); border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--brand-border); transition: transform .25s, box-shadow .25s;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card-cover { aspect-ratio: 16/10; overflow: hidden; background: linear-gradient(135deg, var(--brand-primary-light), #fde68a); }
.card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .card-cover img { transform: scale(1.05); }
.card-body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; }
.card-body h3 { margin-bottom: .5rem; font-size: 1.125rem; }
.card-meta { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }

.badge {
  display: inline-flex; align-items: center; padding: .25rem .625rem; border-radius: 999px;
  font-size: .75rem; font-weight: 600;
}
.badge-primary { background: var(--brand-primary-light); color: var(--brand-primary); }
.badge-success { background: #dcfce7; color: var(--brand-success); }
.badge-warning { background: #fef3c7; color: var(--brand-warning); }
.badge-danger  { background: #fee2e2; color: var(--brand-danger); }
.badge-muted   { background: #f5f5f4; color: var(--brand-text-muted); }

/* ============ Progress ============ */
.progress { background: #f5f5f4; border-radius: 999px; height: 8px; overflow: hidden; margin: .5rem 0; }
.progress-bar { background: var(--brand-primary); height: 100%; border-radius: 999px; transition: width .5s; }
.progress-bar.high { background: var(--brand-success); }
.progress-bar.mid { background: var(--brand-accent); }

/* ============ Forms ============ */
.form-group { margin-bottom: 1.125rem; }
.form-group label { display: block; margin-bottom: .375rem; font-weight: 600; font-size: .9rem; color: var(--brand-text); }
.form-group label .req { color: var(--brand-danger); }
.form-control {
  width: 100%; padding: .625rem .875rem; border-radius: var(--radius-sm);
  border: 1px solid var(--brand-border); background: #fff; font-size: .95rem;
  font-family: inherit; transition: border-color .2s, box-shadow .2s;
}
.form-control:focus { outline: none; border-color: var(--brand-primary); box-shadow: 0 0 0 3px rgba(13,148,136,.15); }
textarea.form-control { min-height: 120px; resize: vertical; }
.form-hint { font-size: .825rem; color: var(--brand-text-muted); margin-top: .375rem; }
.form-error { color: var(--brand-danger); font-size: .85rem; margin-top: .375rem; }
.form-hp { position: absolute; left: -9999px; height: 1px; width: 1px; overflow: hidden; }
.checkbox-row { display: flex; align-items: flex-start; gap: .625rem; }
.checkbox-row input { margin-top: .125rem; }

/* ============ Auth Pages ============ */
.auth-wrap { min-height: 70vh; display: grid; place-items: center; padding: 2.5rem 0; }
.auth-card { width: 100%; max-width: 440px; background: #fff; padding: 2rem; border-radius: var(--radius-lg); box-shadow: var(--shadow); border: 1px solid var(--brand-border); }
.auth-card h1 { font-size: 1.75rem; margin-bottom: .25rem; }
.auth-card .sub { color: var(--brand-text-muted); margin-bottom: 1.5rem; font-size: .95rem; }
.auth-divider { display: flex; align-items: center; gap: 1rem; margin: 1.25rem 0; color: var(--brand-text-muted); font-size: .85rem; }
.auth-divider::before, .auth-divider::after { content:''; flex: 1; height: 1px; background: var(--brand-border); }

/* ============ Alerts ============ */
.alert { padding: .875rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-size: .925rem; }
.alert-success { background: #dcfce7; color: #14532d; border: 1px solid #86efac; }
.alert-error { background: #fee2e2; color: #7f1d1d; border: 1px solid #fca5a5; }
.alert-info { background: #f0fdfa; color: #134e4a; border: 1px solid #5eead4; }
.alert-warning { background: #fef3c7; color: #78350f; border: 1px solid #fcd34d; }

/* ============ Dashboard ============ */
.dash-wrap { display: grid; grid-template-columns: 1fr; gap: 1.5rem; padding: 2rem 0; }
@media (min-width: 900px) { .dash-wrap { grid-template-columns: 240px 1fr; } }
.dash-sidebar {
  background: #fff; border: 1px solid var(--brand-border); border-radius: var(--radius);
  padding: 1rem; height: fit-content;
}
.dash-sidebar h4 { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--brand-text-muted); margin: .5rem 0 .25rem; padding: 0 .5rem; }
.dash-sidebar a {
  display: flex; align-items: center; gap: .625rem; padding: .625rem .75rem; border-radius: 8px;
  color: var(--brand-text); font-weight: 500; font-size: .925rem;
}
.dash-sidebar a:hover { background: var(--brand-bg); }
.dash-sidebar a.active { background: var(--brand-primary); color: #fff; }
.dash-content { min-width: 0; }
.dash-header { background: #fff; border: 1px solid var(--brand-border); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem; }
.dash-header h1 { font-size: 1.5rem; }
.dash-stats { display: grid; grid-template-columns: repeat(2,1fr); gap: 1rem; margin-bottom: 1.5rem; }
@media (min-width: 700px) { .dash-stats { grid-template-columns: repeat(4,1fr); } }
.dash-stat { background: #fff; border: 1px solid var(--brand-border); border-radius: var(--radius); padding: 1.25rem; }
.dash-stat .num { font-size: 1.75rem; font-weight: 800; color: var(--brand-primary); }
.dash-stat .lbl { color: var(--brand-text-muted); font-size: .85rem; margin-top: .25rem; }

/* ============ Table ============ */
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; }
.data-table th, .data-table td { padding: .875rem 1rem; text-align: left; border-bottom: 1px solid var(--brand-border); font-size: .925rem; }
.data-table th { background: #fafaf9; font-weight: 600; color: var(--brand-text-muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.data-table tr:hover td { background: #fafaf9; }

/* ============ Footer ============ */
.site-footer { margin-top: auto; background: #fff; border-top: 1px solid var(--brand-border); }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; padding: 2.5rem 0; }
@media (min-width: 600px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.footer-brand p { color: var(--brand-text-muted); font-size: .9rem; margin-top: 1rem; max-width: 280px; }
.footer-social { display: flex; gap: .5rem; margin-top: 1rem; }
.footer-social a { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; background: var(--brand-bg); color: var(--brand-text); transition: all .2s; }
.footer-social a:hover { background: var(--brand-primary-light); color: var(--brand-primary); }
.footer-col h4 { font-size: .9rem; margin-bottom: .875rem; }
.footer-col a { display: block; padding: .25rem 0; color: var(--brand-text-muted); font-size: .875rem; }
.footer-col a:hover { color: var(--brand-primary); }
.footer-bottom { border-top: 1px solid var(--brand-border); padding: 1rem 0; text-align: center; font-size: .825rem; color: var(--brand-text-muted); }

/* ============ Gallery ============ */
.gallery-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 1rem; }
@media (min-width: 700px) { .gallery-grid { grid-template-columns: repeat(3,1fr); } }
@media (min-width: 1000px) { .gallery-grid { grid-template-columns: repeat(4,1fr); } }
.gallery-item { aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; cursor: pointer; position: relative; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.gallery-item:hover img { transform: scale(1.08); }
.gallery-item .caption { position: absolute; bottom: 0; left: 0; right: 0; padding: .875rem; background: linear-gradient(transparent, rgba(0,0,0,.7)); color: #fff; font-size: .85rem; opacity: 0; transition: opacity .25s; }
.gallery-item:hover .caption { opacity: 1; }

.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.9); z-index: 9999; display: none; place-items: center; padding: 2rem; }
.lightbox.open { display: grid; }
.lightbox img { max-width: 90vw; max-height: 90vh; border-radius: var(--radius); }
.lightbox-close { position: absolute; top: 1.5rem; right: 1.5rem; background: rgba(255,255,255,.15); border: none; color: #fff; width: 44px; height: 44px; border-radius: 50%; font-size: 1.25rem; }

/* ============ FAQ Accordion ============ */
.accordion-item { background: #fff; border: 1px solid var(--brand-border); border-radius: var(--radius); margin-bottom: .75rem; overflow: hidden; }
.accordion-header { width: 100%; padding: 1rem 1.25rem; background: none; border: none; text-align: left; font-weight: 600; font-size: 1rem; display: flex; justify-content: space-between; align-items: center; }
.accordion-header .icon { transition: transform .2s; color: var(--brand-primary); }
.accordion-item.open .accordion-header .icon { transform: rotate(45deg); }
.accordion-body { padding: 0 1.25rem 1rem; color: var(--brand-text-muted); display: none; }
.accordion-item.open .accordion-body { display: block; }

/* ============ Single Program/Kegiatan ============ */
.single-hero { position: relative; aspect-ratio: 21/9; border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 2rem; }
.single-hero img { width: 100%; height: 100%; object-fit: cover; }
.single-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media (min-width: 900px) { .single-grid { grid-template-columns: 2fr 1fr; } }
.single-sidebar { background: #fff; border: 1px solid var(--brand-border); border-radius: var(--radius); padding: 1.5rem; position: sticky; top: 80px; height: fit-content; }
.single-sidebar .stat-row { display: flex; justify-content: space-between; padding: .625rem 0; border-bottom: 1px solid var(--brand-border); font-size: .925rem; }
.single-sidebar .stat-row:last-child { border-bottom: none; }

/* ============ CTA Section ============ */
.cta-section { background: linear-gradient(135deg, var(--brand-primary) 0%, #14b8a6 100%); color: #fff; padding: 4rem 0; border-radius: var(--radius-lg); text-align: center; margin: 4rem 0; }
.cta-section h2 { color: #fff; }
.cta-section p { color: rgba(255,255,255,.9); max-width: 560px; margin: 0 auto 2rem; }
.cta-section .btn-primary { background: #fff; color: var(--brand-primary); }
.cta-section .btn-primary:hover { background: var(--brand-bg); }

/* ============ Empty state ============ */
.empty { text-align: center; padding: 3rem 1rem; color: var(--brand-text-muted); }
.empty .icon { font-size: 3rem; margin-bottom: 1rem; opacity: .4; }

/* ============ Admin Bar offset ============ */
.admin-bar .navbar { top: 32px; }
@media (max-width: 782px) { .admin-bar .navbar { top: 46px; } }

/* ============ Spinner ============ */
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn .spinner { margin-right: .375rem; }
