/*
Theme Name: Abdul Hafeez & Co.
Theme URI: https://ahafeez.com
Author: Abdul Hafeez & Co. Chartered Accountants
Description: Lightweight custom theme for Abdul Hafeez & Co. Chartered Accountants, Karachi. No page builder, no external requests.
Version: 1.0.0
Requires at least: 6.5
Tested up to: 7.0
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ahc
*/

/* ---------- Tokens ---------- */
:root {
  --navy-900: #0b1f35;
  --navy-800: #102b47;
  --navy-700: #163a5e;
  --navy-100: #e8eef4;
  --navy-50:  #f4f7fa;
  --gold:     #b8892b;
  --gold-dark:#966f20;
  --ink:      #1b2733;
  --muted:    #5a6b7c;
  --line:     #dde5ed;
  --white:    #fff;
  --maxw:     1120px;
  --gap:      clamp(1.25rem, 3vw, 2.5rem);
  --radius:   4px;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy-700); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--gold-dark); }
h1, h2, h3, h4 { font-family: var(--serif); color: var(--navy-900); line-height: 1.25; margin: 0 0 .6em; font-weight: 600; }
h1 { font-size: clamp(2rem, 4.5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1.2em; }
ul, ol { margin: 0 0 1.2em; padding-left: 1.3em; }
li { margin-bottom: .45em; }
blockquote { margin: 1.5em 0; padding: .2em 0 .2em 1.4em; border-left: 3px solid var(--gold); color: var(--muted); font-style: italic; }
table { width: 100%; border-collapse: collapse; margin-bottom: 1.5em; }
th, td { padding: .7em .9em; border: 1px solid var(--line); text-align: left; }
th { background: var(--navy-50); font-weight: 600; }
code { background: var(--navy-50); padding: .15em .4em; border-radius: 3px; font-size: .9em; }

.wrap { width: min(100% - 2.5rem, var(--maxw)); margin-inline: auto; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 1rem; top: 1rem; z-index: 999; background: var(--white); padding: .6em 1em; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; padding: .8em 1.7em; border-radius: var(--radius);
  background: var(--gold); color: #fff; font-weight: 600; text-decoration: none;
  border: 1px solid var(--gold); font-size: .95rem; cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.btn:hover { background: var(--gold-dark); border-color: var(--gold-dark); color: #fff; }
.btn-outline { background: transparent; color: var(--navy-900); border-color: var(--navy-900); }
.btn-outline:hover { background: var(--navy-900); color: #fff; }
.btn-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.55); }
.btn-light:hover { background: #fff; color: var(--navy-900); border-color: #fff; }

/* ---------- Header ---------- */
.site-header { border-bottom: 1px solid var(--line); background: #fff; position: sticky; top: 0; z-index: 50; }
.topbar { background: var(--navy-900); color: rgba(255,255,255,.82); font-size: .82rem; }
.topbar .wrap { display: flex; flex-wrap: wrap; gap: 1.2rem; justify-content: flex-end; padding: .45rem 0; }
.topbar a { color: rgba(255,255,255,.82); text-decoration: none; }
.topbar a:hover { color: #fff; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 1rem 0; }
.brand { text-decoration: none; display: block; }
.brand.has-mark { display: flex; align-items: center; gap: .8rem; }
.brand-mark { width: 58px; height: 58px; flex: none; }
.brand-text { display: block; }
.brand strong { display: block; font-family: var(--serif); font-size: 1.3rem; color: var(--navy-900); line-height: 1.2; font-weight: 600; }
.brand .brand-text > span { display: block; font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-dark); margin-top: .25rem; }
@media (max-width: 480px) {
  .brand-mark { width: 38px; height: 38px; }
  .brand strong { font-size: 1.1rem; }
}

/* Footer emblem — the artwork is dark blue, so it is knocked out to white
   against the navy footer rather than being left near-invisible. */
.footer-mark {
  width: 52px; height: 52px; margin-bottom: 1rem;
  filter: brightness(0) invert(1);
  opacity: .85;
}
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: var(--radius); padding: .5em .7em; font-size: 1rem; }
.main-nav ul { display: flex; gap: 1.6rem; list-style: none; margin: 0; padding: 0; align-items: center; }
.main-nav li { margin: 0; }
.main-nav a { text-decoration: none; color: var(--navy-800); font-size: .93rem; font-weight: 500; padding: .3em 0; border-bottom: 2px solid transparent; }
.main-nav a:hover, .main-nav .current-menu-item > a { color: var(--gold-dark); border-bottom-color: var(--gold); }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .main-nav { display: none; width: 100%; }
  .main-nav.open { display: block; }
  .header-inner { flex-wrap: wrap; }
  .main-nav ul { flex-direction: column; align-items: flex-start; gap: 0; padding: .5rem 0 1rem; }
  .main-nav li { width: 100%; border-top: 1px solid var(--line); }
  .main-nav a { display: block; padding: .8em 0; }
}

/* ---------- Hero ---------- */
.hero { background: linear-gradient(160deg, var(--navy-900) 0%, var(--navy-700) 100%); color: #fff; padding: clamp(3.5rem, 9vw, 6.5rem) 0; }
.hero h1 { color: #fff; max-width: 20ch; }
.hero .lede { font-size: clamp(1.02rem, 2vw, 1.2rem); color: rgba(255,255,255,.85); max-width: 58ch; margin-bottom: 1.8em; }
.hero-eyebrow { font-size: .74rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin-bottom: 1.2em; font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; }

/* ---------- Sections ---------- */
.section { padding: clamp(3rem, 7vw, 5rem) 0; }
.section-alt { background: var(--navy-50); }
.section-head { max-width: 62ch; margin-bottom: 2.5rem; }
.section-head .eyebrow { font-size: .74rem; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-dark); font-weight: 600; margin-bottom: .8em; }
.section-head p { color: var(--muted); margin-bottom: 0; }

.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.8rem; }
.card h3 { margin-bottom: .5em; }
.card h3 a { text-decoration: none; color: inherit; }
.card h3 a:hover { color: var(--gold-dark); }
.card p { color: var(--muted); font-size: .95rem; margin-bottom: 1em; }
.card p:last-child { margin-bottom: 0; }
.card-num { font-family: var(--serif); font-size: .8rem; color: var(--gold); letter-spacing: .1em; display: block; margin-bottom: .8em; }
.card ul { font-size: .92rem; color: var(--muted); padding-left: 1.1em; margin-bottom: 0; }

.stat { text-align: left; }
.stat b { display: block; font-family: var(--serif); font-size: clamp(2rem, 4vw, 2.6rem); color: var(--navy-900); line-height: 1; }
.stat span { display: block; font-size: .88rem; color: var(--muted); margin-top: .5em; }

.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: clamp(2rem, 5vw, 4rem); align-items: start; }

.cta-band { background: var(--navy-900); color: #fff; padding: clamp(2.5rem, 6vw, 4rem) 0; }
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,.8); max-width: 55ch; }

/* ---------- Page / entry ---------- */
.page-hero { background: var(--navy-50); border-bottom: 1px solid var(--line); padding: clamp(2.5rem, 6vw, 4rem) 0; }
.page-hero p { color: var(--muted); max-width: 60ch; margin-bottom: 0; }
.breadcrumb { font-size: .82rem; color: var(--muted); margin-bottom: 1em; }
.breadcrumb a { color: var(--muted); }

.entry { padding: clamp(2.5rem, 6vw, 4rem) 0; }
.entry-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(2rem, 5vw, 3.5rem); }
@media (min-width: 960px) { .entry-layout.has-sidebar { grid-template-columns: minmax(0, 1fr) 300px; } }
.entry-content { max-width: 72ch; }
.entry-content h2 { margin-top: 1.8em; }
.entry-content h3 { margin-top: 1.6em; }
.entry-content > *:first-child { margin-top: 0; }

.sidebar { font-size: .93rem; }
.widget { background: var(--navy-50); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; margin-bottom: 1.5rem; }
.widget h3 { font-size: 1rem; margin-bottom: .7em; }
.widget ul { list-style: none; padding: 0; margin: 0; }
.widget li { border-bottom: 1px solid var(--line); padding-bottom: .5em; margin-bottom: .5em; }
.widget li:last-child { border: 0; margin: 0; padding: 0; }
.widget a { text-decoration: none; }

.post-meta { font-size: .84rem; color: var(--muted); margin-bottom: 1.5em; }
.post-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.5rem; }
.post-list article { border-bottom: 1px solid var(--line); padding-bottom: 1.5rem; }
.post-list h2 { font-size: 1.3rem; margin-bottom: .3em; }
.post-list h2 a { text-decoration: none; color: inherit; }
.post-list h2 a:hover { color: var(--gold-dark); }

.pagination { display: flex; gap: .5rem; margin-top: 2.5rem; flex-wrap: wrap; }
.pagination .page-numbers { padding: .5em .9em; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; font-size: .9rem; }
.pagination .current { background: var(--navy-900); color: #fff; border-color: var(--navy-900); }

/* ---------- Contact / forms ---------- */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--gap); }
.contact-item { margin-bottom: 1.5rem; }
.contact-item b { display: block; font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-dark); margin-bottom: .35em; }
.contact-item a { text-decoration: none; }
input[type=text], input[type=email], input[type=tel], input[type=url], textarea, select {
  width: 100%; padding: .7em .85em; border: 1px solid var(--line); border-radius: var(--radius);
  font: inherit; font-size: .95rem; background: #fff; color: var(--ink);
}
input:focus, textarea:focus, select:focus { border-color: var(--navy-700); outline: none; }
label { display: block; font-size: .88rem; font-weight: 600; margin-bottom: .35em; }
.form-row { margin-bottom: 1.1rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-900); color: rgba(255,255,255,.72); padding: clamp(2.5rem, 6vw, 4rem) 0 0; font-size: .92rem; margin-top: auto; }
.site-footer h4 { color: #fff; font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; font-family: var(--sans); margin-bottom: 1.1em; }
.site-footer a { color: rgba(255,255,255,.72); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .55em; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: var(--gap); padding-bottom: 2.5rem; }
.footer-brand strong { font-family: var(--serif); color: #fff; font-size: 1.15rem; display: block; margin-bottom: .5em; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.13); padding: 1.2rem 0; font-size: .84rem; display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; }

html, body { min-height: 100%; }
body { display: flex; flex-direction: column; min-height: 100vh; }
#content { flex: 1; }

.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap; }
.alignwide { width: 100%; }
.aligncenter { margin-inline: auto; }
.wp-caption-text, figcaption { font-size: .84rem; color: var(--muted); margin-top: .5em; }

@media print {
  .site-header, .site-footer, .cta-band, .nav-toggle { display: none; }
}
