/*
Theme Name: Absher
Theme URI: https://absher.design
Author: Absher
Description: A dark, photo-forward portfolio theme for electronics, 3D printing, and CAD/CAM projects. Built around a "project" custom post type with filterable categories.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: absher
*/

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
button, input, textarea { font-family: inherit; font-size: inherit; }
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 600; margin: 0; color: var(--text-heading); }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

/* ---------- Tokens ---------- */
:root {
  --bg: oklch(0.17 0.012 55);
  --bg-panel: oklch(0.14 0.01 55);
  --bg-card: oklch(0.22 0.014 55);
  --border: oklch(0.34 0.016 55);
  --border-soft: oklch(0.3 0.014 55);

  --text: oklch(0.94 0.01 60);
  --text-heading: oklch(0.96 0.008 60);
  --text-muted: oklch(0.68 0.015 60);
  --text-muted-2: oklch(0.62 0.015 58);
  --text-body: oklch(0.78 0.012 58);

  --accent: oklch(0.78 0.14 90);
  --accent-hover: oklch(0.68 0.14 90);
  --on-accent: oklch(0.16 0.012 55);

  --tag-bg: oklch(0.24 0.02 60);
  --tag-border: oklch(0.38 0.03 60);

  --font-heading: Rockwell, 'Sitka Text', Georgia, serif;
  --font-body: 'Segoe UI', 'Helvetica Neue', sans-serif;

  --gap: 28px;
  --pad: 48px;
  --radius: 12px;
  --radius-lg: 14px;
}
@media (max-width: 640px) {
  :root { --pad: 20px; --gap: 20px; }
}

.container { max-width: 1280px; margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); box-sizing: border-box; }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: 1.6px; color: var(--accent); text-transform: uppercase; margin-bottom: 14px; }
.tag {
  display: inline-flex; align-self: flex-start; font-size: 11.5px; font-weight: 700; letter-spacing: 0.6px;
  text-transform: uppercase; color: var(--accent); background: var(--tag-bg); border: 1px solid var(--tag-border);
  padding: 4px 10px; border-radius: 999px;
}
.btn {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px;
  padding: 14px 26px; border-radius: 8px; border: none; cursor: pointer;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn-ghost { background: transparent; color: var(--text); border: 1.5px solid var(--border); }
.btn-ghost:hover { background: var(--bg-card); color: var(--text); }
.link-arrow { font-weight: 600; font-size: 15px; }

/* ---------- Photo blocks (real image, or gradient placeholder) ---------- */
.ph {
  position: relative; overflow: hidden; border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
}
.ph--v1 { background: linear-gradient(135deg, oklch(0.3 0.02 56), oklch(0.2 0.014 54)); }
.ph--v2 { background: linear-gradient(135deg, oklch(0.32 0.02 60), oklch(0.22 0.015 58)); }
.ph--v3 { background: linear-gradient(135deg, oklch(0.28 0.018 52), oklch(0.19 0.013 50)); }
.ph__img { width: 100%; height: 100%; object-fit: cover; }
.ph__icon { opacity: 0.5; color: var(--accent); }
.ph__icon svg { width: 25%; min-width: 28px; max-width: 64px; height: auto; }
.ph__caption {
  position: absolute; bottom: 10px; left: 14px; font-size: 10.5px; letter-spacing: 1px;
  text-transform: uppercase; color: var(--text-muted-2); opacity: 0.9;
}
.ph--hero { height: 460px; }
.ph--square { height: 380px; }
.ph--card { height: 190px; border-radius: var(--radius); }
.ph--gallery { height: 160px; border-radius: 10px; }
@media (max-width: 900px) {
  .ph--hero { height: 300px; }
  .ph--square { height: 300px; }
}

/* ---------- Header / Nav ---------- */
.site-header {
  background: var(--bg); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--pad); height: 84px; position: relative;
}
.site-branding { display: flex; align-items: center; gap: 10px; }
.site-branding img { max-height: 36px; width: auto; }
.site-branding .wordmark {
  font-family: var(--font-heading); font-size: 21px; font-weight: 600; letter-spacing: 0.3px; color: var(--text-heading);
}
.site-branding svg { color: var(--accent); }
.primary-nav ul { display: flex; align-items: center; gap: 36px; font-size: 15px; font-weight: 500; }
.primary-nav a { color: var(--text); position: relative; padding-bottom: 4px; }
.primary-nav a:hover, .primary-nav .current-menu-item > a, .primary-nav .current_page_item > a { color: var(--accent); }
.primary-nav .current-menu-item > a::after, .primary-nav .current_page_item > a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--accent); border-radius: 2px;
}
.nav-toggle { display: none; background: none; border: none; color: var(--text); cursor: pointer; padding: 8px; }
.nav-toggle svg { width: 24px; height: 24px; }
@media (max-width: 800px) {
  .nav-toggle { display: block; }
  .primary-nav {
    position: absolute; top: 84px; left: 0; right: 0; background: var(--bg-panel);
    border-bottom: 1px solid var(--border); display: none; z-index: 20;
  }
  .primary-nav.is-open { display: block; }
  .primary-nav ul { flex-direction: column; align-items: flex-start; gap: 0; padding: 8px var(--pad) 20px; }
  .primary-nav li { width: 100%; }
  .primary-nav a { display: block; padding: 14px 0; }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-panel); padding: 40px var(--pad); }
.footer-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-brand { display: flex; flex-direction: column; gap: 8px; }
.footer-brand .wordmark { font-family: var(--font-heading); font-size: 19px; font-weight: 600; color: var(--text-heading); }
.footer-brand .tagline { font-size: 13px; color: var(--text-muted); }
.footer-nav { display: flex; gap: 28px; font-size: 14px; padding-top: 4px; flex-wrap: wrap; }
.footer-nav a { color: var(--text); }
.footer-social { display: flex; gap: 16px; padding-top: 2px; }
.footer-social a { color: var(--text); }
.footer-social a:hover { color: var(--accent); }
.footer-bottom {
  margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border-soft);
  font-size: 12.5px; color: oklch(0.56 0.015 58);
}

/* ---------- Hero ---------- */
.hero { padding: 64px var(--pad) 0; }
.hero__intro { max-width: 720px; }
.hero h1 { font-size: 52px; line-height: 1.15; margin: 0 0 20px; }
.hero p { font-size: 17px; line-height: 1.6; color: var(--text-muted); margin: 0 0 32px; max-width: 560px; }
.hero__actions { display: flex; gap: 16px; flex-wrap: wrap; }
.hero__photo { margin: 44px 0 0; }
@media (max-width: 640px) {
  .hero h1 { font-size: 36px; }
}

/* ---------- Intro / About teaser ---------- */
.intro { padding: 88px var(--pad); display: flex; gap: 56px; align-items: center; }
.intro__photo { flex: 0 0 380px; }
.intro__body { flex: 1; }
.intro__body h2 { font-size: 32px; margin: 0 0 16px; }
.intro__body p { font-size: 16px; line-height: 1.7; color: var(--text-muted); margin: 0 0 12px; max-width: 540px; }
@media (max-width: 860px) {
  .intro { flex-direction: column; align-items: stretch; padding: 56px var(--pad); }
  .intro__photo { flex: none; width: 100%; }
}

/* ---------- Featured / grid ---------- */
.section { padding: 0 var(--pad) 96px; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 32px; flex-wrap: wrap; gap: 12px; }
.section__head h2 { font-size: 30px; }
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
@media (max-width: 980px) { .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .project-grid { grid-template-columns: 1fr; } }

.project-card { display: flex; flex-direction: column; gap: 14px; }
.project-card .card-title { font-family: var(--font-heading); font-size: 19px; font-weight: 600; }
.project-card:hover .card-title { color: var(--accent); }
.project-card .card-blurb { font-size: 14.5px; line-height: 1.55; color: var(--text-muted); }

/* ---------- Page header ---------- */
.page-header { padding: 64px var(--pad) 0; }
.page-header h1 { font-size: 40px; margin: 0 0 14px; }
.page-header p { font-size: 16px; line-height: 1.6; color: var(--text-muted); margin: 0 0 36px; max-width: 620px; }

/* ---------- Filter pills ---------- */
.filters { display: flex; gap: 12px; margin: 0 var(--pad) 40px; flex-wrap: wrap; }
.filter-pill {
  padding: 10px 20px; border-radius: 999px; font-size: 14px; font-weight: 600; cursor: pointer;
  background: transparent; color: var(--text); border: 1.5px solid var(--border);
}
.filter-pill.is-active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.project-grid[data-filtering] .project-card[hidden] { display: none; }

/* ---------- Single project ---------- */
.breadcrumb { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; }
.project-meta { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.project-meta .date { font-size: 13.5px; color: var(--text-muted-2); }
.project-title { font-size: 44px; margin: 0 0 14px; max-width: 780px; }
.project-subtitle { font-size: 17px; font-style: italic; color: var(--text-muted); margin: 0 0 32px; max-width: 680px; }
.project-body { padding: 56px var(--pad) 0; display: flex; gap: 56px; }
.project-content { flex: 2; max-width: 700px; }
.project-content h2 { font-size: 24px; margin: 0 0 16px; }
.project-content p { font-size: 16px; line-height: 1.75; color: var(--text-body); margin: 0 0 18px; }
.project-sidebar { flex: 1; min-width: 260px; }
.tools-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; }
.tools-card h3 { font-size: 17px; margin: 0 0 18px; }
.tools-list { display: flex; flex-direction: column; gap: 12px; font-size: 14.5px; }
.tools-list .row { display: flex; justify-content: space-between; gap: 12px; }
.tools-list .label { color: var(--text-muted-2); }
.tools-list .value { font-weight: 600; color: var(--text); text-align: right; }
@media (max-width: 860px) {
  .project-body { flex-direction: column; }
  .project-content { max-width: none; }
}
.gallery-section { padding: 64px var(--pad) 0; }
.gallery-section h2 { font-size: 24px; margin: 0 0 20px; }
.gallery-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 980px) { .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.project-pagination {
  padding: 56px var(--pad) 96px; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  border-top: 1px solid var(--border-soft); margin: 0 var(--pad); padding-left: 0; padding-right: 0;
}
.project-pagination > div { padding-top: 32px; }

/* ---------- About & Contact page ---------- */
.about-section { padding: 0 var(--pad); display: flex; gap: 56px; align-items: flex-start; }
.about-section .ph { flex: 0 0 380px; height: 420px; }
.about-body { flex: 1; }
.about-body h2 { font-size: 28px; margin: 0 0 16px; }
.about-body p { font-size: 16px; line-height: 1.75; color: var(--text-body); margin: 0 0 16px; max-width: 560px; }
.skills-row { display: flex; gap: 32px; flex-wrap: wrap; margin-top: 12px; }
.skills-row .skill { display: flex; align-items: center; gap: 10px; font-size: 14.5px; font-weight: 600; }
.skills-row svg { color: var(--accent); width: 22px; height: 22px; }
@media (max-width: 860px) {
  .about-section { flex-direction: column; }
  .about-section .ph { flex: none; width: 100%; height: 300px; }
}

.contact-section { padding: 96px var(--pad) 96px; }
.contact-divider { height: 1px; background: var(--border-soft); margin-bottom: 64px; }
.contact-section > h2 { font-size: 28px; margin: 0 0 12px; }
.contact-section > p.lead { font-size: 16px; color: var(--text-muted); margin: 0 0 40px; max-width: 560px; }
.contact-columns { display: flex; gap: 56px; flex-wrap: wrap; }
.contact-form { flex: 1.4; min-width: 280px; display: flex; flex-direction: column; gap: 18px; }
.contact-form .row { display: flex; gap: 18px; flex-wrap: wrap; }
.contact-form input, .contact-form textarea {
  flex: 1; min-width: 200px; box-sizing: border-box; padding: 14px 16px; border-radius: 8px;
  border: 1.5px solid var(--border); background: var(--bg-card); color: var(--text); resize: none;
}
.contact-form input::placeholder, .contact-form textarea::placeholder { color: oklch(0.55 0.014 58); }
.contact-form button { align-self: flex-start; }
.contact-info {
  flex: 1; min-width: 240px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px; display: flex; flex-direction: column; gap: 20px; height: fit-content;
}
.contact-info .item { display: flex; align-items: center; gap: 12px; font-size: 14.5px; }
.contact-info svg { color: var(--accent); width: 20px; height: 20px; flex-shrink: 0; }
.form-notice { padding: 14px 18px; border-radius: 8px; margin-bottom: 18px; font-size: 14.5px; }
.form-notice.success { background: oklch(0.24 0.02 60); border: 1px solid var(--tag-border); color: var(--accent); }
.form-notice.error { background: oklch(0.24 0.02 30); border: 1px solid oklch(0.4 0.1 30); color: oklch(0.8 0.1 30); }

/* ---------- Generic page/blog fallback ---------- */
.page-content { padding: 64px var(--pad) 96px; max-width: 780px; }
.page-content p { font-size: 16px; line-height: 1.75; color: var(--text-body); margin: 0 0 18px; }
