/* Custom Styles */
:root {
    --custom-primary: #112a41;
    --custom-secondary: #e6eaf4;
    --custom-tertiary: #0a1928;
    --custom-primary-transparent: rgba(17, 42, 65, 0.8);

    /* Accent colors from VM 2026-logon */
    --custom-accent-red: #db2022;
    --custom-accent-red-dark: #b21a1c;
    --custom-accent-green: #1c825d;
    --custom-accent-green-dark: #145e44;
}

/* Global Styles */
body {
    font-family: 'Barlow', sans-serif;
    margin: 0;
    padding: 0;
}

a,
a:visited {
    color: var(--custom-primary);
}

a:hover,
a:focus,
a:active {
    color: var(--custom-tertiary);
}

:root {
    --bs-focus-ring-color: transparent;
    --bs-focus-ring-shadow: none;    
}

.btn:focus,
.form-control:focus,
.form-select:focus,
.form-check-input:focus,
.form-range:focus,
.input-group-text:focus {
    outline: 0 !important;
    box-shadow: none !important;
    border-color: var(--bs-border-color) !important;
}

/* Keyboard-only focus ring: restored after Bootstrap's default ring is removed.
   Uses :focus-visible so the ring only appears on tab-navigation, not on mouse clicks. */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.nav-link:focus-visible,
.dropdown-item:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
.form-check-input:focus-visible,
.accordion-button:focus-visible,
[role="button"]:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--custom-accent-red) !important;
    outline-offset: 2px !important;
    box-shadow: none !important;
}

/* Skip-link — visually hidden until focused via tab key. */
.skip-link {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2000;
    background: var(--custom-primary);
    color: var(--custom-secondary);
    padding: 0.6rem 1rem;
    border-radius: 0 0 0.25rem 0;
    text-decoration: none;
    font-weight: 600;
}
.skip-link:not(:focus):not(:focus-visible) {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
}
.skip-link:focus,
.skip-link:focus-visible {
    color: var(--custom-secondary);
}

/* Remove default <main> focus outline when programmatically focused (skip-link target). */
main:focus { outline: none; }

.grecaptcha-badge { visibility: hidden !important; }

/* Cookie Banner */
.cookie-banner {
    z-index: 1050;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.cookie-banner.show {
    display: flex !important;
}

/* Header Styles */
.navbar {
    background-color: white;
    padding: 1rem 0;
}

.navbar-brand {
    display: inline-flex;
    align-items: center;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
}

.navbar-brand img {
    height: 45px;
    display: block;
}

.navbar-nav .nav-link {
    color: #333;
    font-weight: 600;
    margin: 0 1rem;
    text-transform: uppercase;
    font-size: 14px;
}

.navbar-nav .nav-link:hover {
    color: var(--custom-primary);
}

.navbar-nav .nav-link.active {
    color: var(--custom-primary);
    font-weight: 600;
}

/* Navbar dropdowns — match site dropdown language (primary bg, secondary text). */
.navbar-nav .dropdown-toggle::after {
    margin-left: 0.4em;
    vertical-align: 0.15em;
    opacity: 0.7;
}

.navbar-nav .dropdown-toggle:hover::after,
.navbar-nav .dropdown-toggle.show::after {
    opacity: 1;
}

.navbar-nav .dropdown-menu {
    background-color: var(--custom-primary);
    border: 0;
    border-radius: 12px;
    margin-top: 0.5rem;
    padding: 0.35rem 0;
    min-width: 12rem;
    box-shadow: 0 8px 24px rgba(17, 42, 65, 0.22);
}

.navbar-nav .dropdown-item {
    color: var(--custom-secondary);
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.navbar-nav .dropdown-item:hover,
.navbar-nav .dropdown-item:focus {
    background-color: var(--custom-tertiary);
    color: #fff;
}

.navbar-nav .dropdown-item.active,
.navbar-nav .dropdown-item:active {
    background-color: var(--custom-tertiary);
    color: #fff;
    font-weight: 600;
}

/* Collapsed mobile view — let the dropdown panel sit inline like a submenu. */
@media (max-width: 991.98px) {
    .navbar-nav .dropdown-menu {
        box-shadow: none;
        margin: 0.25rem 0 0.5rem;
        padding: 0.25rem 0;
    }
    .navbar-nav .dropdown-item {
        padding-left: 2rem;
    }
}

.search-icon {
    font-size: 20px;
    color: #333;
    cursor: pointer;
    background-color: #f5f5fa;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-icon:hover {
    background-color: #e9e9ef;
}

.navbar button.navbar-toggler {
    border: 0 !important;
}

.navbar button.navbar-toggler:focus {
    box-shadow: none !important;
}

.navbar button.navbar-toggler:hover {
    color: var(--custom-primary) !important;
    box-shadow: none !important;
}

.navbar button.navbar-toggler span {
    width: 30px;
    height: 30px;
    padding: 1px 0 0 0;
    margin: 0;
}

.navbar button.navbar-toggler span.menu-close {
    display: inline-block;
}

.navbar button.navbar-toggler span.menu-open {
    display: none;
}    

.navbar button.navbar-toggler.open span.menu-close {
    display: none;
}

.navbar button.navbar-toggler.open span.menu-open {
    display: inline-block;
} 


/* Hero Section */
.hero-section {
    background-image: url('../images/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: white;
    padding: 80px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 650px;
    display: flex;
    align-items: center;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--custom-primary-transparent);
    z-index: 1;
}

/* Tunn flagg-stripe längst ner i hero (Mexikos flaggas röd-vit-grön) */
.hero-section::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 4px;
    background: linear-gradient(90deg,
        var(--custom-accent-green) 0%,
        var(--custom-accent-green) 33.33%,
        #ffffff 33.33%,
        #ffffff 66.66%,
        var(--custom-accent-red) 66.66%,
        var(--custom-accent-red) 100%);
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    color: rgba(255, 255, 255, 0.92);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.hero-pill-line {
    display: inline-block;
    width: 32px;
    height: 1px;
    background: rgba(255, 255, 255, 0.55);
}

.hero-divider {
    display: block;
    width: 64px;
    height: 4px;
    margin: 0 auto 1.75rem;
    border-radius: 2px;
    background: linear-gradient(90deg,
        var(--custom-accent-green) 0%,
        var(--custom-accent-green) 33.33%,
        #ffffff 33.33%,
        #ffffff 66.66%,
        var(--custom-accent-red) 66.66%,
        var(--custom-accent-red) 100%);
}

.hero-buttons .btn {
    margin: 0 0.5rem;
    padding: 12px 30px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 25px;
    border: 2px solid var(--custom-secondary);
    background-color: transparent;
    color: var(--custom-secondary);
    text-decoration: none;
    display: inline-block;
    transition: background-color 200ms ease-out, color 200ms ease-out, transform 200ms ease-out;
}

.hero-buttons .btn:hover {
    background-color: var(--custom-secondary);
    color: var(--custom-primary);
}

/* Stats counter section */
.stats-counter {
    padding: 3.5rem 0;
    border-bottom: 1px solid #e1e0e7;
}

.stats-counter .stat-num {
    font-size: clamp(2.75rem, 7vw, 4.5rem);
    font-weight: 800;
    line-height: 1;
    color: var(--custom-primary);
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.stats-counter .stat-label {
    margin-top: 0.5rem;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: #6c757d;
}

/* Section eyebrows — small uppercase tagline above each h2 */
.section-eyebrow {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--custom-primary);
    margin-bottom: 0.5rem;
    position: relative;
    padding-left: 1.5rem;
}

.section-eyebrow::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 1rem;
    height: 2px;
    background: currentColor;
    transform: translateY(-50%);
}

/* Custom button colors */
.btn-primary {
    background-color: var(--custom-primary) !important;
    border-color: var(--custom-primary) !important;
    color: var(--custom-secondary) !important;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--custom-secondary) !important;
    border-color: var(--custom-secondary) !important;
    color: var(--custom-primary) !important;
}

.bg-primary {
    background-color: var(--custom-primary) !important;
}

.text-primary {
    color: var(--custom-primary);
}

.bg-secondary {
    background-color: var(--custom-secondary) !important;
}

.text-secondary {
    color: var(--custom-secondary) !important;
}

/* Accent text helpers */
.text-accent-red {
    color: var(--custom-accent-red) !important;
}

.text-accent-green {
    color: var(--custom-accent-green) !important;
}

.btn-outline-primary {
    border: 2px solid var(--custom-primary) !important;
    background-color: transparent !important;
    color: var(--custom-primary) !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
    border: 2px solid var(--custom-primary) !important;
    background-color: var(--custom-primary) !important;
    color: var(--custom-secondary) !important;
}

.btn-outline-secondary {
    border: 2px solid var(--custom-secondary) !important;
    background-color: transparent !important;
    color: var(--custom-secondary) !important;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-outline-secondary:active {
    border: 2px solid var(--custom-secondary) !important;
    background-color: var(--custom-secondary) !important;
    color: var(--custom-primary) !important;
}

/* Custom button group */
.btn-group button.btn,
.btn-group button.btn.dropdown-toggle {
    background-color: var(--custom-primary);
    color: var(--custom-secondary);
    border-color: var(--custom-primary);
    border-radius: 50px;
}

.btn-group button.btn:hover,
.btn-group button.btn:focus,
.btn-group button.btn:active,
.btn-group button.btn.dropdown-toggle:hover,
.btn-group button.btn.dropdown-toggle:focus {
    background-color: var(--custom-tertiary);
    color: var(--custom-secondary);
    border-color: var(--custom-tertiary);
}

.btn-group ul {
    background-color: var(--custom-primary);
}

.btn-group ul li a {
    background-color: var(--custom-primary);
    color: var(--custom-secondary);
}

.btn-group ul li a:hover,
.btn-group ul li a:focus {
    background-color: var(--custom-tertiary);
    color: var(--custom-secondary);
}

/* Sub navbar */
.sub-navbar.nav-pills .nav-link {
    color: var(--custom-primary);
    border-radius: 30px;
    border: 2px solid var(--custom-primary);
    padding: 0.25rem 0.75rem 0.35rem 0.75rem;
    font-weight: 600 !important;
}

.sub-navbar.nav-pills .nav-link:hover {
    color: var(--custom-secondary);
    background-color: var(--custom-primary);
}

.sub-navbar.nav-pills .nav-link.active {
    color: var(--custom-secondary);
    background-color: var(--custom-primary);
}

/* Table */
table thead tr.table-custom,
table thead tr.table-custom th {
    background-color: var(--custom-primary) !important;
    color: var(--custom-secondary) !important;
}

/* Home Articles */
.articles .card-img-top {
    height: 200px;
    object-fit: cover;
}

/* Huvudartikel — bild som bakgrund med rubrik + ingress överlagrad */
.article-main {
    position: relative;
    min-height: 480px;
}

.article-main-link {
    position: relative;
}

.article-main-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-main-link::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        rgba(17, 42, 65, 0.10) 0%,
        rgba(17, 42, 65, 0.55) 55%,
        rgba(17, 42, 65, 0.94) 100%);
    z-index: 1;
    pointer-events: none;
}

.article-main-content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 1.75rem 1.75rem 1.5rem;
    z-index: 2;
}

/* Tagga av topp-stripen och square aspect-ratio inom artikelsektionen
   så huvudartikeln kan fylla höjden och thumb-bilderna spänner hela kort­höjden. */
.articles .card::before { display: none; }

.articles .img-thumb {
    aspect-ratio: auto;
    height: 100%;
    width: 100%;
}

/* Match cards — sport-style polish with accent stripe + hover */
.card {
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    transition: border-color 200ms ease-out, box-shadow 200ms ease-out, transform 200ms ease-out;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--custom-primary);
    z-index: 1;
}

.card:hover {
    border-color: var(--custom-primary);
    box-shadow: 0 8px 22px rgba(17, 42, 65, 0.14);
    transform: translateY(-2px);
}

.card:hover::before {
    background: linear-gradient(90deg,
        var(--custom-accent-green) 0%,
        var(--custom-primary) 50%,
        var(--custom-accent-red) 100%);
}

@media (prefers-reduced-motion: reduce) {
    .card,
    .card:hover { transition: none; transform: none; }
}

/* CTA banner — top stripe (flagg-inspirerad) */
.cta-banner {
    position: relative;
    overflow: hidden;
}

.cta-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg,
        var(--custom-accent-green) 0%,
        var(--custom-accent-green) 33.33%,
        var(--custom-secondary) 33.33%,
        var(--custom-secondary) 66.66%,
        var(--custom-accent-red) 66.66%,
        var(--custom-accent-red) 100%);
}

/* Subtilt rutmönster i CTA-bannern */
.cta-banner::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.08) 1px, transparent 0);
    background-size: 24px 24px;
    pointer-events: none;
    z-index: 0;
}

.cta-banner > * { position: relative; z-index: 1; }

/* Article */
.article h1,
.article h2,
.article h3,
.article h4,
.article h5,
.article h6 {
    font-weight: 700;
}

.article strong {
    font-weight: 600;
}

/* Article body prose — applies to Markdown-rendered output inside <div class="content">. */
.article .content > h2 {
    font-size: 1.5rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.article .content > h3 {
    font-size: 1.2rem;
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
}

.article .content > p,
.article .content > ul,
.article .content > ol {
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 1.1rem;
}

.article .content > ul,
.article .content > ol {
    padding-left: 1.25rem;
}

.article .content > ul li,
.article .content > ol li {
    margin-bottom: 0.4rem;
}

/* Markdown tables — render with Bootstrap-table-style spacing, borders, and
   responsive horizontal scroll without the .table class. */
.article .content table {
    width: 100%;
    margin: 1.5rem 0;
    border-collapse: collapse;
    background-color: #fff;
    font-size: 0.95rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.375rem;
    overflow: hidden; /* clip border-radius corners on inner cells */
}

/* On narrow viewports turn the table into a horizontally scrollable block
   so wide schedules don't blow out the layout. */
@media (max-width: 768px) {
    .article .content table {
        display: block;
        overflow-x: auto;
        overflow-y: hidden;
        border-radius: 0.375rem;
    }
}

.article .content table thead {
    background-color: var(--custom-primary);
    color: var(--custom-secondary);
}

.article .content table thead th {
    padding: 0.75rem 1rem;
    font-weight: 600;
    text-align: left;
    border: none;
    white-space: nowrap;
}

.article .content table tbody td {
    padding: 0.65rem 1rem;
    vertical-align: top;
    border-top: 1px solid var(--bs-border-color);
}

.article .content table tbody tr:nth-child(odd) td {
    background-color: rgba(0, 0, 0, 0.025);
}

.article .content table tbody tr:hover td {
    background-color: rgba(17, 42, 65, 0.05);
}

.article .content table strong {
    font-weight: 700;
}

/* Inline code + blockquote inside articles. */
.article .content code {
    background: rgba(17, 42, 65, 0.07);
    color: var(--custom-tertiary);
    padding: 0.1rem 0.35rem;
    border-radius: 0.25rem;
    font-size: 0.9em;
}

.article .content blockquote {
    border-left: 4px solid var(--custom-accent-red);
    padding: 0.25rem 0 0.25rem 1rem;
    margin: 1.5rem 0;
    color: var(--custom-tertiary);
    font-style: italic;
}

.article .content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.375rem;
    margin: 1.25rem 0;
}

.img-thumb {
    object-fit: cover;
    aspect-ratio: 1/1;
    border-bottom-left-radius: var(--bs-card-border-radius);
    border-top-left-radius: var(--bs-card-border-radius);
}

/* Main Article */
.main-article img {
    border-top-left-radius: var(--bs-card-border-radius);
    border-bottom-left-radius: var(--bs-card-border-radius);
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* Standings */
.standings.nav-pills .nav-link {
    color: var(--custom-primary);
    border-radius: 30px;
    border: 2px solid var(--custom-primary);
    padding: 0.25rem 0.75rem 0.35rem 0.75rem;
    font-weight: 600 !important;
}

.standings.nav-pills .nav-link:hover {
    color: var(--custom-secondary);
    background-color: var(--custom-primary);
}

.standings.nav-pills .nav-link.active {
    color: var(--custom-secondary);
    background-color: var(--custom-primary);
}

/* Fixtures */
.fixtures.nav-pills .nav-link {
    color: var(--custom-primary);
    border-radius: 30px;
    border: 2px solid var(--custom-primary);
    padding: 0.25rem 0.75rem 0.35rem 0.75rem;
    font-weight: 600 !important;
}

.fixtures.nav-pills .nav-link:hover {
    color: var(--custom-secondary);
    background-color: var(--custom-primary);
}

.fixtures.nav-pills .nav-link.active {
    color: var(--custom-secondary);
    background-color: var(--custom-primary);
}


/* Fixtures */
table.table-matches { width: 100%; }
table.table-matches tr td.kickoff { width: 16%; }
table.table-matches tr td.home-team,
table.table-matches tr td.away-team { width: 36%; }
table.table-matches tr td.result { width: 12%; }

/* Accordion */
.custom-accordion .accordion-item h3 button {
    font-weight: 600 !important;
}

.custom-accordion .accordion-button:not(.collapsed) {
    color: var(--custom-secondary) !important;
    background-color: var(--custom-primary) !important;
}

.custom-accordion .accordion-button:focus {
    box-shadow: none;
    border-color: rgba(0,0,0,.125);
}

.custom-accordion .accordion-button:not(.collapsed)::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23FECB00'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6.253 6.253a.5.5 0 0 1-.708 0L1.646 5.354a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

/* Footer */
footer {
    background-color: #f5f5Fa;
    border-top: 4px solid var(--custom-primary);
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg,
        var(--custom-accent-green) 0%,
        var(--custom-accent-green) 33.33%,
        #ffffff 33.33%,
        #ffffff 66.66%,
        var(--custom-accent-red) 66.66%,
        var(--custom-accent-red) 100%);
}

footer .logo {
    height: 50px;
    width: auto;
}

footer .disclaimer {
    width: 75%;
    margin: 0 auto;
}

/* Media Queries */
@media (max-width: 991.98px) {
    .navbar-nav {
        padding-top: 1rem;
    }

    footer .disclaimer {
        width: 100%;
    }
}

@media (max-width: 767.98px) {
    .articles .card-img-top {
        height: 300px;
        object-fit: cover;
    }
    .main-article img {
        border-top-left-radius: var(--bs-card-border-radius);
        border-bottom-left-radius: 0;
        border-top-right-radius: var(--bs-card-border-radius);
        border-bottom-right-radius: 0;
    }
    .img-thumb {
        object-fit: cover;
        aspect-ratio: 1/1;
        border-top-right-radius: var(--bs-card-border-radius);
        border-top-left-radius: var(--bs-card-border-radius);; 
        border-bottom-right-radius: 0;
        border-bottom-left-radius: 0;
    }    
}

@media (max-width: 575.98px) {
    .articles .card-img-top {
        height: 200px;
        object-fit: cover;
    }
}
