/*
Theme Name: FindMyQibla
Theme URI: https://findmyqibla.com/
Author: FindMyQibla
Author URI: https://findmyqibla.com/
Description: Bespoke lightweight theme for FindMyQibla — a fast, accessible Qibla finder. Ivory page, navy instrument surfaces, emerald actions, gold Qibla accents. No frameworks, no jQuery. Text domain findmyqibla.
Version: 4.0.0
Requires at least: 6.2
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: findmyqibla
Tags: custom-colors, custom-menu, featured-images, threaded-comments, translation-ready, accessibility-ready
*/

/* ============ Tokens (BRAND.md v4) ============ */
:root{
  --emerald:#086C69;
  --emerald-deep:#075653;
  --navy:#101C2D;
  --ivory:#F8F6F0;
  --gold:#D5A62D;
  --white:#FFFFFF;
  --text:#192B34;
  --muted:#566873;
  --hairline:#E4DCCB;
  --on-dark:#C9D4D8;
  --radius:16px;
  --font:"Inter",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
}

*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;scroll-behavior:smooth}
body{
  margin:0;
  font-family:var(--font);
  font-size:16px;
  line-height:1.6;
  color:var(--text);
  background:var(--ivory);
}
h1,h2,h3,h4{line-height:1.25;letter-spacing:-0.01em;color:var(--navy);margin:0 0 .8rem}
h1{font-size:clamp(1.75rem,4.6vw,3rem);font-weight:800}
h2{font-size:clamp(1.4rem,2.8vw,1.9rem);font-weight:700}
h3{font-size:1.1rem;font-weight:700}
p{margin:0 0 1rem}
a{color:var(--emerald)}
img,svg{max-width:100%;height:auto;vertical-align:middle}

/* Tabular numerals for every bearing and distance */
.num,.bearing{font-variant-numeric:tabular-nums}

/* ============ Accessibility ============ */
:focus-visible{outline:3px solid var(--gold);outline-offset:3px;border-radius:6px}
.skip-link{
  position:absolute;left:-9999px;top:0;z-index:300;
  background:var(--navy);color:#fff;padding:.75rem 1.25rem;
  font-weight:700;text-decoration:none;border-radius:0 0 10px 0;
}
.skip-link:focus{left:0;color:#fff}
.visually-hidden{
  position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;
  overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;
}

/* ============ Layout ============ */
.wrap{max-width:1120px;margin:0 auto;padding-left:1.25rem;padding-right:1.25rem}
.content-narrow{max-width:46rem}
.eyebrow{
  display:inline-block;font-size:.75rem;font-weight:800;letter-spacing:.14em;
  text-transform:uppercase;color:var(--emerald-deep);margin-bottom:.8rem;
}
.eyebrow::before{
  content:"";display:inline-block;width:1.4rem;height:2px;background:var(--gold);
  vertical-align:middle;margin-right:.55rem;border-radius:2px;
}

/* ============ Header ============ */
.site-header{
  background:var(--ivory);
  border-bottom:1px solid var(--hairline);
  position:sticky;top:0;z-index:100;
}
.header-inner{
  display:flex;align-items:center;justify-content:space-between;
  min-height:68px;gap:1rem;
}
.brand{
  display:inline-flex;align-items:center;gap:.6rem;
  text-decoration:none;color:var(--navy);
  font-weight:800;font-size:1.2rem;letter-spacing:-0.01em;
  min-height:44px;
}
.brand svg{flex:none}
.nav-desktop ul{
  display:flex;gap:1.4rem;list-style:none;margin:0;padding:0;align-items:center;
}
.nav-desktop a{
  display:inline-flex;align-items:center;min-height:44px;
  text-decoration:none;color:var(--text);font-weight:600;font-size:.95rem;
  padding:.4rem 0;border-bottom:2px solid transparent;
}
.nav-desktop a:hover{color:var(--emerald-deep);border-bottom-color:var(--gold)}
.nav-desktop a[aria-current="page"],.nav-desktop .current-menu-item a{
  color:var(--emerald-deep);border-bottom-color:var(--gold);
}
/* Language switcher: scaffolded, hidden until first genuine translation ships */
.fmq-lang-switcher{display:none!important}
.menu-btn{
  display:none;background:var(--emerald);color:#fff;border:0;border-radius:10px;
  min-height:44px;min-width:44px;padding:.6rem .9rem;font-weight:700;cursor:pointer;
  font-family:inherit;font-size:1rem;
}
.menu-btn:hover{background:var(--emerald-deep)}
.mobile-nav{
  display:none;border-top:1px solid var(--hairline);background:var(--ivory);
}
.mobile-nav.open{display:block}
.mobile-nav ul{list-style:none;margin:0;padding:.6rem 1.25rem 1.1rem}
.mobile-nav a{
  display:flex;align-items:center;min-height:48px;
  padding:.6rem 0;text-decoration:none;color:var(--text);font-weight:600;
  border-bottom:1px solid var(--hairline);
}
.mobile-nav li:last-child a{border-bottom:0}
.mobile-nav a[aria-current="page"]{color:var(--emerald-deep)}

/* ============ Hero ============ */
.hero{padding:2.6rem 0 1.2rem}
.hero .lede{font-size:1.12rem;color:var(--muted);max-width:44rem;margin:0 0 1.1rem}
.trust{display:flex;flex-wrap:wrap;gap:.6rem 1.4rem;list-style:none;margin:0;padding:0}
.trust li{
  display:flex;align-items:center;gap:.45rem;
  font-size:.92rem;font-weight:600;color:var(--emerald-deep);
}
.trust svg{flex:none}

/* ============ Tool section wrapper (tool itself is the plugin shortcode) ============ */
.tool-section{padding:1.2rem 0 3rem}

/* ============ Buttons ============ */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:.5rem;
  border-radius:999px;font-weight:700;cursor:pointer;text-decoration:none;border:0;
  min-height:48px;padding:.8rem 1.6rem;font-size:1rem;font-family:inherit;
  line-height:1.2;
}
.btn-primary{background:var(--emerald);color:#fff}
.btn-primary:hover{background:var(--emerald-deep);color:#fff}
.btn-gold{background:var(--gold);color:var(--navy)}
.btn-gold:hover{background:#c4962a;color:var(--navy)}
.btn-ghost{background:transparent;color:var(--emerald-deep);border:2px solid var(--emerald)}
.btn-ghost:hover{background:var(--emerald);color:#fff}
.btn-row{display:flex;flex-wrap:wrap;gap:.7rem;margin-top:1rem}

/* ============ Content sections ============ */
.section{padding:2.6rem 0;border-top:1px solid var(--hairline)}
.section .lede{color:var(--muted);max-width:44rem}
.steps{display:grid;grid-template-columns:repeat(3,1fr);gap:1.2rem;margin-top:1.6rem}
.step{background:var(--white);border:1px solid var(--hairline);border-radius:var(--radius);padding:1.4rem}
.step .n{
  display:inline-flex;align-items:center;justify-content:center;
  width:40px;height:40px;border-radius:50%;
  background:var(--emerald);color:#fff;font-weight:800;margin-bottom:.8rem;
  font-variant-numeric:tabular-nums;
}
.step h3{margin-bottom:.4rem}
.step p{font-size:.95rem;color:var(--muted);margin:0}
.benefits{display:grid;grid-template-columns:repeat(2,1fr);gap:1.4rem 1.2rem;margin-top:1.6rem}
.benefit{display:flex;gap:.9rem;align-items:flex-start}
.benefit svg{flex:none;margin-top:.2rem}
.benefit h3{margin-bottom:.25rem;font-size:1.02rem}
.benefit p{font-size:.94rem;color:var(--muted);margin:0}
.calc-grid{display:grid;grid-template-columns:minmax(0,5fr) minmax(0,6fr);gap:1.6rem;align-items:center;margin-top:1.4rem}
.calc-diagram{background:var(--white);border:1px solid var(--hairline);border-radius:var(--radius);padding:1.2rem}

/* FAQ accordion */
.faq{margin-top:1.4rem;max-width:46rem}
.faq-item{border:1px solid var(--hairline);border-radius:12px;margin-bottom:.7rem;background:var(--white);overflow:hidden}
.faq-q{
  width:100%;background:none;border:0;text-align:left;
  font-weight:700;font-size:1rem;color:var(--navy);
  padding:1rem 1.2rem;cursor:pointer;
  display:flex;justify-content:space-between;align-items:center;gap:1rem;
  min-height:56px;font-family:inherit;line-height:1.4;
}
.faq-q .chev{flex:none;transition:transform .2s;color:var(--emerald-deep)}
.faq-item.open .faq-q .chev{transform:rotate(180deg)}
.faq-a{display:none;padding:0 1.2rem 1.1rem;color:var(--muted);font-size:.96rem}
.faq-item.open .faq-a{display:block}
.faq-a p:last-child{margin-bottom:0}

/* Guide cards */
.guides-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:1.2rem;margin-top:1.6rem}
.guide-card{
  background:var(--white);border:1px solid var(--hairline);border-radius:var(--radius);
  padding:1.4rem;display:flex;flex-direction:column;gap:.6rem;
}
.guide-card svg{margin-bottom:.2rem}
.guide-card h3{margin:0;font-size:1.05rem}
.guide-card p{font-size:.93rem;color:var(--muted);margin:0;flex:1}
.guide-card a{font-weight:700;text-decoration:none}
.guide-card a:hover{text-decoration:underline}

/* Generic page content */
.page-content{padding:2.2rem 0 3rem}
.page-content > .wrap > :first-child{margin-top:0}
.entry-content > *{max-width:46rem}
.entry-content .alignwide{max-width:70rem}
.entry-content .alignfull{max-width:none}

/* Post list (index) */
.post-list{list-style:none;margin:1.6rem 0 0;padding:0;display:grid;gap:1.2rem}
.post-list article{background:var(--white);border:1px solid var(--hairline);border-radius:var(--radius);padding:1.4rem}
.post-list h2{font-size:1.3rem;margin-bottom:.4rem}
.post-list h2 a{text-decoration:none;color:var(--navy)}
.post-list h2 a:hover{color:var(--emerald-deep);text-decoration:underline}
.post-meta{font-size:.85rem;color:var(--muted);margin-bottom:.6rem}
.post-excerpt{color:var(--muted);margin:0}

/* Breadcrumbs */
.breadcrumbs{font-size:.85rem;color:var(--muted);margin-bottom:1.2rem}
.breadcrumbs ol{list-style:none;display:flex;flex-wrap:wrap;gap:.4rem;margin:0;padding:0}
.breadcrumbs li{display:flex;align-items:center;gap:.4rem}
.breadcrumbs li+li::before{content:"›";color:var(--muted);font-weight:700}
.breadcrumbs a{text-decoration:none}
.breadcrumbs [aria-current="page"]{color:var(--text);font-weight:600}

/* 404 */
.error-404{padding:4rem 0;text-align:center}
.error-404 .code{font-size:5rem;font-weight:800;color:var(--emerald);font-variant-numeric:tabular-nums;line-height:1}

/* ============ Footer ============ */
.site-footer{background:var(--navy);color:var(--ivory);margin-top:3rem}
.footer-grid{
  display:grid;grid-template-columns:2fr 1fr 1fr 1fr;gap:2rem;
  padding:2.8rem 0 1.6rem;
}
.footer-brand .brand{color:#fff}
.footer-brand p{color:var(--on-dark);font-size:.94rem;max-width:22rem;margin-top:.9rem}
.footer-h{
  color:var(--ivory);font-size:.85rem;letter-spacing:.1em;text-transform:uppercase;
  margin-bottom:.9rem;font-weight:700;
}
.footer-list{list-style:none;margin:0;padding:0}
.footer-list li{margin-bottom:.35rem}
.footer-list a{
  color:var(--on-dark);text-decoration:none;font-size:.94rem;
  display:inline-flex;align-items:center;min-height:36px;
}
.footer-list a:hover{color:var(--gold)}
.footer-base{
  border-top:1px solid rgba(248,246,240,.14);
  padding:1.2rem 0 1.6rem;
  display:flex;justify-content:space-between;flex-wrap:wrap;gap:.6rem;
}
.footer-base p{margin:0;font-size:.85rem;color:#9AA8B0}

/* ============ Responsive ============ */
@media (max-width:1023px){
  .guides-grid{grid-template-columns:repeat(2,1fr)}
}
@media (max-width:899px){
  .nav-desktop{display:none}
  .menu-btn{display:inline-flex}
  .tool-grid,.steps,.calc-grid{grid-template-columns:1fr}
  .footer-grid{grid-template-columns:1fr 1fr}
  .hero{padding:2rem 0 1rem}
}
@media (max-width:639px){
  .guides-grid,.benefits,.result-cards{grid-template-columns:1fr}
  .footer-grid{grid-template-columns:1fr;gap:1.4rem;padding:2rem 0 1rem}
  .section{padding:2rem 0}
  .wrap{padding-left:1rem;padding-right:1rem}
  /* Footer base: stack on narrow screens so the right-aligned line never
     touches the viewport edge (QA: 390px clipping). */
  .footer-base{flex-direction:column;align-items:flex-start}
}
@media (max-width:389px){
  .trust{gap:.5rem 1rem}
  .btn{width:100%}
  .btn-row .btn{width:100%}
}

/* ============ Reduced motion ============ */
@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *,*::before,*::after{animation:none!important;transition:none!important}
}
