/**
 * Main theme styles
 * Loaded globally on every page.
 *
 * Contains global design tokens, base reset, typography, header, footer,
 * homepage components, generic page content and WYSIWYG/legal content styles.
 */

/* ================================
   01. Design tokens / defaults
================================ */

:root {
    --hpromo-color-primary: #e30613;
    --hpromo-color-primary-hover: #c90010;
    --hpromo-color-primary-dark: #b9000c;

    --hpromo-color-dark: #111827;
    --hpromo-color-dark-soft: #161616;
    --hpromo-color-text: #374151;
    --hpromo-color-text-legacy: #333333;
    --hpromo-color-muted: #6b7280;
    --hpromo-color-muted-legacy: #6f6f6f;
    --hpromo-color-muted-light: #7a8492;

    --hpromo-color-white: #ffffff;
    --hpromo-color-light: #f7f7f7;
    --hpromo-color-bg: #f7f7f7;
    --hpromo-color-bg-soft: #fff7f7;
    --hpromo-color-light-soft: #f3f4f6;
    --hpromo-color-border: #e5e7eb;
    --hpromo-color-border-legacy: #e5e5e5;
    --hpromo-color-border-soft: #e4e4e7;
    --hpromo-color-border-strong: #dfe3e8;

    --hpromo-color-success: #16a34a;
    --hpromo-color-success-bg: #f0fdf4;
    --hpromo-color-error: #b91c1c;
    --hpromo-color-error-bg: #fef2f2;
    --hpromo-color-warning: #9a3412;
    --hpromo-color-warning-bg: #fff7ed;
    --hpromo-color-info: #1d4ed8;
    --hpromo-color-info-bg: #eff6ff;

    --hpromo-container-width: 1280px;
    --hpromo-container-narrow: 1180px;

    --hpromo-font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, Helvetica, sans-serif;

    --hpromo-font-size-xs: 11px;
    --hpromo-font-size-sm: 12px;
    --hpromo-font-size-base: 13px;
    --hpromo-font-size-md: 14px;
    --hpromo-font-size-lg: 15px;
    --hpromo-font-size-xl: 16px;
    --hpromo-font-size-h5: 18px;
    --hpromo-font-size-h4: 20px;
    --hpromo-font-size-h3: clamp(24px, 2.4vw, 30px);
    --hpromo-font-size-h2: clamp(28px, 3vw, 42px);
    --hpromo-font-size-h1: clamp(36px, 5vw, 64px);

    --hpromo-line-height-tight: 1.05;
    --hpromo-line-height-heading: 1.15;
    --hpromo-line-height-base: 1.6;
    --hpromo-line-height-relaxed: 1.65;
    --hpromo-line-height-text: 1.75;

    --hpromo-radius-sm: 6px;
    --hpromo-radius-md: 8px;
    --hpromo-radius-lg: 12px;
    --hpromo-radius-xl: 18px;
    --hpromo-radius-pill: 999px;

    --hpromo-shadow-sm: 0 4px 14px rgba(17, 24, 39, 0.05);
    --hpromo-shadow-md: 0 8px 24px rgba(17, 24, 39, 0.06);
    --hpromo-shadow-lg: 0 18px 45px rgba(22, 22, 22, 0.08);

    --hpromo-transition: 0.2s ease;

    /* Legacy aliases used by older templates/components. */
    --color-primary: var(--hpromo-color-primary);
    --color-primary-dark: var(--hpromo-color-primary-dark);
    --color-dark: var(--hpromo-color-dark-soft);
    --color-text: var(--hpromo-color-text-legacy);
    --color-muted: var(--hpromo-color-muted-legacy);
    --color-light: var(--hpromo-color-light);
    --color-white: var(--hpromo-color-white);
    --color-border: var(--hpromo-color-border-legacy);
    --container-width: var(--hpromo-container-width);
    --radius: var(--hpromo-radius-xl);
    --shadow: var(--hpromo-shadow-lg);
}

/* ================================
   02. Reset / base elements
================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--hpromo-font-family);
    color: var(--color-text);
    background: var(--color-white);
    font-size: var(--hpromo-font-size-lg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover,
a:focus {
    color: var(--color-primary-dark);
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

:focus-visible {
    outline: 3px solid rgba(227, 6, 19, 0.22);
    outline-offset: 3px;
}

.hpromo-site-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.hpromo-main-content {
    flex: 1;
    width: 100%;
}

/* ================================
   03. Global typography
================================ */

.hpromo-page-content h1,
.hpromo-post-content h1,
.hpromo-text-content h1 {
    margin: 0 0 24px;
    color: var(--hpromo-color-dark);
    font-size: var(--hpromo-font-size-h1);
    line-height: var(--hpromo-line-height-tight);
    font-weight: 800;
    letter-spacing: -0.04em;
}

.hpromo-page-content h2,
.hpromo-post-content h2,
.hpromo-text-content h2 {
    margin: 36px 0 16px;
    color: var(--hpromo-color-dark);
    font-size: var(--hpromo-font-size-h2);
    line-height: var(--hpromo-line-height-heading);
    font-weight: 800;
    letter-spacing: -0.035em;
}

.hpromo-page-content h3,
.hpromo-post-content h3,
.hpromo-text-content h3 {
    margin: 30px 0 14px;
    color: var(--hpromo-color-dark);
    font-size: var(--hpromo-font-size-h3);
    line-height: var(--hpromo-line-height-heading);
    font-weight: 800;
    letter-spacing: -0.025em;
}

.hpromo-page-content h4,
.hpromo-post-content h4,
.hpromo-text-content h4 {
    margin: 26px 0 12px;
    color: var(--hpromo-color-dark);
    font-size: var(--hpromo-font-size-h4);
    line-height: 1.3;
    font-weight: 800;
}

.hpromo-page-content h5,
.hpromo-post-content h5,
.hpromo-text-content h5 {
    margin: 22px 0 10px;
    color: var(--hpromo-color-dark);
    font-size: var(--hpromo-font-size-h5);
    line-height: 1.35;
    font-weight: 800;
}

.hpromo-page-content p,
.hpromo-post-content p,
.hpromo-text-content p {
    margin: 0 0 22px;
    color: var(--hpromo-color-text);
    font-size: var(--hpromo-font-size-lg);
    line-height: var(--hpromo-line-height-text);
}

.hpromo-page-content ul,
.hpromo-page-content ol,
.hpromo-post-content ul,
.hpromo-post-content ol,
.hpromo-text-content ul,
.hpromo-text-content ol {
    margin: 0 0 24px 22px;
    padding: 0;
    color: var(--hpromo-color-text);
}

.hpromo-page-content li,
.hpromo-post-content li,
.hpromo-text-content li {
    margin-bottom: 10px;
    color: var(--hpromo-color-text);
    font-size: var(--hpromo-font-size-lg);
    line-height: var(--hpromo-line-height-base);
}

.hpromo-page-content a,
.hpromo-post-content a,
.hpromo-text-content a {
    color: var(--hpromo-color-primary);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.hpromo-page-content a:hover,
.hpromo-post-content a:hover,
.hpromo-text-content a:hover {
    color: var(--hpromo-color-primary-dark);
}

/* ================================
   Header
================================ */

.hpromo-header {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99;
}

.hpromo-header-inner {
    width: fit-content;
    min-width: 520px;
    background: var(--color-white);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4rem;
    padding: 9px 24px;
    border: 1px solid #e4e4e7;
    border-radius: 999px;
}

.hpromo-branding .hpromo-site-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-dark);
}

.hpromo-navigation {
    display: flex;
}

.hpromo-menu {
    display: flex;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 8px;
}

.hpromo-menu li a {
    color: #71717b;
    padding: 0.35rem 0.45rem;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
}

.hpromo-menu li a:hover {
    color: var(--color-primary);
}

/* ================================
   Existing hero - kept for now
================================ */

.hpromo-hero {
    background: linear-gradient(135deg, #ffffff 0%, #fcf2f2 100%);
    padding: 100px 0 60px;
}

.hpromo-hero-inner {
    max-width: 960px;
    margin: 0 auto;
    text-align: center;
    padding: 0 20px;
}

.hpromo-label {
    display: inline-block;
    margin-bottom: 1rem;
    color: var(--color-primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.85rem;
}

.hpromo-hero-title {
    margin: 0 0 1rem;
    font-size: clamp(2.6rem, 5vw, 4.2rem);
    line-height: 1.05;
    color: var(--color-dark);
}

.hpromo-hero-text {
    max-width: 720px;
    margin: 0 auto 2rem;
    color: var(--color-muted);
    font-size: 1.05rem;
}

.hpromo-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.75rem;
    border-radius: 999px;
    background: var(--color-primary);
    color: var(--color-white);
    font-weight: 700;
    border: none;
    transition: background 0.2s ease;
}

.hpromo-button:hover,
.hpromo-button:focus {
    background: var(--color-primary-dark);
    color: var(--color-white);
}

/* ================================
   Homepage shared
================================ */

.hpromo-home-section {
    width: min(100% - 40px, 1180px);
    margin: 0 auto;
}

.hpromo-home-section-header {
    text-align: center;
    margin: 0 auto 24px;
}

.hpromo-home-section-header h2 {
    margin: 0;
    color: var(--color-primary);
    font-size: clamp(28px, 3vw, 42px);
    line-height: 1.05;
    font-weight: 700;
    letter-spacing: -0.035em;
}

.hpromo-section-subtitle {
    max-width: 660px;
    margin: 10px auto 0;
    color: #7a8492;
    font-size: 15px;
    line-height: 1.6;
}

/* ================================
   Campaign cards
================================ */
.hpromo-home-campaign-title {
    margin: 0 0 8px;
    color: #111827;
    font-size: 16px;
    line-height: 1.25;
    font-weight: 800;
}

.hpromo-home-campaign-status {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-bottom: 14px;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.hpromo-home-campaign-status--active {
    background: rgba(227, 6, 19, 0.1);
    color: #e30613;
}

.hpromo-home-campaign-status--upcoming {
    background: rgba(0, 140, 255, 0.1);
    color: #0057b8;
}

.hpromo-home-campaign-status--expired {
    background: rgba(17, 24, 39, 0.08);
    color: #111827;
}

.hpromo-home-past-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(17, 24, 39, 0.05);
}

.hpromo-home-past-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.hpromo-home-past-card-body {
    padding: 16px 18px 18px;
    background: #ffffff;
}

/* ================================
   Active campaigns
================================ */

.hpromo-home-active-campaigns {
    padding: 18px 0 34px;
}

.hpromo-home-active-grid,
.hpromo-home-past-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    max-width: 1180px;
    margin: 0 auto;
}

.hpromo-home-campaign-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(17, 24, 39, 0.05);
}

.hpromo-home-campaign-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.hpromo-home-campaign-card-image {
    background: #f7f7f7;
    overflow: hidden;
}

.hpromo-home-campaign-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hpromo-home-campaign-card-body {
    padding: 18px;
    background: #ffffff;
}

.hpromo-home-campaign-period {
    padding: 14px 16px;
    margin-bottom: 14px;
    background: #f7f7f7;
    border-radius: 6px;
}

.hpromo-home-campaign-period span {
    display: block;
    margin-bottom: 5px;
    color: #7a8492;
    font-size: 13px;
    line-height: 1.2;
}

.hpromo-home-campaign-period strong {
    display: block;
    color: #111827;
    font-size: 15px;
    line-height: 1.3;
    font-weight: 700;
}

.hpromo-home-campaign-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    min-height: 40px;
    padding: 10px 16px;
    border-radius: 6px;
    background: var(--color-primary);
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    transition: background-color 0.2s ease;
}

.hpromo-home-campaign-card-link:hover .hpromo-home-campaign-button {
    background: var(--color-primary-dark);
}

.hpromo-home-campaign-button--muted {
    background: #9ca3af;
}

/* ================================
   Upcoming campaigns section
================================ */

.hpromo-home-upcoming-campaigns {
    padding: 18px 0 34px;
}

.hpromo-home-upcoming-campaigns .hpromo-home-section-header h2 {
    color: #e30613;
}

/* ================================
   Past campaigns
================================ */

.hpromo-home-past-campaigns {
    padding: 18px 0 34px;
}

.hpromo-home-past-card {
    border-radius: 6px;
    overflow: hidden;
    background: #f7f7f7;
}

.hpromo-home-past-card.is-hidden {
    display: none;
}

.hpromo-home-past-card-link {
    display: block;
}

.hpromo-home-past-card-image {
    overflow: hidden;
}

.hpromo-home-past-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hpromo-home-load-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 22px;
}

.hpromo-home-load-more {
    min-height: 36px;
    padding: 9px 22px;
    background: var(--color-primary);
    color: #ffffff;
    border: 0;
    border-radius: 5px;
    font-size: 14px;
    line-height: 1;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.hpromo-home-load-more:hover {
    background: var(--color-primary-dark);
}

/* ================================
   Brands section
================================ */

.hpromo-brands-section {
    padding: 28px 0 74px;
    text-align: center;
}

.hpromo-brands-header {
    margin-bottom: 28px;
}

.hpromo-brands-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    padding: 5px 11px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #7a8492;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.hpromo-brands-grid {
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(9, minmax(0, 1fr));
    gap: 0;
    align-items: center;
}

.hpromo-brand-item {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
}

.hpromo-brand-logo {
    display: block;
    max-height: 100px;
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* ================================
   Empty state
================================ */

.hpromo-empty-state {
    max-width: 760px;
    margin: 0 auto;
    padding: 34px 20px;
    text-align: center;
    color: var(--color-muted);
    background: #f7f7f7;
    border-radius: 8px;
}

.hpromo-empty-state p {
    margin: 0;
}

/* ================================
   Generic pages
================================ */

.hpromo-page,
.hpromo-post {
    max-width: 1280px;
    margin: 0 auto;
    padding: 100px 0 60px;
}

.hpromo-page-title,
.hpromo-post-title {
    margin: 0 0 1.5rem;
    font-size: 2.6rem;
}

.hpromo-page-content,
.hpromo-post-content,
.hpromo-text-content {
    color: var(--color-text);
}

.hpromo-page-hero {
    background: linear-gradient(135deg, #f5f5f5 0%, #f0f0f0 100%);
    padding: 3rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.hpromo-container {
    max-width: var(--container-width);
    margin: 0 auto;
}

.hpromo-page-hero .hpromo-page-title {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1.1;
    color: var(--color-dark);
}

.hpromo-page-wrapper {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

.hpromo-page-content {
    color: var(--color-text);
    line-height: 1.8;
}


/* ================================
   Official rules WYSIWYG content
   Used for campaign rules and legal text pages.
================================ */

.hpromo-rules-content {
    max-width: 920px;
    margin: 0 auto;
    color: var(--hpromo-color-dark, #111827);
    font-size: var(--hpromo-font-size-lg, 15px);
    line-height: var(--hpromo-line-height-text, 1.75);
}

.hpromo-rules-content h1 {
    margin: 0 0 14px;
    color: var(--hpromo-color-dark, #111827);
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.035em;
}

.hpromo-rules-content h2 {
    margin: 0 0 28px;
    color: var(--hpromo-color-dark, #111827);
    font-size: clamp(21px, 3vw, 30px);
    line-height: 1.25;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.hpromo-rules-content h3 {
    margin: 34px 0 14px;
    padding-top: 18px;
    border-top: 1px solid var(--hpromo-color-border, #e5e7eb);
    color: var(--hpromo-color-dark, #111827);
    font-size: var(--hpromo-font-size-h3, 20px);
    line-height: 1.3;
    font-weight: 800;
    letter-spacing: -0.015em;
}

.hpromo-rules-content h4 {
    margin: 26px 0 12px;
    color: var(--hpromo-color-dark, #111827);
    font-size: var(--hpromo-font-size-h4, 17px);
    line-height: 1.35;
    font-weight: 800;
}

.hpromo-rules-content p {
    margin: 0 0 13px;
    color: var(--hpromo-color-text, #374151);
    font-size: var(--hpromo-font-size-lg, 15px);
    line-height: var(--hpromo-line-height-text, 1.75);
}

.hpromo-rules-content strong {
    color: var(--hpromo-color-dark, #111827);
    font-weight: 800;
}

.hpromo-rules-content ul,
.hpromo-rules-content ol {
    margin: 0 0 18px 22px;
    padding: 0;
    color: var(--hpromo-color-text, #374151);
}

.hpromo-rules-content li {
    margin: 0 0 7px;
    padding-left: 3px;
    color: var(--hpromo-color-text, #374151);
    font-size: var(--hpromo-font-size-lg, 15px);
    line-height: var(--hpromo-line-height-relaxed, 1.65);
}

.hpromo-rules-content a {
    color: var(--hpromo-color-primary, #e30613);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.hpromo-rules-content a:hover {
    color: var(--hpromo-color-primary-hover, #c90010);
}

@media (max-width: 560px) {
    .hpromo-rules-content {
        font-size: var(--hpromo-font-size-md, 14px);
        line-height: var(--hpromo-line-height-relaxed, 1.65);
    }

    .hpromo-rules-content h1 {
        font-size: 30px;
    }

    .hpromo-rules-content h2 {
        font-size: 22px;
    }

    .hpromo-rules-content h3 {
        margin-top: 28px;
        font-size: 18px;
    }

    .hpromo-rules-content h4 {
        font-size: 16px;
    }

    .hpromo-rules-content p,
    .hpromo-rules-content li {
        font-size: var(--hpromo-font-size-md, 14px);
        line-height: var(--hpromo-line-height-relaxed, 1.65);
    }
}

/* ================================
   Footer
================================ */

.hpromo-footer {
    background: var(--color-white);
    padding: 1.5rem;
}

.hpromo-footer-inner {
    max-width: var(--container-width);
    background: #f7f7f7;
    text-align: center;
    font-size: 0.95rem;
    color: var(--color-muted);
    padding: 24px 16px;
    border-radius: 15px;
    margin: 0 auto;
}

.hpromo-footer-logo {
    margin-bottom: 12px;
}

.hpromo-footer-logo img {
    display: block;
    margin: 0 auto;
    max-width: 72px;
}

.hpromo-footer-nav {
    margin-bottom: 8px;
}

.hpromo-footer-nav a {
    font-size: 13px;
    color: #09090b;
    margin: 0 7px;
}

.hpromo-footer-nav a:hover {
    color: var(--color-primary);
}

.hpromo-footer-copy {
    font-size: 12px;
    color: #09090b;
    margin: 0;
}

/* ================================
   Responsive
================================ */

@media (max-width: 1100px) {
    .hpromo-home-section {
        width: min(100% - 32px, 960px);
    }

    .hpromo-brands-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
        max-width: 620px;
    }
}

@media (max-width: 780px) {
    .hpromo-page, .hpromo-post {
        padding: 80px 0 40px;
    }
    .hpromo-header {
        top: 14px;
        width: calc(100% - 28px);
    }

    .hpromo-header-inner {
        width: 100%;
        min-width: 0;
        gap: 1rem;
        justify-content: space-between;
        padding: 9px 16px;
    }

    .hpromo-menu {
        gap: 4px;
    }

    .hpromo-menu li a {
        font-size: 12px;
        padding: 0.35rem 0.25rem;
    }

    .hpromo-hero {
        padding: 110px 0 46px;
    }

    .hpromo-home-active-grid,
    .hpromo-home-past-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-width: 760px;
    }

    .hpromo-brands-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 18px 24px;
        max-width: 360px;
    }
}

@media (max-width: 520px) {
    .hpromo-home-section {
        width: min(100% - 28px, 100%);
    }

    .hpromo-header-inner {
        flex-direction: column;
        gap: 8px;
    }

    .hpromo-menu {
        flex-wrap: wrap;
        justify-content: center;
    }

    .hpromo-hero-title {
        font-size: 2.3rem;
    }

    .hpromo-home-section-header h2 {
        font-size: 30px;
    }

    .hpromo-home-campaign-card-body {
        padding: 14px;
    }

    .hpromo-home-active-grid,
    .hpromo-home-past-grid {
        grid-template-columns: 1fr;
        max-width: 520px;
    }

    .hpromo-footer {
        padding: 1rem;
    }

    .hpromo-footer-nav a {
        display: inline-block;
        margin: 4px 7px;
    }
}