/*
Theme Name:   unHINGED Framework
Theme URI:    https://unhingedmagazine.com
Author:       unHINGED Editorial
Author URI:   https://unhingedmagazine.com
Description:  Lightweight editorial publishing framework for unHINGED Magazine. Child theme of Hello Elementor. Provides WordPress infrastructure — navigation, header, footer, SEO scaffolding, and dynamic functionality — while preserving complete art-directional freedom for every individual article. The theme provides infrastructure. The article provides the visual experience.
Template:     hello-elementor
Version:      1.0.0
Requires PHP: 7.4
Text Domain:  unhinged-framework
*/

/* ==========================================================================
   unHINGED FRAMEWORK — GLOBAL FOUNDATION STYLES

   READ THIS BEFORE EDITING.

   This file intentionally contains almost no design opinions.

   Every unHINGED article ships as a self-contained HTML/CSS block
   (pasted into the post content, or eventually a block/ACF field)
   scoped under a wrapper such as `.uh-article`. That block defines
   its OWN typography, its OWN color palette, its OWN layout — a new
   editorial identity for every single feature.

   This stylesheet's only job is to:
     1. Reset the handful of things WordPress/Elementor injects by
        default so they don't fight with article-level design.
     2. Provide NEUTRAL fallback values for the shared CSS Custom
        Properties (design tokens) that header.php / footer.php use,
        so the site doesn't break on pages that have no article
        (archives, search, 404, etc).
     3. Style the global header/footer chrome using ONLY those tokens
        — never a hardcoded brand color — so that when an article
        defines its own palette, the header/footer can optionally
        inherit it (see header.php for how `--accent` etc. cascade).
     4. Provide baseline accessibility + WordPress core support
        (alignwide/alignfull, captions, screen-reader-text, etc).

   DO NOT add brand colors, brand fonts, or article-specific styling
   here. That always belongs inside the article's own scoped CSS.
   ========================================================================== */


/* --------------------------------------------------------------------------
   1. DESIGN TOKENS (FRAMEWORK-LEVEL FALLBACKS ONLY)
   --------------------------------------------------------------------------
   These are neutral, unbranded defaults. Every article is expected to
   redeclare these same variable names inside its own scoped wrapper
   (e.g. `.uh-article { --accent: #8A1538; --background: #F2ECE6; ... }`)
   so that the header/footer chrome — which reads these tokens — can
   pick up the article's palette when it sits inside that wrapper.

   On pages with no article (index.php, archives, 404), these fallback
   values are what render.
   -------------------------------------------------------------------------- */
:root {
  --accent:        #1A1A1A;
  --accent-light:  #3A3A3A;
  --background:    #F7F5F2;
  --surface:       #FFFFFF;
  --surface-2:     #EFECE7;
  --text:          #1A1A1A;
  --muted:         #6B6B6B;
  --border:        #DEDAD5;
  --shadow:        rgba(0, 0, 0, 0.08);

  --uh-font-sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --uh-nav-height: 64px;
}

/* --------------------------------------------------------------------------
   2. RESET / NORMALIZE (MINIMAL, INTENTIONAL)
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--background);
  color: var(--text);
  font-family: var(--uh-font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Admin bar offset so the sticky nav never sits underneath it */
body.admin-bar .uh-site-header {
  top: 32px;
}
@media screen and (max-width: 782px) {
  body.admin-bar .uh-site-header {
    top: 46px;
  }
}

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

a {
  color: inherit;
}

/* --------------------------------------------------------------------------
   3. ACCESSIBILITY
   -------------------------------------------------------------------------- */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute !important;
  width: 1px;
  word-wrap: normal !important;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  z-index: 100000;
  background: var(--accent);
  color: var(--surface);
  padding: 12px 20px;
  font-family: var(--uh-font-sans);
  font-size: 0.85rem;
  text-decoration: none;
  transition: top 0.15s ease-in-out;
}
.skip-link:focus {
  top: 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   4. WORDPRESS CORE MARKUP SUPPORT
   -------------------------------------------------------------------------- */
.wp-caption,
figure.wp-block-image {
  max-width: 100%;
  margin: 0;
}
.wp-caption-text,
figcaption {
  font-size: 0.8rem;
  color: var(--muted);
  padding-top: 8px;
}

.alignwide {
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}
.alignfull {
  max-width: none;
  width: 100%;
}
.aligncenter {
  margin-left: auto;
  margin-right: auto;
  display: block;
}
.alignleft {
  float: left;
  margin-right: 1.5rem;
}
.alignright {
  float: right;
  margin-left: 1.5rem;
}

/* --------------------------------------------------------------------------
   5. GLOBAL CHROME — HEADER
   -------------------------------------------------------------------------- */
.uh-site-header {
  position: sticky;
  top: 0;
  z-index: 999;
  background: var(--accent);
  color: var(--surface);
  min-height: var(--uh-nav-height);
  display: flex;
  align-items: center;
}

.uh-site-header__inner {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.uh-site-header__brand {
  display: flex;
  align-items: baseline;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}

.uh-site-header__logo {
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  color: var(--surface);
}
.uh-site-header__logo img {
  max-height: 32px;
  width: auto;
  display: block;
}

.uh-site-header__tagline {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--surface);
  opacity: 0.7;
  white-space: nowrap;
}

.uh-site-header__category {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-light);
  background: var(--surface);
  padding: 4px 10px;
  border-radius: 2px;
}

.uh-site-header__nav ul {
  list-style: none;
  display: flex;
  gap: 24px;
  margin: 0;
  padding: 0;
}
.uh-site-header__nav a {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--surface);
  opacity: 0.85;
  transition: opacity 0.15s ease;
}
.uh-site-header__nav a:hover,
.uh-site-header__nav a:focus-visible {
  opacity: 1;
}
.uh-site-header__nav .current-menu-item a {
  opacity: 1;
  border-bottom: 1px solid currentColor;
}

.uh-site-header__toggle {
  display: none;
  background: none;
  border: 1px solid var(--surface);
  color: var(--surface);
  padding: 6px 10px;
  font-size: 0.75rem;
  border-radius: 2px;
}

@media (max-width: 720px) {
  .uh-site-header__toggle {
    display: inline-block;
  }
  .uh-site-header__nav {
    display: none;
    width: 100%;
    order: 3;
  }
  .uh-site-header__nav.is-open {
    display: block;
  }
  .uh-site-header__nav ul {
    flex-direction: column;
    gap: 12px;
    padding: 16px 0;
  }
}

/* --------------------------------------------------------------------------
   6. GLOBAL CHROME — FOOTER
   -------------------------------------------------------------------------- */
.uh-site-footer {
  background: var(--accent);
  color: var(--surface);
  padding: 56px 32px 40px;
}

.uh-site-footer__inner {
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}

.uh-site-footer__logo {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  color: var(--surface);
}

.uh-site-footer__tagline {
  font-style: italic;
  font-size: 0.9rem;
  color: var(--surface);
  opacity: 0.7;
  margin-top: 6px;
}

.uh-site-footer__nav {
  margin-top: 28px;
}
.uh-site-footer__nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin: 0;
  padding: 0;
}
.uh-site-footer__nav a {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--surface);
  opacity: 0.75;
}
.uh-site-footer__nav a:hover,
.uh-site-footer__nav a:focus-visible {
  opacity: 1;
}

.uh-site-footer__meta {
  margin-top: 32px;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--surface);
  opacity: 0.45;
}

/* --------------------------------------------------------------------------
   7. FALLBACK CONTENT STYLES
   --------------------------------------------------------------------------
   Used only by index.php / archive-style loops and any singular post
   that has NOT been given custom article HTML. Real unHINGED features
   override all of this from inside their own `.uh-article` wrapper.
   -------------------------------------------------------------------------- */
.uh-site-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 32px 80px;
}

.uh-teaser-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 32px;
}

.uh-teaser-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 1px 3px var(--shadow);
  display: flex;
  flex-direction: column;
}

.uh-teaser-card__media img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.uh-teaser-card__body {
  padding: 20px;
}

.uh-teaser-card__category {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.uh-teaser-card__title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 10px 0;
  line-height: 1.3;
}
.uh-teaser-card__title a {
  text-decoration: none;
  color: var(--text);
}

.uh-teaser-card__excerpt {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.6;
}

.uh-teaser-card__meta {
  margin-top: 14px;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.uh-pagination {
  margin-top: 48px;
  display: flex;
  justify-content: center;
  gap: 8px;
}
.uh-pagination a,
.uh-pagination span {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 2px;
  font-size: 0.8rem;
  text-decoration: none;
  color: var(--text);
}
.uh-pagination .current {
  background: var(--accent);
  color: var(--surface);
  border-color: var(--accent);
}
