/* ==========================================================================
   KGND standalone — public page styles (fork A: pages).
   Collected from the <style> blocks the WordPress theme 4.0.2 printed inside
   individual templates, plus RTL fixes. Loaded per view via $GLOBALS['kgnd_extra_css'].
   ========================================================================== */

/* ---------- Programs / Projects: white CTA button keeps navy text (theme wp_head fix) */
.kgnd-cta-white-btn, .kgnd-cta-white-btn *, .kgnd-cta-white-btn:hover, .kgnd-cta-white-btn:visited { color: #003366 !important; }
.kgnd-cta-white-btn:hover { background: #E0F7F8 !important; }

/* ---------- Contact form */
.kgnd-hp { position: absolute !important; inset-inline-start: -10000px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 640px) {
  .kgnd-contact-names { grid-template-columns: 1fr !important; }
  .kgnd-contact-card { padding: 1.75rem !important; }
}

/* ---------- Gallery: masonry columns */
.kgnd-gallery-grid { columns: 3; column-gap: 1rem; }
@media (max-width: 900px) { .kgnd-gallery-grid { columns: 2; } }
@media (max-width: 520px) { .kgnd-gallery-grid { columns: 1; } }

/* ---------- News: featured grid + single article typography (theme single.php) */
@media (max-width: 760px) { .kgnd-news-featured-grid { grid-template-columns: 1fr !important; } }

.kgnd-article-content { color: #1e293b; }
.kgnd-article-content h2 { color: #003366; font-size: 1.6rem; font-weight: 800; margin: 2.5rem 0 1rem; line-height: 1.3; }
.kgnd-article-content h3 { color: #003366; font-size: 1.3rem; font-weight: 700; margin: 2rem 0 .85rem; }
.kgnd-article-content h4 { color: #003366; font-size: 1.1rem; font-weight: 700; margin: 1.75rem 0 .65rem; }
.kgnd-article-content p { margin: 0 0 1.25rem; line-height: 1.85; }
.kgnd-article-content a { color: #14B1BB; text-decoration: underline; text-underline-offset: 3px; }
.kgnd-article-content a:hover { color: #003366; }
.kgnd-article-content blockquote { border-inline-start: 4px solid #14B1BB; background: #f8fafc; margin: 1.75rem 0; padding: 1.25rem 1.75rem; border-start-end-radius: 1rem; border-end-end-radius: 1rem; font-style: italic; color: #003366; font-size: 1.05rem; }
.kgnd-article-content ul, .kgnd-article-content ol { margin-block: 1.25rem 1.5rem; margin-inline: 1.75rem 0; padding: 0; }
.kgnd-article-content ul { list-style: disc; }
.kgnd-article-content ol { list-style: decimal; }
.kgnd-article-content li { margin-bottom: .5rem; line-height: 1.75; }
.kgnd-article-content img { max-width: 100%; height: auto; border-radius: 1rem; margin: 1.5rem 0; box-shadow: 0 4px 20px rgba(0,0,0,.08); }
.kgnd-article-content figure { margin: 1.75rem 0; }
.kgnd-article-content figcaption { font-size: .82rem; color: #64748b; text-align: center; margin-top: .5rem; font-style: italic; }
.kgnd-article-content code { background: #f1f5f9; color: #003366; padding: .15rem .4rem; border-radius: .3rem; font-size: .92em; }
.kgnd-article-content pre { background: #1e293b; color: #f1f5f9; padding: 1.25rem; border-radius: .75rem; overflow-x: auto; margin: 1.5rem 0; direction: ltr; text-align: left; }
.kgnd-article-content pre code { background: transparent; color: inherit; padding: 0; }
.kgnd-article-content hr { border: none; border-top: 1px solid #e2e8f0; margin: 2.5rem 0; }
.kgnd-article-content table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; border-radius: .75rem; overflow: hidden; border: 1px solid #e2e8f0; }
.kgnd-article-content th, .kgnd-article-content td { padding: .75rem 1rem; border-bottom: 1px solid #e2e8f0; text-align: start; }
.kgnd-article-content th { background: #f8fafc; color: #003366; font-weight: 700; }
.kgnd-article-content iframe { max-width: 100%; border-radius: 1rem; }
@media (max-width: 900px) {
  .kgnd-single-grid { grid-template-columns: 1fr !important; }
  .kgnd-single-sidebar { order: 2; }
}

/* ---------- Events (theme single-kgnd_event.php) */
.kgnd-event-content h2 { color: #003366; font-size: 1.6rem; font-weight: 800; margin: 2.5rem 0 1rem; line-height: 1.3; }
.kgnd-event-content h3 { color: #003366; font-size: 1.3rem; font-weight: 700; margin: 2rem 0 .85rem; }
.kgnd-event-content p { margin: 0 0 1.25rem; line-height: 1.85; }
.kgnd-event-content ul, .kgnd-event-content ol { margin-block: 1.25rem 1.5rem; margin-inline: 1.75rem 0; padding: 0; }
.kgnd-event-content li { margin-bottom: .6rem; line-height: 1.75; }
.kgnd-event-content a { color: #14B1BB; text-decoration: underline; text-underline-offset: 3px; }
.kgnd-event-content a:hover { color: #003366; }
.kgnd-event-content blockquote { border-inline-start: 4px solid #14B1BB; background: #f8fafc; margin: 1.75rem 0; padding: 1.25rem 1.75rem; font-style: italic; color: #003366; font-size: 1.05rem; }
.kgnd-event-content img { max-width: 100%; height: auto; border-radius: 1rem; margin: 1.5rem 0; }
@media (max-width: 900px) {
  .kgnd-event-grid { grid-template-columns: 1fr !important; }
  .kgnd-event-sidebar { order: 2; }
}

/* ---------- Publications list (theme archive-kgnd_book.php) — fixed 4 columns on desktop */
.kgnd-books-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 1.5rem !important;
  width: 100% !important;
  box-sizing: border-box !important;
}
@media screen and (max-width: 1024px) { .kgnd-books-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 1rem !important; } }
@media screen and (max-width: 600px)  { .kgnd-books-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: .75rem !important; } }
@media screen and (max-width: 380px)  { .kgnd-books-grid { grid-template-columns: 1fr !important; gap: 1rem !important; } }
.kgnd-books-grid > * { min-width: 0 !important; max-width: 100% !important; justify-self: stretch !important; }
/* A book card keeps its own direction even when the site language is the opposite one. */
.kgnd-books-grid > [dir="ltr"], .kgnd-books-grid > [dir="ltr"] *:not([dir]) { direction: ltr !important; text-align: left !important; unicode-bidi: embed !important; }
.kgnd-books-grid > [dir="rtl"], .kgnd-books-grid > [dir="rtl"] *:not([dir]) { direction: rtl !important; text-align: right !important; unicode-bidi: embed !important; }
.kgnd-books-grid a[dir="ltr"], .kgnd-books-grid span[dir="ltr"] { direction: ltr !important; }

/* ---------- Single book (theme single-kgnd_book.php "Clean Editorial") */
.kgnd-bookpage { background: #fbf9f4; color: #1a1410; font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 15px; line-height: 1.65; }
body.kgnd-rtl .kgnd-bookpage { font-family: 'Kurdistan24', 'Noto Kufi Arabic', 'Vazirmatn', 'Tahoma', sans-serif; }
.kgnd-bookpage .bp-container { max-width: 1140px; margin: 0 auto; padding: 0 1.75rem; }
.kgnd-bookpage h1, .kgnd-bookpage h2, .kgnd-bookpage h3 { font-family: 'Playfair Display', Georgia, 'Times New Roman', serif; color: #1a1410; letter-spacing: -0.005em; font-weight: 600; }
body.kgnd-rtl .kgnd-bookpage h2, body.kgnd-rtl .kgnd-bookpage h3 { font-family: 'Kurdistan24', 'Noto Kufi Arabic', 'Vazirmatn', 'Tahoma', sans-serif; letter-spacing: 0; }
.kgnd-bookpage .bp-eyebrow { display: inline-flex; align-items: center; gap: .65rem; font-size: .7rem; letter-spacing: .22em; text-transform: uppercase; color: #c8a96a; font-weight: 700; margin-bottom: 1rem; }
.kgnd-bookpage .bp-eyebrow::before { content: ''; display: inline-block; width: 28px; height: 1.5px; background: #c8a96a; }
.kgnd-bookpage .bp-section { padding: 4.5rem 0; border-bottom: 1px solid #ece5d3; }
.kgnd-bookpage .bp-section:last-of-type { border-bottom: none; }
.kgnd-bookpage .bp-section-title { font-family: 'Playfair Display', Georgia, serif; font-size: 1.5rem; font-weight: 600; color: #1a1410; margin: 0 0 1.5rem; }
body.kgnd-rtl .kgnd-bookpage .bp-section-title { font-family: 'Kurdistan24', 'Noto Kufi Arabic', 'Vazirmatn', 'Tahoma', sans-serif; }

.kgnd-bookpage .bp-btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  background: linear-gradient(180deg, #2a2018 0%, #1a1410 100%); color: #fff !important;
  padding: 1rem 1.95rem; border-radius: 8px; font-weight: 600; font-size: .95rem; text-decoration: none;
  border: 1.5px solid #1a1410; transition: all .25s; min-width: 200px;
  box-shadow: 0 6px 18px -6px rgba(26,20,16,.35), inset 0 1px 0 rgba(255,255,255,.08);
}
.kgnd-bookpage .bp-btn-primary:hover { background: linear-gradient(180deg, #0e4280 0%, #003366 100%); border-color: #003366; color: #fff !important; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,51,102,.25); }
.kgnd-bookpage .bp-btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  background: #fff; color: #1a1410 !important; padding: .95rem 1.85rem; border-radius: 6px;
  font-weight: 600; font-size: .92rem; text-decoration: none; border: 1.5px solid #d4cdb8; transition: all .25s; min-width: 200px;
}
.kgnd-bookpage .bp-btn-secondary:hover { border-color: #1a1410; background: #fbf9f4; }
.kgnd-bookpage .bp-btn-amazon-icon { display: inline-block; width: 18px; height: 18px; background: #fff; color: #1a1410; border-radius: 50%; font-size: .65rem; font-weight: 900; line-height: 18px; text-align: center; }

.kgnd-bookpage .bp-cover-wrap { position: relative; display: inline-block; max-width: 340px; width: 100%; }
.kgnd-bookpage .bp-cover-wrap::before {
  content: ''; position: absolute; inset: -10% -8%;
  background: radial-gradient(ellipse at 35% 50%, rgba(200,169,106,.18) 0%, rgba(200,169,106,.05) 35%, transparent 70%);
  filter: blur(20px); z-index: 0; pointer-events: none;
}
.kgnd-bookpage .bp-cover-3d { position: relative; z-index: 1; width: 100%; max-width: 340px; margin: 0; aspect-ratio: 2/3; transform: perspective(1800px) rotateY(-8deg); transform-style: preserve-3d; transition: transform .8s cubic-bezier(.2,.8,.2,1); }
.kgnd-bookpage .bp-cover-3d:hover { transform: perspective(1800px) rotateY(-3deg); }
.kgnd-bookpage .bp-cover-3d img, .kgnd-bookpage .bp-cover-3d .bp-cover-fallback {
  width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 1px 4px 4px 1px;
  box-shadow: -10px 0 0 -2px #d4cdb8, -12px 2px 0 -4px #c4bca3, 0 30px 50px -10px rgba(60,40,20,.35), 0 12px 25px -6px rgba(60,40,20,.2);
}
.kgnd-bookpage .bp-cover-3d::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, rgba(255,255,255,.18) 0%, transparent 30%, transparent 70%, rgba(0,0,0,.04) 100%); border-radius: 1px 4px 4px 1px; pointer-events: none; z-index: 2; }

.kgnd-bookpage .bp-hero { display: grid; grid-template-columns: 1fr 1.2fr; gap: 4.5rem; align-items: center; padding: 4rem 0 5rem; }
.kgnd-bookpage .bp-2col-divider { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; position: relative; }
.kgnd-bookpage .bp-2col-divider::before { content: ''; position: absolute; inset-inline-start: 50%; top: 0; bottom: 0; width: 1px; background: #ece5d3; }
.kgnd-bookpage .bp-col-start { padding-inline-end: 2rem; }
.kgnd-bookpage .bp-col-end { padding-inline-start: 2rem; }
.kgnd-bookpage .bp-books-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1.5rem; }
.kgnd-bookpage .bp-book-description p { margin: 0 0 1rem; }

.kgnd-bookpage .bp-final-cta {
  background: linear-gradient(135deg, #1a1410 0%, #2a1f15 100%); color: #fbf9f4; padding: 4rem; border-radius: 10px;
  margin: 4.5rem 0 5rem; display: grid; grid-template-columns: 1.5fr 1fr; gap: 3rem; align-items: center; position: relative; overflow: hidden;
}
.kgnd-bookpage .bp-final-cta::after { content: ''; position: absolute; inset-inline-end: 0; top: 0; bottom: 0; width: 50%; background: radial-gradient(circle at 70% 50%, rgba(200,169,106,.15), transparent 60%); pointer-events: none; }
.kgnd-bookpage .bp-final-cta h2 { color: #fbf9f4; font-size: 2.4rem; margin: 0 0 .85rem; font-weight: 600; line-height: 1.15; }
.kgnd-bookpage .bp-final-cta p { color: rgba(251,249,244,.7); font-size: 1rem; margin: 0 0 1.75rem; line-height: 1.65; }
.kgnd-bookpage .bp-final-cta .bp-btn-primary { background: #c8a96a; color: #1a1410 !important; border-color: #c8a96a; }
.kgnd-bookpage .bp-final-cta .bp-btn-primary:hover { background: #fbf9f4; border-color: #fbf9f4; }
.kgnd-bookpage .bp-final-cta .bp-btn-amazon-icon { background: #1a1410; color: #c8a96a; }
.kgnd-bookpage .bp-final-cta-art { font-size: 8rem; text-align: center; color: rgba(200,169,106,.2); font-family: 'Playfair Display', serif; line-height: 1; position: relative; z-index: 1; }

/* Book written in an RTL language: the text blocks follow the book, not the site. */
.kgnd-bookpage.kgnd-bookpage-rtl .bp-text-block,
.kgnd-bookpage.kgnd-bookpage-rtl .bp-title-block { direction: rtl; text-align: right; }
.kgnd-bookpage.kgnd-bookpage-rtl .bp-text-block *,
.kgnd-bookpage.kgnd-bookpage-rtl .bp-title-block h1 { font-family: 'Kurdistan24', 'Noto Kufi Arabic', 'Vazirmatn', 'Tahoma', sans-serif !important; letter-spacing: 0 !important; }
.kgnd-bookpage.kgnd-bookpage-rtl .bp-text-block * { line-height: 1.95 !important; }

@media (max-width: 900px) {
  .kgnd-bookpage .bp-hero { grid-template-columns: 1fr; gap: 2.5rem; padding: 2rem 0 3rem; text-align: center; }
  .kgnd-bookpage .bp-cover-wrap { max-width: 220px; }
  .kgnd-bookpage .bp-cover-3d { max-width: 220px; margin: 0 auto; transform: none; }
  .kgnd-bookpage .bp-cover-3d:hover { transform: none; }
  .kgnd-bookpage .bp-cover-3d img, .kgnd-bookpage .bp-cover-3d .bp-cover-fallback { box-shadow: 0 20px 40px -10px rgba(60,40,20,.3), 0 8px 18px -4px rgba(60,40,20,.18); }
  .kgnd-bookpage .bp-2col-divider { grid-template-columns: 1fr; gap: 3rem; }
  .kgnd-bookpage .bp-2col-divider::before { display: none; }
  .kgnd-bookpage .bp-col-start, .kgnd-bookpage .bp-col-end { padding: 0; }
  .kgnd-bookpage .bp-books-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
  .kgnd-bookpage .bp-final-cta { grid-template-columns: 1fr; padding: 2.5rem; text-align: center; }
  .kgnd-bookpage .bp-final-cta h2 { font-size: 1.85rem; }
  .kgnd-bookpage .bp-final-cta-art { display: none; }
  .kgnd-bookpage .bp-section { padding: 3rem 0; }
  .kgnd-bookpage .bp-btn-primary, .kgnd-bookpage .bp-btn-secondary { min-width: 0; flex: 1; }
}

/* ---------- Author */
@media (max-width: 800px) {
  .kgnd-author-hero-grid { grid-template-columns: 1fr !important; gap: 2rem !important; text-align: center; }
  .kgnd-author-hero-grid > div:first-child { display: flex; justify-content: center; }
  .kgnd-author-hero-grid > div:first-child > * { width: 160px !important; height: 160px !important; }
}

/* ---------- Documents (theme inc/documents.php shortcode) */
.kgnd-docs-wrap { font-family: inherit; max-width: 1100px; margin: 0 auto; padding: 1rem 1.5rem 4rem; color: #0f172a; }
.kgnd-docs-hero { text-align: center; padding: 2rem 1rem 2.5rem; }
.kgnd-docs-hero h2 { color: #003366; font-size: clamp(1.5rem, 3vw, 2.2rem); margin: 0 0 .5rem; }
.kgnd-docs-hero p { color: #64748b; font-size: 1rem; margin: 0 auto; max-width: 600px; }
.kgnd-docs-filter { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; background: #fff; border: 1px solid #e2e8f0; border-radius: 1rem; padding: 1rem 1.25rem; margin-bottom: 1.5rem; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.kgnd-docs-filter input[type=search] { flex: 1; min-width: 200px; padding: .65rem 1rem; border: 1.5px solid #e2e8f0; border-radius: .65rem; font-size: .9rem; font-family: inherit; }
.kgnd-docs-filter select { padding: .65rem 1rem; border: 1.5px solid #e2e8f0; border-radius: .65rem; font-size: .9rem; background: #fff; font-family: inherit; }
.kgnd-docs-filter button { background: #003366; color: #fff; border: 0; padding: .65rem 1.25rem; border-radius: .65rem; font-weight: 700; cursor: pointer; font-family: inherit; }
.kgnd-docs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.kgnd-doc-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 1rem; padding: 1.25rem; display: flex; flex-direction: column; gap: .5rem; transition: all .2s; }
.kgnd-doc-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.06); border-color: #14B1BB; }
.kgnd-doc-cat-pill { display: inline-block; align-self: flex-start; background: #E0F7F8; color: #003366; padding: .2rem .6rem; border-radius: 9999px; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.kgnd-doc-title { font-size: 1rem; font-weight: 800; color: #003366; line-height: 1.35; margin: 0; }
.kgnd-doc-title a { color: inherit; text-decoration: none; }
.kgnd-doc-title a:hover { color: #0E7C83; }
.kgnd-doc-meta { font-size: .8rem; color: #64748b; }
.kgnd-doc-download { background: #14B1BB; color: #fff; padding: .65rem 1rem; border-radius: .65rem; font-weight: 700; text-decoration: none; text-align: center; margin-top: auto; font-size: .85rem; transition: background .15s; }
.kgnd-doc-download:hover { background: #003366; color: #fff; }
.kgnd-doc-locked { background: #fef3c7; color: #92400e; padding: .6rem .85rem; border-radius: .5rem; font-size: .8rem; font-weight: 600; }
.kgnd-docs-empty { text-align: center; color: #94a3b8; padding: 3rem 1rem; }
