/*
Theme Name: Neuro Elshahabi
Theme URI: https://neuro.elshahabi.com
Author: OpenAI Codex
Author URI: https://openai.com
Description: A custom editorial WordPress theme for Neuro Elshahabi, adapted from the visual language of the elshahabi.com project.
Version: 0.2.2
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 8.0
Text Domain: neuro-elshahabi
*/

:root {
  --background: #f8fbfd;
  --background-deep: #eef4fb;
  --surface: rgba(255, 255, 255, 0.76);
  --surface-strong: rgba(255, 255, 255, 0.9);
  --foreground: #24254e;
  --muted: #61718b;
  --line: rgba(39, 91, 140, 0.14);
  --line-strong: rgba(39, 91, 140, 0.28);
  --brand-funblue: #275b8c;
  --brand-blaze: #dc4504;
  --brand-malachite: #1f8f25;
  --shadow-soft: 0 20px 44px rgba(36, 37, 78, 0.08);
  --shadow-card: 0 16px 36px rgba(36, 37, 78, 0.04);
  --radius-large: 1.3rem;
  --radius-medium: 0.95rem;
  --radius-small: 0.7rem;
  --frame-width: 80rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(39, 91, 140, 0.07), transparent 0 24rem),
    linear-gradient(180deg, var(--background) 0%, var(--background-deep) 100%);
  color: var(--foreground);
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  line-height: 1.7;
}

body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(39, 91, 140, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(39, 91, 140, 0.03) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: center top;
  opacity: 0.42;
  z-index: -1;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--brand-blaze);
}

button,
input,
textarea,
select {
  font: inherit;
}

::selection {
  background: rgba(39, 91, 140, 0.16);
  color: var(--foreground);
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.site-shell {
  min-height: 100vh;
}

.site-frame {
  width: min(100%, var(--frame-width));
  min-height: 100vh;
  margin: 0 auto;
  padding: 1.2rem 1rem 2rem;
  display: flex;
  flex-direction: column;
}

.site-header,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: relative;
  padding: 1.1rem 0;
}

.site-header::after,
.site-footer::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(39, 91, 140, 0.18) 12%,
    rgba(39, 91, 140, 0.18) 88%,
    transparent 100%
  );
}

.site-header::after {
  bottom: 0;
}

.site-footer::before {
  top: 0;
}

.site-brand {
  display: grid;
  gap: 0.08rem;
}

.site-title {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: clamp(1.4rem, 2.2vw, 1.85rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.site-title a:hover {
  color: inherit;
}

.site-tagline {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.3rem;
  align-items: center;
  justify-content: flex-end;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.3rem;
  align-items: center;
  justify-content: flex-end;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav li {
  margin: 0;
}

.site-nav a {
  position: relative;
  font-size: 0.92rem;
  color: var(--muted);
  transition: color 0.18s ease;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.18rem;
  height: 1px;
  background: rgba(39, 91, 140, 0.22);
  transform: scaleX(0.32);
  transform-origin: left center;
  transition:
    transform 0.18s ease,
    background-color 0.18s ease;
}

.site-nav a:hover,
.site-nav .current-menu-item > a,
.site-nav .current_page_item > a {
  color: var(--brand-funblue);
}

.site-nav a:hover::after,
.site-nav .current-menu-item > a::after,
.site-nav .current_page_item > a::after {
  transform: scaleX(1);
  background: rgba(39, 91, 140, 0.42);
}

.site-main {
  flex: 1;
  padding: 2.2rem 0 2.8rem;
}

.hero-panel,
.content-panel,
.post-card,
.article-shell,
.empty-state {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-large);
  border: 1px solid rgba(39, 91, 140, 0.11);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78) 0%, rgba(247, 250, 253, 0.58) 100%),
    radial-gradient(circle at top left, rgba(39, 91, 140, 0.055), transparent 20rem);
  box-shadow:
    var(--shadow-card),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.hero-panel::before,
.content-panel::before,
.article-shell::before,
.empty-state::before {
  content: "";
  position: absolute;
  left: 1.4rem;
  right: 1.4rem;
  top: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(39, 91, 140, 0.16) 16%,
    rgba(39, 91, 140, 0.16) 84%,
    transparent 100%
  );
}

.hero-panel {
  display: grid;
  gap: 1.4rem;
  padding: clamp(1.7rem, 4vw, 3rem);
  margin-bottom: 2rem;
}

.hero-kicker,
.section-kicker,
.post-index {
  margin: 0;
  color: var(--brand-blaze);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.hero-title,
.page-title,
.archive-title,
.entry-title,
.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  color: var(--foreground);
}

.hero-title {
  font-size: clamp(2.15rem, 5vw, 3.95rem);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.hero-subtitle {
  margin: 0;
  max-width: 48rem;
  font-size: 1.08rem;
  line-height: 1.9;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.95rem;
  padding: 0.78rem 1.08rem;
  border-radius: var(--radius-medium);
  border: 1px solid rgba(39, 91, 140, 0.18);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease;
}

.button-link:hover {
  transform: translateY(-1px);
}

.button-link-primary {
  background: var(--foreground);
  border-color: var(--foreground);
  color: #f8fbfd;
  box-shadow: 0 10px 24px rgba(36, 37, 78, 0.11);
}

.button-link-primary:hover {
  color: #f8fbfd;
  background: #1f2144;
  border-color: #1f2144;
}

.button-link-secondary {
  background: rgba(255, 255, 255, 0.62);
  color: var(--foreground);
}

.button-link-secondary:hover {
  color: var(--foreground);
  border-color: rgba(39, 91, 140, 0.28);
  background: rgba(255, 255, 255, 0.84);
}

.hero-metrics {
  display: grid;
  gap: 0.95rem;
}

.hero-metric {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.85rem;
  align-items: start;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(39, 91, 140, 0.11);
}

.hero-metric-title {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 1.1rem;
}

.hero-metric-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.7;
}

.content-grid {
  display: grid;
  gap: 1.6rem;
}

.content-panel {
  padding: 1.55rem;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.section-title {
  font-size: clamp(1.42rem, 2.6vw, 1.92rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.section-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
}

.post-list {
  display: grid;
  gap: 1rem;
}

.project-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1.4rem;
}

.project-card {
  position: relative;
  overflow: hidden;
  padding: 1.45rem 1.4rem 1.35rem;
  border: 1px solid rgba(39, 91, 140, 0.12);
  border-radius: var(--radius-large);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82) 0%, rgba(247, 250, 253, 0.68) 100%),
    radial-gradient(circle at top left, rgba(39, 91, 140, 0.05), transparent 18rem);
  box-shadow:
    0 16px 34px rgba(36, 37, 78, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.56);
}

.project-card::before,
.contact-form-panel::before {
  content: "";
  position: absolute;
  left: 1.25rem;
  right: 1.25rem;
  top: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(39, 91, 140, 0.16) 18%,
    rgba(39, 91, 140, 0.16) 82%,
    transparent 100%
  );
}

.project-card .entry-title {
  margin-top: 0.8rem;
}

.project-link-row {
  margin: 1rem 0 0;
}

.contact-form-panel {
  position: relative;
  overflow: hidden;
  margin-top: 1.35rem;
  padding: 1.5rem;
  border: 1px solid rgba(39, 91, 140, 0.12);
  border-radius: var(--radius-large);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.84) 0%, rgba(247, 250, 253, 0.72) 100%),
    radial-gradient(circle at top left, rgba(39, 91, 140, 0.05), transparent 18rem);
  box-shadow:
    0 16px 34px rgba(36, 37, 78, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.56);
}

.contact-form-status {
  margin: 1rem 0 1.2rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-medium);
  border: 1px solid rgba(39, 91, 140, 0.14);
  font-size: 0.94rem;
  line-height: 1.7;
}

.contact-form-status-success {
  color: var(--brand-malachite);
  background: rgba(31, 143, 37, 0.08);
  border-color: rgba(31, 143, 37, 0.16);
}

.contact-form-status-error {
  color: var(--brand-blaze);
  background: rgba(220, 69, 4, 0.08);
  border-color: rgba(220, 69, 4, 0.14);
}

.contact-form {
  display: grid;
  gap: 1rem;
}

.contact-form-grid {
  display: grid;
  gap: 1rem;
}

.contact-form-field {
  display: grid;
  gap: 0.38rem;
}

.contact-form-field span {
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-funblue);
}

.contact-form-field input,
.contact-form-field textarea {
  width: 100%;
  min-height: 3rem;
  padding: 0.78rem 0.92rem;
  border: 1px solid rgba(39, 91, 140, 0.16);
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.76);
  color: var(--foreground);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease;
}

.contact-form-field textarea {
  min-height: 11rem;
  resize: vertical;
}

.contact-form-field input:focus,
.contact-form-field textarea:focus,
.search-field:focus {
  outline: none;
  border-color: rgba(39, 91, 140, 0.34);
  box-shadow: 0 0 0 4px rgba(39, 91, 140, 0.08);
  background: rgba(255, 255, 255, 0.9);
}

.contact-form-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-form-turnstile {
  display: flex;
  justify-content: flex-start;
  min-height: 4.25rem;
}

.post-card {
  padding: 1.25rem 1.3rem;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.post-card:hover {
  transform: translateY(-2px);
  border-color: rgba(39, 91, 140, 0.2);
  box-shadow:
    0 20px 38px rgba(36, 37, 78, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.56);
}

.post-card-link {
  display: block;
}

.post-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.entry-title {
  font-size: clamp(1.22rem, 2.4vw, 1.68rem);
  line-height: 1.12;
  letter-spacing: -0.04em;
}

.entry-summary,
.entry-meta,
.entry-taxonomy,
.entry-content,
.entry-content p,
.entry-content li,
.article-intro {
  color: var(--muted);
}

.entry-summary {
  margin: 0.75rem 0 0;
  font-size: 0.98rem;
  line-height: 1.85;
}

.entry-meta,
.entry-taxonomy {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
  font-size: 0.8rem;
}

.entry-meta {
  margin-top: 0.7rem;
}

.entry-taxonomy {
  margin-top: 0.9rem;
}

.taxonomy-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.65rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.archive-links .taxonomy-list {
  display: grid;
  gap: 0.55rem;
}

.taxonomy-link {
  display: inline-flex;
  align-items: center;
  padding: 0.36rem 0.62rem;
  border-radius: 999px;
  background: rgba(39, 91, 140, 0.08);
  color: var(--brand-funblue);
  font-size: 0.74rem;
}

.article-shell {
  padding: clamp(1.7rem, 4vw, 3rem);
}

.article-header {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.article-header .entry-title,
.page-header .page-title,
.archive-header .archive-title {
  font-size: clamp(1.88rem, 4.3vw, 3.1rem);
  line-height: 1.02;
}

.page-header,
.archive-header {
  display: grid;
  gap: 0.9rem;
  margin-bottom: 1.4rem;
}

.page-intro {
  margin: 0;
  max-width: 42rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.85;
}

.article-thumbnail {
  margin: 0 0 1.5rem;
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid rgba(39, 91, 140, 0.12);
}

.article-thumbnail img {
  display: block;
  width: 100%;
}

.entry-content {
  font-size: 1rem;
  line-height: 1.92;
}

.entry-content > *:first-child {
  margin-top: 0;
}

.entry-content > *:last-child {
  margin-bottom: 0;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
  margin-top: 2.2rem;
  margin-bottom: 0.7rem;
  color: var(--foreground);
}

.entry-content h2 {
  font-size: 1.6rem;
  letter-spacing: -0.04em;
}

.entry-content h3 {
  font-size: 1.24rem;
}

.entry-content h4 {
  font-size: 1.05rem;
}

.entry-content a {
  color: var(--brand-funblue);
  text-decoration: underline;
  text-decoration-color: rgba(39, 91, 140, 0.25);
  text-underline-offset: 0.18rem;
}

.entry-content blockquote {
  margin: 1.8rem 0;
  padding: 0.2rem 0 0.2rem 1rem;
  border-left: 2px solid rgba(39, 91, 140, 0.22);
  color: var(--foreground);
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 1.2rem;
  line-height: 1.6;
}

.entry-content pre,
.entry-content code {
  font-family: "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
}

.entry-content pre {
  overflow-x: auto;
  padding: 1rem;
  border-radius: var(--radius-small);
  background: rgba(36, 37, 78, 0.04);
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.6rem;
  min-height: 2.6rem;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(39, 91, 140, 0.16);
  background: rgba(255, 255, 255, 0.62);
  color: var(--foreground);
  font-size: 0.9rem;
}

.pagination .current {
  background: var(--foreground);
  border-color: var(--foreground);
  color: #f8fbfd;
}

.empty-state {
  padding: 1.5rem;
}

.search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.search-form label {
  flex: 1 1 14rem;
}

.search-field {
  width: 100%;
  min-height: 2.95rem;
  padding: 0.75rem 0.9rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(39, 91, 140, 0.16);
  background: rgba(255, 255, 255, 0.72);
}

.search-submit {
  border: 0;
  cursor: pointer;
}

.site-footer-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.alignwide,
.alignfull {
  width: 100%;
}

.search-results-list {
  margin-top: 1.4rem;
}

@media (min-width: 860px) {
  .hero-panel {
    grid-template-columns: minmax(0, 1.2fr) minmax(18rem, 0.8fr);
    align-items: start;
    gap: 2.4rem;
  }

  .content-grid {
    grid-template-columns: minmax(0, 1.55fr) minmax(16rem, 0.8fr);
    align-items: start;
  }

  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .site-frame {
    padding: 1rem 1rem 1.6rem;
  }

  .site-header,
  .site-footer,
  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-nav {
    justify-content: flex-start;
  }
}
