/* AI Ki Duniya stylesheet
   White background, indigo theme, compact layout, RTL, Noto Nastaliq Urdu */

@font-face {
  font-family: 'Noto Nastaliq Urdu';
  src: url('fonts/noto-nastaliq-urdu.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --indigo: #303F9F;
  --indigo-deep: #1A237E;
  --indigo-soft: #E8EAF6;
  --paper: #FFFFFF;
  --ink: #1B2032;
  --muted: #6E7487;
  --line: #E4E7F2;
  --accent: #5C6BC0;
}

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

body {
  font-family: 'Noto Nastaliq Urdu', serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 2;
  font-size: 15px;
}

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 18px; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* Top strip with the date */

.topstrip {
  background: var(--indigo-soft);
  color: var(--indigo-deep);
  font-size: 12px;
  padding: 4px 0;
  text-align: center;
}

/* Masthead */

.masthead { background: var(--indigo); color: #fff; padding: 20px 0 14px; text-align: center; }
.site-name { font-size: 30px; font-weight: 700; line-height: 1.9; }
.site-tagline { font-size: 12px; opacity: .85; line-height: 1.9; }

/* Navigation */

.mainnav { background: var(--indigo-deep); }
.mainnav .wrap { display: flex; justify-content: center; gap: 4px; flex-wrap: wrap; }
.mainnav a {
  color: #fff; padding: 7px 16px; font-size: 14px; display: inline-block;
  border-bottom: 3px solid transparent;
  transition: background .15s;
}
.mainnav a:hover { background: rgba(255,255,255,.08); }
.mainnav a.on { border-bottom-color: #9FA8DA; }

/* Section headings */

.section-head {
  margin: 26px 0 14px;
  padding-right: 12px;
  border-right: 4px solid var(--indigo);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.9;
}

/* Featured strip */

.featured {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 0;
  margin-top: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.featured-img { width: 100%; height: 100%; min-height: 230px; object-fit: cover; }

.ph {
  background: linear-gradient(135deg, var(--indigo) 0%, var(--indigo-deep) 100%);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.5);
  font-size: 18px; font-weight: 700;
}
.featured .ph { min-height: 230px; }

.featured-text { padding: 18px 22px; align-self: center; }

.cat { color: var(--accent); font-size: 12px; font-weight: 700; }

.featured-title { font-size: 23px; font-weight: 700; line-height: 1.95; margin: 2px 0 6px; }
.featured-title a:hover { color: var(--indigo); }

.excerpt { color: var(--muted); font-size: 13px; }
.date { color: var(--muted); font-size: 11px; margin-top: 6px; }

/* Compact post rows */

.rows { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 22px; }

.row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  align-items: center;
  transition: box-shadow .15s;
}
.row:hover { box-shadow: 0 6px 18px rgba(48,63,159,.10); }

.row-img { width: 110px; height: 100%; min-height: 86px; object-fit: cover; }
.row .ph { height: 100%; min-height: 86px; font-size: 12px; }
.row-body { padding: 8px 2px 8px 14px; }
.row-title { font-size: 14px; font-weight: 700; line-height: 1.95; }
.row-title a:hover { color: var(--indigo); }

/* Popular list */

.popular {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 2px 20px;
  margin-bottom: 36px;
}
.pop { display: flex; align-items: baseline; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.pop:last-child { border-bottom: none; }
.pop-num { color: var(--accent); font-size: 24px; font-weight: 700; min-width: 28px; text-align: center; line-height: 1.6; }
.pop-title { font-size: 14px; font-weight: 700; line-height: 1.95; }
.pop-title a:hover { color: var(--indigo); }

/* Single post page */

.post-page { max-width: 740px; margin: 0 auto; }
.post-head { margin: 26px 0 12px; }
.post-title { font-size: 26px; font-weight: 700; line-height: 1.95; margin: 6px 0; }
.post-hero { border-radius: 10px; margin: 14px 0 20px; width: 100%; }
.post-body p { margin-bottom: 16px; font-size: 16px; line-height: 2.2; }
.related { margin-top: 44px; }

/* Pagination */

.pager { display: flex; justify-content: center; gap: 10px; margin: 32px 0; }
.pager a, .pager span {
  padding: 5px 15px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; font-size: 13px;
}
.pager .cur { background: var(--indigo); color: #fff; border-color: var(--indigo); }

/* Footer */

.footer { background: var(--indigo-deep); color: #fff; margin-top: 50px; padding: 28px 0; text-align: center; }
.footer-name { font-size: 20px; font-weight: 700; }
.footer-note { font-size: 12px; opacity: .8; margin-top: 2px; }
.footer-links { margin-top: 10px; }
.footer-links a { margin: 0 10px; border-bottom: 1px solid #9FA8DA; padding-bottom: 2px; font-size: 13px; }

/* Admin */

.admin-box {
  max-width: 560px; margin: 40px auto;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 26px;
}
.admin-box h1 { font-size: 19px; margin-bottom: 14px; line-height: 1.9; }
.admin-box label { display: block; font-size: 13px; font-weight: 700; margin: 14px 0 5px; }
.admin-box input[type=text],
.admin-box input[type=password],
.admin-box textarea,
.admin-box select {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 8px;
  font-family: inherit; font-size: 14px; background: #F7F8FC;
}
.admin-box textarea { min-height: 200px; line-height: 2; }

.btn {
  display: inline-block; background: var(--indigo); color: #fff;
  border: none; border-radius: 8px; padding: 9px 28px;
  font-family: inherit; font-size: 14px; font-weight: 700;
  cursor: pointer; margin-top: 16px;
}
.btn:hover { background: var(--indigo-deep); }

.msg-ok, .msg-err { padding: 9px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 12px; }
.msg-ok { background: #EAF5EA; color: #2C6B2F; }
.msg-err { background: #FBEAEA; color: #8B2020; }

.admin-list { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-list td, .admin-list th { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: right; }
.admin-list a.del { color: #8B2020; }
.admin-list select { padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; font-family: inherit; font-size: 12px; background: #F7F8FC; }
.admin-list .mini { padding: 3px 12px; margin: 0; font-size: 12px; }

/* Focus visibility for keyboard users */

a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 2px;
}

/* Responsive */

@media (max-width: 860px) {
  .featured { grid-template-columns: 1fr; }
  .rows { grid-template-columns: 1fr; }
  .site-name { font-size: 25px; }
  .featured-title { font-size: 20px; }
  .post-title { font-size: 22px; }
}
