/* =========================================================
   Awara Banjara — Article reader (blogs & attractions)
   "Magazine" pop-up: photo hero with the title over it, drop-cap lead,
   highlighter headings, fact tiles, numbered steps and FAQ accordions.
   Self-contained (no site variables) so the admin's Preview looks the same.
   Markup: assets/js/article-reader.js
   ========================================================= */

.ar-modal {
  --ar-ink: #14140f;
  --ar-text: #2c2c26;
  --ar-muted: #6b6b63;
  --ar-lime: #d6ff3f;
  --ar-surface: #f6f6f1;
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(10, 10, 8, 0.82);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-family: 'Plus Jakarta Sans', 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html.ar-open, html.ar-open body { overflow: hidden; }

.ar-card {
  position: relative;
  width: 100%;
  max-width: 760px;
  max-height: 92vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff;
  color: var(--ar-text);
  border-radius: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.55);
  outline: none;
  animation: ar-in 0.28s cubic-bezier(0.2, 0.8, 0.25, 1);
}

@keyframes ar-in {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

/* Zero-height sticky bar keeps the close button pinned while scrolling */
.ar-close-bar { position: sticky; top: 0; height: 0; z-index: 5; }

.ar-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: rgba(20, 20, 15, 0.65);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
}

.ar-close:hover { background: var(--ar-ink); transform: rotate(90deg); }
.ar-close:focus-visible { outline: 3px solid var(--ar-lime); outline-offset: 2px; }

/* ---------- Hero ---------- */

.ar-hero { position: relative; height: 420px; background: var(--ar-ink); }

.ar-hero-img { width: 100%; height: 100%; object-fit: cover; display: block; }

.ar-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 20, 15, 0) 28%, rgba(20, 20, 15, 0.92) 100%);
}

.ar-hero-text {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 28px 34px;
  color: #fff;
}

.ar-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }

.ar-pill {
  display: inline-block;
  background: var(--ar-lime);
  color: var(--ar-ink);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
}

.ar-read { font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, 0.8); }
.ar-read:empty { display: none; }

.ar-title {
  color: #fff;
  font-family: inherit;
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
}

.ar-sub { color: rgba(255, 255, 255, 0.86); font-size: 15.5px; line-height: 1.55; margin: 0; }

/* ---------- Author (blogs only) ---------- */

.ar-author {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 34px;
  padding: 20px 0 18px;
  border-bottom: 1px solid #ecece4;
}

.ar-author[hidden] { display: none; }
.ar-author-img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; border: 2px solid var(--ar-lime); }
.ar-author strong { display: block; font-size: 14px; color: var(--ar-ink); }
.ar-author span { font-size: 12px; color: var(--ar-muted); }

/* ---------- Body ---------- */

.ar-body {
  padding: 30px 34px 44px;
  font-size: 15.5px;
  line-height: 1.8;
  color: var(--ar-text);
}

.ar-body > :first-child { margin-top: 0; }
.ar-body > :last-child { margin-bottom: 0; }
.ar-body p { margin: 0 0 16px; }
.ar-body strong { color: var(--ar-ink); font-weight: 700; }
.ar-body em { font-style: italic; }
.ar-body a { color: var(--ar-ink); text-decoration: underline; text-decoration-color: var(--ar-lime); text-decoration-thickness: 3px; text-underline-offset: 3px; }

.ar-body .ar-lead::first-letter {
  float: left;
  font-size: 62px;
  line-height: 0.9;
  font-weight: 800;
  color: var(--ar-ink);
  background: var(--ar-lime);
  padding: 6px 11px 7px;
  margin: 6px 12px 0 0;
  border-radius: 10px;
}

/* Section headings: lime highlighter */
.ar-body h3,
.ar-body h4 {
  color: var(--ar-ink);
  font-family: inherit;
  font-weight: 800;
  line-height: 1.3;
  margin: 36px 0 16px;
}

.ar-body h3 { font-size: 22px; }
.ar-body h4 { font-size: 20px; }

.ar-body .ar-hl {
  background: linear-gradient(transparent 58%, var(--ar-lime) 58%);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  padding: 0 3px;
}

/* Divider: small mountain-line mark */
.ar-body hr {
  border: 0;
  height: 18px;
  margin: 32px 0;
  background: center / 60px 18px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 18'%3E%3Cpath d='M2 16 L14 4 L22 12 L30 2 L40 14 L46 8 L58 16' fill='none' stroke='%2314140f' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* Numbered lists: big outlined numbers */
.ar-body ol { list-style: none; counter-reset: ar-step; padding: 0; margin: 0 0 18px; }

.ar-body ol li {
  counter-increment: ar-step;
  position: relative;
  padding: 4px 0 4px 64px;
  margin-bottom: 18px;
  min-height: 40px;
}

.ar-body ol li::before {
  content: counter(ar-step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: -2px;
  font-size: 36px;
  font-weight: 800;
  line-height: 1.1;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--ar-ink);
}

/* Bullet lists: lime check circles */
.ar-body ul { list-style: none; padding: 0; margin: 0 0 18px; }

.ar-body ul li { position: relative; padding-left: 34px; margin-bottom: 14px; }

.ar-body ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ar-lime) center / 12px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%2314140f' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.ar-body blockquote {
  margin: 0 0 18px;
  padding: 14px 18px;
  border-left: 5px solid var(--ar-lime);
  background: var(--ar-surface);
  border-radius: 0 12px 12px 0;
  font-size: 16.5px;
  font-weight: 600;
  color: var(--ar-ink);
}

.ar-body blockquote p:last-child { margin-bottom: 0; }

/* Any other table: tidy, scrollable */
.ar-body table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.5;
}

.ar-body th,
.ar-body td { border: 1px solid #e5e5dc; padding: 10px 12px; text-align: left; vertical-align: top; }
.ar-body th { background: var(--ar-surface); color: var(--ar-ink); }

/* Two-column "Feature | Details" tables: fact tiles */
.ar-body table.ar-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  overflow: visible;
  margin: 0 0 8px;
}

.ar-body table.ar-facts thead { display: none; }
.ar-body table.ar-facts tbody,
.ar-body table.ar-facts tr { display: contents; }
.ar-body table.ar-facts td { display: block; border: 0; padding: 0; }
.ar-body table.ar-facts td:first-child { display: none; }

.ar-body table.ar-facts td:last-child {
  background: var(--ar-surface);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ar-text);
}

.ar-body table.ar-facts td:last-child::before {
  content: attr(data-label);
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ar-muted);
  margin-bottom: 4px;
}

/* FAQ accordions */
.ar-faqs { margin: 0 0 8px; }

.ar-faq { background: var(--ar-surface); border-radius: 14px; margin-bottom: 10px; overflow: hidden; }

.ar-faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ar-ink);
}

.ar-faq summary::-webkit-details-marker { display: none; }

.ar-faq summary::after {
  content: '+';
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  transition: transform 0.25s ease, background 0.25s ease;
}

.ar-faq[open] summary::after { transform: rotate(45deg); background: var(--ar-lime); }
.ar-faq summary:focus-visible { outline: 3px solid var(--ar-lime); outline-offset: -3px; border-radius: 14px; }
.ar-faq-a { padding: 0 18px 16px; font-size: 14.5px; line-height: 1.7; }
.ar-faq-a p:last-child { margin-bottom: 0; }

/* ---------- Phones: full-height sheet ---------- */

@media (max-width: 600px) {
  .ar-modal { padding: 0; align-items: flex-end; }
  .ar-card { max-height: 100%; height: 100%; border-radius: 0; }
  .ar-hero { height: 58vh; min-height: 320px; max-height: 440px; }
  .ar-hero-text { padding: 22px 20px; }
  .ar-author { margin: 0 20px; }
  .ar-body { padding: 24px 20px 48px; font-size: 15px; }
  .ar-body table.ar-facts { grid-template-columns: 1fr; }
  .ar-body ol li { padding-left: 54px; }
  .ar-body ol li::before { font-size: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  .ar-card { animation: none; }
  .ar-close, .ar-faq summary::after { transition: none; }
}
