/* ==========================================================================
   ILAMA BOOKS — SINGLE BLOG POST STYLES
   Place at: ilama-books-child/assets/css/single.css
   Scoped to #il-single so nothing leaks to other pages.
   ========================================================================== */

#il-single {
  font-family: "Lato", "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--il-ink);
  line-height: 1.6;
  background: var(--il-bg);
}

/* =====================================================================
   POST HERO — featured image full-width banner
   ===================================================================== */

#il-single .il-post-hero {
  position: relative;
  width: 100%;
  max-height: 480px;
  overflow: hidden;
  background: var(--il-bg-soft);
}

#il-single .il-post-hero img {
  width: 100%;
  height: 480px;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Gradient overlay so the title reads well if placed over image */
#il-single .il-post-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(0,0,0,.45));
}

/* Placeholder hero when no featured image */
#il-single .il-post-hero--placeholder {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fff4ee 0%, #ffe8dc 100%);
}

#il-single .il-post-hero--placeholder svg {
  width: 64px;
  height: 64px;
  color: var(--il-accent);
  opacity: .3;
}

/* =====================================================================
   POST HEADER — title, meta, category
   ===================================================================== */

#il-single .il-post-header {
  padding: 48px 0 0;
  text-align: center;
}

/* Breadcrumb back link */
#il-single .il-post-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--il-muted);
  text-decoration: none !important;
  margin-bottom: 28px;
  transition: color .2s;
}

#il-single .il-post-back:hover { color: var(--il-accent); }

#il-single .il-post-back svg {
  width: 14px;
  height: 14px;
  transition: transform .2s;
}

#il-single .il-post-back:hover svg { transform: translateX(-3px); }

/* Category pill */
#il-single .il-post-cat {
  display: inline-block;
  background: rgba(255,100,40,.1);
  color: var(--il-accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 20px;
  text-decoration: none !important;
  margin-bottom: 18px;
}

#il-single .il-post-cat:hover {
  background: var(--il-accent);
  color: #fff;
}

/* Post title */
#il-single .il-post-title {
  font-size: clamp(24px, 3.5vw, 40px);
  font-weight: 800;
  line-height: 1.2;
  max-width: 760px;
  margin: 0 auto 20px;
}

/* Decorative accent underline beneath title */
#il-single .il-post-title-bar {
  width: 56px;
  height: 5px;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(255,100,40,.25), var(--il-accent));
  margin: 0 auto 24px;
}

/* Meta row */
#il-single .il-post-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 14px;
  color: var(--il-muted);
  padding-bottom: 36px;
  border-bottom: 1px solid #eee;
  margin-bottom: 0;
}

#il-single .il-post-meta__item {
  display: flex;
  align-items: center;
  gap: 6px;
}

#il-single .il-post-meta__item svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--il-accent);
}

/* =====================================================================
   POST BODY — the WordPress content
   ===================================================================== */

#il-single .il-post-body {
  padding: 52px 0 64px;
}

#il-single .il-post-content {
  max-width: 760px;
  margin: 0 auto;
}

/* ── Typography ── */
#il-single .il-post-content p {
  font-size: 17px;
  line-height: 1.8;
  color: #333;
  margin-bottom: 24px;
}

#il-single .il-post-content h2 {
  font-size: clamp(20px, 2.5vw, 26px);
  font-weight: 800;
  margin: 48px 0 16px;
  color: var(--il-ink);
  padding-left: 14px;
  border-left: 4px solid var(--il-accent);
}

#il-single .il-post-content h3 {
  font-size: clamp(17px, 2vw, 21px);
  font-weight: 700;
  margin: 36px 0 12px;
  color: var(--il-ink);
}

#il-single .il-post-content h4 {
  font-size: 17px;
  font-weight: 700;
  margin: 28px 0 10px;
  color: var(--il-ink);
}

#il-single .il-post-content a {
  color: var(--il-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

#il-single .il-post-content a:hover { color: var(--il-accent-dark); }

/* Lists */
#il-single .il-post-content ul,
#il-single .il-post-content ol {
  margin: 0 0 24px 20px;
  padding: 0;
}

#il-single .il-post-content ul { list-style: disc; }
#il-single .il-post-content ol { list-style: decimal; }

#il-single .il-post-content li {
  font-size: 17px;
  line-height: 1.8;
  margin-bottom: 8px;
  color: #333;
}

/* Blockquote */
#il-single .il-post-content blockquote {
  margin: 36px 0;
  padding: 20px 24px;
  background: var(--il-bg-soft);
  border-left: 4px solid var(--il-accent);
  border-radius: 0 var(--il-radius) var(--il-radius) 0;
  font-size: 18px;
  font-style: italic;
  color: #555;
  line-height: 1.7;
}

#il-single .il-post-content blockquote cite {
  display: block;
  margin-top: 10px;
  font-size: 14px;
  font-style: normal;
  color: var(--il-muted);
}

/* Images inside content */
#il-single .il-post-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--il-radius);
  box-shadow: var(--il-shadow);
  display: block;
  margin: 32px auto;
}

#il-single .il-post-content figure {
  margin: 36px 0;
}

#il-single .il-post-content figcaption {
  text-align: center;
  font-size: 13px;
  color: var(--il-muted);
  margin-top: 10px;
}

/* Horizontal rule */
#il-single .il-post-content hr {
  border: none;
  border-top: 2px solid #eee;
  margin: 44px 0;
}

/* Code */
#il-single .il-post-content code {
  background: var(--il-bg-soft);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 15px;
  font-family: monospace;
}

#il-single .il-post-content pre {
  background: #1e1e1e;
  color: #f0f0f0;
  padding: 20px;
  border-radius: var(--il-radius);
  overflow-x: auto;
  font-size: 14px;
  margin-bottom: 24px;
}

/* =====================================================================
   POST FOOTER — tags + share CTA
   ===================================================================== */

#il-single .il-post-footer {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 0 0;
  border-top: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

/* Tags */
#il-single .il-post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#il-single .il-post-tags a {
  display: inline-block;
  background: var(--il-bg-soft);
  color: var(--il-muted);
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 20px;
  text-decoration: none !important;
  border: 1px solid #e8e8e8;
  transition: border-color .2s, color .2s;
}

#il-single .il-post-tags a:hover {
  border-color: var(--il-accent);
  color: var(--il-accent);
}

/* WhatsApp share button */
#il-single .il-post-wa-share {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--il-wa);
  color: #fff !important;
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--il-radius);
  text-decoration: none !important;
  transition: background-color .2s, transform .2s;
}

#il-single .il-post-wa-share:hover {
  background: var(--il-wa-dark);
  transform: translateY(-2px);
}

#il-single .il-post-wa-share svg {
  width: 18px;
  height: 18px;
}

/* =====================================================================
   RELATED POSTS
   Same card style as blog index — 3 col grid
   ===================================================================== */

#il-single .il-related {
  background: var(--il-bg-soft);
  padding: 64px 0;
  border-top: 1px solid #eee;
}

#il-single .il-related__head {
  text-align: center;
  margin-bottom: 36px;
}

#il-single .il-related__title {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 800;
}

/* Decorative lines matching home headings */
#il-single .il-related__title::before,
#il-single .il-related__title::after {
  content: "";
  width: 40px;
  height: 5px;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(255,100,40,.15), var(--il-accent));
}
#il-single .il-related__title::after { transform: scaleX(-1); }

#il-single .il-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Reuse card styles — mirrors blog.css il-post-card */
#il-single .il-rel-card {
  background: #fff;
  border-radius: var(--il-radius);
  box-shadow: var(--il-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .2s, box-shadow .2s;
}

#il-single .il-rel-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 26px rgba(0,0,0,.14);
}

#il-single .il-rel-card__thumb {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--il-bg-soft);
}

#il-single .il-rel-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}

#il-single .il-rel-card:hover .il-rel-card__thumb img {
  transform: scale(1.04);
}

#il-single .il-rel-card__body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

#il-single .il-rel-card__title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--il-ink);
  text-decoration: none !important;
}

#il-single .il-rel-card__title:hover { color: var(--il-accent); }

#il-single .il-rel-card__date {
  font-size: 13px;
  color: var(--il-muted);
  margin-top: auto;
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */

@media (max-width: 1024px) {
  #il-single .il-related-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  #il-single .il-post-hero img { height: 240px; }
  #il-single .il-post-header { padding: 32px 0 0; }
  #il-single .il-post-body { padding: 36px 0 48px; }
  #il-single .il-related { padding: 48px 0; }
  #il-single .il-related-grid { grid-template-columns: 1fr; gap: 16px; }
  #il-single .il-post-footer { flex-direction: column; align-items: flex-start; }
  #il-single .il-post-content h2 { padding-left: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  #il-single .il-rel-card,
  #il-single .il-rel-card__thumb img,
  #il-single .il-post-back svg { transition: none; }
}
