/*
Theme Name: HUMEFAi
Author: Khazar Media
Description: Institute theme for Mövlana Ədəbi-Fəlsəfi Araşdırmalar İnstitutu (MƏFAİ).
Version: 1.0.0
Requires at least: 6.0
Text Domain: humefai
*/

:root {
  --ink: #171a21;
  --navy: #222836;
  --navy-2: #2c3344;
  --green: #2c6b3c;
  --brass: #a4844a;
  --paper: #f4f1ea;
  --card: #fffdf8;
  --muted: #5b615c;
  --line: #ddd6c8;
  --max: 1140px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, system-ui, sans-serif;
  line-height: 1.65;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
.wrap { width: min(var(--max), calc(100% - 40px)); margin-inline: auto; }
.skip {
  position: absolute; left: -999px; top: 8px; z-index: 80;
  background: var(--navy); color: #fff; padding: 8px 12px;
}
.skip:focus { left: 12px; }
.screen-reader-text {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
}

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: #fbf9f3;
  border-bottom: 1px solid var(--line);
}
.mast {
  display: flex; align-items: center; gap: 16px;
  min-height: 84px; padding: 10px 0;
}
.brand {
  display: flex; align-items: center; gap: 14px;
  text-decoration: none; min-width: 0;
}
.brand-mark {
  height: 52px; width: auto; max-width: 160px;
  object-fit: contain;
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong {
  font-family: "EB Garamond", Georgia, serif;
  font-size: 1.55rem; font-weight: 700; letter-spacing: .04em; line-height: 1;
  color: var(--green);
}
.brand-text em {
  font-style: normal; color: var(--muted);
  font-size: .72rem; margin-top: 4px; line-height: 1.3;
}
.mast-end { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.search-mini { display: flex; }
.search-mini input {
  width: 170px; border: 1px solid var(--line); background: #fff;
  padding: 8px 10px; font: inherit; color: var(--ink);
}
.search-mini button {
  border: 0; background: var(--navy); color: #f4f1ea;
  padding: 8px 12px; cursor: pointer; font: inherit; font-weight: 600;
}
.nav-toggle {
  display: none; border: 1px solid var(--line); background: #fff;
  color: var(--ink); font: inherit; letter-spacing: .08em;
  text-transform: uppercase; font-size: .75rem; cursor: pointer;
  padding: 8px 12px;
}
.nav-main { background: var(--navy); }
.nav-main ul {
  display: flex; flex-wrap: nowrap; gap: 0;
  list-style: none; margin: 0; padding: 0;
}
.nav-main li { position: relative; }
.nav-main a {
  display: block; text-decoration: none; color: #e8e6df;
  padding: 12px 15px; font-size: .78rem;
  letter-spacing: .07em; text-transform: uppercase; white-space: nowrap;
}
.nav-main a:hover, .nav-main .current-menu-item > a,
.nav-main .current-menu-ancestor > a { color: #fff; }
.nav-main .sub-menu {
  display: none; position: absolute; left: 0; top: 100%;
  min-width: 260px; background: var(--navy-2);
  z-index: 30; flex-direction: column;
}
.nav-main .sub-menu a { white-space: normal; padding: 10px 16px; }
.nav-main li:hover > .sub-menu,
.nav-main li:focus-within > .sub-menu { display: flex; }

.hero {
  position: relative;
  color: #f6f3ea;
  min-height: 420px;
  display: grid; align-items: end;
  padding: 72px 0 48px;
  background:
    linear-gradient(90deg, rgba(18, 22, 32, .88) 0%, rgba(18, 22, 32, .55) 52%, rgba(18, 22, 32, .28) 100%),
    linear-gradient(180deg, rgba(18, 22, 32, .15) 0%, rgba(18, 22, 32, .72) 100%),
    var(--hero) center 40%/cover no-repeat;
}
.hero-inner { max-width: 720px; }
.kicker {
  margin: 0 0 10px; color: #d4c09a;
  letter-spacing: .18em; text-transform: uppercase; font-size: .72rem; font-weight: 700;
}
.hero h1 {
  font-family: "EB Garamond", Georgia, serif;
  font-size: clamp(2rem, 4.4vw, 3.2rem);
  font-weight: 600; line-height: 1.12; margin: 0 0 14px;
}
.hero p { margin: 0 0 22px; max-width: 54ch; color: #e6e3da; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; text-decoration: none;
  padding: 10px 16px; font-size: .92rem; font-weight: 700;
  border: 1px solid transparent;
}
.btn-solid { background: var(--green); color: #f4f1e8; }
.btn-ghost { border-color: #9aa3b5; color: #f6f3ea; }

.band {
  background: #ece6d6; color: var(--navy);
  padding: 14px 0; font-size: .92rem;
}
.band ul {
  display: flex; flex-wrap: wrap; gap: 8px 28px;
  list-style: none; margin: 0; padding: 0;
}
.band b { display: block; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--green); }

.section { padding: 52px 0; }
.section.alt { background: #ebe6db; border-top: 1px solid var(--line); }
.section h2, .page-main h1 {
  font-family: "EB Garamond", Georgia, serif;
  font-weight: 600; line-height: 1.15;
}
.section h2 { font-size: clamp(1.55rem, 2.6vw, 2.15rem); margin: 0 0 8px; }
.lede { color: var(--muted); margin: 0 0 24px; max-width: 66ch; }
.section-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  margin-bottom: 4px;
}
.section-head a { color: var(--green); text-decoration: none; font-weight: 700; }

.points {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px;
}
.points > a, .points > div {
  background: var(--card); border: 1px solid var(--line); padding: 18px;
  text-decoration: none;
}
.points > a:hover { border-color: var(--green); }
.points h3 {
  font-family: "EB Garamond", Georgia, serif;
  font-size: 1.18rem; margin: 0 0 8px;
}
.points p { margin: 0; color: var(--muted); }

.news-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px;
}
.news-card {
  background: var(--card); border: 1px solid var(--line);
  text-decoration: none; overflow: hidden;
}
.news-card:hover { border-color: var(--navy); }
.news-card img {
  width: 100%; aspect-ratio: 16/10; object-fit: cover; background: #ddd8cc;
}
.news-card .cap { padding: 14px 16px 16px; }
.news-card time { color: var(--green); font-size: .8rem; }
.news-card h3 {
  font-family: "EB Garamond", Georgia, serif;
  font-size: 1.15rem; margin: 6px 0 8px; font-weight: 600; line-height: 1.3;
}
.news-card p { margin: 0; color: var(--muted); font-size: .92rem; }

.page-main {
  padding: 40px 0 72px;
  width: min(760px, calc(100% - 40px));
  margin-inline: auto;
}
.page-main.wide { width: min(var(--max), calc(100% - 40px)); }
.crumbs { font-size: .82rem; color: var(--muted); margin: 0 0 14px; }
.crumbs a { text-decoration: none; }
.page-main h1 {
  font-size: clamp(1.8rem, 3.4vw, 2.55rem);
  margin: 0 0 18px;
}
.meta { color: var(--muted); font-size: .88rem; margin: 0 0 18px; }
.lead-img { margin: 0 0 22px; }
.lead-img img { width: 100%; }
.entry { font-size: 1.05rem; }
.entry [style] { color: inherit !important; background: transparent !important; font-family: inherit !important; font-size: inherit !important; }
.entry a { color: var(--green); }
.entry p, .entry li { margin: 0 0 1em; }
.entry h2, .entry h3, .entry strong {
  font-family: "EB Garamond", Georgia, serif;
}
.entry img { margin: 1em 0; }
.entry table {
  width: 100%; border-collapse: collapse; margin: 8px 0 24px;
  background: var(--card);
}
.entry td, .entry th {
  border: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top;
}
.entry tr:nth-child(even) td { background: #f7f3ea; }
.pager { display: flex; gap: 16px; margin-top: 28px; }
.pager a { color: var(--green); }

.site-footer {
  background: var(--navy); color: #d8d4c8;
  padding: 40px 0 24px; font-size: .92rem;
}
.foot {
  display: grid; grid-template-columns: 1.3fr 1fr auto; gap: 28px; align-items: start;
  border-bottom: 1px solid #3a4152; padding-bottom: 22px; margin-bottom: 16px;
}
.foot strong {
  font-family: "EB Garamond", Georgia, serif;
  font-size: 1.45rem; color: #f4f1e8; display: block; margin-bottom: 8px;
}
.foot a, .copy a { color: #e7d7b0; text-decoration: none; }
.foot-logo {
  justify-self: end;
  background: #fff;
  padding: 10px 12px;
}
.foot-logo img { width: 210px; height: auto; }
.copy { color: #9a9588; font-size: .8rem; }

@media (max-width: 980px) {
  .points, .news-grid { grid-template-columns: 1fr 1fr; }
  .foot { grid-template-columns: 1fr 1fr; }
  .foot-logo { grid-column: 1 / -1; justify-self: start; }
  .nav-toggle { display: block; }
  .search-mini { display: none; }
  .nav-main { display: none; }
  body.nav-open .nav-main { display: block; }
  .nav-main ul { flex-direction: column; flex-wrap: wrap; }
  .nav-main .sub-menu { position: static; display: flex; min-width: 0; background: #1b2030; }
}
@media (max-width: 760px) {
  .brand-mark { height: 40px; max-width: 110px; }
  .brand-text em { display: none; }
  .points, .news-grid { grid-template-columns: 1fr; }
  .section { padding: 36px 0; }
  .hero { min-height: 360px; padding: 48px 0 36px; }
  .foot { grid-template-columns: 1fr; }
}
