/*
 * Frisbeegolfopas Component Library
 * Lightweight utility classes for Gutenberg HTML blocks.
 * Prefix: fgo-  |  Version: 1.0
 */

/* === TOKENS === */
:root {
    --fgo-primary: #f4d430;
    --fgo-primary-hover: #e6c520;
    --fgo-gold: #d4a017;
    --fgo-gold-dark: #b8860b;
    --fgo-black: #0a0a0a;
    --fgo-dark: #111111;
    --fgo-text: #1a1a1a;
    --fgo-muted: #6b7280;
    --fgo-white: #ffffff;
    --fgo-light: #fafaf8;
    --fgo-gray: #f3f4f6;
    --fgo-border: #e5e7eb;
    --fgo-radius: 10px;
    --fgo-radius-sm: 6px;
    --fgo-shadow: 0 1px 3px rgba(0,0,0,0.06);
    --fgo-shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --fgo-green: #16a34a;
    --fgo-green-bg: #f0fdf4;
    --fgo-red: #dc2626;
    --fgo-red-bg: #fef2f2;
    --fgo-blue: #2563eb;
    --fgo-blue-bg: #eff6ff;
    --fgo-amber: #d97706;
    --fgo-amber-bg: #fffbeb;
}

/* === SPACING === */
.fgo-section { margin: 2.5rem 0; }
.fgo-section:first-child { margin-top: 0; }

/* === TYPOGRAPHY === */
.fgo-lead { font-size: 1.1875rem; line-height: 1.7; color: var(--fgo-muted); max-width: 640px; }
.fgo-small { font-size: 0.8125rem; }
.fgo-muted { color: var(--fgo-muted); }

/* === BUTTONS === */
.fgo-btn { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.75rem 1.5rem; background: var(--fgo-primary); color: var(--fgo-black); font-size: 0.9375rem; font-weight: 700; border-radius: 50px; border: 2px solid transparent; text-decoration: none; cursor: pointer; transition: background 0.15s, transform 0.1s, box-shadow 0.15s; line-height: 1.4; }
.fgo-btn:hover { background: var(--fgo-primary-hover); transform: translateY(-1px); box-shadow: var(--fgo-shadow-md); }
.fgo-btn-outline { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.75rem 1.5rem; background: transparent; color: var(--fgo-text); font-size: 0.9375rem; font-weight: 600; border-radius: 50px; border: 2px solid var(--fgo-border); text-decoration: none; cursor: pointer; transition: border-color 0.15s, color 0.15s; }
.fgo-btn-outline:hover { border-color: var(--fgo-primary); color: var(--fgo-gold-dark); }
.fgo-btn-sm { padding: 0.4375rem 1rem; font-size: 0.8125rem; }

/* === BADGES === */
.fgo-badge { display: inline-block; padding: 0.1875rem 0.625rem; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; border-radius: 4px; border: 1.5px solid var(--fgo-border); color: var(--fgo-muted); vertical-align: middle; }
.fgo-badge-gold { border-color: var(--fgo-primary); color: var(--fgo-gold-dark); background: rgba(244,212,48,0.08); }

/* === CARDS === */
.fgo-card-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.fgo-card { background: var(--fgo-white); border: 1px solid var(--fgo-border); border-radius: var(--fgo-radius); padding: 1.5rem; box-shadow: var(--fgo-shadow); transition: box-shadow 0.2s, transform 0.2s; }
.fgo-card:hover { box-shadow: var(--fgo-shadow-md); transform: translateY(-2px); }
.fgo-card h3, .fgo-card h4 { margin: 0 0 0.5rem; font-size: 1.0625rem; font-weight: 700; color: var(--fgo-black); line-height: 1.3; }
.fgo-card p { margin: 0; font-size: 0.9375rem; color: var(--fgo-muted); line-height: 1.6; }
@media (min-width: 640px) { .fgo-card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .fgo-card-grid { grid-template-columns: repeat(3, 1fr); } .fgo-card-grid.fgo-cols-2 { grid-template-columns: repeat(2, 1fr); } }

/* === STATS === */
.fgo-stats { display: flex; flex-wrap: wrap; gap: 1rem; }
.fgo-stat { flex: 1 1 120px; background: var(--fgo-white); border: 1px solid var(--fgo-border); border-radius: var(--fgo-radius); padding: 1.25rem; text-align: center; box-shadow: var(--fgo-shadow); }
.fgo-stat strong { display: block; font-size: 1.75rem; font-weight: 700; color: var(--fgo-gold-dark); line-height: 1.1; }
.fgo-stat span { display: block; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--fgo-muted); margin-top: 0.25rem; }

/* === TABLES === */
.fgo-table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; background: var(--fgo-white); border: 1px solid var(--fgo-border); border-radius: var(--fgo-radius); overflow: hidden; }
.fgo-table th, .fgo-table td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--fgo-border); }
.fgo-table th { background: var(--fgo-black); color: var(--fgo-white); font-size: 0.8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.fgo-table tbody tr:nth-child(even) { background: var(--fgo-gray); }
.fgo-table tbody tr:hover { background: rgba(244,212,48,0.06); }
.fgo-table tbody tr:last-child td { border-bottom: none; }
.fgo-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--fgo-radius); }
.fgo-compare { text-align: center; }
.fgo-compare td:first-child { text-align: left; font-weight: 600; }
.fgo-winner { color: var(--fgo-green); font-weight: 700; }

/* === CALLOUTS === */
.fgo-callout { padding: 1rem 1.25rem; border-radius: var(--fgo-radius-sm); border-left: 4px solid var(--fgo-blue); background: var(--fgo-blue-bg); font-size: 0.9375rem; line-height: 1.6; color: var(--fgo-text); }
.fgo-callout strong { display: block; margin-bottom: 0.25rem; font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.04em; }
.fgo-callout p { margin: 0; }
.fgo-callout-tip { border-left-color: var(--fgo-green); background: var(--fgo-green-bg); }
.fgo-callout-warning { border-left-color: var(--fgo-amber); background: var(--fgo-amber-bg); }

/* === PRO / CON LISTS === */
.fgo-pros, .fgo-cons { list-style: none; padding: 1rem 1.25rem; margin: 0; border-radius: var(--fgo-radius-sm); font-size: 0.9375rem; line-height: 1.7; }
.fgo-pros { background: var(--fgo-green-bg); }
.fgo-cons { background: var(--fgo-red-bg); }
.fgo-pros li, .fgo-cons li { padding-left: 1.5rem; position: relative; margin-bottom: 0.25rem; }
.fgo-pros li::before, .fgo-cons li::before { position: absolute; left: 0; font-weight: 700; font-size: 1rem; }
.fgo-pros li::before { content: '+'; color: var(--fgo-green); }
.fgo-cons li::before { content: '\2212'; color: var(--fgo-red); }

/* === HERO STAT CARDS === */
.fgo-hero-stats { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.fgo-hero-stat { background: var(--fgo-black); color: #fff; border-radius: var(--fgo-radius); padding: 1.5rem; text-align: center; position: relative; overflow: hidden; }
.fgo-hero-stat::before { content: ''; position: absolute; top: -40px; right: -40px; width: 120px; height: 120px; background: radial-gradient(circle, rgba(244,212,48,0.1) 0%, transparent 70%); pointer-events: none; }
.fgo-hero-stat__label { font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px; color: rgba(255,255,255,0.4); margin-bottom: 0.5rem; }
.fgo-hero-stat__number { font-size: 2.5rem; font-weight: 700; color: var(--fgo-primary); line-height: 1; letter-spacing: -0.02em; }
.fgo-hero-stat__sub { font-size: 0.8125rem; color: rgba(255,255,255,0.5); margin-top: 0.375rem; }
.fgo-hero-stat__trend { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.75rem; font-weight: 600; margin-top: 0.5rem; padding: 0.1875rem 0.5rem; border-radius: 50px; }
.fgo-hero-stat__trend--up { background: rgba(22,163,74,0.15); color: #4ade80; }
.fgo-hero-stat__trend--down { background: rgba(220,38,38,0.15); color: #f87171; }
@media (min-width: 640px) { .fgo-hero-stats { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .fgo-hero-stats { grid-template-columns: repeat(4, 1fr); } .fgo-hero-stats.fgo-cols-3 { grid-template-columns: repeat(3, 1fr); } }

/* === HORIZONTAL BAR CHART === */
.fgo-bar-chart { display: flex; flex-direction: column; gap: 0.5rem; }
.fgo-bar-chart__row { display: flex; align-items: center; gap: 0.75rem; }
.fgo-bar-chart__label { min-width: 3rem; font-size: 0.8125rem; font-weight: 600; color: var(--fgo-text); text-align: right; flex-shrink: 0; }
.fgo-bar-chart__track { flex: 1; height: 28px; background: var(--fgo-gray); border-radius: 4px; overflow: hidden; position: relative; }
.fgo-bar-chart__fill { height: 100%; background: var(--fgo-primary); border-radius: 4px; display: flex; align-items: center; justify-content: flex-end; padding-right: 0.5rem; font-size: 0.75rem; font-weight: 700; color: var(--fgo-black); min-width: fit-content; transition: width 0.6s ease; }
.fgo-bar-chart__fill--alt { background: var(--fgo-gold); }
.fgo-bar-chart__fill--dark { background: var(--fgo-black); color: #fff; }
.fgo-bar-chart__value { min-width: 3.5rem; font-size: 0.8125rem; font-weight: 600; color: var(--fgo-muted); text-align: left; flex-shrink: 0; }
.fgo-bar-chart__row--highlight .fgo-bar-chart__label { color: var(--fgo-gold-dark); }
.fgo-bar-chart__row--highlight .fgo-bar-chart__value { color: var(--fgo-gold-dark); font-weight: 700; }

/* === STACKED BAR === */
.fgo-stacked-bar { display: flex; height: 40px; border-radius: var(--fgo-radius-sm); overflow: hidden; background: var(--fgo-gray); }
.fgo-stacked-bar__seg { display: flex; align-items: center; justify-content: center; font-size: 0.6875rem; font-weight: 700; white-space: nowrap; padding: 0 0.5rem; transition: width 0.6s ease; }
.fgo-stacked-legend { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; margin-top: 0.75rem; }
.fgo-stacked-legend__item { display: flex; align-items: center; gap: 0.375rem; font-size: 0.8125rem; color: var(--fgo-muted); }
.fgo-stacked-legend__dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }

/* === RANKING LIST === */
.fgo-ranking { display: flex; flex-direction: column; gap: 0; background: var(--fgo-white); border: 1px solid var(--fgo-border); border-radius: var(--fgo-radius); overflow: hidden; }
.fgo-ranking__item { display: flex; align-items: center; gap: 1rem; padding: 0.875rem 1.25rem; border-bottom: 1px solid var(--fgo-border); transition: background 0.15s; }
.fgo-ranking__item:last-child { border-bottom: none; }
.fgo-ranking__item:hover { background: var(--fgo-gray); }
.fgo-ranking__item--highlight { background: rgba(244,212,48,0.06); border-left: 3px solid var(--fgo-primary); }
.fgo-ranking__pos { min-width: 2rem; font-size: 1.25rem; font-weight: 700; color: var(--fgo-muted); text-align: center; flex-shrink: 0; }
.fgo-ranking__item--highlight .fgo-ranking__pos { color: var(--fgo-gold-dark); }
.fgo-ranking__body { flex: 1; min-width: 0; }
.fgo-ranking__name { font-size: 0.9375rem; font-weight: 600; color: var(--fgo-text); }
.fgo-ranking__meta { font-size: 0.75rem; color: var(--fgo-muted); }
.fgo-ranking__badge { font-size: 0.8125rem; font-weight: 700; color: var(--fgo-gold-dark); flex-shrink: 0; }

/* === DATA CARDS === */
.fgo-data-card { background: var(--fgo-white); border: 1px solid var(--fgo-border); border-left: 4px solid var(--fgo-primary); border-radius: 0 var(--fgo-radius-sm) var(--fgo-radius-sm) 0; padding: 1.25rem 1.5rem; box-shadow: var(--fgo-shadow); }
.fgo-data-card__title { font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px; color: var(--fgo-muted); margin-bottom: 0.25rem; }
.fgo-data-card__value { font-size: 1.75rem; font-weight: 700; color: var(--fgo-text); line-height: 1.1; }
.fgo-data-card__desc { font-size: 0.8125rem; color: var(--fgo-muted); margin-top: 0.25rem; }
.fgo-data-cards { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 640px) { .fgo-data-cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .fgo-data-cards { grid-template-columns: repeat(3, 1fr); } }

/* === YEAR-OVER-YEAR TABLE === */
.fgo-yoy-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; background: var(--fgo-white); border: 1px solid var(--fgo-border); border-radius: var(--fgo-radius); overflow: hidden; }
.fgo-yoy-table th { background: var(--fgo-black); color: #fff; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; padding: 0.625rem 0.75rem; text-align: left; }
.fgo-yoy-table td { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--fgo-border); }
.fgo-yoy-table tbody tr:nth-child(even) { background: var(--fgo-gray); }
.fgo-yoy-table tbody tr:last-child td { border-bottom: none; }
.fgo-yoy-table .fgo-change-up { color: var(--fgo-green); font-weight: 600; font-size: 0.75rem; }
.fgo-yoy-table .fgo-change-down { color: var(--fgo-red); font-weight: 600; font-size: 0.75rem; }
.fgo-yoy-table .fgo-peak { background: rgba(244,212,48,0.1); font-weight: 700; }

@media (max-width: 639px) {
    .fgo-yoy-table thead { display: none; }
    .fgo-yoy-table, .fgo-yoy-table tbody, .fgo-yoy-table tr, .fgo-yoy-table td { display: block; width: 100%; }
    .fgo-yoy-table tbody tr { padding: 0.75rem 1rem; border-bottom: 1px solid var(--fgo-border); position: relative; }
    .fgo-yoy-table tbody tr:last-child { border-bottom: none; }
    .fgo-yoy-table td { display: flex; justify-content: space-between; align-items: center; padding: 0.1875rem 0; border-bottom: none; font-size: 0.8125rem; }
    .fgo-yoy-table td::before { content: attr(data-label); font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--fgo-muted); flex-shrink: 0; margin-right: 1rem; }
    .fgo-yoy-table td:first-child { font-size: 0.9375rem; font-weight: 700; color: var(--fgo-text); padding-bottom: 0.375rem; margin-bottom: 0.25rem; border-bottom: 1px solid var(--fgo-border); }
    .fgo-yoy-table td:first-child::before { display: none; }
    .fgo-yoy-table .fgo-peak { border-left: 3px solid var(--fgo-primary); }
}

/* === PLAYER PROFILES === */
.fgo-player {
    background: var(--fgo-white);
    border: 1px solid var(--fgo-border);
    border-radius: var(--fgo-radius);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--fgo-shadow);
    position: relative;
    transition: box-shadow 0.2s;
}
.fgo-player:hover {
    box-shadow: var(--fgo-shadow-md);
}
.fgo-player-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.fgo-player-rank {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--fgo-black);
    color: var(--fgo-primary);
    font-size: 1.125rem;
    font-weight: 700;
    border-radius: 50%;
    flex-shrink: 0;
}
.fgo-player-rank--gold {
    background: var(--fgo-primary);
    color: var(--fgo-black);
}
.fgo-player-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--fgo-black);
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.3;
}
.fgo-player-meta {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}
.fgo-player-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--fgo-muted);
    background: var(--fgo-gray);
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
}
.fgo-player-meta-item strong {
    color: var(--fgo-text);
}
.fgo-player-body p {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--fgo-text);
    margin-bottom: 0.75rem;
}
.fgo-player-body p:last-child {
    margin-bottom: 0;
}
.fgo-player-achievements {
    list-style: none;
    padding: 0 !important;
    margin: 0.75rem 0 0 !important;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.fgo-player-achievements li {
    display: inline-block;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    background: rgba(244,212,48,0.1);
    border: 1px solid rgba(244,212,48,0.3);
    border-radius: 20px;
    color: var(--fgo-gold-dark);
    margin: 0;
}

/* === HIGHLIGHT BOX === */
.fgo-highlight {
    background: linear-gradient(135deg, rgba(244,212,48,0.08), rgba(244,212,48,0.02));
    border: 1px solid rgba(244,212,48,0.25);
    border-radius: var(--fgo-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}
.fgo-highlight strong {
    font-size: 1.5rem;
    color: var(--fgo-gold-dark);
    display: block;
    margin-bottom: 0.25rem;
}
.fgo-highlight span {
    font-size: 0.9375rem;
    color: var(--fgo-muted);
}

/* === PLAYER RESPONSIVE === */
@media (max-width: 640px) {
    .fgo-player-header { gap: 0.75rem; }
    .fgo-player-name { font-size: 1.1rem; }
    .fgo-highlight strong { font-size: 1.25rem; }
}
/* === RESPONSIVE TABLES (global) === */
.fgo-table th,
.fgo-table td {
    white-space: nowrap;
}
.fgo-table-wrap {
    margin-bottom: 1.25rem;
}
/* Wrap any table inside article/content in a scrollable container */
.entry-content table:not(.fgo-table) {
    width: 100%;
    border-collapse: collapse;
}
.entry-content table:not(.fgo-table) th,
.entry-content table:not(.fgo-table) td {
    white-space: nowrap;
}
@media (max-width: 768px) {
    .fgo-table-wrap {
        margin-left: -1rem;
        margin-right: -1rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .fgo-table {
        min-width: 600px;
    }
    .fgo-table th,
    .fgo-table td {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }
}