/*
Theme Name: Kaytos
Theme URI: https://kaytos.net
Author: Kaytos
Description: Lightweight bilingual (Arabic RTL / English) theme for the Kaytos visual Quran platform. Display-only content: visual readings, short stories and documentaries. Mobile-first with bottom tab bar.
Version: 1.1.1
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: kaytos
*/

/* ---------- Tokens ---------- */
:root {
  --blue: #25AAE2;          /* logo blue */
  --blue-ink: #0A6C97;      /* accessible blue for text on light backgrounds */
  --blue-deep: #08506F;     /* dark buttons / headings accent */
  --blue-soft: #DDF0F9;
  --blue-tint: #EEF7FC;
  --ink: #1B2428;
  --muted: #5B6A72;
  --line: #DCE6EB;
  --bg: #F8FBFC;
  --bg-warm: #FBFCF6;
  --card: #FFFFFF;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 10px 30px rgba(8, 80, 111, .10);
  --gutter: 20px;
  --max: 1160px;
  --bar-h: 72px;
  --font-ar: "Tajawal", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-en: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-en);
  font-size: 17px;
  line-height: 1.75;
  padding-bottom: var(--bar-h);
}
html[lang="ar"] body { font-family: var(--font-ar); font-size: 19px; line-height: 1.95; }
img, video, iframe { max-width: 100%; height: auto; }
a { color: var(--blue-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(2.2rem, 7vw, 4rem); }
h2 { font-size: clamp(1.8rem, 5vw, 2.8rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 8px; inset-inline-start: 8px; z-index: 100; background: #fff; padding: 8px 14px; border-radius: 8px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(48px, 9vw, 96px); }
.section--soft { background: var(--blue-tint); }
.section--warm { background: var(--bg-warm); }
.section__head { max-width: 680px; margin-bottom: 30px; }
.eyebrow { display: block; color: var(--blue-ink); font-weight: 700; font-size: 1.05rem; margin-bottom: 10px; }
.lead { font-size: 1.1em; color: var(--muted); max-width: 62ch; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 28px; border-radius: var(--radius-sm); font-weight: 700; font-family: inherit; font-size: 1.05rem; border: 1.5px solid transparent; cursor: pointer; transition: transform .15s, background .15s, box-shadow .15s; }
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--primary { background: var(--blue-deep); color: #fff; }
.btn--primary:hover { background: #063B54; box-shadow: var(--shadow); }
.btn--ghost { border-color: var(--line); color: var(--blue-deep); background: #fff; }
.btn--ghost:hover { border-color: var(--blue); }
.btn--block { display: flex; width: 100%; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 60; background: rgba(248, 251, 252, .94); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.site-header__in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand img, .site-header .custom-logo { display: block; height: 38px !important; width: auto !important; max-width: 160px; }
.site-header .custom-logo-link { display: block; line-height: 0; }
.hero__title { font-family: var(--font-en); font-weight: 800; font-size: clamp(1.8rem, 6vw, 2.6rem); margin: 0 0 8px; color: #fff; text-shadow: 0 2px 16px rgba(0,0,0,.3); }

/* language pill */
.lang-pill { display: inline-flex; padding: 5px; border-radius: 999px; background: #fff; border: 1px solid var(--line); box-shadow: 0 4px 14px rgba(8, 80, 111, .08); }
.lang-pill a { padding: 6px 18px; border-radius: 999px; font-weight: 700; font-size: .85rem; letter-spacing: .08em; color: var(--muted); font-family: var(--font-en); }
.lang-pill a:hover { text-decoration: none; color: var(--blue-deep); }
.lang-pill a.is-active { background: linear-gradient(180deg, var(--blue-soft), #C6E7F6); color: var(--blue-deep); box-shadow: inset 0 0 0 1px rgba(37,170,226,.25); }

/* nav: bottom tab bar on mobile, inline on desktop */
.nav { position: fixed; inset-inline: 0; bottom: 0; z-index: 70; display: flex; justify-content: space-around; gap: 4px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: rgba(251, 252, 246, .97); backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
.nav a { flex: 1; text-align: center; color: var(--muted); font-weight: 600; padding: 12px 6px; border-radius: 16px; font-size: 1rem; line-height: 1.2; }
.nav a:hover { text-decoration: none; color: var(--blue-deep); }
.nav a[aria-current="page"] { background: var(--blue-soft); color: var(--blue-deep); }
.nav .nav__more { display: none; }

@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .site-header__in { justify-content: flex-start; }
  .nav { position: static; flex: 1; justify-content: flex-start; gap: 4px; padding: 0 12px; background: none; border: 0; backdrop-filter: none; margin-inline-start: 16px; }
  .nav a { flex: none; padding: 8px 16px; font-size: .98rem; }
  .nav .nav__more { display: block; }
  .site-header .lang-pill { margin-inline-start: auto; }
}

/* ---------- Hero (video / image) ---------- */
.hero { position: relative; isolation: isolate; overflow: hidden; display: grid; place-items: center; text-align: center; min-height: clamp(300px, 46svh, 460px); padding: 40px var(--gutter) 56px; color: #fff; background: linear-gradient(160deg, #0B2F43 0%, #0A6C97 55%, #25AAE2 100%); }
.hero__bg, .hero__bg video, .hero__bg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(5, 25, 36, .25) 0%, rgba(5, 25, 36, .55) 100%); }
/* default animated backdrop (used until a video or image is chosen in the Customizer) */
.hero--anim .hero__bg { overflow: hidden; }
.hero--anim .blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; will-change: transform; }
.blob--1 { width: 60vmax; height: 60vmax; background: #25AAE2; inset-block-start: -20vmax; inset-inline-start: -15vmax; animation: kt-float1 16s ease-in-out infinite alternate; }
.blob--2 { width: 50vmax; height: 50vmax; background: #0A6C97; inset-block-end: -20vmax; inset-inline-end: -12vmax; animation: kt-float2 20s ease-in-out infinite alternate; }
.blob--3 { width: 34vmax; height: 34vmax; background: #7FD3F5; inset-block-start: 30%; inset-inline-start: 40%; opacity: .35; animation: kt-float3 24s ease-in-out infinite alternate; }
@keyframes kt-float1 { to { transform: translate(18vmax, 14vmax) scale(1.15); } }
@keyframes kt-float2 { to { transform: translate(-16vmax, -12vmax) scale(1.2); } }
@keyframes kt-float3 { to { transform: translate(-10vmax, 8vmax) scale(.8); } }
.hero__in { max-width: 760px; }
.hero__tag { font-size: clamp(1rem, 2.8vw, 1.25rem); font-weight: 500; margin: 0 auto 20px; max-width: 34ch; text-shadow: 0 2px 16px rgba(0,0,0,.35); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.hero .btn { padding: 11px 22px; font-size: 1rem; }
.hero .btn--primary { background: #fff; color: var(--blue-deep); }
.hero .btn--ghost { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.5); }
.hero__scroll { display: none; position: absolute; bottom: 22px; inset-inline: 0; text-align: center; color: rgba(255,255,255,.85); font-weight: 600; font-size: .95rem; }
.hero__scroll::after { content: ""; display: block; width: 2px; height: 26px; margin: 8px auto 0; background: rgba(255,255,255,.7); border-radius: 2px; animation: kt-drip 1.8s infinite; }
@keyframes kt-drip { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* ---------- Grids & cards ---------- */
.grid { display: grid; gap: 22px; }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 26px 28px; overflow: hidden; transition: box-shadow .2s, transform .2s; }
.card::before { content: ""; position: absolute; inset-inline: 0; top: 0; height: 6px; background: linear-gradient(90deg, var(--blue), var(--blue-deep)); }
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); text-decoration: none; }
.card__icon { width: 64px; height: 64px; border-radius: 18px; background: var(--blue-tint); color: var(--blue-ink); display: grid; place-items: center; font-size: 1.6rem; margin: 0 auto 16px; border: 1px solid var(--line); }
.card--center { text-align: center; }
.card h3 { color: var(--blue-deep); margin-bottom: .35em; font-size: 1.5rem; }
.card p { color: var(--muted); margin: 0 0 18px; }
.card .btn { margin-top: 6px; }

.quote { border-inline-start: 5px solid var(--blue); background: #fff; padding: 20px 26px; border-radius: var(--radius-sm); font-weight: 600; font-size: 1.15em; color: var(--blue-deep); margin: 28px 0 0; box-shadow: 0 4px 18px rgba(8,80,111,.06); }

.checklist { list-style: none; padding: 0; margin: 0 0 1em; }
.checklist li { position: relative; padding-inline-start: 36px; margin-bottom: 14px; }
.checklist li::before { content: "✓"; position: absolute; inset-inline-start: 0; top: .2em; width: 26px; height: 26px; border-radius: 50%; background: var(--blue-soft); color: var(--blue-deep); font-weight: 800; font-size: .85rem; display: grid; place-items: center; line-height: 1; }

/* ---------- Numbered feature blocks ---------- */
.feature { display: grid; gap: 18px; margin-bottom: 40px; }
.feature__img { position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; background: linear-gradient(150deg, #0B4A68, var(--blue)); box-shadow: var(--shadow); }
.feature__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.feature__img .num { position: absolute; inset-inline-end: 22px; bottom: 26px; color: #fff; font-family: var(--font-en); font-weight: 800; font-size: clamp(2.6rem, 9vw, 4rem); line-height: 1; text-shadow: 0 3px 18px rgba(0,0,0,.3); }
.feature__img .num small { display: block; font-family: inherit; font-weight: 500; font-size: 1rem; margin-top: 6px; }
.feature__big { font-family: var(--font-en); font-weight: 800; font-size: 3.4rem; color: var(--blue-ink); line-height: 1; }
.feature h3 { font-size: 1.9rem; margin: 4px 0 6px; }
.feature p { color: var(--muted); margin: 0; }
@media (min-width: 820px) {
  .feature { grid-template-columns: 1fr 1fr; align-items: center; gap: 48px; }
  .feature:nth-child(even) .feature__img { order: 2; }
}

/* ---------- Productions ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.chip { border: 1.5px solid var(--line); border-radius: 999px; padding: 6px 18px; font-weight: 600; color: var(--ink); font-size: .95rem; background: #fff; }
.chip:hover, .chip.is-active { background: var(--blue-deep); color: #fff; border-color: var(--blue-deep); text-decoration: none; }
.prod { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: inherit; transition: box-shadow .2s, transform .2s; }
.prod:hover { box-shadow: var(--shadow); transform: translateY(-2px); text-decoration: none; }
.prod__media { aspect-ratio: 4 / 3; background: linear-gradient(150deg, #0B4A68, var(--blue)); position: relative; }
.prod__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.prod__num { position: absolute; inset-inline-start: 18px; bottom: 14px; color: #fff; font-family: var(--font-en); font-weight: 800; font-size: 2.4rem; line-height: 1; text-shadow: 0 2px 14px rgba(0,0,0,.4); }
.prod__body { padding: 18px 22px 24px; }
.prod__meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; font-size: .85rem; font-weight: 700; }
.tag { background: var(--blue-soft); color: var(--blue-deep); padding: 2px 14px; border-radius: 999px; }
.tag--lang { background: #111; color: #fff; }
.prod h3 { margin: 0; font-size: 1.35rem; color: var(--ink); }
.empty { text-align: center; padding: 48px 20px; border: 2px dashed var(--line); border-radius: var(--radius); color: var(--muted); background: #fff; }

/* horizontal carousel */
.rail { display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px var(--gutter) 22px; margin-inline: calc(var(--gutter) * -1); scrollbar-width: thin; }
.rail > * { flex: 0 0 min(78vw, 330px); scroll-snap-align: start; }
@media (min-width: 900px) { .rail { display: grid; grid-template-columns: repeat(3, 1fr); overflow: visible; margin-inline: 0; padding-inline: 0; } .rail > * { flex: none; } }

/* social buttons */
.social { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 8px; }
.social a { background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 14px 26px; font-weight: 700; color: var(--blue-deep); font-family: var(--font-en); }
.social a:hover { border-color: var(--blue); text-decoration: none; background: var(--blue-tint); }

/* ---------- Steps (process page) ---------- */
.steps { counter-reset: step; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); padding: 0; list-style: none; margin: 0; }
.step { counter-increment: step; position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; padding-inline-start: 80px; }
.step::before { content: counter(step, decimal-leading-zero); position: absolute; inset-inline-start: 18px; top: 18px; font-family: var(--font-en); font-weight: 800; font-size: 1.9rem; color: var(--blue); line-height: 1.2; }
.step h3 { font-size: 1.15rem; margin-bottom: .25em; color: var(--blue-deep); }
.step p { color: var(--muted); margin: 0; font-size: .97rem; line-height: 1.75; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 16px; max-width: 640px; }
.form label { font-weight: 700; display: block; margin-bottom: 6px; }
.form input, .form select, .form textarea { width: 100%; font: inherit; padding: 13px 16px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: #fff; color: var(--ink); }
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(37,170,226,.2); }
.form textarea { min-height: 150px; resize: vertical; }
.hp { position: absolute; inset-inline-start: -9999px; }
.notice { padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 20px; font-weight: 600; }
.notice--ok { background: #E8F7EE; color: #145A32; }
.notice--err { background: #FDECEA; color: #8A1C12; }

/* ---------- Inner page hero ---------- */
.page-hero { background: linear-gradient(180deg, var(--blue-tint), var(--bg)); padding-block: clamp(40px, 8vw, 84px) clamp(20px, 4vw, 40px); }
.page-hero h1 { margin: 0; font-size: clamp(2rem, 6vw, 3.2rem); color: var(--blue-deep); }
.page-hero p { margin: 12px 0 0; color: var(--muted); max-width: 62ch; }

.entry { max-width: 780px; }
.entry img, .entry video { border-radius: var(--radius); }

/* ---------- CTA band ---------- */
.cta-band { background: linear-gradient(150deg, #0B2F43, var(--blue-deep)); color: #fff; border-radius: 28px; padding: clamp(34px, 6vw, 64px); text-align: center; }
.cta-band h2 { color: #fff; }
.cta-band p { color: #CFE3EE; max-width: 56ch; margin-inline: auto; }
.cta-band .btn--primary { background: var(--blue); color: #06222F; }
.cta-band .btn--primary:hover { background: #4DBCEA; }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-warm); border-top: 1px solid var(--line); padding-block: 48px 28px; }
.footer__grid { display: grid; gap: 32px; grid-template-columns: 1.4fr 1fr 1fr; }
.footer__grid img { height: 44px; width: auto; margin-bottom: 12px; }
.footer__grid h4 { font-size: 1.05rem; margin-bottom: 10px; color: var(--blue-deep); }
.footer__grid ul { list-style: none; padding: 0; margin: 0; }
.footer__grid li { margin-bottom: 8px; }
.footer__grid a { color: var(--muted); }
.footer__copy { border-top: 1px solid var(--line); margin-top: 32px; padding-top: 18px; color: var(--muted); font-size: .9rem; }
@media (max-width: 760px) { .footer__grid { grid-template-columns: 1fr; } }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }
.pagination .page-numbers { padding: 8px 16px; border: 1.5px solid var(--line); border-radius: 999px; color: var(--ink); font-weight: 600; background: #fff; }
.pagination .current { background: var(--blue-deep); color: #fff; border-color: var(--blue-deep); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
