/*
Theme Name: Hakami
Theme URI: https://hhhakami.com
Author: Hussam Hadi Hakami
Description: Block theme for Hakami & Partners — the seven chapters of a company's life, three grounds (Soot, Navy, Shell), bilingual Arabic/English, the signature foot on every page.
Version: 0.1.0
Requires at least: 6.6
Tested up to: 6.8
Requires PHP: 8.0
License: GNU General Public License v2 or later
Text Domain: hh
*/

/* ---------- grounds: the three registers, switched per page ---------- */
:root, body.ground-soot {
  --hh-ground: #1A1714; --hh-ink: #F6F1EA; --hh-ink-soft: rgba(246,241,234,.78); --hh-ink-muted: rgba(246,241,234,.55);
  --hh-rule: rgba(246,241,234,.2); --hh-rule-strong: rgba(246,241,234,.6);
  --hh-brass: #B08D57; --hh-brass-text: #D9B57A; --hh-saffron: #D9531E; --hh-oasis: #1B7F5F; --hh-oxblood: #9A3B2E; --hh-navy: #0F2A44;
  --hh-paper: #F3ECDF; --hh-band: #E1D5C3; --hh-shadow: rgba(0,0,0,.55);
  --hh-foot-filter: grayscale(1) contrast(1.05); --hh-foot-opacity: .38;
  --hh-tile-text: #F6F1EA;
  color-scheme: dark;
}
body.ground-navy {
  --hh-ground: #0F2A44; --hh-shadow: rgba(0,0,0,.5);
}
body.ground-shell {
  --hh-ground: #F6F1EA; --hh-ink: #0F2A44; --hh-ink-soft: #2B3746; --hh-ink-muted: #5B6470;
  --hh-rule: rgba(15,42,68,.15); --hh-rule-strong: #0F2A44; --hh-brass-text: #B08D57; --hh-shadow: rgba(15,42,68,.32);
  --hh-foot-filter: none; --hh-foot-opacity: .32;
  color-scheme: light;
}
html { background: var(--hh-ground); }
body { background: var(--hh-ground); color: var(--hh-ink); -webkit-font-smoothing: antialiased; }
body[dir="rtl"], html[lang^="ar"] body { font-family: 'Almarai', system-ui, sans-serif; }
html[lang^="ar"] h1, html[lang^="ar"] h2, html[lang^="ar"] h3, html[lang^="ar"] .wp-block-post-title, html[lang^="ar"] .hh-display { font-family: 'Reem Kufi', sans-serif; font-weight: 500; letter-spacing: 0; line-height: 1.25; }
html[lang^="ar"] .hh-caps { letter-spacing: .02em; }

/* ---------- utilities used by templates and blocks ---------- */
.hh-caps { font-family: 'IBM Plex Sans Arabic', 'IBM Plex Sans', system-ui, sans-serif; font-size: .625rem; letter-spacing: .18em; text-transform: uppercase; color: var(--hh-ink-muted); }
.hh-caps.is-brass { color: var(--hh-brass-text); }
.hh-caps.is-saffron { color: var(--hh-saffron); }
.hh-display { font-family: 'Newsreader', Georgia, serif; font-weight: 300; letter-spacing: -.02em; line-height: 1.02; }
.hh-rule { width: 44px; height: 1px; background: var(--hh-brass); }
.hh-page { position: relative; z-index: 1; }
.hh-tile { padding: 1.4rem; color: var(--hh-tile-text); }
.hh-tile.is-navy { background: var(--hh-navy); }
.hh-tile.is-oasis { background: var(--hh-oasis); }
.hh-tile.is-saffron { background: var(--hh-saffron); }
.hh-tile .hh-caps { color: rgba(246,241,234,.75); }
.hh-tile.is-navy .hh-caps { color: #D9B57A; }
.hh-list-row { display: grid; grid-template-columns: 44px 1fr 60px; gap: .8rem; padding: .7rem 0; border-bottom: 1px solid var(--hh-rule); align-items: baseline; color: var(--hh-ink); text-decoration: none; }
.hh-list-row .t { font-family: 'Newsreader', Georgia, serif; font-size: 1.05rem; line-height: 1.25; transition: color .2s; }
.hh-list-row:hover .t { color: var(--hh-brass-text); }
.hh-list-row .d { text-align: end; }

/* ---------- header ---------- */
.hh-header { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; padding-block: 1.6rem .8rem; }
.hh-header .wp-block-site-title { font-family: 'Newsreader', Georgia, serif; font-size: .875rem; font-weight: 300; letter-spacing: .20em; text-transform: uppercase; margin: 0; white-space: nowrap; }
.hh-header .wp-block-site-title a { color: var(--hh-ink); text-decoration: none; }
.hh-header .wp-block-site-title a::after { content: ""; }
.hh-header .wp-block-navigation { justify-content: center; }
.hh-header .wp-block-navigation a { color: var(--hh-ink-muted); transition: color .2s; }
.hh-header .wp-block-navigation a:hover, .hh-header .wp-block-navigation .current-menu-item > a { color: var(--hh-ink); }
.hh-header .hh-tools { display: flex; justify-content: flex-end; align-items: center; gap: 1.2rem; }
.hh-amp { font-style: italic; color: var(--hh-brass-text); letter-spacing: 0; }
@media (max-width: 900px) { .hh-header { grid-template-columns: 1fr auto; } .hh-header .hh-tools .hh-coords { display: none; } }

/* ---------- footer with the signature foot ---------- */
.hh-footer { position: relative; margin-top: 6rem; }
.hh-footer .hh-footer-inner { position: relative; z-index: 1; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; padding-block: 2rem; border-top: 1px solid var(--hh-rule); }
body.hh-no-foot .wp-block-hh-foot { display: none; }
body.hh-home .hh-footer { margin-top: 0; }

/* ---------- article (memo / case) ---------- */
.hh-article-columns { display: grid; grid-template-columns: 300px minmax(0, 640px) 246px; gap: 3rem; justify-content: space-between; align-items: start; }
.hh-article-columns > * { min-width: 0; }
.hh-article-body { font-size: .9375rem; line-height: 1.7; color: var(--hh-ink-soft); max-width: 62ch; }
.hh-article-body h2 { font-size: 1.375rem; font-weight: 400; margin: 2rem 0 .8rem; }
.hh-article-body p { margin: 0 0 1.2rem; }
.hh-article-body .wp-block-table th { background: var(--hh-oasis); color: #F6F1EA; font-size: .5625rem; letter-spacing: .18em; text-transform: uppercase; font-weight: 400; padding: .6rem .8rem; }
.hh-article-body .wp-block-table td { padding: .6rem .8rem; border-bottom: 1px solid var(--hh-rule); font-size: .75rem; }
.hh-article-body .wp-block-table figcaption { font-size: .5rem; letter-spacing: .14em; text-transform: uppercase; color: var(--hh-ink-muted); text-align: start; }
.hh-toc { display: flex; flex-direction: column; }
.hh-toc a { display: grid; grid-template-columns: 28px 1fr; gap: .6rem; padding: .5rem 0; border-bottom: 1px solid var(--hh-rule); font-size: .75rem; color: var(--hh-ink-soft); text-decoration: none; }
.hh-toc a span:first-child { color: var(--hh-brass-text); }
.hh-figure { display: flex; flex-direction: column; gap: .2rem; padding: .6rem 0; border-bottom: 1px solid var(--hh-rule); }
.hh-figure .v { font-family: 'Newsreader', Georgia, serif; font-size: 1.75rem; font-weight: 300; }
@media (max-width: 1100px) { .hh-article-columns { grid-template-columns: 1fr; gap: 2rem; } }

/* ---------- generic page ---------- */
.hh-lede { font-size: 1.25rem; line-height: 1.45; font-family: 'Newsreader', Georgia, serif; font-weight: 300; color: var(--hh-ink); }
.wp-block-post-title { font-family: 'Newsreader', Georgia, serif; font-weight: 300; letter-spacing: -.02em; line-height: .98; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---------- footer geometry: room for the foot to melt up ---------- */
.hh-footer { padding-top: 26vh; }
.hh-footer .wp-block-navigation a { color: var(--hh-ink-muted); }
body.hh-no-foot .hh-footer { padding-top: 0; }

/* ---------- site title: the brass ampersand ---------- */
.hh-header .wp-block-site-title .hh-amp { font-style: italic; color: var(--hh-brass-text); letter-spacing: 0; }

/* ---------- article page ---------- */
.hh-article-head .wp-block-post-title { max-width: 22ch; margin: .6rem 0 0; }
.hh-article-side, .hh-article-aside { display: flex; flex-direction: column; gap: 1.6rem; }
.hh-article-aside > * { margin: 0; }
.hh-article-body .hh-deck { font-family: 'Newsreader', Georgia, serif; font-weight: 300; font-size: 1.25rem; line-height: 1.45; color: var(--hh-ink); margin: 0 0 1.6rem; }
.hh-article-body .hh-figures { display: flex; flex-wrap: wrap; gap: 0 2rem; border-top: 1px solid var(--hh-rule); border-bottom: 1px solid var(--hh-rule); margin: 0 0 2rem; }
.hh-article-body .hh-figure { display: flex; flex-direction: column; gap: .2rem; padding: .8rem 0; flex: 1 1 120px; }
.hh-article-body .hh-figure p { margin: 0; }
.hh-article-body .hh-figure .v { font-family: 'Newsreader', Georgia, serif; font-size: 1.9rem; font-weight: 300; line-height: 1; color: var(--hh-ink); }
.hh-article-body > .wp-block-post-content { max-width: none; }
.wp-block-post-content.hh-article-body { max-width: 62ch; }
@media (max-width: 1100px) { .hh-article-side { order: 2; } .hh-article-aside { order: 3; } }

/* ---------- approach ---------- */
.hh-principle { display: grid; grid-template-columns: 56px 1fr; gap: 1.2rem; padding: 1.5rem 0; border-top: 1px solid var(--hh-rule); }
.hh-principle .n { font-family: 'Newsreader', Georgia, serif; font-size: 2.25rem; line-height: 1; font-weight: 300; color: var(--hh-brass-text); margin: 0; }
.hh-principle h3 { margin: 0 0 .6rem; font-size: 1.5rem; font-weight: 300; }
.hh-principle p { margin: 0; font-size: .875rem; color: var(--hh-ink-soft); max-width: 62ch; }
.hh-approach-columns .hh-tile { margin-bottom: 1rem; }
.hh-tile .hh-tile-line { font-family: 'Newsreader', Georgia, serif; font-size: 1.375rem; line-height: 1.2; margin: .5rem 0 0; }
.hh-tile .hh-tile-body { font-size: .8125rem; line-height: 1.65; margin: .5rem 0 0; color: rgba(246,241,234,.85); }
.hh-tile p.hh-caps { margin: 0; }

/* ---------- about ---------- */
.hh-plate-words { gap: 1.6rem; }
.hh-numeral { font-family: 'Newsreader', Georgia, serif; font-size: clamp(6rem, 14vw, 12.5rem); line-height: .78; font-weight: 300; letter-spacing: -.05em; color: var(--hh-brass); margin: 0; }
.hh-plate-words h1 { margin: 0; font-size: clamp(2.4rem, 4vw, 3.5rem); line-height: .95; }
.hh-arabic-display { font-family: 'Reem Kufi', sans-serif; font-weight: 500; font-size: 1.5rem; color: var(--hh-brass-text); margin: .4rem 0; }
.hh-plate-words .hh-lede { margin: .2rem 0 .4rem; font-size: 1.375rem; color: var(--hh-ink-soft); max-width: 36ch; }
.hh-muted { color: var(--hh-ink-muted); font-size: .8125rem; }
.hh-facts { border-top: 1px solid var(--hh-rule); padding-top: .4rem; gap: 1rem 1.2rem; }
.hh-facts p { margin: 0; }
.hh-facts .hh-fact { font-family: 'Newsreader', Georgia, serif; font-size: 1.0625rem; color: var(--hh-ink); margin-top: .3rem; }
.hh-contact p { display: grid; grid-template-columns: 90px 1fr; gap: .8rem; padding: .65rem 0; margin: 0; border-bottom: 1px solid var(--hh-rule); font-size: .8125rem; align-items: baseline; }
.hh-contact .hh-arabic { font-family: 'Almarai', sans-serif; }
.hh-contact a { color: var(--hh-ink); }

/* ---------- lists (archive fallbacks) ---------- */
.hh-list-row-block { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .8rem 0; border-bottom: 1px solid var(--hh-rule); }
.hh-list-row-block h3 { margin: 0; font-size: 1.25rem; font-weight: 300; }
.hh-list-row-block h3 a { color: var(--hh-ink); }
.hh-list-row-block p { margin: 0; }
.wp-block-query-pagination { padding-top: 1.5rem; font-size: .625rem; letter-spacing: .18em; text-transform: uppercase; }

/* ---------- small type inside patterns ---------- */
p.hh-caps { margin: 0 0 .6rem; }
.hh-page > .wp-block-post-content > .hh-caps:first-child { margin-bottom: 1rem; }
