/* ============================================================
   Ghost Hunters Map — Main Stylesheet
   ============================================================ */

/* ---------- Custom Properties ---------- */
:root {
    --color-bg:          #1a1a1a;
    --color-bg-surface:  #242424;
    --color-bg-elevated: #2e2e2e;
    --color-text:        #f5f5f5;
    --color-text-muted:  #a0a0a0;
    --color-accent:      #56adbf;
    --color-accent-glow: rgba(86, 173, 191, 0.15);
    --color-accent-dim:  rgba(86, 173, 191, 0.08);
    --color-border:      #3a3a3a;
    --color-ghost-white: #ffffff;

    --font-body:         'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-horror:       'Creepster', 'Chiller', cursive; /* Google Font loaded in functions.php */

    --spacing-xs:  0.25rem;
    --spacing-sm:  0.5rem;
    --spacing-md:  1rem;
    --spacing-lg:  2rem;
    --spacing-xl:  4rem;

    --radius-sm:   4px;
    --radius-md:   8px;
    --radius-lg:   16px;

    --transition:       0.25s ease;
    --ghm-header-height: 72px;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ---------- Base ---------- */
html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

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

a {
    color: var(--color-ghost-white);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: opacity var(--transition);
}

a:hover {
    opacity: 0.75;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    font-weight: 700;
    color: var(--color-ghost-white);
}

/* "Dripping" horror-style title class */
.ghm-title-horror {
    font-family: var(--font-horror);
    font-size: clamp(2.5rem, 6vw, 5rem);
    color: var(--color-ghost-white);
    text-shadow:
        0 4px 16px rgba(86, 173, 191, 0.35),
        0 0 60px rgba(86, 173, 191, 0.15),
        0 2px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: 0.04em;
    position: relative;
}

/* Standard section title */
.ghm-title {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: var(--color-ghost-white);
    margin-bottom: var(--spacing-md);
}

/* ---------- Layout ---------- */
.ghm-container {
    width: 100%;
    max-width: 1200px;
    margin-inline: auto;
    padding-inline: var(--spacing-lg);
}

.ghm-section {
    padding-block: var(--spacing-xl);
}

/* ---------- Header ---------- */
.ghm-header {
    background-color: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 10000;
    padding-block: var(--spacing-md);
}

.ghm-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
}

@keyframes ghm-flicker {
    0%, 92%, 100% {
        opacity: 1;
        text-shadow: 0 0 18px rgba(86, 173, 191, 0.5);
    }
    93% { opacity: 0.75; text-shadow: none; }
    94% { opacity: 1;    text-shadow: 0 0 28px rgba(86, 173, 191, 0.8); }
    95% { opacity: 0.82; text-shadow: none; }
    96% { opacity: 1;    text-shadow: 0 0 18px rgba(86, 173, 191, 0.5); }
}

.ghm-logo {
    font-family: var(--font-horror);
    font-size: 1.75rem;
    color: var(--color-ghost-white);
    text-decoration: none;
    letter-spacing: 0.05em;
    animation: ghm-flicker 9s ease-in-out infinite;
}

/* ---------- Navigation ---------- */
.ghm-nav__list {
    list-style: none;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

/* wp_nav_menu nests links inside <li> */
.ghm-nav__list li {
    display: flex;
}

.ghm-nav a,
.ghm-nav__list a {
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.95rem;
    letter-spacing: 0.03em;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    transition: color var(--transition), background-color var(--transition);
}

.ghm-nav a:hover,
.ghm-nav__list a:hover,
.ghm-nav a[aria-current="page"],
.ghm-nav__list .current-menu-item > a {
    color: var(--color-ghost-white);
    background-color: var(--color-bg-elevated);
    opacity: 1;
}

/* ---------- Cards (index.php fallback) ---------- */
.ghm-card {
    background-color: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.ghm-card:hover {
    border-color: var(--color-accent);
    box-shadow: 0 4px 24px rgba(86, 173, 191, 0.15), 0 2px 8px rgba(0, 0, 0, 0.4);
}

.ghm-card__header {
    margin-bottom: var(--spacing-sm);
}

.ghm-card__title {
    font-size: 1.2rem;
    font-weight: 700;
}

.ghm-card__title a {
    color: var(--color-ghost-white);
    text-decoration: none;
}

.ghm-card__title a:hover {
    text-decoration: underline;
    opacity: 1;
}

.ghm-card__excerpt {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    line-height: 1.6;
}

.ghm-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-lg);
    margin-block: var(--spacing-lg);
}

/* ---------- Page template ---------- */
.ghm-page-header {
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--color-border);
}

.ghm-page-content {
    max-width: 780px;
}

/* ---------- Buttons (single source of truth) ---------- */
.ghm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    background-color: var(--color-ghost-white);
    color: var(--color-bg);
    border: 2px solid var(--color-ghost-white);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.625rem 1.5rem;
    cursor: pointer;
    text-decoration: none;
    transition: background-color var(--transition), color var(--transition), border-color var(--transition);
    white-space: nowrap;
}

.ghm-btn:hover {
    background-color: var(--color-accent);
    color: var(--color-ghost-white);
    border-color: var(--color-accent);
    box-shadow: 0 0 20px rgba(86, 173, 191, 0.4);
    opacity: 1;
}

.ghm-btn--outline {
    background-color: transparent;
    color: var(--color-ghost-white);
}

.ghm-btn--outline:hover {
    background-color: var(--color-accent);
    color: var(--color-ghost-white);
    border-color: var(--color-accent);
    box-shadow: 0 0 20px rgba(86, 173, 191, 0.4);
}

.ghm-btn--ghost {
    background-color: transparent;
    color: var(--color-text-muted);
    border-color: var(--color-border);
}

.ghm-btn--ghost:hover {
    color: var(--color-ghost-white);
    border-color: var(--color-accent);
    background-color: transparent;
}

.ghm-btn--sm {
    font-size: 0.82rem;
    padding: 0.4rem 1rem;
}

.ghm-btn--lg {
    font-size: 1rem;
    padding: 0.75rem 1.75rem;
}

/* ---------- Header user nav ---------- */
.ghm-header__nav-group {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.ghm-nav--user {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

/* ---------- Footer ---------- */
.ghm-footer {
    background-color: var(--color-bg-surface);
    border-top: 1px solid var(--color-border);
    padding-block: var(--spacing-lg);
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

/* ---------- Utility ---------- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ================================================================
   HOMEPAGE
   ================================================================ */

/* ---------- Hero ---------- */
.ghm-home-hero {
    text-align: center;
    padding-block: calc(var(--spacing-xl) * 2) calc(var(--spacing-xl) * 1.5);
    position: relative;
    overflow: hidden;
    background: var(--color-bg);
}

/* Globo di sfondo nell'hero */
#ghm-hero-globe {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: max(100%, 100vh);
    height: max(100%, 100vh);
    pointer-events: none;
    z-index: 0;
    opacity: 0.7;
}

/* Overlay sfumato per leggibilità del testo */
.ghm-home-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 50% 50%, transparent 30%, rgba(0,0,0,0.55) 70%),
        linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, transparent 40%, transparent 60%, rgba(0,0,0,0.4) 100%);
    pointer-events: none;
    z-index: 1;
}

.ghm-home-hero__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
    position: relative;
    z-index: 2;
}

.ghm-home-hero__eyebrow {
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.ghm-home-hero .ghm-title-horror {
    font-size: clamp(3rem, 10vw, 7rem);
    margin-bottom: var(--spacing-sm);
    animation: ghm-title-pulse 6s ease-in-out infinite;
}

@keyframes ghm-title-pulse {
    0%, 100% { text-shadow: 0 4px 16px rgba(86, 173, 191, 0.35), 0 0 60px rgba(86, 173, 191, 0.15), 0 2px 4px rgba(0,0,0,0.8); }
    50%       { text-shadow: 0 4px 24px rgba(86, 173, 191, 0.55), 0 0 90px rgba(86, 173, 191, 0.25), 0 2px 4px rgba(0,0,0,0.8); }
}

.ghm-home-hero__sub {
    font-size: 1.15rem;
    color: var(--color-text-muted);
    max-width: 520px;
    line-height: 1.65;
}

.ghm-home-hero__cta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    justify-content: center;
    margin-top: var(--spacing-md);
}

/* ---------- Stats bar ---------- */
.ghm-home-statsbar {
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    background-color: var(--color-bg-surface);
    padding-block: var(--spacing-lg);
}

.ghm-home-statsbar__inner {
    display: flex;
    justify-content: center;
    gap: calc(var(--spacing-xl) * 1.5);
    flex-wrap: wrap;
}

.ghm-home-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.ghm-home-stat__number {
    font-size: 2.75rem;
    font-weight: 700;
    color: var(--color-ghost-white);
    font-family: var(--font-horror);
    line-height: 1;
}

.ghm-home-stat__label {
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

/* ---------- How it works ---------- */
.ghm-home-howto {
    border-bottom: 1px solid var(--color-border);
}

.ghm-home-howto__heading {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.ghm-home-howto__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-xl);
}

@media (max-width: 768px) {
    .ghm-home-howto__grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
}

.ghm-home-step {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.ghm-home-step__num {
    font-family: var(--font-horror);
    font-size: 3rem;
    color: var(--color-bg-elevated);
    line-height: 1;
    user-select: none;
}

.ghm-home-step__title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-ghost-white);
}

.ghm-home-step__desc {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    line-height: 1.7;
}

/* ---------- Homepage search ---------- */
.ghm-home-search {
    padding-block: var(--spacing-xl);
    border-bottom: 1px solid var(--color-border);
}

.ghm-home-search__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
}

.ghm-home-search__label {
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.ghm-home-search__form {
    display: flex;
    gap: var(--spacing-sm);
    width: 100%;
    max-width: 600px;
}

.ghm-home-search__input {
    flex: 1;
    background-color: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: 1rem;
    padding: 0.65rem 1rem;
    outline: none;
    transition: border-color var(--transition);
    font-family: var(--font-body);
}

.ghm-home-search__input::placeholder {
    color: var(--color-text-muted);
}

.ghm-home-search__input:focus {
    border-color: var(--color-accent);
}

@media (max-width: 480px) {
    .ghm-home-search__form {
        flex-direction: column;
    }
}

/* ---------- Map preview ---------- */
.ghm-home-map-section {
    padding-block: 0;
    background-color: var(--color-bg-surface);
    border-bottom: 1px solid var(--color-border);
}

.ghm-home-map-preview {
    position: relative;
    width: 100%;
    height: 650px;
    overflow: hidden;
}

/* Stretch the shortcode's map-wrap to fill the preview container */
.ghm-home-map-preview .ghm-map-wrap {
    height: 1050px;
    padding-inline: 0;
    padding-bottom: 0;
    gap: 0;
}

.ghm-home-map-preview #ghm-map {
    width: 100% !important;
    max-width: none !important;
    aspect-ratio: unset !important;
    height: 1050px !important;
    margin: 0;
}

/* Hide filter panel on homepage preview */
.ghm-home-map-preview .ghm-map-filters {
    display: none;
}

/* Bottom gradient + CTA overlay */
.ghm-home-map-preview__overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to top, var(--color-bg-surface) 0%, transparent 100%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: var(--spacing-md);
    pointer-events: none;
    z-index: 9999;
}

.ghm-home-map-preview__overlay .ghm-btn {
    pointer-events: auto;
}

.ghm-home-map-caption {
    margin-top: var(--spacing-md);
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-align: center;
    letter-spacing: 0.03em;
}

/* ---------- Latest teams ---------- */
.ghm-home-latest {
    border-bottom: 1px solid var(--color-border);
}

.ghm-home-latest__heading {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.ghm-home-latest__more {
    text-align: center;
    margin-top: var(--spacing-lg);
}

/* Latest cards — 3-column grid */
.ghm-latest-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.ghm-latest-card {
    background-color: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.ghm-latest-card:hover {
    border-color: var(--color-accent);
    box-shadow: 0 8px 32px rgba(86, 173, 191, 0.18), 0 2px 8px rgba(0, 0, 0, 0.4);
    transform: translateY(-3px);
}

/* Media area with image */
.ghm-latest-card__media {
    display: block;
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background-color: var(--color-bg-elevated);
    text-decoration: none;
}

.ghm-latest-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.ghm-latest-card:hover .ghm-latest-card__img {
    transform: scale(1.06);
}

/* Ghost placeholder when no image */
.ghm-latest-card__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-bg-elevated) 0%, #1a0a12 100%);
}

/* Country badge overlaid on image */
.ghm-latest-card__badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    background-color: var(--color-accent);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    padding: 3px 8px;
    border-radius: 3px;
    line-height: 1.5;
    white-space: nowrap;
    max-width: calc(100% - 20px);
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Card body */
.ghm-latest-card__body {
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.ghm-latest-card__location {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-accent);
    letter-spacing: 0.03em;
    margin: 0;
}

.ghm-latest-card__title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
}

.ghm-latest-card__title a {
    color: var(--color-ghost-white);
    text-decoration: none;
}

.ghm-latest-card__title a:hover {
    color: var(--color-accent);
    opacity: 1;
}

.ghm-latest-card__founded {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin: 0;
}

.ghm-latest-card__excerpt {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    line-height: 1.55;
    margin: 0;
}

@media (max-width: 768px) {
    .ghm-latest-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .ghm-latest-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- Final CTA banner ---------- */
.ghm-home-cta-banner {
    padding-block: calc(var(--spacing-xl) * 1.5);
    text-align: center;
    background: radial-gradient(ellipse at 50% 100%, rgba(86, 173, 191, 0.08) 0%, transparent 70%);
}

.ghm-home-cta-banner__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
}

.ghm-home-cta-banner__title {
    font-size: clamp(1.75rem, 4vw, 3rem);
    color: var(--color-ghost-white);
}

.ghm-home-cta-banner__sub {
    font-size: 1rem;
    color: var(--color-text-muted);
    max-width: 420px;
    line-height: 1.65;
}
