/* ==========================================================================
   Al-Zawiyah — main stylesheet
   --------------------------------------------------------------------------
   SCAFFOLD STAGE. This is a readable baseline, not the site design.
   The visual identity has not been designed yet — see PROGRESS.md.

   Everything below is deliberately plain: enough structure and rhythm that
   the live site stays usable after activation, nothing that would have to be
   unpicked later.
   ========================================================================== */

/* Design tokens -------------------------------------------------------- */
:root {
  --az-ink: #1a1a1a;
  --az-ink-muted: #5a5a5a;
  --az-bg: #ffffff;
  --az-surface: #f6f5f2;
  --az-rule: #e2e0da;
  --az-accent: #7a5c2e;

  --az-font-body: Georgia, "Times New Roman", serif;
  --az-font-ui: system-ui, -apple-system, "Segoe UI", sans-serif;

  --az-measure: 68ch;
  --az-gutter: 1.5rem;
}

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

body {
  margin: 0;
  background: var(--az-bg);
  color: var(--az-ink);
  font-family: var(--az-font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--az-accent);
}

h1,
h2,
h3,
h4 {
  font-family: var(--az-font-ui);
  line-height: 1.25;
  text-wrap: balance;
}

/* Layout --------------------------------------------------------------- */
.site-header__inner,
.site-main,
.site-footer__inner {
  width: min(100% - (var(--az-gutter) * 2), var(--az-measure));
  margin-inline: auto;
}

.site-main {
  padding-block: 2.5rem 4rem;
}

/* Elementor pages manage their own width — release the theme constraint. */
.site-main--front,
.elementor-page .site-main {
  width: 100%;
  max-width: none;
  padding-inline: 0;
}

/* Header --------------------------------------------------------------- */
.site-header {
  border-bottom: 1px solid var(--az-rule);
  padding-block: 1.25rem;
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-title {
  margin: 0;
  font-size: 1.375rem;
  letter-spacing: 0.01em;
}

.site-title a {
  color: inherit;
  text-decoration: none;
}

.site-description {
  margin: 0.15rem 0 0;
  color: var(--az-ink-muted);
  font-size: 0.875rem;
}

/* Navigation ----------------------------------------------------------- */
.main-navigation ul {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--az-font-ui);
  font-size: 0.9375rem;
}

.main-navigation a {
  color: var(--az-ink);
  text-decoration: none;
}

.main-navigation a:hover,
.main-navigation a:focus {
  text-decoration: underline;
}

/* Sub-menus are left unstyled on purpose; the nav is a design decision
   still to be made, and a half-built dropdown is worse than none. */

.menu-toggle {
  display: none;
}

/* Entries -------------------------------------------------------------- */
.entry + .entry {
  margin-top: 3rem;
  padding-top: 3rem;
  border-top: 1px solid var(--az-rule);
}

.entry-title {
  margin: 0 0 0.4rem;
  font-size: 1.5rem;
}

.entry--single .entry-title {
  font-size: 2rem;
}

.entry-title a {
  color: inherit;
  text-decoration: none;
}

.entry-meta {
  color: var(--az-ink-muted);
  font-family: var(--az-font-ui);
  font-size: 0.8125rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.entry-thumbnail {
  display: block;
  margin: 0 0 1.25rem;
}

.entry-more {
  display: inline-block;
  margin-top: 0.5rem;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--az-accent);
  font-family: var(--az-font-ui);
  font-size: 0.875rem;
  text-decoration: none;
}

.entry-more:hover,
.entry-more:focus {
  border-bottom-width: 2px;
}

/* Accent rule under archive/search headings. Visible marker that the
   theme's own CSS is loading — replace freely during the design phase. */
.page-title {
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--az-accent);
}

/* Pagination ----------------------------------------------------------- */
.pagination {
  margin-top: 3rem;
  font-family: var(--az-font-ui);
  font-size: 0.9375rem;
}

.pagination .page-numbers {
  display: inline-block;
  padding: 0.25rem 0.6rem;
}

.pagination .current {
  background: var(--az-surface);
  border-radius: 3px;
}

/* Footer --------------------------------------------------------------- */
.site-footer {
  margin-top: 4rem;
  border-top: 1px solid var(--az-rule);
  padding-block: 2rem;
  background: var(--az-surface);
}

.site-info {
  margin: 0;
  color: var(--az-ink-muted);
  font-family: var(--az-font-ui);
  font-size: 0.8125rem;
}

.footer-navigation ul {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
  font-family: var(--az-font-ui);
  font-size: 0.875rem;
}

/* Accessibility -------------------------------------------------------- */
.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 1000;
  width: auto;
  height: auto;
  clip: auto;
  margin: 0;
  padding: 0.6rem 1rem;
  background: var(--az-bg);
  border: 2px solid var(--az-accent);
  font-family: var(--az-font-ui);
}

:where(a, button, input, textarea, select):focus-visible {
  outline: 2px solid var(--az-accent);
  outline-offset: 2px;
}

/* Small screens -------------------------------------------------------- */
@media (max-width: 640px) {
  .site-header__inner {
    align-items: flex-start;
  }

  .entry--single .entry-title {
    font-size: 1.625rem;
  }
}
