/* AutoAdhan blog — custom templates (tpl-list / tpl-single / tpl-404). Loaded after blog.css; uses its --aa-* tokens. */
.aa-blog { margin: 0; font-family: 'Hind Siliguri', system-ui, sans-serif; line-height: 1.7; }
.aa-blog *, .aa-blog *::before, .aa-blog *::after { box-sizing: border-box; }
.aa-blog img { max-width: 100%; height: auto; }
.aa-blog a { text-decoration: none; }
.aa-skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--aa-primary); color: var(--aa-on-primary); padding: 8px 14px; border-radius: 8px; }
.aa-skip:focus { left: 8px; }
.aa-main { display: block; min-height: 60vh; }
.aa-blog :focus-visible { outline: 2px solid var(--aa-primary); outline-offset: 2px; }
.aa-btn-ghost { background: var(--aa-surface); border-color: var(--aa-line); color: var(--aa-text) !important; }
.aa-btn-ghost:hover { border-color: var(--aa-primary); color: var(--aa-primary) !important; }
.aa-section-title { font-family: var(--aa-font-display); font-size: clamp(22px, 2.6vw, 28px); font-weight: 800; color: var(--aa-text); margin: 44px 0 18px; display: flex; align-items: center; gap: 12px; }
.aa-section-title::after { content: ''; flex: 1; height: 1px; background: var(--aa-line); }

/* geometric lattice, same as the main site */
.aa-hero::before {
  content: ''; position: absolute; inset: 0; background: #fff; opacity: .06; pointer-events: none;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72' fill='none' stroke='%23000' stroke-width='1.1'%3E%3Crect x='22' y='22' width='28' height='28'/%3E%3Crect x='22' y='22' width='28' height='28' transform='rotate(45 36 36)'/%3E%3Ccircle cx='36' cy='36' r='6'/%3E%3Cpath d='M0 0l16 16M72 0L56 16M0 72l16-16M72 72L56 56M36 0v6M36 72v-6M0 36h6M72 36h-6'/%3E%3C/svg%3E") repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72' fill='none' stroke='%23000' stroke-width='1.1'%3E%3Crect x='22' y='22' width='28' height='28'/%3E%3Crect x='22' y='22' width='28' height='28' transform='rotate(45 36 36)'/%3E%3Ccircle cx='36' cy='36' r='6'/%3E%3Cpath d='M0 0l16 16M72 0L56 16M0 72l16-16M72 72L56 56M36 0v6M36 72v-6M0 36h6M72 36h-6'/%3E%3C/svg%3E") repeat;
}

/* ---------- list hero ---------- */
.aa-hero { position: relative; overflow: hidden; background: radial-gradient(120% 140% at 85% 0%, #1d7a4e 0%, var(--aa-band) 45%, var(--aa-band-2) 100%); color: #d6ece0; padding: 48px 0 30px; }
.aa-hero::after { content: ''; position: absolute; width: 420px; height: 420px; right: -120px; top: -180px; border-radius: 50%; background: radial-gradient(circle, rgba(224, 189, 106, .28), transparent 65%); pointer-events: none; }
.aa-hero-inner { position: relative; z-index: 1; text-align: center; display: flex; flex-direction: column; align-items: center; }
.aa-eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px 5px 6px; border-radius: 999px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); font-size: 14px; color: #e9f5ee; }
.aa-eyebrow img { border-radius: 6px; }
.aa-hero h1 { margin: 14px 0 6px; font-family: var(--aa-font-display); font-weight: 800; font-size: clamp(34px, 6vw, 58px); line-height: 1.15; color: #fff; letter-spacing: -.01em; }
.aa-hero-lead { margin: 0; max-width: 620px; font-size: 17px; color: #bfdccd; }
.aa-hero-search { position: relative; display: flex; align-items: center; width: min(560px, 100%); margin: 24px auto 0; background: var(--aa-surface); border-radius: 16px; padding: 6px; box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .5); }
.aa-hero-search svg { width: 20px; height: 20px; margin: 0 4px 0 12px; fill: none; stroke: var(--aa-muted); stroke-width: 2; flex: none; }
.aa-hero-search input { flex: 1; min-width: 0; height: 46px; border: 0; background: transparent; color: var(--aa-text); font: inherit; font-size: 16px; padding: 0 8px; }
.aa-hero-search input:focus { outline: none; }
.aa-hero-search button { height: 46px; padding: 0 20px; border: 0; border-radius: 12px; background: var(--aa-primary); color: var(--aa-on-primary); font: inherit; font-weight: 700; cursor: pointer; }
.aa-hero-search button:hover { background: var(--aa-primary-strong); }
.aa-chips { display: flex; gap: 8px; margin-top: 18px; max-width: 100%; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 6px; }
.aa-chips::-webkit-scrollbar { display: none; }
.aa-chip { flex: none; padding: 7px 14px; border-radius: 999px; font-size: 14px; font-weight: 500; color: #e3f2ea; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); white-space: nowrap; transition: background-color .2s; }
.aa-chip small { opacity: .7; margin-left: 2px; }
.aa-chip:hover { background: rgba(255, 255, 255, .16); }
.aa-chip.is-on { background: #fff; color: var(--aa-band); border-color: #fff; font-weight: 700; }

/* ---------- cards ---------- */
.aa-list { padding-top: 32px; padding-bottom: 20px; }
.aa-card { position: relative; display: flex; flex-direction: column; background: var(--aa-surface); border: 1px solid var(--aa-line); border-radius: 20px; overflow: hidden; box-shadow: var(--aa-shadow-sm); transition: transform .2s, box-shadow .2s, border-color .2s; }
.aa-card:hover { transform: translateY(-3px); box-shadow: var(--aa-shadow); border-color: color-mix(in srgb, var(--aa-primary) 40%, var(--aa-line)); }
.aa-card-media { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--aa-primary-soft); }
.aa-card-media .aa-thumb-img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.aa-card:hover .aa-thumb-img { transform: scale(1.04); }
.aa-card-body { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 18px 20px 20px; flex: 1; }
.aa-badge { display: inline-block; padding: 3px 11px; border-radius: 999px; background: var(--aa-primary-soft); color: var(--aa-primary) !important; font-size: 13px; font-weight: 600; }
.aa-badge:hover { background: var(--aa-primary); color: var(--aa-on-primary) !important; }
.aa-card-title { margin: 0; font-family: var(--aa-font-display); font-weight: 700; font-size: 21px; line-height: 1.35; }
.aa-card-title a { color: var(--aa-text); }
.aa-card-title a:hover { color: var(--aa-primary); }
.aa-card-title a::after { content: ''; position: absolute; inset: 0; } /* whole card clickable */
.aa-card .aa-badge { position: relative; z-index: 1; }
.aa-card-excerpt { margin: 0; color: var(--aa-muted); font-size: 15.5px; line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.aa-card-meta { margin: auto 0 0; padding-top: 6px; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13.5px; color: var(--aa-muted); }
.aa-card-meta span + span::before { content: '•'; margin-right: 14px; color: var(--aa-line); }

/* branded placeholder when a post has no thumbnail */
.aa-ph { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: #e6f4ec; font-family: var(--aa-font-display); font-weight: 700; background: radial-gradient(120% 120% at 80% 10%, #1f8a57, var(--aa-band) 55%, var(--aa-band-2)); overflow: hidden; }
.aa-ph::before { content: ''; position: absolute; inset: 0; opacity: .1; background: repeating-conic-gradient(from 45deg, #fff 0 25%, transparent 0 50%) 0 0 / 28px 28px; -webkit-mask: radial-gradient(circle at 50% 50%, #000, transparent 75%); mask: radial-gradient(circle at 50% 50%, #000, transparent 75%); }
.aa-ph img { position: relative; border-radius: 14px; box-shadow: 0 12px 24px -10px rgba(0, 0, 0, .5); }
.aa-ph span { position: relative; padding: 2px 12px; border-radius: 999px; background: rgba(255, 255, 255, .12); font-size: 14px; }

/* featured (latest) post */
.aa-card-featured { display: grid; grid-template-columns: 1.15fr 1fr; margin-bottom: 8px; }
.aa-card-featured .aa-card-media { aspect-ratio: auto; min-height: 320px; height: 100%; }
.aa-card-featured .aa-card-body { justify-content: center; padding: 34px 36px; gap: 12px; }
.aa-card-featured .aa-card-title { font-size: clamp(26px, 3vw, 36px); line-height: 1.25; }
.aa-card-featured .aa-card-excerpt { font-size: 17px; -webkit-line-clamp: 4; }
.aa-card-featured .aa-card-meta { margin-top: 6px; }
.aa-card-featured .aa-ph img { width: 84px; height: 84px; }

.aa-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.aa-grid-wide { grid-column: 1 / -1; }
.aa-grid-wide .aa-app-card { max-width: none; margin: 4px 0; }
.aa-list > .aa-app-card { max-width: none; margin-top: 32px; }

/* pagination */
.aa-pages { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 40px 0 10px; }
.aa-pages a, .aa-pages span { min-width: 44px; height: 44px; display: inline-grid; place-items: center; padding: 0 14px; border-radius: 12px; border: 1px solid var(--aa-line); background: var(--aa-surface); color: var(--aa-text); font-weight: 600; }
.aa-pages a:hover { border-color: var(--aa-primary); color: var(--aa-primary); }
.aa-pages .current { background: var(--aa-primary); border-color: var(--aa-primary); color: var(--aa-on-primary); }
.aa-pages .dots { border: 0; background: none; }

/* empty / 404 */
.aa-empty { text-align: center; max-width: 560px; margin: 20px auto 10px; padding: 36px 24px; background: var(--aa-surface); border: 1px dashed var(--aa-line); border-radius: 24px; }
.aa-empty img { margin: 0 auto 12px; border-radius: 18px; }
.aa-empty h1, .aa-empty h2 { font-family: var(--aa-font-display); color: var(--aa-text); margin: 0 0 6px; font-size: 26px; }
.aa-empty p { color: var(--aa-muted); margin: 0 0 18px; }
.aa-404 { margin-top: 40px; }
.aa-404-num { display: block; font-family: var(--aa-font-display); font-weight: 800; font-size: 96px; line-height: 1; color: var(--aa-primary); opacity: .25; }
.aa-404 .aa-hero-search { box-shadow: none; border: 1px solid var(--aa-line); margin: 10px auto 18px; }
.aa-404-links { display: flex; gap: 10px; justify-content: center; }

/* ---------- single post ---------- */
.aa-progress { position: fixed; top: var(--wp-admin--admin-bar--height, 0); left: 0; right: 0; height: 3px; z-index: 60; pointer-events: none; }
.aa-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--aa-primary), var(--aa-gold)); }
.aa-article-head { max-width: 820px; padding-top: 34px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.aa-crumbs { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; font-size: 14px; color: var(--aa-muted); }
.aa-crumbs a { color: var(--aa-muted); }
.aa-crumbs a:hover { color: var(--aa-primary); }
.aa-crumbs span { opacity: .5; }
.aa-article-title { margin: 0; font-family: var(--aa-font-display); font-weight: 800; font-size: clamp(30px, 5vw, 50px); line-height: 1.2; color: var(--aa-text); letter-spacing: -.01em; }
.aa-article-lead { margin: 0; max-width: 680px; font-size: 19px; color: var(--aa-muted); line-height: 1.6; }
.aa-article-meta { display: flex; align-items: center; gap: 10px; margin: 4px 0 0; text-align: left; }
.aa-article-meta img { border-radius: 10px; }
.aa-article-meta span { display: flex; flex-direction: column; line-height: 1.3; }
.aa-article-meta strong { font-size: 15px; color: var(--aa-text); }
.aa-article-meta small { font-size: 13.5px; color: var(--aa-muted); }
.aa-article-cover { width: min(1040px, 100% - 32px); margin: 30px auto 0; }
.aa-article-cover img { display: block; width: 100%; max-height: 560px; object-fit: cover; border-radius: 24px; box-shadow: var(--aa-shadow); }
.aa-article-cover figcaption { text-align: center; font-size: 14px; color: var(--aa-muted); margin-top: 8px; }

.aa-content { width: min(720px, 100% - 32px); margin: 34px auto 0; font-size: clamp(17px, 16px + .3vw, 18.5px); line-height: 1.9; color: var(--aa-text); }
.aa-content > * { margin-top: 0; margin-bottom: 1.15em; }
.aa-content h2 { font-family: var(--aa-font-display); font-size: clamp(24px, 3vw, 30px); line-height: 1.3; margin: 1.8em 0 .6em; color: var(--aa-text); }
.aa-content h3 { font-family: var(--aa-font-display); font-size: clamp(20px, 2.4vw, 24px); margin: 1.5em 0 .5em; }
.aa-content h2::before { content: ''; display: inline-block; width: 6px; height: .8em; border-radius: 3px; background: var(--aa-gold); margin-right: 10px; vertical-align: -.02em; }
.aa-content a { color: var(--aa-primary); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.aa-content .aa-app-inline a, .aa-content .aa-app-card a { text-decoration: none; }
.aa-content ul, .aa-content ol { padding-left: 1.4em; }
.aa-content li { margin-bottom: .4em; }
.aa-content li::marker { color: var(--aa-primary); }
.aa-content blockquote { margin-left: 0; margin-right: 0; border-left: 4px solid var(--aa-gold); background: var(--aa-gold-soft); padding: 16px 22px; border-radius: 0 16px 16px 0; }
.aa-content blockquote p:last-child { margin-bottom: 0; }
.aa-content figure { margin-left: 0; margin-right: 0; }
.aa-content img { border-radius: 16px; }
.aa-content figcaption { font-size: 14px; color: var(--aa-muted); text-align: center; }
.aa-content .alignwide { width: min(1000px, 100vw - 32px); max-width: none; margin-left: 50%; transform: translateX(-50%); }
.aa-content .alignfull { width: 100vw; max-width: none; margin-left: 50%; transform: translateX(-50%); border-radius: 0; }
.aa-content [lang="ar"], .aa-content .arabic { display: block; font-family: 'Amiri', serif; font-size: 1.6em; line-height: 2.1; color: var(--aa-gold); direction: rtl; text-align: center; }
.aa-content table { width: 100%; border-collapse: collapse; font-size: .92em; }
.aa-content th, .aa-content td { border: 1px solid var(--aa-line); padding: 8px 12px; }
.aa-content th { background: var(--aa-primary-soft); }
.aa-content hr { border: 0; border-top: 1px solid var(--aa-line); margin: 2em 0; }
.aa-content .aa-app-card { margin-top: 44px; }

.aa-article-foot { width: min(720px, 100% - 32px); margin: 28px auto 0; padding-top: 22px; border-top: 1px solid var(--aa-line); display: flex; flex-direction: column; gap: 16px; }
.aa-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.aa-tags a { padding: 4px 12px; border-radius: 999px; background: var(--aa-surface-2); border: 1px solid var(--aa-line); color: var(--aa-muted); font-size: 14px; }
.aa-tags a:hover { color: var(--aa-primary); border-color: var(--aa-primary); }
.aa-share { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.aa-share-label { font-weight: 600; margin-right: 4px; }
.aa-share-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--aa-line); background: var(--aa-surface); color: var(--aa-text); cursor: pointer; padding: 0; transition: transform .15s, background-color .2s, color .2s; }
.aa-share-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.aa-share-btn:hover { transform: translateY(-2px); }
.aa-wa:hover { background: #25d366; border-color: #25d366; color: #fff; }
.aa-fb:hover { background: #1877f2; border-color: #1877f2; color: #fff; }
.aa-tg:hover { background: #229ed9; border-color: #229ed9; color: #fff; }
.aa-copy:hover, .aa-share-native:hover, .aa-copy.is-done { background: var(--aa-primary); border-color: var(--aa-primary); color: var(--aa-on-primary); }
.aa-related { padding-bottom: 10px; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .aa-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .aa-card-featured { grid-template-columns: 1fr; }
  .aa-card-featured .aa-card-media { min-height: 0; aspect-ratio: 16 / 9; }
  .aa-card-featured .aa-card-body { padding: 24px; }
}
@media (max-width: 640px) {
  .aa-hero { padding: 30px 0 18px; }
  .aa-hero-lead { font-size: 15.5px; }
  .aa-hero-search { margin-top: 18px; border-radius: 14px; }
  .aa-hero-search button { padding: 0 14px; }
  .aa-chips { width: calc(100% + 32px); margin-inline: -16px; padding-inline: 16px; }
  .aa-list { padding-top: 20px; }
  .aa-section-title { margin: 30px 0 14px; }
  /* phones: compact rows (thumbnail left, text right) like a news app */
  .aa-grid { grid-template-columns: 1fr; gap: 12px; }
  .aa-grid > .aa-card { flex-direction: row; align-items: stretch; border-radius: 16px; }
  .aa-grid > .aa-card .aa-card-media { flex: none; width: 112px; aspect-ratio: auto; min-height: 112px; }
  .aa-grid > .aa-card .aa-card-body { padding: 12px 14px; gap: 5px; }
  .aa-grid > .aa-card .aa-card-title { font-size: 17px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .aa-grid > .aa-card .aa-card-excerpt { display: none; }
  .aa-grid > .aa-card .aa-badge { font-size: 12px; padding: 1px 9px; }
  .aa-grid > .aa-card .aa-card-meta { font-size: 12.5px; padding-top: 2px; }
  .aa-grid > .aa-card .aa-card-meta span + span::before { margin-right: 8px; }
  .aa-grid > .aa-card .aa-ph img { width: 40px; height: 40px; border-radius: 10px; }
  .aa-grid > .aa-card .aa-ph span { display: none; }
  .aa-card:hover { transform: none; }
  .aa-card-featured { border-radius: 18px; }
  .aa-card-featured .aa-card-body { padding: 18px; gap: 8px; }
  .aa-card-featured .aa-card-excerpt { font-size: 15.5px; -webkit-line-clamp: 3; }
  .aa-article-head { padding-top: 20px; gap: 10px; }
  .aa-article-lead { font-size: 17px; }
  .aa-article-cover { width: 100%; margin-top: 20px; }
  .aa-article-cover img { border-radius: 0; box-shadow: none; }
  .aa-content { margin-top: 24px; }
  .aa-share-label { width: 100%; }
  .aa-share-btn { width: 48px; height: 48px; }
}

/* the list page has its own big search box */
.aa-list-page .aa-search { display: none; }
.aa-single-page .aa-footer, .aa-404-page .aa-footer { margin-top: 64px; }
