/* ======================================================
   JAR Magazine - CLEAN FINAL CSS (No Plugin)
   Works with:
   - page-magazine.php (hero + featured + grid)
   - page-magazine-login.php
   - page-magazine-submit.php
====================================================== */

:root{
  --jar-bg:#ffffff;
  --jar-card:#ffffff;
  --jar-text:#111111;
  --jar-muted:#555555;
  --jar-border:#e9e9e9;
  --jar-soft:#fafafa;
  --jar-shadow:0 10px 28px rgba(0,0,0,.06);
  --jar-radius:18px;
  --jar-radius-sm:14px;
}

/* Base + Safety */
.jar-mag-wrap, .jar-mag-wrap * { box-sizing: border-box; }
.jar-mag-wrap{
  max-width:1140px;
  margin:28px auto;
  padding:0 16px;
  font-family: Arial, sans-serif;
  line-height:1.6;
  color:var(--jar-text);
}
.jar-mag-wrap img{
  max-width:100% !important;
  height:auto !important;
  display:block !important;
}
.jar-mag-wrap iframe,
.jar-mag-wrap video,
.jar-mag-wrap table{
  max-width:100% !important;
}

/* Common UI */
.jar-section{ margin-top:22px; }
.jar-h2{
  margin:0 0 12px;
  font-size:22px;
  letter-spacing:-.01em;
}
.jar-meta{ color:#666; font-size:13px; }

.jar-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:10px 14px;
  border-radius:12px;
  border:1px solid #dcdcdc;
  background:#fff;
  color:#111;
  font-weight:800;
  text-decoration:none;
  cursor:pointer;
}
.jar-btn:hover{ filter:brightness(.98); }
.jar-btn--primary{ background:#111; color:#fff; border-color:#111; }
.jar-btn--black{ background:#111; color:#fff; border-color:#111; }

/* Page card container (login/submit use this) */
.jar-mag-card{
  background:var(--jar-card);
  border:1px solid var(--jar-border);
  border-radius:var(--jar-radius);
  padding:18px;
  box-shadow:var(--jar-shadow);
}
.jar-mag-top{
  display:flex;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
  align-items:flex-start;
}
.jar-mag-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}
.jar-mag-title{
  margin:0;
  font-size:30px;
  line-height:1.15;
  letter-spacing:-.02em;
}
.jar-mag-sub{ margin:8px 0 0; color:var(--jar-muted); }

/* Alerts */
.jar-mag-alert{
  margin-top:14px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid #ddd;
}
.jar-mag-alert--ok{ background:#f2fff2; border-color:#bfe8bf; }
.jar-mag-alert--error{ background:#fff2f2; border-color:#efb1b1; }

/* Forms (login/submit) */
.jar-mag-form{ margin-top:14px; display:grid; gap:12px; }
.jar-mag-label{ display:block; font-weight:900; font-size:16px; margin-bottom:6px; }

.jar-mag-input, .jar-mag-textarea{
  width:100%;
  border:1px solid #dcdcdc;
  border-radius:14px;
  padding:14px 16px;
  font-size:18px;
  background:#fff;
}
.jar-mag-textarea{
  min-height:420px;
  font-size:17px;
  resize:vertical;
}

/* HERO */
.jar-hero{
  display:grid;
  grid-template-columns:1.2fr .8fr;
  gap:14px;
  border:1px solid var(--jar-border);
  border-radius:var(--jar-radius);
  padding:16px;
  background:var(--jar-bg);
  box-shadow:var(--jar-shadow);
  overflow:hidden;
}
.jar-kicker{
  font-size:12px;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:#666;
}
.jar-hero__title{
  margin:8px 0 10px;
  font-size:30px;
  line-height:1.15;
  letter-spacing:-.02em;
}
.jar-hero__desc{ margin:0; color:var(--jar-muted); font-size:16px; }

.jar-hero__cta{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:14px;
}
.jar-auth{
  margin-top:14px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}
.jar-auth__box{ display:flex; gap:10px; flex-wrap:wrap; }
.jar-note{ color:#777; font-size:12px; }

.jar-hero__media{ display:flex; flex-direction:column; gap:8px; }
.jar-hero__img{
  width:100%;
  border-radius:14px;
  border:1px solid #eee;
}
.jar-hero__caption{ color:#777; font-size:12px; }

/* Service cards */
.jar-cards{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:12px;
}
.jar-card{
  display:block;
  text-decoration:none;
  border:1px solid var(--jar-border);
  border-radius:16px;
  padding:14px;
  background:#fff;
  box-shadow:0 6px 18px rgba(0,0,0,.04);
}
.jar-card:hover{ transform:translateY(-1px); transition:.15s; }
.jar-card__title{ font-weight:900; color:#111; }
.jar-card__meta{ margin-top:6px; color:#666; font-size:13px; }

/* Brand pills */
.jar-pills{ display:flex; gap:10px; flex-wrap:wrap; }
.jar-pill{
  text-decoration:none;
  font-weight:900;
  color:#111;
  background:var(--jar-soft);
  border:1px solid #eee;
  border-radius:999px;
  padding:10px 12px;
}
.jar-pill:hover{ filter:brightness(.98); }

/* Featured article */
.jar-featured{
  margin-top:8px;
  border:1px solid var(--jar-border);
  border-radius:18px;
  background:#fff;
  overflow:hidden;
  display:grid;
  grid-template-columns:1.1fr .9fr;
  box-shadow:var(--jar-shadow);
}
.jar-featured__media{ display:block; width:100%; text-decoration:none; }
.jar-featured__img{
  width:100% !important;
  height:auto !important;
  min-height:260px;
  object-fit:cover;
  background:#f2f2f2;
}
.jar-featured__body{ padding:14px; }
.jar-featured__title{
  margin:6px 0 8px;
  font-size:20px;
  line-height:1.25;
  word-break:break-word;
  overflow-wrap:anywhere;
}
.jar-featured__title a{ text-decoration:none; color:#111; }
.jar-featured__excerpt{ margin:0 0 12px; color:#555; }

/* Grid */
.jar-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:12px;
  margin-top:14px;
  align-items:stretch;
}
.jar-item{
  border:1px solid var(--jar-border);
  border-radius:16px;
  overflow:hidden;
  background:#fff;
  box-shadow:0 6px 18px rgba(0,0,0,.04);
}
.jar-item__media{ display:block; width:100%; }
.jar-item__img{
  width:100% !important;
  aspect-ratio:16/9;
  height:auto !important;
  object-fit:cover;
  background:#f2f2f2;
}
.jar-mag-thumb--blank{ background:#f2f2f2; }
.jar-item__body{ padding:12px; }
.jar-item__title{
  margin:6px 0 0;
  font-size:16px;
  line-height:1.35;
  word-break:break-word;
  overflow-wrap:anywhere;
}
.jar-item__title a{ text-decoration:none; color:#111; }

/* Pagination */
.jar-nav{
  margin-top:14px;
  overflow-x:auto;
  white-space:nowrap;
  padding-bottom:6px;
}
.jar-nav .page-numbers{
  display:inline-block;
  padding:8px 10px;
  border:1px solid #e5e5e5;
  border-radius:10px;
  margin-right:8px;
  text-decoration:none;
  color:#111;
  background:#fff;
  font-weight:800;
}
.jar-nav .current{ background:#111; color:#fff; border-color:#111; }

/* Contact */
.jar-contact{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}
.jar-contact__box{
  border:1px solid var(--jar-border);
  border-radius:16px;
  padding:14px;
  background:#fff;
  box-shadow:0 6px 18px rgba(0,0,0,.04);
}
.jar-contact__title{ font-weight:900; margin-bottom:8px; }
.jar-contact__text{ color:#333; font-size:15px; }
.jar-contact__text a{ color:#111; font-weight:900; text-decoration:none; }

/* FAQ */
.jar-faq{
  margin-top:12px;
  border:1px solid var(--jar-border);
  border-radius:16px;
  background:#fff;
  padding:10px 14px;
}
.jar-faq details{ padding:10px 0; border-bottom:1px solid #eee; }
.jar-faq details:last-child{ border-bottom:none; }
.jar-faq summary{ cursor:pointer; font-weight:900; }
.jar-faq p{ margin:8px 0 0; color:#555; }

/* Footer */
.jar-footer{
  margin:22px 0 8px;
  color:#777;
  font-size:12px;
  text-align:center;
}

/* ===== Premium Single Article ===== */
.jar-article{
  background:#fff;
  border:1px solid var(--jar-border, #e9e9e9);
  border-radius:18px;
  box-shadow:0 10px 28px rgba(0,0,0,.06);
  padding:18px;
}
.jar-article__top{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:center;
  flex-wrap:wrap;
  margin-bottom:10px;
}
.jar-article__meta{ color:#666; font-size:13px; font-weight:700; }
.jar-article__title{
  margin:10px 0 14px;
  font-size:32px;
  line-height:1.15;
  letter-spacing:-.02em;
}
.jar-article__cover img{
  width:100%;
  border-radius:16px;
  border:1px solid #eee;
  object-fit:cover;
}
.jar-article__content{
  margin-top:14px;
  font-size:17px;
  line-height:1.85;
  color:#222;
}
.jar-article__content h2{ font-size:22px; margin:18px 0 8px; }
.jar-article__content p{ margin:0 0 14px; }
.jar-article__nav{
  display:flex;
  justify-content:space-between;
  gap:10px;
  margin-top:16px;
  padding-top:14px;
  border-top:1px solid #eee;
}
.jar-article__nav a{ font-weight:900; text-decoration:none; }
.jar-article__related{ margin-top:18px; }

@media (max-width:640px){
  .jar-article__title{ font-size:24px; }
}

/* Responsive */
@media (max-width: 980px){
  .jar-hero{ grid-template-columns:1fr; }
  .jar-featured{ grid-template-columns:1fr; }
  .jar-featured__img{ min-height:210px; }
  .jar-cards{ grid-template-columns:repeat(2,1fr); }
  .jar-grid{ grid-template-columns:repeat(2,1fr); }
  .jar-contact{ grid-template-columns:1fr; }
}

@media (max-width: 640px){
  .jar-hero__title{ font-size:24px; }
  .jar-cards{ grid-template-columns:1fr; }
  .jar-grid{ grid-template-columns:1fr; }
  .jar-featured__img{ min-height:190px; }
}

/* ===== Rotating Ads: Landing + Single ===== */
.jar-adrot{
  margin:22px 0;
  border-radius:18px;
  overflow:hidden;
  border:1px solid #eee;
  box-shadow:0 10px 28px rgba(0,0,0,.06);
  background:#fff;
}
.jar-adrot a{ display:block; text-decoration:none; }
.jar-adrot img{
  width:100%;
  height:180px;
  object-fit:cover;
  object-position:center;
  display:block;
}
@media (max-width:640px){
  .jar-adrot img{ height:110px; }
}
.jar-adrot{margin:22px 0;border-radius:18px;overflow:hidden;border:1px solid #eee;box-shadow:0 10px 28px rgba(0,0,0,.06);background:#fff;}
.jar-adrot a{display:block;text-decoration:none;}
.jar-adrot img{width:100%;height:180px;object-fit:cover;object-position:center;display:block;}
@media (max-width:640px){.jar-adrot img{height:110px;}}