/*
Theme Name: Taqrir
Theme URI: https://taqrir.ae
Author: Taqrir
Description: Flat, editorial light theme for Taqrir.ae — institutional-grade UAE stock research. Pairs with the Taqrir Core plugin.
Version: 0.8.0
Requires PHP: 8.0
Text Domain: taqrir-theme
*/

:root {
  --tq-bg: #ffffff;
  --tq-panel: #ffffff;
  --tq-soft: #f6f8fb;
  --tq-border: #e6eaf0;
  --tq-border-strong: #d3dae4;
  --tq-text: #0f1c2e;
  --tq-muted: #64748b;
  --tq-faint: #94a3b8;
  --tq-primary: #a87f14;
  --tq-primary-hover: #8a680f;
  --tq-primary-soft: #faf3e2;
  --tq-accent: #a87f14;
  --tq-green: #148a4e;
  --tq-red: #d13425;
  --tq-font: 'Inter', 'IBM Plex Sans Arabic', -apple-system, "Segoe UI", Tahoma, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body { margin: 0; background: var(--tq-bg); color: var(--tq-text); font-family: var(--tq-font); font-size: 15.5px; line-height: 1.65; }
a { color: var(--tq-primary); text-decoration: none; }
a:hover { color: var(--tq-primary-hover); }
h1, h2, h3 { line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 30px; }
h2 { font-size: 20px; }
img { max-width: 100%; height: auto; }
.tq-num, table td { font-variant-numeric: tabular-nums; }

.tq-container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ---------- header ---------- */
.tq-header { background: #fff; border-bottom: 1px solid var(--tq-border); position: sticky; top: 0; z-index: 100; }
.tq-header__inner { display: flex; align-items: center; gap: 22px; padding: 0 24px; height: 60px; max-width: 1180px; margin: 0 auto; }
.tq-logo { display: flex; align-items: baseline; gap: 8px; font-size: 20px; font-weight: 800; letter-spacing: .04em; color: var(--tq-text); }
.tq-logo b { color: var(--tq-accent); font-weight: 800; }
.tq-logo small { color: var(--tq-muted); font-weight: 500; font-size: 15px; }
.tq-logo:hover { color: var(--tq-text); }

.tq-search { position: relative; flex: 0 1 300px; }
.tq-search input {
  width: 100%; height: 36px; padding: 0 12px; font-size: 14px; font-family: inherit;
  background: #fff; color: var(--tq-text);
  border: 1px solid var(--tq-border-strong); border-radius: 4px; outline: none;
}
.tq-search input:focus { border-color: var(--tq-primary); }
.tq-search__list {
  position: absolute; top: 42px; inset-inline: 0; background: #fff;
  border: 1px solid var(--tq-border-strong); max-height: 320px; overflow-y: auto; display: none; z-index: 110;
}
.tq-search__list a { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; font-size: 14px; color: var(--tq-text); border-bottom: 1px solid var(--tq-border); }
.tq-search__list a:last-child { border-bottom: 0; }
.tq-search__list a:hover { background: var(--tq-soft); }
.tq-search__list .t { font-weight: 700; color: var(--tq-primary); letter-spacing: .03em; }
.tq-search__list .n { color: var(--tq-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tq-nav { display: flex; gap: 18px; align-items: center; margin-inline-start: auto; }
.tq-nav a { color: var(--tq-muted); font-size: 14px; font-weight: 500; padding: 4px 0; border-bottom: 2px solid transparent; }
.tq-nav a:hover { color: var(--tq-text); }
.tq-nav a.current { color: var(--tq-text); border-bottom-color: var(--tq-primary); }
.tq-nav a.tq-cta { color: #fff; background: var(--tq-primary); font-weight: 600; padding: 8px 18px; border-radius: 4px; border-bottom: 0; }
.tq-nav a.tq-cta:hover { background: var(--tq-primary-hover); }

/* ---------- layout ---------- */
.tq-main { min-height: 60vh; padding: 40px 0 12px; }

/* section headings replace panels */
.tq-panel { background: transparent; border: 0; padding: 0; margin: 0 0 44px; }
.tq-panel h2, .tq-section-h {
  font-size: 13px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--tq-text);
  margin: 0 0 14px; padding-bottom: 10px; border-bottom: 2px solid var(--tq-text);
}

/* ---------- hero ---------- */
.tq-hero { text-align: start; padding: 56px 0 48px; border-bottom: 1px solid var(--tq-border); margin-bottom: 44px; }
.tq-hero h1 { font-size: 44px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 14px; max-width: 780px; }
.tq-hero h1 em { color: var(--tq-primary); font-style: normal; }
.tq-hero p { color: var(--tq-muted); font-size: 18px; max-width: 640px; margin: 0 0 28px; }
.tq-hero__trust { color: var(--tq-faint); font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; margin-top: 26px; }
.tq-btn { display: inline-block; background: var(--tq-primary); color: #fff; font-weight: 600; padding: 11px 26px; border-radius: 4px; font-size: 15px; margin-inline-end: 10px; }
.tq-btn:hover { background: var(--tq-primary-hover); color: #fff; }
.tq-btn--ghost { background: transparent; color: var(--tq-text); border: 1px solid var(--tq-border-strong); }
.tq-btn--ghost:hover { background: var(--tq-soft); color: var(--tq-text); }

/* ---------- grids ---------- */
.tq-grid { display: grid; gap: 0 40px; }
.tq-grid--2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.tq-grid--3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 48px; }
.tq-grid--4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

/* metrics: flat stat row with hairline separators */
.tq-metric { background: transparent; border: 0; border-inline-start: 1px solid var(--tq-border); padding: 4px 0 4px 20px; }
.tq-grid--4 .tq-metric:first-child { border-inline-start: 0; padding-inline-start: 0; }
.tq-metric__label { color: var(--tq-muted); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; display: block; margin-bottom: 2px; }
.tq-metric__value { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
div.tq-grid--4[style] { margin-bottom: 44px !important; }
div.tq-grid--2[style], div.tq-grid--3[style] { margin-bottom: 44px !important; }

/* features: plain editorial columns */
.tq-feature { background: transparent; border: 0; border-top: 2px solid var(--tq-text); padding: 16px 0 0; }
.tq-feature__icon { display: none; }
.tq-feature h3 { margin: 0 0 8px; font-size: 15.5px; }
.tq-feature p { margin: 0; color: var(--tq-muted); font-size: 14px; }

/* CTA: flat centered section */
.tq-band { background: transparent; color: var(--tq-text); border-top: 1px solid var(--tq-border); border-radius: 0; padding: 44px 0; text-align: center; margin: 8px 0 24px; }
.tq-band h2 { color: var(--tq-text); font-size: 26px; margin: 0 0 8px; }
.tq-band p { color: var(--tq-muted); margin: 0 0 20px; }
.tq-band .tq-btn { background: var(--tq-primary); color: #fff; }
.tq-band .tq-btn:hover { background: var(--tq-primary-hover); }

/* ---------- movers ---------- */
.tq-movers { width: 100%; border-collapse: collapse; font-size: 14px; }
.tq-movers td { padding: 9px 8px 9px 0; border-bottom: 1px solid var(--tq-border); }
.tq-movers td:last-child { text-align: end; padding-inline-end: 0; }
.tq-movers .tick { color: var(--tq-primary); font-weight: 700; letter-spacing: .03em; }
.pos, .neg { font-weight: 600; font-variant-numeric: tabular-nums; }
.pos { color: var(--tq-green); }
.neg { color: var(--tq-red); }
.tq-pill { display: inline-block; font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tq-pill--up { color: var(--tq-green); }
.tq-pill--down { color: var(--tq-red); }

/* ---------- directory: flat rows ---------- */
.tq-dir { border-top: 2px solid var(--tq-text); }
.tq-card {
  background: transparent; border: 0; border-bottom: 1px solid var(--tq-border); border-radius: 0;
  padding: 13px 0; display: flex; align-items: baseline; gap: 14px; color: var(--tq-text); box-shadow: none;
}
.tq-card:hover { background: var(--tq-soft); color: var(--tq-text); }
.tq-card__ticker { color: var(--tq-primary); font-weight: 700; letter-spacing: .04em; font-size: 14.5px; flex: 0 0 90px; }
.tq-card__name { flex: 1; margin: 0; font-size: 14.5px; color: var(--tq-text); }
.tq-card__meta { color: var(--tq-muted); font-size: 13.5px; display: flex; gap: 22px; font-variant-numeric: tabular-nums; }

/* ---------- single company ---------- */
.tq-quote { background: transparent; border: 0; border-bottom: 1px solid var(--tq-border); border-radius: 0; box-shadow: none; padding: 0 0 20px; margin-bottom: 28px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.tq-quote__id h1 { margin: 0; font-size: 26px; }
.tq-quote__sub { color: var(--tq-muted); font-size: 13.5px; margin-top: 4px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.tq-exch { color: var(--tq-muted); font-size: 12px; font-weight: 600; letter-spacing: .05em; }
.tq-quote__price { margin-inline-start: auto; text-align: end; }
.tq-quote__price .p { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.tq-prose { color: var(--tq-muted); max-width: 820px; margin-bottom: 12px; }

/* ---------- company tabs (macrotrends-style) ---------- */
.tq-tabs { display: flex; border-bottom: 2px solid var(--tq-text); margin: 0 0 28px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.tq-tabs::-webkit-scrollbar { display: none; }
.tq-tabs button {
  background: transparent; color: var(--tq-muted); border: 0; border-bottom: 3px solid transparent;
  padding: 10px 16px; cursor: pointer; font-size: 13.5px; font-weight: 600; font-family: inherit;
  white-space: nowrap; margin-bottom: -2px;
}
.tq-tabs button:hover { color: var(--tq-text); }
.tq-tabs button.active { color: var(--tq-primary); border-bottom-color: var(--tq-primary); }
.tq-tabpane { min-height: 200px; }
.tq-subtabs {
  display: flex; background: var(--tq-soft); border: 1px solid var(--tq-border);
  margin: 0 0 24px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.tq-subtabs::-webkit-scrollbar { display: none; }
.tq-subtabs button {
  background: transparent; color: var(--tq-primary); border: 0; border-inline-end: 1px solid var(--tq-border);
  padding: 9px 15px; cursor: pointer; font-size: 13px; font-weight: 600; font-family: inherit; white-space: nowrap;
}
.tq-subtabs button:hover { background: #fff; }
.tq-subtabs button.active { background: #fff; color: var(--tq-text); box-shadow: inset 0 -2px 0 var(--tq-primary); }

/* ---------- footer ---------- */
.tq-footer { background: #fff; border-top: 1px solid var(--tq-border); margin-top: 64px; padding: 40px 0 32px; }
.tq-footer__inner { max-width: 1180px; margin: 0 auto; padding: 0 24px; color: var(--tq-muted); font-size: 13.5px; }
.tq-footer__cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 28px; margin-bottom: 20px; }
.tq-footer__brand { font-size: 17px; font-weight: 800; letter-spacing: .04em; color: var(--tq-text); }
.tq-footer__brand b { color: var(--tq-accent); }
.tq-footer h4 { margin: 0 0 10px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--tq-faint); }
.tq-footer a { color: var(--tq-muted); display: inline-block; padding: 2px 0; }
.tq-footer a:hover { color: var(--tq-primary); }
.tq-disclaimer { border-top: 1px solid var(--tq-border); margin-top: 8px; padding-top: 16px; font-size: 12px; line-height: 1.7; color: var(--tq-faint); }

/* ---------- forms / wp ---------- */
.aligncenter { display: block; margin: 0 auto; }
input, select, textarea, button { font-family: inherit; }
.tq-content input[type=text], .tq-content input[type=email], .tq-content input[type=password] {
  background: #fff; color: var(--tq-text); border: 1px solid var(--tq-border-strong); border-radius: 4px; padding: 9px 13px;
}

/* ---------- mobile ---------- */
@media (max-width: 900px) {
  .tq-nav { gap: 12px; }
}
@media (max-width: 760px) {
  body { font-size: 15px; }
  .tq-container { padding: 0 16px; }
  .tq-main { padding: 24px 0 8px; }

  /* header: logo row, then search full-width; nav scrolls horizontally */
  .tq-header__inner { flex-wrap: wrap; height: auto; padding: 10px 16px 0; gap: 10px 12px; }
  .tq-logo { font-size: 18px; }
  .tq-nav {
    order: 2; margin-inline-start: auto; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    max-width: 100%; scrollbar-width: none; gap: 14px; padding-bottom: 10px;
  }
  .tq-nav::-webkit-scrollbar { display: none; }
  .tq-nav a { white-space: nowrap; padding: 8px 0; }
  .tq-nav a.tq-cta { padding: 8px 14px; }
  .tq-search { order: 3; flex-basis: 100%; margin-bottom: 10px; }
  .tq-search input { height: 42px; font-size: 16px; }

  /* hero */
  .tq-hero { padding: 32px 0 30px; margin-bottom: 30px; }
  .tq-hero h1 { font-size: 29px; }
  .tq-hero p { font-size: 16px; }
  .tq-btn { display: block; text-align: center; margin: 0 0 10px; padding: 13px 26px; }

  /* stats + grids stack */
  .tq-grid { gap: 0; }
  .tq-grid--4 { grid-template-columns: 1fr 1fr; gap: 18px 20px; }
  .tq-metric { border-inline-start: 0; padding: 0; }
  .tq-metric__value { font-size: 21px; }
  .tq-grid--2, .tq-grid--3 { grid-template-columns: 1fr; gap: 28px; }
  .tq-panel { margin-bottom: 34px; }

  /* directory rows wrap */
  .tq-card { flex-wrap: wrap; gap: 4px 12px; padding: 12px 0; }
  .tq-card__ticker { flex: 0 0 auto; }
  .tq-card__name { flex: 1 1 100%; order: 3; }
  .tq-card__meta { margin-inline-start: auto; gap: 14px; }

  /* company quote header stacks */
  .tq-quote { display: block; padding-bottom: 16px; margin-bottom: 22px; }
  .tq-quote__id h1 { font-size: 22px; }
  .tq-quote__price { margin: 12px 0 8px; text-align: start; }
  .tq-quote__price .p { font-size: 28px; }

  /* footer */
  .tq-footer__cols { grid-template-columns: 1fr; gap: 20px; }

  .tq-tabs button { padding: 12px 13px; font-size: 13px; }

  /* tap targets */
  .tq-nav a, .tq-footer a { min-height: 32px; display: inline-flex; align-items: center; }
}
@media (max-width: 420px) {
  .tq-grid--4 { grid-template-columns: 1fr 1fr; }
  .tq-hero h1 { font-size: 25px; }
}
