@import './fonts/fonts.css';

/* ================================================
   gewinnspiele-lotterien.de — Custom Theme
   Aesthetic: Editorial Authority — DM Serif + Manrope
   Brand: #239e3a (Primary Green)
   ================================================ */

/* --- Variables --- */
:root {
    --c-primary:       #239e3a;
    --c-primary-dark:  #1a7a2c;
    --c-primary-deep:  #0d5c1e;
    --c-primary-light: #e3f5e7;
    --c-primary-pale:  #f2fbf4;
    --c-dark:          #0d1f10;
    --c-text:          #1e2c20;
    --c-text-muted:    #5a6b5c;
    --c-bg:            #ffffff;
    --c-bg-soft:       #f7fcf8;
    --c-border:        #d4e8d6;
    --c-white:         #ffffff;

    --f-heading: 'DM Serif Display', 'Georgia', 'Times New Roman', serif;
    --f-body:    'Manrope', 'Segoe UI', system-ui, -apple-system, sans-serif;

    --nav-h:       70px;
    --r-sm:        4px;
    --r-md:        8px;
    --r-lg:        16px;
    --t-fast:      150ms ease;
    --t-med:       250ms ease;
    --shadow-sm:   0 1px 4px rgba(13, 31, 16, 0.08);
    --shadow-md:   0 4px 16px rgba(13, 31, 16, 0.10);
    --shadow-lg:   0 8px 32px rgba(13, 31, 16, 0.13);
}

/* --- Base Reset --- */
*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--f-body);
    font-size: 16px;
    line-height: 1.65;
    color: var(--c-text);
    background-color: var(--c-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    margin-top: 0;
    margin-bottom: 0.5em;
    color: var(--c-dark);
}

h1 {
    font-family: var(--f-heading);
    font-weight: 400;
    font-size: clamp(1.875rem, 4vw, 2.875rem);
}

h2 {
    font-family: var(--f-heading);
    font-weight: 400;
    font-size: clamp(1.375rem, 3vw, 2.125rem);
}

h3 {
    font-family: var(--f-body);
    font-weight: 700;
    font-size: clamp(1.1rem, 2.5vw, 1.375rem);
}

h4 {
    font-family: var(--f-body);
    font-weight: 600;
    font-size: 1.0625rem;
}

p { margin-top: 0; margin-bottom: 1rem; }

a {
    color: var(--c-primary);
    text-decoration: none;
    transition: color var(--t-fast);
}
a:hover { color: var(--c-primary-dark); }

img { max-width: 100%; height: auto; }

ul, ol { margin-bottom: 1rem; padding-left: 1.5rem; }
li { margin-bottom: 0.3rem; line-height: 1.65; }

/* --- Site Wrapper --- */
.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-main { flex: 1; }

/* ================================================
   NAVIGATION
   ================================================ */

/* The base mainMenuWrapper is replaced — reset it */
.mainMenuWrapper {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    height: var(--nav-h);
    background-color: var(--c-white);
    border-bottom: 1px solid var(--c-border);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
}

.site-header .container {
    display: flex;
    align-items: center;
    width: 100%;
}

.site-header .navbar {
    padding: 0 !important;
    width: 100%;
    align-items: center;
}

/* Logo */
.nav-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.nav-logo .logo {
    height: 46px;
    width: auto;
    display: block;
}

.nav-logo-text {
    font-family: var(--f-heading);
    font-size: 1.25rem;
    color: var(--c-primary);
    font-weight: 400;
}

/* Nav links */
.site-header .navbar-nav { margin-left: auto; }

.site-header .navbar-nav .nav-item { list-style: none; }

.site-header .navbar-nav .nav-link {
    font-family: var(--f-body);
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--c-text) !important;
    padding: 0.5rem 0.9rem !important;
    position: relative;
    letter-spacing: 0.01em;
    transition: color var(--t-fast);
}

.site-header .navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    right: 50%;
    height: 2px;
    background-color: var(--c-primary);
    transition: left var(--t-med), right var(--t-med);
    border-radius: 2px;
}

.site-header .navbar-nav .nav-link:hover,
.site-header .navbar-nav .nav-link.active {
    color: var(--c-primary) !important;
}

.site-header .navbar-nav .nav-link:hover::after,
.site-header .navbar-nav .nav-link.active::after {
    left: 0;
    right: 0;
}

/* Hamburger */
.site-header .navbar-toggler {
    border-color: var(--c-border);
    padding: 0.4rem 0.6rem;
    border-radius: var(--r-sm);
}

.site-header .navbar-toggler:focus { box-shadow: none; }

.site-header .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23239e3a' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.5' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    width: 22px;
    height: 22px;
}

/* Dropdown */
.site-header .dropdown-menu {
    border-color: var(--c-border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-md);
    padding: 0.5rem 0;
    margin-top: 4px;
}

.site-header .dropdown-item {
    font-family: var(--f-body);
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    color: var(--c-text);
    transition: background-color var(--t-fast), color var(--t-fast);
}

.site-header .dropdown-item:hover,
.site-header .dropdown-item:focus {
    background-color: var(--c-primary-light);
    color: var(--c-primary-dark);
}

.site-header .dropdown-item.active {
    background-color: var(--c-primary);
    color: var(--c-white);
}

/* Mobile nav collapse */
@media (max-width: 991.98px) {
    .site-header .navbar-collapse {
        position: absolute;
        top: var(--nav-h);
        left: 0;
        right: 0;
        background-color: var(--c-white);
        border-top: 1px solid var(--c-border);
        border-bottom: 1px solid var(--c-border);
        box-shadow: var(--shadow-md);
        padding: 0.75rem 0;
    }

    .site-header .navbar-nav { margin-left: 0; }

    .site-header .navbar-nav .nav-link {
        padding: 0.65rem 1.25rem !important;
    }

    .site-header .navbar-nav .nav-link::after { display: none; }
}

/* ================================================
   BREADCRUMB
   ================================================ */
.breadcrumb-bar {
    background-color: var(--c-bg-soft);
    border-bottom: 1px solid var(--c-border);
    padding: 0.55rem 0;
}

.breadcrumb-bar .container { padding-top: 0; padding-bottom: 0; }

.breadcrumb-bar .breadcrumb {
    margin: 0;
    padding: 0;
    font-size: 0.8125rem;
    background: none;
    flex-wrap: nowrap;
    overflow: hidden;
}

.breadcrumb-bar .breadcrumb-item { color: var(--c-text-muted); }
.breadcrumb-bar .breadcrumb-item a { color: var(--c-text-muted); }
.breadcrumb-bar .breadcrumb-item a:hover { color: var(--c-primary); }

.breadcrumb-bar .breadcrumb-item.active { color: var(--c-text); font-weight: 500; }

.breadcrumb-bar .breadcrumb-item + .breadcrumb-item::before {
    color: var(--c-border);
}

/* ================================================
   INNER WRAPPER (standard content pages)
   ================================================ */
.inner-wrapper {
    padding-top: 2.5rem;
    padding-bottom: 3rem;
}

/* ================================================
   HERO SECTION (home page)
   ================================================ */
.hero-section {
    position: relative;
    height: 420px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center 30%;
    background-repeat: no-repeat;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        140deg,
        rgba(8, 28, 12, 0.88) 0%,
        rgba(35, 158, 58, 0.62) 100%
    );
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: var(--c-white);
    padding: 2rem 1.5rem;
    max-width: 820px;
    width: 100%;
}

.hero-content h1 {
    color: var(--c-white);
    font-size: clamp(1.7rem, 4.5vw, 3rem);
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.3);
    margin-bottom: 0.85rem;
    letter-spacing: -0.01em;
}

.hero-slogan {
    font-family: var(--f-body);
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    color: rgba(255, 255, 255, 0.88);
    font-weight: 400;
    letter-spacing: 0.03em;
    margin: 0;
    line-height: 1.55;
}

/* Hero badge */
.hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.3em 0.9em;
    border-radius: 20px;
    margin-bottom: 1.1rem;
}

/* ================================================
   INTRO SECTION
   ================================================ */
.intro-section {
    background-color: var(--c-bg-soft);
    border-bottom: 1px solid var(--c-border);
    padding: 1.5rem 0;
}

.intro-text {
    font-size: 0.9375rem;
    color: var(--c-text-muted);
    line-height: 1.75;
}

/* ================================================
   COMPARISON SECTION (home)
   ================================================ */
.comparison-section {
    padding: clamp(2.5rem, 5vw, 4.5rem) 0;
}

.section-title {
    color: var(--c-dark);
    margin-bottom: 1.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--c-primary);
    display: inline-block;
}

/* Table wrapper — handles horizontal scroll on mobile */
.table-scroll {
    border-radius: var(--r-md);
    box-shadow: var(--shadow-md);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--c-border);
}

/* Comparison table */
table.overview {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--c-white);
    font-size: 0.9375rem;
    min-width: 560px;
}

table.overview thead tr {
    background-color: var(--c-primary);
}

table.overview thead th {
    color: var(--c-white);
    font-family: var(--f-body);
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    padding: 1rem 1.5rem;
    border: none;
    white-space: nowrap;
}

table.overview thead th:first-child { border-radius: var(--r-sm) 0 0 0; }
table.overview thead th:last-child  { border-radius: 0 var(--r-sm) 0 0; }

table.overview tbody tr {
    border-bottom: 1px solid var(--c-border);
    transition: background-color var(--t-fast);
}

table.overview tbody tr:last-child { border-bottom: none; }

table.overview tbody tr:nth-child(even) {
    background-color: var(--c-bg-soft);
}

table.overview tbody tr:hover {
    background-color: var(--c-primary-light);
}

table.overview td {
    padding: 1.125rem 1.5rem;
    vertical-align: middle;
}

/* Provider logo cell */
table.overview td.provider-cell {
    width: 200px;
    min-width: 160px;
    text-align: center;
}

table.overview td.provider-cell a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

table.overview td.provider-cell img {
    max-width: 150px;
    height: auto;
    display: block;
    transition: transform var(--t-fast), opacity var(--t-fast);
}

table.overview td.provider-cell a:hover img {
    transform: scale(1.04);
    opacity: 0.9;
}

/* Offers cell */
table.overview td.offers-cell {
    min-width: 220px;
}

table.overview td.offers-cell ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

table.overview td.offers-cell li {
    display: inline-block;
    background-color: var(--c-primary-pale);
    color: var(--c-primary-deep);
    border: 1px solid var(--c-primary-light);
    padding: 0.22em 0.7em;
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
    line-height: 1.5;
}

/* Action cell */
table.overview td.action-cell {
    width: 160px;
    min-width: 140px;
    text-align: center;
}

/* CTA Button */
.btn-play {
    display: inline-block;
    background-color: var(--c-primary);
    color: var(--c-white) !important;
    padding: 0.6rem 1.5rem;
    border-radius: var(--r-sm);
    font-family: var(--f-body);
    font-weight: 700;
    font-size: 0.875rem;
    letter-spacing: 0.02em;
    text-decoration: none !important;
    transition: background-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
    white-space: nowrap;
    border: none;
    cursor: pointer;
    line-height: 1.5;
}

.btn-play:hover {
    background-color: var(--c-primary-dark);
    box-shadow: 0 4px 14px rgba(35, 158, 58, 0.38);
    transform: translateY(-1px);
    color: var(--c-white) !important;
}

.btn-play:active {
    transform: translateY(0);
    box-shadow: none;
}

/* ================================================
   ARTICLE LIST (article-list partial)
   ================================================ */
.article-list { margin-top: 1rem; }

.article-list .row { --bs-gutter-y: 1.5rem; }

.article-item {
    background: var(--c-white);
    border-radius: var(--r-md);
    overflow: hidden;
    border: 1px solid var(--c-border);
    transition: box-shadow var(--t-med), transform var(--t-med);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.article-item > a {
    color: inherit;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.article-item > a:hover { color: inherit; }

.article-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.article-item .image {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    flex-shrink: 0;
}

.article-item .image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 300ms ease;
}

.article-item:hover .image img { transform: scale(1.04); }

.article-item .date {
    font-size: 0.8rem;
    color: var(--c-primary);
    font-weight: 600;
    padding: 0.8rem 1rem 0;
    letter-spacing: 0.02em;
}

.article-item h2,
.article-item h3 {
    font-family: var(--f-body);
    font-size: 0.9875rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--c-dark);
    margin: 0.3rem 1rem 0.4rem;
    padding: 0;
}

.article-item .excerpt {
    font-size: 0.875rem;
    color: var(--c-text-muted);
    line-height: 1.55;
    padding: 0 1rem 1rem;
    flex: 1;
}

/* ================================================
   PAGE CONTENT
   ================================================ */
.page-layout {
    padding: 2.5rem 0 3rem;
}

.page-body h1 { margin-bottom: 1.25rem; }

.page-body h2 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.page-body h3 { margin-top: 1.5rem; }

.page-body table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
}

.page-body table th,
.page-body table td {
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--c-border);
    text-align: left;
}

.page-body table th {
    background-color: var(--c-primary-light);
    font-weight: 600;
    color: var(--c-primary-deep);
}

.page-body table tr:nth-child(even) td {
    background-color: var(--c-bg-soft);
}

/* ================================================
   ARTICLE LAYOUT
   ================================================ */
.article-layout { padding: 2.5rem 0 3.5rem; }

.article-header { margin-bottom: 1.5rem; }

.article-header h1 { margin-bottom: 0.75rem; }

.article-feature-image {
    margin: 0 0 2rem;
    border-radius: var(--r-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.article-feature-image img {
    width: 100%;
    height: auto;
    display: block;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.875rem;
    color: var(--c-text-muted);
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--c-border);
}

.article-meta time {
    color: var(--c-primary);
    font-weight: 600;
}

.article-meta .modified-date {
    color: var(--c-text-muted);
    font-style: italic;
}

.article-body {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: var(--c-text);
}

.article-body h2 {
    margin-top: 2rem;
    border-bottom: 1px solid var(--c-border);
    padding-bottom: 0.5rem;
}

.related-articles {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--c-border);
}

.related-articles > h2 {
    font-size: 1.25rem;
    margin-bottom: 1.25rem;
}

/* ================================================
   CATEGORY LAYOUT
   ================================================ */
.category-layout { padding: 2rem 0 3rem; }

.category-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--c-border);
}

.category-header h1 { margin-bottom: 0.5rem; }

/* ================================================
   FOOTER
   ================================================ */
.site-footer {
    background-color: var(--c-dark);
    color: rgba(255, 255, 255, 0.70);
    padding: 3rem 0 1.5rem;
    margin-top: auto;
}

.footer-inner { }

.footer-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
    padding-bottom: 2rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.footer-brand {}

.footer-site-name {
    font-family: var(--f-heading);
    font-size: 1.3rem;
    font-weight: 400;
    color: var(--c-white);
    margin-bottom: 0.4rem;
}

.footer-slogan {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.50);
    margin: 0;
    max-width: 320px;
    line-height: 1.55;
}

.footer-nav-block { display: flex; align-items: center; }

/* Override footermenu partial's nav styles */
.site-footer .footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem;
    align-items: center;
}

.site-footer .footer-nav a {
    color: rgba(255, 255, 255, 0.60);
    font-size: 0.875rem;
    padding: 0.3rem 0.75rem;
    border-radius: var(--r-sm);
    transition: color var(--t-fast), background-color var(--t-fast);
    text-decoration: none;
    font-weight: 500;
}

.site-footer .footer-nav a:hover {
    color: var(--c-white);
    background-color: rgba(255, 255, 255, 0.08);
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.35);
}

.footer-bottom p { margin: 0; }

/* ================================================
   PAGINATION
   ================================================ */
.pagination { gap: 0.25rem; }

.page-link {
    color: var(--c-primary) !important;
    border-color: var(--c-border) !important;
    border-radius: var(--r-sm) !important;
    font-size: 0.9rem;
    padding: 0.45rem 0.85rem;
    font-family: var(--f-body);
    transition: background-color var(--t-fast), color var(--t-fast);
}

.page-link:hover {
    background-color: var(--c-primary-light) !important;
    border-color: var(--c-primary) !important;
    color: var(--c-primary-dark) !important;
}

.page-item.active .page-link {
    background-color: var(--c-primary) !important;
    border-color: var(--c-primary) !important;
    color: var(--c-white) !important;
}

.page-item.disabled .page-link { opacity: 0.45; }

/* ================================================
   FOCUS & ACCESSIBILITY
   ================================================ */
:focus-visible {
    outline: 2px solid var(--c-primary);
    outline-offset: 2px;
}

/* ================================================
   RESPONSIVE — Tablet (≤991px)
   ================================================ */
@media (max-width: 991.98px) {
    .hero-section { height: 340px; }

    .footer-top { flex-direction: column; gap: 1.5rem; }
}

/* ================================================
   RESPONSIVE — Mobile (≤575px)
   ================================================ */
@media (max-width: 575.98px) {
    .hero-section { height: 280px; }

    .hero-content h1 { font-size: 1.6rem; }

    .comparison-section { padding: 2rem 0; }

    .inner-wrapper { padding-top: 1.5rem; padding-bottom: 2rem; }

    .article-layout { padding: 1.5rem 0 2.5rem; }

    /* Stack table to cards on small screens */
    .table-scroll table.overview,
    .table-scroll table.overview tbody,
    .table-scroll table.overview tr,
    .table-scroll table.overview td {
        display: block;
        width: 100%;
        min-width: unset;
    }

    .table-scroll table.overview thead { display: none; }

    .table-scroll table.overview tr {
        border: 1px solid var(--c-border);
        border-radius: var(--r-md);
        margin-bottom: 1rem;
        overflow: hidden;
        box-shadow: var(--shadow-sm);
    }

    .table-scroll table.overview tbody tr:nth-child(even) {
        background: var(--c-white);
    }

    .table-scroll table.overview td {
        padding: 0.75rem 1rem;
    }

    .table-scroll table.overview td.provider-cell {
        background-color: var(--c-bg-soft);
        border-bottom: 1px solid var(--c-border);
        text-align: center;
    }

    .table-scroll table.overview td.action-cell {
        text-align: center;
        padding-bottom: 1.25rem;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .site-footer .footer-nav {
        justify-content: center;
    }
}

/* ================================================
   BOOTSTRAP OVERRIDES
   ================================================ */
@media (min-width: 1200px) {
    .container { max-width: 1200px; }
}

/* Remove Bootstrap's blue outline from buttons/links */
.btn:focus, .nav-link:focus, .navbar-toggler:focus {
    box-shadow: none !important;
}

/* Navbar hover dropdown fix */
@media (min-width: 992px) {
    .navbar-nav .dropdown:hover .dropdown-menu {
        display: block;
    }
}
