/*
 * Human Still Wins — supplementary front-end styles.
 * The bulk of the design system lives in theme.json.
 * This file handles details that theme.json cannot express:
 * brand markers, animation hooks, custom post type renderings.
 */

/* ============================================================
   GLOBAL RESETS AND TYPOGRAPHY REFINEMENTS
   ============================================================ */

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-feature-settings: "kern" 1, "liga" 1, "ss01" 1;
}

/* Tighten heading optical alignment when using Bebas Neue */
h1, h2, h3,
.wp-block-heading.has-heading-font-family {
    text-wrap: balance;
}

p, li {
    text-wrap: pretty;
}

/* Selection colour */
::selection {
    background: #E56A25;
    color: #F7F5F2;
}

/* Focus rings, accessible and on-brand */
:where(a, button, input, textarea, select):focus-visible {
    outline: 2px solid #E56A25;
    outline-offset: 3px;
    border-radius: 2px;
}

/* ============================================================
   BRAND MARK — the orange tick between letters
   Used as a divider you can drop in anywhere
   ============================================================ */

.hsw-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1em;
    height: 1.2em;
    position: relative;
}

.hsw-mark::before,
.hsw-mark::after {
    content: "";
    position: absolute;
    left: 50%;
    width: 2px;
    height: 0.25em;
    background: #E56A25;
    transform: translateX(-50%);
}

.hsw-mark::before { top: 0; }
.hsw-mark::after  { bottom: 0; }

/* A horizontal version for between paragraphs */
.hsw-divider {
    display: block;
    width: 100%;
    text-align: center;
    margin: 3rem 0;
    position: relative;
}

.hsw-divider::before {
    content: "";
    display: inline-block;
    width: 2px;
    height: 32px;
    background: #E56A25;
}

/* ============================================================
   HEADER
   ============================================================ */

.wp-block-template-part.site-header {
    border-bottom: 1px solid #B8BEC7;
}

/* Tiny site title treatment when no logo is set */
.wp-block-site-title a {
    text-decoration: none;
    color: inherit;
}

.wp-block-site-title a:hover {
    color: #E56A25;
}

/* ============================================================
   HERO — used in the front-page pattern
   ============================================================ */

.hsw-hero {
    position: relative;
    padding: clamp(4rem, 12vw, 9rem) 0;
    overflow: hidden;
}

.hsw-hero__eyebrow {
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.875rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #4A4A4A;
    margin-bottom: 1.5rem;
}

.hsw-hero__title {
    font-family: "Bebas Neue", "Oswald", sans-serif;
    font-size: clamp(4rem, 12vw, 9rem);
    line-height: 0.9;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #111111;
    margin: 0;
}

.hsw-hero__title .accent {
    color: #E56A25;
}

.hsw-hero__sub {
    font-family: "Inter", sans-serif;
    font-size: clamp(1.125rem, 2vw, 1.5rem);
    font-weight: 400;
    line-height: 1.5;
    color: #4A4A4A;
    margin-top: 2rem;
    max-width: 48ch;
}

/* ============================================================
   POST CARDS — archive and front page article grids
   ============================================================ */

.wp-block-post-template.is-flex-container .wp-block-post {
    border-top: 1px solid #B8BEC7;
    padding-top: 2rem;
}

.wp-block-post-title a {
    text-decoration: none;
    color: inherit;
}

.wp-block-post-title a:hover {
    color: #E56A25;
}

/* ============================================================
   RESOURCE DOWNLOAD CARD
   ============================================================ */

.hsw-resource-download {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #111111;
}

.hsw-resource-download a {
    display: inline-block;
    background: #E56A25;
    color: #111111;
    padding: 1rem 2rem;
    font-family: "Inter", sans-serif;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.02em;
    text-decoration: none;
    border-radius: 2px;
    transition: background 0.2s ease, color 0.2s ease;
}

.hsw-resource-download a:hover {
    background: #111111;
    color: #F7F5F2;
}

/* ============================================================
   QUIZ / POLL
   ============================================================ */

.hsw-quiz {
    margin: 3rem 0;
    padding: 2rem;
    background: #F7F5F2;
    border: 1px solid #B8BEC7;
    border-radius: 2px;
}

.hsw-quiz__question {
    font-family: "Bebas Neue", sans-serif;
    font-size: 1.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #111111;
    margin-bottom: 1.5rem;
}

.hsw-quiz__counter {
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.8125rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #4A4A4A;
    margin-bottom: 0.5rem;
}

.hsw-quiz__options {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.hsw-quiz__option {
    display: block;
    width: 100%;
    padding: 1rem 1.25rem;
    background: #FFFFFF;
    border: 1px solid #B8BEC7;
    border-radius: 2px;
    font-family: "Inter", sans-serif;
    font-size: 1rem;
    text-align: left;
    color: #111111;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.hsw-quiz__option:hover {
    border-color: #E56A25;
}

.hsw-quiz__option.is-selected {
    border-color: #E56A25;
    background: #FFF6F0;
}

.hsw-quiz__option.is-correct {
    border-color: #2E7D32;
    background: #EAF5EB;
}

.hsw-quiz__option.is-incorrect {
    border-color: #C62828;
    background: #FBEAEA;
}

.hsw-quiz__nav {
    margin-top: 1.5rem;
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.hsw-quiz__btn {
    background: #E56A25;
    color: #111111;
    border: 0;
    padding: 0.75rem 1.5rem;
    font-family: "Inter", sans-serif;
    font-weight: 600;
    font-size: 0.9375rem;
    border-radius: 2px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.hsw-quiz__btn:hover {
    background: #111111;
    color: #F7F5F2;
}

.hsw-quiz__btn:disabled {
    background: #B8BEC7;
    cursor: not-allowed;
}

.hsw-quiz__result {
    font-family: "Bebas Neue", sans-serif;
    font-size: 2rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #E56A25;
    margin: 1rem 0;
}

.hsw-quiz__summary {
    font-family: "Inter", sans-serif;
    color: #4A4A4A;
}

/* ============================================================
   FOOTER
   ============================================================ */

.wp-block-template-part.site-footer {
    margin-top: 6rem;
}

/* ============================================================
   UTILITY: editorial caption labels
   ============================================================ */

.hsw-eyebrow {
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.8125rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #4A4A4A;
}

/* ============================================================
   PRINT
   ============================================================ */

@media print {
    .site-header, .site-footer, .hsw-quiz, .hsw-resource-download {
        display: none;
    }
    body {
        color: #000;
        background: #fff;
    }
}

/* ============================================================
   ELEMENTOR COMPATIBILITY (v5.0.0)

   Pages built with Elementor receive the body class
   .hsw-elementor-page. CSS here is scoped to that class to
   prevent theme typography and spacing from overriding
   Elementor widget styles.
   ============================================================ */

/* Elementor content wrapper */
.hsw-elementor-content {
    min-height: 60vh;
}

/* Let Elementor control its own widget font families and sizes.
   Without this, theme heading rules bleed into the widget canvas. */
.hsw-elementor-page .elementor-widget-heading .elementor-heading-title,
.hsw-elementor-page .elementor-widget * {
    font-family: inherit;
    text-transform: inherit;
}

/* Restore Elementor's default link colours inside widget areas
   so they are not overridden by the theme --hsw-link variable. */
.hsw-elementor-page .elementor-widget a {
    color: inherit;
}

/* Keep the theme header border on Elementor pages */
.hsw-elementor-page .wp-block-template-part.site-header {
    border-bottom: 1px solid #B8BEC7;
}

/* Prevent theme footer top margin from stacking with
   Elementor's last section bottom margin */
.hsw-elementor-page .wp-block-template-part.site-footer {
    margin-top: 0;
}

