/* =========================================================
   Design tokens
   Palette: deep maroon + white + warm gold accent
   Display: "Poppins" (bold, confident), Body: "Inter"
   Devanagari text: "Noto Sans Devanagari"
   ========================================================= */
:root {
  --ink:        #7a2530;   /* maroon - primary brand color */
  --ink-soft:   #5f1c25;   /* darker maroon for hover states */
  --parchment:  #ffffff;
  --parchment-2:#f6eceb;
  --brass:      #7a2530;   /* accent reuses maroon for consistency */
  --brass-soft: #a8434f;
  --line:       #ecdfdd;
  --text-main:  #241417;
  --text-muted: #7a6a6c;
  --white:      #ffffff;
  --radius:     10px;
  --shadow:     0 10px 30px rgba(122, 37, 48, 0.10);
  --shadow-lg:  0 20px 50px rgba(122, 37, 48, 0.18);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--parchment);
  color: var(--text-main);
  font-family: 'Inter', 'Noto Sans Devanagari', system-ui, sans-serif;
  line-height: 1.6;
}

h1, h2, h3, h4, .display {
  font-family: 'Poppins', 'Noto Sans Devanagari', system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 0.4em;
  color: var(--ink);
  text-transform: none;
}

.tagline-np, [lang="ne"] {
  font-family: 'Noto Sans Devanagari', 'Inter', sans-serif;
}

a { color: var(--brass); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

button, .btn {
  font-family: inherit;
  cursor: pointer;
  border: none;
  border-radius: 999px;
  padding: 11px 22px;
  font-size: 0.92rem;
  font-weight: 600;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn-primary { background: var(--ink); color: var(--parchment); }
.btn-primary:hover { background: var(--ink-soft); transform: translateY(-1px); text-decoration: none; }
.btn-outline { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--parchment); text-decoration: none; }
.btn-danger { background: #a3423a; color: #fff; }
.btn-danger:hover { background: #8a352e; }
.btn-brass { background: var(--brass); color: var(--white); }
.btn-brass:hover { background: #a17636; text-decoration: none; }
.btn-sm { padding: 7px 14px; font-size: .8rem; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 61;
  background: var(--ink);
  height: 84px;
}
.nav-inner {
  position: relative;
  height: 100%;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0;
}
.brand {
  font-family: 'Poppins', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--white);
  display: flex; align-items: center; gap: 10px;
}
.brand-logo {
  height: 200px;
  width: auto;
  display: block;
  /* Logo is black-on-transparent; invert to white for dark maroon backgrounds */
  filter: brightness(0) invert(1);
}
.admin-bar .brand span { color: var(--white); font-size: .95rem; font-weight: 600; }
.brand .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--white); display: inline-block; opacity: .8; }

.nav-icon-link {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.14);
  color: var(--white);
}
.nav-icon-link:hover { background: rgba(255,255,255,0.28); text-decoration: none; }

.nav-close { display: none; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px; height: 38px;
  background: transparent;
  border-radius: 8px;
  padding: 0;
}
.nav-toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.nav-links { display: flex; gap: 30px; align-items: center; }
.nav-links a { color: rgba(255,255,255,0.92); font-weight: 500; font-size: .92rem; }
.nav-links a:hover { color: var(--white); text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Hero / Introduction ---------- */
.hero {
  position: relative;
  padding: 90px 0 70px;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(600px 300px at 85% -10%, rgba(182,135,62,0.16), transparent 60%),
    radial-gradient(500px 260px at 5% 110%, rgba(18,24,43,0.08), transparent 60%);
  pointer-events: none;
}
.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 56px;
  align-items: center;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .75rem;
  font-weight: 700;
  color: var(--brass);
  margin-bottom: 14px;
  display: block;
}
.hero h1 {
  font-size: clamp(2.2rem, 4.4vw, 3.4rem);
  line-height: 1.08;
}
.hero-tagline {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 46ch;
  margin: 14px 0 26px;
}
.hero-meta {
  display: flex; gap: 22px; flex-wrap: wrap;
  font-size: .88rem; color: var(--text-muted);
  margin-bottom: 26px;
}
.hero-meta span { display: flex; align-items: center; gap: 6px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.portrait-frame {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4/5;
  background: var(--ink);
  box-shadow: var(--shadow-lg);
  border: 4px solid var(--white);
}
.portrait-frame img { width: 100%; height: 100%; object-fit: cover; }
.portrait-frame .no-avatar {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--brass-soft);
  font-family: 'Fraunces', serif;
  font-size: 4rem;
  background: linear-gradient(160deg, var(--ink), var(--ink-soft));
}

/* ---------- Section wrapper ---------- */
.section { padding: 64px 0; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 34px; gap: 20px; flex-wrap: wrap;
}
.section-head h2 { font-size: 1.9rem; }
.section-sub { color: var(--text-muted); font-size: .95rem; }
.title-rule {
  width: 56px; height: 3px; background: var(--ink);
  border: none; margin: 10px 0 0;
}
.divider {
  border: none; height: 1px; background: var(--line); margin: 0;
}

/* ---------- Bio card ---------- */
.bio-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}
.bio-card p { color: var(--text-main); white-space: pre-line; }

/* ---------- Portfolio grid ---------- */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}
.portfolio-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease;
}
.portfolio-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.portfolio-thumb {
  aspect-ratio: 16/11;
  background: var(--parchment-2);
  overflow: hidden;
}
.portfolio-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.portfolio-card:hover .portfolio-thumb img { transform: scale(1.06); }
.portfolio-body { padding: 18px 20px 22px; }
.portfolio-body h3 { font-size: 1.1rem; margin-bottom: 6px; }
.portfolio-body p { color: var(--text-muted); font-size: .9rem; margin: 0 0 12px; }
.portfolio-link { font-size: .85rem; font-weight: 600; }
.empty-state {
  text-align: center; color: var(--text-muted);
  padding: 50px 20px; border: 1.5px dashed var(--line); border-radius: var(--radius);
}

/* ---------- Feed / Status posts (Facebook-style cards) ---------- */
.feed {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.fb-post {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  scroll-margin-top: 100px;
}
.fb-post-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px 0;
}
.fb-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  overflow: hidden; flex-shrink: 0;
  background: var(--ink);
  display: flex; align-items: center; justify-content: center;
  color: var(--brass-soft);
  font-family: 'Poppins', sans-serif; font-weight: 700;
}
.fb-avatar img { width: 100%; height: 100%; object-fit: cover; }
.fb-post-name { font-weight: 700; font-size: .95rem; color: var(--ink); }
.fb-post-time { font-size: .78rem; color: var(--text-muted); }
.fb-post-content {
  padding: 12px 18px 14px;
  white-space: pre-line;
  font-size: 1rem;
  line-height: 1.6;
}
.fb-post-image { background: var(--parchment-2); }
.fb-post-image img { width: 100%; max-height: 520px; object-fit: cover; display: block; }

/* ---------- Forms ---------- */
.form-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  max-width: 520px;
}
.field { margin-bottom: 18px; }
.field label {
  display: block; font-weight: 600; font-size: .85rem;
  margin-bottom: 7px; color: var(--ink);
}
.field input[type=text],
.field input[type=email],
.field input[type=password],
.field input[type=url],
.field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  font-family: inherit;
  font-size: .95rem;
  background: var(--parchment);
  color: var(--text-main);
}
.field input:focus, .field textarea:focus {
  outline: 2px solid var(--brass); outline-offset: 1px;
  background: var(--white);
}
.field textarea { min-height: 110px; resize: vertical; }
.field input[type=file] {
  width: 100%; padding: 9px; border: 1.5px dashed var(--line); border-radius: 9px; background: var(--parchment);
}
.help-text { font-size: .78rem; color: var(--text-muted); margin-top: 5px; }
.alert {
  padding: 13px 16px; border-radius: 9px; margin-bottom: 20px; font-size: .9rem; font-weight: 500;
}
.alert-error { background: #fbeceb; color: #8a352e; border: 1px solid #eec8c4; }
.alert-success { background: #eef4ea; color: #3d6b32; border: 1px solid #cfe3c6; }

/* ---------- Admin layout ---------- */
.admin-shell { min-height: 100vh; background: var(--parchment); }
.admin-bar {
  background: var(--ink); color: var(--parchment);
  padding: 16px 0;
}
.admin-bar .container { display: flex; align-items: center; justify-content: space-between; }
.admin-bar .brand { color: var(--parchment); }
.admin-bar a.link { color: var(--brass-soft); font-size: .9rem; font-weight: 600; }
.admin-tabs { display: flex; gap: 10px; margin: 30px 0; flex-wrap: wrap; }
.admin-tabs a {
  padding: 9px 18px; border-radius: 999px; font-weight: 600; font-size: .88rem;
  border: 1.5px solid var(--line); color: var(--text-main); background: var(--white);
}
.admin-tabs a.active, .admin-tabs a:hover { background: var(--ink); color: var(--parchment); border-color: var(--ink); text-decoration: none; }

.manage-list { display: flex; flex-direction: column; gap: 14px; }
.manage-item {
  display: flex; gap: 16px; align-items: center;
  background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
}
.manage-thumb {
  width: 64px; height: 64px; border-radius: 8px; overflow: hidden; background: var(--parchment-2);
  flex-shrink: 0;
}
.manage-thumb img { width: 100%; height: 100%; object-fit: cover; }
.manage-info { flex: 1; min-width: 0; }
.manage-info strong { display: block; font-size: .95rem; }
.manage-info span { font-size: .8rem; color: var(--text-muted); }
.manage-actions { display: flex; gap: 8px; flex-shrink: 0; }

.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--ink), var(--ink-soft));
  padding: 20px;
}
.login-card {
  background: var(--parchment);
  border-radius: var(--radius);
  padding: 40px 36px;
  width: 100%; max-width: 400px;
  box-shadow: var(--shadow-lg);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: rgba(255,255,255,0.85);
}

/* ---------- Blog / News portal ---------- */
.news-header {
  background: var(--ink);
  color: var(--white);
  padding: 60px 0 44px;
  text-align: center;
}
.news-header .eyebrow { color: var(--brass-soft); }
.news-header h1 { color: var(--white); }
.news-header .section-sub { color: rgba(255,255,255,0.75); }

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 26px;
}
.news-card {
  display: block;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  color: var(--text-main);
  transition: transform .2s ease, box-shadow .2s ease;
}
.news-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); text-decoration: none; }
.news-thumb { aspect-ratio: 16/10; background: var(--parchment-2); overflow: hidden; }
.news-thumb img { width: 100%; height: 100%; object-fit: cover; }
.news-body { padding: 18px 20px 22px; }
.news-date {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--brass); font-weight: 700;
}
.news-body h3 { font-size: 1.15rem; margin: 8px 0 8px; }
.news-body p { color: var(--text-muted); font-size: .9rem; margin: 0 0 12px; }
.news-readmore { font-size: .85rem; font-weight: 600; color: var(--ink); }

.article-body {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-main);
}
.article-body p { margin: 0 0 1.2em; }
.article-body h2, .article-body h3, .article-body h4 { margin-top: 1.4em; }
.article-body ul, .article-body ol { margin: 0 0 1.2em; padding-left: 1.4em; }
.article-body img { border-radius: var(--radius); margin: 1.2em 0; }
.article-body blockquote {
  border-left: 3px solid var(--ink);
  margin: 1.4em 0; padding: 4px 0 4px 18px;
  color: var(--text-muted); font-style: italic;
}
/* ---------- Contact page ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
  align-items: start;
}
.contact-grid .form-card { margin-top: 16px; max-width: none; }
.contact-grid .bio-card { margin-top: 16px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 800px) {
  .hero-grid { grid-template-columns: 1fr; }
  .portrait-frame { max-width: 320px; margin: 0 auto; order: -1; }
  .hero { padding: 50px 0 40px; }
  .section { padding: 44px 0; }
}

@media (max-width: 700px) {
  /* iOS Safari auto-zooms the page when a focused input's text is under
     16px. Forcing 16px here (visually identical, just crisper) stops the
     zoom without changing how anything looks. */
  input[type=text], input[type=email], input[type=password],
  input[type=url], input[type=file], textarea, select {
    font-size: 16px !important;
  }

  .nav { height: 76px; }
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed;
    top: 0; right: 0;
    height: 100vh;
    width: min(78vw, 320px);
    background: var(--ink);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 96px 28px 28px;
    box-shadow: -12px 0 32px rgba(0,0,0,0.28);
    z-index: 60;
    transform: translateX(100%);
    transition: transform .3s ease;
    overflow-y: auto;
  }
  .nav-links.open { transform: translateX(0); }
  .nav-links a { padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,0.12); font-size: .95rem; }
  .nav-links a:last-child { border-bottom: none; }
  .nav-icon-link { align-self: flex-start; margin-top: 14px; }

  .nav-close {
    display: flex;
    align-items: center; justify-content: center;
    position: absolute;
    top: 22px; right: 22px;
    width: 30px; height: 30px;
    background: transparent;
    color: var(--white);
  }
  .nav-close:hover { opacity: 0.75; }
  .nav-close svg { stroke-width: 1.75; width: 26px; height: 26px; }

  .nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 55;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
  }
  .nav-overlay.open { opacity: 1; pointer-events: auto; }
  body.nav-open { overflow: hidden; }

  .brand-logo { height: 150px; }
  .news-header { padding: 42px 0 32px; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .hero h1 { font-size: 1.9rem; }
  .hero-tagline { font-size: 1rem; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { text-align: center; }
  .hero-meta { flex-direction: column; gap: 10px; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .bio-card, .form-card { padding: 20px; }
  .portfolio-grid { grid-template-columns: 1fr; }
  .manage-item { flex-wrap: wrap; }
  .manage-actions { width: 100%; justify-content: flex-end; }
  .admin-bar .container { flex-direction: column; gap: 10px; text-align: center; }
  .admin-tabs { justify-content: center; }
  .login-card { padding: 30px 24px; }
}
