/*
Theme Name: mcqstutor
Theme URI: https://mcqstutor.com
Author: mcqstutor
Description: A green-themed MCQ test-prep WordPress theme with subject sidebar, quiz mode, and MCQ submission — built for Pakistani competitive-exam prep sites (CSS, PPSC, FPSC, NTS).
Version: 1.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: mcqstutor
*/

:root{
  --paper:#F6FAF7;
  --paper-deep:#E9F3EB;
  --ink:#2D3540;
  --ink-soft:#5A6472;
  --green:#2E9E4B;
  --green-dark:#1F7A38;
  --blue:#1B4F91;
  --blue-dark:#123B70;
  --red-pen:#C0272D;
  --gold:#1B4F91;
  --line:#D6E3DA;
  --line-soft:#E9F1EC;
  --white:#FFFFFF;
}
[data-theme="dark"]{
  --paper:#0F1F17;
  --paper-deep:#16281F;
  --ink:#EAF3EC;
  --ink-soft:#AFC4B7;
  --line:#28402F;
  --line-soft:#1D3226;
  --white:#132A1E;
}
*{box-sizing:border-box;}
html{scroll-behavior:smooth;}
body{
  margin:0;
  background:var(--paper);
  color:var(--ink);
  font-family:'Inter',sans-serif;
  -webkit-font-smoothing:antialiased;
}
@media (prefers-reduced-motion: reduce){ *{animation-duration:.01ms !important; transition-duration:.01ms !important;} }
h1,h2,h3{font-family:'Lora',serif; margin:0; color:var(--ink);}
a{color:inherit; text-decoration:none;}
img{max-width:100%; display:block;}
.mono{font-family:'IBM Plex Mono',monospace; letter-spacing:.02em;}
.container{max-width:1180px; margin:0 auto; padding:0 24px;}
.layout{display:grid; grid-template-columns:1fr 320px; gap:36px; align-items:start; max-width:1180px; margin:0 auto; padding:36px 24px 64px;}
@media (max-width:900px){ .layout{grid-template-columns:1fr;} }

/* ---------- Topbar ---------- */
.topbar{background:var(--ink); color:var(--paper); font-size:.78rem;}
.topbar .container{display:flex; justify-content:space-between; align-items:center; padding:7px 24px;}
.topbar .social a{margin-left:14px; opacity:.85;}
.topbar .social a:hover{opacity:1;}
.topbar .tools{display:flex; gap:14px; align-items:center;}
.topbar button{background:none; border:none; color:var(--paper); cursor:pointer; font-size:.9rem;}

/* ---------- Header ---------- */
header.site{background:var(--paper); border-bottom:2px solid var(--ink); position:sticky; top:0; z-index:30;}
.header-inner{display:flex; align-items:center; justify-content:space-between; padding:12px 24px; max-width:1180px; margin:0 auto; gap:16px;}
.brand{order:1; margin-right:auto;}
.menu-toggle{order:2;}
.primary-menu{order:3;}
.brand{display:flex; align-items:center; gap:10px;}
.site-logo{height:52px; width:auto; display:block;}
@media (max-width:600px){ .site-logo{height:40px;} }
.custom-logo-link img{height:52px; width:auto; display:block;}
@media (max-width:600px){ .custom-logo-link img{height:40px;} }
.brand-mark{width:34px; height:34px; border-radius:50%; border:2.5px solid var(--ink); display:flex; align-items:center; justify-content:center; position:relative; flex-shrink:0;}
.brand-mark::after{content:''; width:15px; height:15px; border-radius:50%; background:var(--green);}
.brand-name{font-family:'Lora',serif; font-weight:700; font-size:1.32rem;}
.brand-name span{color:var(--green);}

/* ---------- Breadcrumb ---------- */
.breadcrumb{font-family:'IBM Plex Mono',monospace; font-size:.76rem; color:var(--ink-soft); margin-bottom:16px;}
.breadcrumb a{color:var(--blue); text-decoration:underline;}
.breadcrumb .sep{margin:0 6px; opacity:.6;}

/* ---------- More details link ---------- */
.more-details{display:inline-block; margin-top:8px; font-family:'IBM Plex Mono',monospace; font-size:.78rem; color:var(--blue); font-weight:600; text-decoration:underline;}
.more-details:hover{color:var(--blue-dark);}
nav.primary-menu ul{list-style:none; display:flex; gap:24px; margin:0; padding:0; flex-wrap:wrap; font-size:.9rem; font-weight:600;}
nav.primary-menu li{position:relative;}
nav.primary-menu a{color:var(--ink-soft); padding-bottom:3px; border-bottom:2px solid transparent;}
nav.primary-menu a:hover{color:var(--ink); border-bottom-color:var(--green);}
nav.primary-menu ul ul{display:none; position:absolute; top:100%; left:0; background:var(--white); border:1.5px solid var(--ink); border-radius:4px; padding:8px 0; min-width:220px; flex-direction:column; z-index:40;}
nav.primary-menu li:hover > ul{display:flex;}
nav.primary-menu ul ul a{display:block; padding:7px 16px; border:none;}
nav.primary-menu ul ul a:hover{background:var(--paper-deep);}
.menu-toggle{display:none; background:none; border:2px solid var(--ink); border-radius:3px; padding:6px 10px; cursor:pointer;}
@media (max-width:900px){
  nav.primary-menu{display:none; width:100%;}
  nav.primary-menu.open{display:block;}
  nav.primary-menu ul{flex-direction:column; gap:0;}
  nav.primary-menu ul ul{position:static; border:none; padding-left:14px;}
  .menu-toggle{display:block;}
  .header-inner{flex-wrap:wrap;}
}

/* ---------- Buttons ---------- */
.btn{font-family:'Inter',sans-serif; font-weight:700; font-size:.9rem; padding:12px 22px; border-radius:3px; cursor:pointer; display:inline-flex; align-items:center; gap:8px; border:2px solid var(--ink); transition:transform .15s ease, background .15s ease;}
.btn-primary{background:var(--green); color:var(--white); border-color:var(--green);}
.btn-primary:hover{background:var(--green-dark); border-color:var(--green-dark); transform:translateY(-1px);}
.btn-ghost{background:transparent; color:var(--ink);}
.btn-ghost:hover{background:var(--ink); color:var(--paper);}
.btn-sm{padding:8px 15px; font-size:.8rem;}

/* ---------- Hero ---------- */
.hero{padding:52px 0 20px;}
.hero-grid{display:grid; grid-template-columns:1.1fr .9fr; gap:44px; align-items:center;}
@media (max-width:820px){ .hero-grid{grid-template-columns:1fr;} }
.eyebrow{font-family:'IBM Plex Mono',monospace; font-size:.76rem; letter-spacing:.12em; color:var(--green); text-transform:uppercase; font-weight:600; margin-bottom:12px; display:flex; align-items:center; gap:10px;}
.eyebrow::before{content:''; width:24px; height:1px; background:var(--green); display:inline-block;}
.hero h1{font-size:2.5rem; line-height:1.14; margin-bottom:16px;}
.hero p.lede{font-size:1.02rem; color:var(--ink-soft); line-height:1.6; max-width:48ch; margin-bottom:22px;}

/* ---------- MCQ post card (index/archive loop) ---------- */
.mcq-card{background:var(--white); border:1.5px solid var(--line); border-left:4px solid var(--green); border-radius:2px; padding:20px 22px; margin-bottom:16px;}
.mcq-card .qnum{font-family:'IBM Plex Mono',monospace; font-size:.72rem; color:var(--green-dark); font-weight:600; text-transform:uppercase;}
.mcq-card h2{font-size:1.1rem; margin:6px 0 12px; line-height:1.4;}
.mcq-card h2 a:hover{color:var(--green-dark);}
.opt-list{display:flex; flex-direction:column; gap:7px; margin-bottom:10px;}
.opt-row{display:flex; align-items:center; gap:10px; font-size:.92rem; color:var(--ink-soft);}
.opt-letter{width:22px; height:22px; border-radius:50%; border:1.5px solid var(--ink); display:flex; align-items:center; justify-content:center; font-size:.72rem; font-weight:700; font-family:'IBM Plex Mono',monospace; flex-shrink:0;}
.opt-row.answer .opt-letter{background:var(--green); border-color:var(--green); color:var(--white);}
.opt-row.answer{color:var(--green-dark); font-weight:700;}
.mcq-meta{display:flex; justify-content:space-between; align-items:center; font-size:.78rem; color:var(--ink-soft); border-top:1px solid var(--line-soft); padding-top:10px; margin-top:8px;}
.mcq-card-actions{display:flex; align-items:center; justify-content:space-between; gap:14px; flex-wrap:wrap; margin-top:8px;}
.btn-reveal{
  font-family:'Inter',sans-serif; font-weight:700; font-size:.84rem; padding:10px 20px;
  border-radius:3px; cursor:pointer; border:2px solid var(--blue); background:var(--white); color:var(--blue);
  transition:background .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.btn-reveal:hover{background:var(--blue); color:var(--white); transform:translateY(-1px); box-shadow:0 6px 14px -6px rgba(23,58,99,.4);}
.btn-reveal:focus-visible{outline:2px solid var(--gold); outline-offset:2px;}
.btn-reveal:disabled, .btn-reveal-done{background:var(--green); border-color:var(--green); color:var(--white); cursor:default; transform:none; box-shadow:none;}

/* ---------- Sidebar ---------- */
.sidebar{display:flex; flex-direction:column; gap:26px;}
.widget{background:var(--white); border:1.5px solid var(--line); border-radius:4px; padding:18px 20px;}
.widget h3{font-size:.82rem; text-transform:uppercase; letter-spacing:.08em; font-family:'IBM Plex Mono',monospace; color:var(--green-dark); margin-bottom:14px; padding-bottom:10px; border-bottom:1px solid var(--line-soft);}
.search-form{display:flex; gap:0;}
.search-form input[type=search]{flex:1; border:1.5px solid var(--ink); border-right:none; border-radius:3px 0 0 3px; padding:10px 12px; font-family:'Inter',sans-serif; background:var(--paper); color:var(--ink);}
.search-form button{border:1.5px solid var(--ink); border-radius:0 3px 3px 0; background:var(--green); color:var(--white); padding:0 16px; cursor:pointer; font-weight:700;}
.widget ul{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:4px;}
.widget ul li a{display:block; padding:7px 6px; font-size:.88rem; color:var(--ink-soft); border-radius:3px;}
.widget ul li a:hover{background:var(--paper-deep); color:var(--ink);}
.widget.social-widget{display:flex; flex-direction:column; gap:10px;}
.social-links{display:flex; gap:10px; flex-wrap:wrap;}
.social-links a{border:1.5px solid var(--ink); border-radius:3px; padding:7px 12px; font-size:.78rem; font-weight:700;}
.social-links a:hover{background:var(--ink); color:var(--paper);}
.cat-seal-mini{width:28px; height:28px; border-radius:50%; border:2px dashed var(--gold); display:inline-flex; align-items:center; justify-content:center; font-family:'Lora',serif; font-weight:700; color:var(--gold); font-size:.7rem; margin-right:8px;}

/* ---------- Category / subject cards (home + archive intro) ---------- */
.cat-grid{display:grid; grid-template-columns:repeat(3,1fr); gap:18px;}
@media (max-width:820px){ .cat-grid{grid-template-columns:repeat(2,1fr);} }
@media (max-width:560px){ .cat-grid{grid-template-columns:1fr;} }

/* ---------- Featured homepage category cards ---------- */
.cat-showcase{padding-bottom:8px;}
.cat-grid-featured{gap:20px;}
.cat-card-featured{
  display:block; text-decoration:none; color:var(--ink); background:var(--white);
  border:1.5px solid var(--line); border-radius:10px; padding:22px; position:relative;
  overflow:hidden; transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  border-top:4px solid var(--blue);
}
.cat-card-featured.accent-green{border-top-color:var(--green);}
.cat-card-featured.accent-red{border-top-color:var(--red-pen);}
.cat-card-featured:hover{transform:translateY(-4px); box-shadow:0 14px 28px -12px rgba(23,58,99,.28); border-color:var(--blue);}
.cat-card-featured.accent-green:hover{box-shadow:0 14px 28px -12px rgba(46,158,73,.3);}
.cat-card-featured.accent-red:hover{box-shadow:0 14px 28px -12px rgba(193,39,45,.3);}
.cat-card-top{display:flex; align-items:center; justify-content:space-between; margin-bottom:14px;}
.cat-icon{font-size:2rem; line-height:1;}
.cat-count-badge{font-family:'IBM Plex Mono',monospace; font-size:.7rem; font-weight:700; background:var(--paper-deep); color:var(--ink-soft); padding:4px 10px; border-radius:20px;}
.cat-card-featured h3{font-size:1.2rem; margin-bottom:6px;}
.cat-card-featured .cat-sub{font-size:.86rem; color:var(--ink-soft); line-height:1.5; margin:0 0 18px;}
.cat-card-featured .cat-actions{display:flex; gap:10px; margin-top:0;}
.cat-card-featured .btn{pointer-events:none;}
.cat-card-featured .quiz-cta{pointer-events:auto; cursor:pointer;}
.cat-card{background:var(--white); border:1.5px solid var(--ink); border-radius:4px; padding:20px; display:flex; flex-direction:column; gap:10px; transition:box-shadow .15s ease, transform .15s ease;}
.cat-card:hover{box-shadow:5px 5px 0 var(--green); transform:translate(-2px,-2px);}
.cat-seal{width:42px; height:42px; border-radius:50%; border:2px dashed var(--gold); display:flex; align-items:center; justify-content:center; font-size:1.4rem;}
.cat-count{font-family:'IBM Plex Mono',monospace; font-size:.74rem; color:var(--ink-soft);}
.cat-actions{display:flex; gap:8px; margin-top:auto; padding-top:6px;}

/* ---------- Quiz page ---------- */
.quiz-setup{background:var(--white); border:1.5px solid var(--ink); border-radius:4px; padding:28px; max-width:560px;}
.field{margin-bottom:20px;}
.field label{display:block; font-family:'IBM Plex Mono',monospace; font-size:.72rem; letter-spacing:.06em; text-transform:uppercase; color:var(--ink-soft); margin-bottom:8px; font-weight:600;}
select{width:100%; padding:11px 12px; border:1.5px solid var(--ink); border-radius:3px; font-family:'Inter',sans-serif; font-size:.95rem; background:var(--paper); color:var(--ink);}
.count-row{display:flex; gap:10px; flex-wrap:wrap;}
.count-opt{flex:1; min-width:60px; text-align:center; padding:10px 0; border:1.5px solid var(--line); border-radius:3px; cursor:pointer; font-family:'IBM Plex Mono',monospace; font-weight:600; font-size:.86rem; color:var(--ink-soft); background:var(--paper);}
.count-opt.selected{border-color:var(--green); background:var(--green); color:var(--white);}
.quiz-shell{max-width:660px;}
.quiz-progress{display:flex; justify-content:space-between; margin-bottom:16px; font-family:'IBM Plex Mono',monospace; font-size:.78rem; color:var(--ink-soft);}
.progress-track{height:5px; background:var(--line-soft); border-radius:3px; overflow:hidden; margin-bottom:24px;}
.progress-fill{height:100%; background:var(--green); transition:width .3s ease;}
.quiz-qcard{background:var(--white); border:1.5px solid var(--ink); border-radius:4px; padding:26px 24px;}
.quiz-qcard .qnum{font-family:'IBM Plex Mono',monospace; font-size:.74rem; color:var(--green-dark); font-weight:600; margin-bottom:8px; display:block;}
.quiz-qcard h3{font-size:1.15rem; line-height:1.4; margin-bottom:20px;}
.quiz-opt{display:flex; align-items:center; gap:14px; padding:12px 14px; border:1.5px solid var(--line); border-radius:3px; margin-bottom:10px; cursor:pointer; background:var(--paper);}
.quiz-opt:hover{border-color:var(--green);}
.quiz-opt.locked{cursor:default;}
.quiz-opt.chosen-correct{border-color:var(--green); background:var(--paper-deep);}
.quiz-opt.chosen-wrong{border-color:var(--red-pen); background:#FBF0EE;}
.quiz-opt.reveal-correct{border-color:var(--green);}
.quiz-footer{display:flex; justify-content:flex-end; margin-top:18px;}
.result-card{background:var(--white); border:2px solid var(--ink); border-radius:4px; padding:36px; text-align:center; max-width:520px; margin:0 auto;}
.score-big{font-family:'Lora',serif; font-weight:700; font-size:3.2rem; margin:6px 0;}
.score-big span{color:var(--green-dark);}
.result-actions{display:flex; gap:12px; justify-content:center; margin-top:20px; flex-wrap:wrap;}
.review-list{max-width:640px; margin:30px auto 0; text-align:left;}
.review-row{display:flex; gap:12px; padding:13px 0; border-bottom:1px solid var(--line-soft);}
.review-mark{font-family:'IBM Plex Mono',monospace; font-weight:700; width:20px; flex-shrink:0;}
.review-mark.ok{color:var(--green-dark);} .review-mark.no{color:var(--red-pen);}

/* ---------- Submit MCQs form ---------- */
.mcq-form{background:var(--white); border:1.5px solid var(--ink); border-radius:4px; padding:28px; max-width:640px;}
.mcq-form label{display:block; font-family:'IBM Plex Mono',monospace; font-size:.72rem; text-transform:uppercase; color:var(--ink-soft); margin-bottom:6px; font-weight:600;}
.mcq-form input[type=text], .mcq-form textarea, .mcq-form select{width:100%; padding:10px 12px; border:1.5px solid var(--ink); border-radius:3px; font-family:'Inter',sans-serif; margin-bottom:16px; background:var(--paper); color:var(--ink);}
.mcq-form .opt-fields{display:grid; grid-template-columns:1fr 1fr; gap:0 14px;}

/* ---------- Auth ---------- */
.auth-card{background:var(--white); border:1.5px solid var(--ink); border-radius:4px; padding:30px; max-width:420px; margin:0 auto;}
.auth-card input{width:100%; padding:10px 12px; border:1.5px solid var(--ink); border-radius:3px; margin-bottom:14px; background:var(--paper); color:var(--ink);}

/* ---------- Pagination ---------- */
.pagination{display:flex; gap:8px; margin-top:20px; flex-wrap:wrap;}
.pagination a, .pagination span{border:1.5px solid var(--line); border-radius:3px; padding:8px 13px; font-family:'IBM Plex Mono',monospace; font-size:.82rem;}
.pagination .current{background:var(--ink); color:var(--paper); border-color:var(--ink);}
.hidden{display:none !important;}
.comments-area{margin-top:26px; padding-top:20px; border-top:1.5px solid var(--line);}

/* ---------- Ad slots (AdSense-ready zones) ---------- */
.ad-slot{margin:22px 0; display:flex; flex-direction:column; align-items:center;}
.ad-slot .ad-unit{width:100%; text-align:center;}
.ad-label{display:block; font-family:'IBM Plex Mono',monospace; font-size:.66rem; letter-spacing:.1em; text-transform:uppercase; color:var(--ink-soft); opacity:.6; margin-bottom:6px;}
.ad-slot-leaderboard{min-height:0;}
.sidebar .ad-slot{margin:0;}

/* ---------- Footer ---------- */
footer.site{background:var(--ink); color:var(--paper); margin-top:40px;}
footer.site .footer-top{max-width:1180px; margin:0 auto; padding:48px 24px 30px; display:grid; grid-template-columns:1.4fr 1fr 1fr 1fr; gap:32px;}
@media (max-width:820px){ footer.site .footer-top{grid-template-columns:1fr 1fr;} }
@media (max-width:520px){ footer.site .footer-top{grid-template-columns:1fr;} }
footer.site .site-logo, footer.site .custom-logo-link img{height:44px; filter:brightness(0) invert(1);}
footer.site .footer-about p{color:#B9C4BD; font-size:.88rem; line-height:1.6; margin:14px 0 16px; max-width:32ch;}
footer.site h4{font-family:'IBM Plex Mono',monospace; font-size:.78rem; text-transform:uppercase; letter-spacing:.08em; color:var(--paper); margin-bottom:14px;}
footer.site ul{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px;}
footer.site ul a{color:#B9C4BD; font-size:.88rem;}
footer.site ul a:hover{color:var(--paper); text-decoration:underline;}
footer.site .social-links a{border-color:#3E4B41; color:var(--paper);}
footer.site .social-links a:hover{background:var(--green); border-color:var(--green);}
.footer-bottom{border-top:1px solid #34413A; padding:18px 24px; }
.footer-bottom .container{max-width:1180px; margin:0 auto; display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:10px;}
.footer-bottom .mono{color:#94A39A; font-size:.76rem;}
.footer-bottom a{color:#94A39A;}
.footer-bottom a:hover{color:var(--paper);}

/* ---------- Static content pages (about/privacy/contact) ---------- */
.content-page{line-height:1.75; color:var(--ink-soft); font-size:1rem;}
.content-page h2{font-size:1.3rem; color:var(--ink); margin:28px 0 12px;}
.content-page h2:first-child{margin-top:0;}
.content-page ul{padding-left:20px;}
.content-page li{margin-bottom:6px;}
.content-page strong{color:var(--ink);}

/* ---------- Contact page ---------- */
.contact-grid{display:grid; grid-template-columns:1fr 1fr; gap:28px;}
@media (max-width:700px){ .contact-grid{grid-template-columns:1fr;} }
.contact-info .widget{margin-bottom:16px;}

/* ---------- Past papers ---------- */
.paper-card{background:var(--white); border:1.5px solid var(--line); border-left:4px solid var(--blue); border-radius:2px; padding:16px 20px; margin-bottom:12px; display:flex; justify-content:space-between; align-items:center; gap:14px; flex-wrap:wrap;}
.paper-card h3{font-size:1rem; margin-bottom:4px;}
.paper-card .mono{color:var(--ink-soft); font-size:.78rem;}

/* ---------- Extra mobile-friendliness ---------- */
@media (max-width:600px){
  .hero{padding:36px 0 12px;}
  .hero h1{font-size:1.7rem;}
  section{padding:36px 0;}
  .quiz-qcard, .quiz-setup, .mcq-form, .result-card, .auth-card{padding:20px 16px;}
  .cat-grid{gap:14px;}
  .btn{width:100%; justify-content:center;}
  .hero-actions .btn, .hero > .container .btn{width:auto;}
  footer.site .footer-top{padding:36px 20px 20px;}
}
@media (max-width:420px){
  .brand-name{font-size:1.05rem;}
  .topbar .container{flex-direction:column; gap:6px; align-items:flex-start; padding:8px 20px;}
}
