/*
Theme Name:        Gotowissen Finance
Theme URI:         https://gotowissen.de
Description:       Finance-magazine child theme for gotowissen.de — trust-first, BaFin-aware, German YMYL personal-finance design. Child of Twenty Twenty-Four.
Author:            Gotowissen Redaktion
Author URI:        https://gotowissen.de
Template:          twentytwentyfour
Version:           1.0.2
Requires at least: 6.4
Tested up to:      6.9
Requires PHP:      8.0
License:           GPL-2.0-or-later
License URI:       https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:       gotowissen-finance
Tags:              blog, news, finance, two-columns, custom-colors, custom-logo, full-site-editing, block-patterns, block-styles, wide-blocks, accessibility-ready
*/

/* Tighter, magazine-like reading experience that complements theme.json */
body {
    font-feature-settings: "liga" on, "calt" on, "kern" on;
}

.wp-block-post-title,
h1, h2, h3, h4 {
    letter-spacing: -0.01em;
}

/* Generous reading width on long-form */
.wp-block-post-content > p,
.wp-block-post-content > ul,
.wp-block-post-content > ol,
.wp-block-post-content > blockquote {
    max-width: 68ch;
}

/* Dense, readable tables for broker / fund comparisons */
.wp-block-table table {
    font-size: 0.95rem;
    border-collapse: collapse;
    width: 100%;
}
.wp-block-table th,
.wp-block-table td {
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--wp--preset--color--gw-border, #e5e7eb);
    vertical-align: top;
}
.wp-block-table thead th {
    background: var(--wp--preset--color--gw-warm-white, #faf7f2);
    text-align: left;
    font-weight: 600;
}

/* Stand-Box pattern styling */
.gw-stand-box {
    border-left: 4px solid var(--wp--preset--color--gw-deep-blue, #0b3d63);
    background: var(--wp--preset--color--gw-warm-white, #faf7f2);
    padding: 0.85rem 1rem;
    margin: 1.25rem 0 1.75rem;
    font-size: 0.95rem;
    line-height: 1.45;
}
.gw-stand-box strong { color: var(--wp--preset--color--gw-deep-blue, #0b3d63); }

/* YMYL disclaimer */
.gw-ymyl-disclaimer {
    border: 1px solid var(--wp--preset--color--gw-border, #e5e7eb);
    background: #ffffff;
    padding: 1rem 1.1rem;
    margin: 2rem 0;
    border-radius: 4px;
    font-size: 0.92rem;
    color: #374151;
}
.gw-ymyl-disclaimer h3 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    color: var(--wp--preset--color--gw-deep-blue, #0b3d63);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Footer trim */
.wp-block-site-footer,
.wp-block-template-part[data-type="footer"],
footer.wp-block-template-part {
    border-top: 1px solid var(--wp--preset--color--gw-border, #e5e7eb);
    font-size: 0.92rem;
}

/* Brand / site-logo block in the header.
 * The wordmark renders at ~40px desktop / ~28px mobile.
 * Site title is kept in the markup for screen-readers + SEO continuity. */
.gw-brand {
    align-items: center;
    gap: 0.5rem;
}
.gw-site-logo,
.gw-brand .wp-block-site-logo {
    display: inline-flex;
    align-items: center;
    line-height: 0;
}
.gw-site-logo img,
.gw-brand .wp-block-site-logo img {
    height: 40px;
    width: auto;
    max-width: 240px;
    display: block;
}
@media (max-width: 600px) {
    .gw-site-logo img,
    .gw-brand .wp-block-site-logo img {
        height: 28px;
        max-width: 180px;
    }
}

/* Visually hide the site-title while keeping it accessible (kept for SR + SEO). */
.gw-brand .wp-block-site-title.screen-reader-text,
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    -webkit-clip-path: inset(50%);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

/* ============================================================
   T-0010 — magazine layout, mega-menu, lightbulb brand row,
   newsletter band, mint accent. CSS only — no JS deps.
   ============================================================ */

/* --- BRAND ROW (mark + wordmark side-by-side) ------------------------- */
.gw-header { position: relative; }
.gw-trust-band { font-size: 0.78rem; }
.gw-trust-band p { margin: 0 !important; }

.gw-header-row { gap: 1.25rem; }
.gw-brand { gap: 0.65rem; }
.gw-brand-link {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    line-height: 1;
}
.gw-brand-mark {
    display: block;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
}
.gw-brand-wordmark {
    font-family: 'Merriweather', Georgia, 'Times New Roman', serif;
    font-weight: 700;
    font-size: 1.45rem;
    color: var(--wp--preset--color--gw-deep-blue-2, #0a2a44);
    letter-spacing: -0.01em;
    line-height: 1;
}
.gw-brand-dot { color: var(--wp--preset--color--gw-accent, #b45309); }
@media (max-width: 600px) {
    .gw-brand-mark { width: 32px; height: 32px; }
    .gw-brand-wordmark { font-size: 1.15rem; }
}

/* Hide the legacy site-logo block image if it ever rendered alongside us */
.gw-header .gw-site-logo,
.gw-header .wp-block-site-logo { display: none; }

/* --- CSS-ONLY MEGA-MENU (primary nav) -------------------------------- */
.gw-primary-nav .wp-block-navigation__submenu-container,
.gw-primary-nav ul ul {
    border: 1px solid var(--wp--preset--color--gw-border, #e5e7eb);
    box-shadow: 0 12px 32px rgba(11, 61, 99, 0.08);
    border-radius: 6px;
    padding: 0.5rem 0.25rem;
    min-width: 240px;
    background: #fff;
}
.gw-primary-nav .wp-block-navigation-item.gw-mega
  > .wp-block-navigation__submenu-container {
    /* Wider panel for the cluster categories */
    min-width: 280px;
}
.gw-primary-nav .wp-block-navigation__submenu-icon { transition: transform 0.15s ease; }
.gw-primary-nav .has-child:hover > .wp-block-navigation__submenu-icon,
.gw-primary-nav .has-child:focus-within > .wp-block-navigation__submenu-icon {
    transform: rotate(180deg);
}

/* --- MAGAZINE: section heads ----------------------------------------- */
.gw-magazine { background: var(--wp--preset--color--gw-paper, #ffffff); }
.gw-section { position: relative; }
.gw-section-head { margin-bottom: 1.4rem; }
.gw-section-h2 {
    margin-top: 0;
    padding-top: 0.75rem;
    position: relative;
}
.gw-section-h2::before {
    content: "";
    display: block;
    width: 56px;
    height: 1px;
    background: rgba(11, 61, 99, 0.25);
    position: absolute;
    top: 0;
    left: 0;
}
.gw-eyebrow {
    font-family: 'Manrope', 'Inter', -apple-system, sans-serif !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.78rem !important;
    margin-top: 0;
    margin-bottom: 0.25rem !important;
}

/* --- HERO ------------------------------------------------------------ */
.gw-hero-cols { gap: 2rem; }
.gw-card-lead .wp-block-post-featured-image img {
    width: 100%;
    height: auto;
    border-radius: 6px;
}
.gw-card-lead .wp-block-post-title a,
.gw-card-stack .wp-block-post-title a {
    color: var(--wp--preset--color--gw-deep-blue-2, #0a2a44);
    text-decoration: none;
}
.gw-card-lead .wp-block-post-title a:hover,
.gw-card-stack .wp-block-post-title a:hover {
    color: var(--wp--preset--color--gw-deep-blue, #0b3d63);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}
.gw-card-stack {
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--wp--preset--color--gw-border, #e5e7eb);
}
.gw-card-stack:last-child { border-bottom: 0; }
.gw-card-stack .wp-block-post-featured-image {
    flex: 0 0 96px;
    width: 96px;
}
.gw-card-stack .wp-block-post-featured-image img {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 4px;
}

/* --- TOOLS & RECHNER GRID ------------------------------------------- */
.gw-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 1.25rem;
}
.gw-tool-tile {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 1.1rem 1rem;
    background: #ffffff;
    border: 1px solid var(--wp--preset--color--gw-border, #e5e7eb);
    border-radius: 8px;
    text-decoration: none;
    transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
.gw-tool-tile:hover,
.gw-tool-tile:focus-visible {
    transform: translateY(-2px);
    border-color: var(--wp--preset--color--gw-deep-blue, #0b3d63);
    box-shadow: 0 8px 24px rgba(11, 61, 99, 0.08);
    outline: none;
}
.gw-tool-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: var(--wp--preset--color--gw-mint, #7fb6a3);
    color: #0a2a44;
}
.gw-tool-icon svg { display: block; }
.gw-tool-label {
    font-family: 'Merriweather', Georgia, serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--wp--preset--color--gw-deep-blue-2, #0a2a44);
    line-height: 1.25;
}
.gw-tool-sub {
    font-size: 0.85rem;
    color: var(--wp--preset--color--gw-muted-ink, #4b5563);
    line-height: 1.4;
}

/* --- LATEST grid -- shared card hover ------------------------------- */
.gw-card-grid-item { background: #fff; transition: box-shadow 0.12s ease, transform 0.12s ease; }
.gw-card-grid-item:hover { box-shadow: 0 8px 24px rgba(11, 61, 99, 0.06); transform: translateY(-2px); }
.gw-card-grid-item .wp-block-post-title a {
    color: var(--wp--preset--color--gw-deep-blue-2, #0a2a44);
    text-decoration: none;
}
.gw-card-grid-item .wp-block-post-title a:hover {
    color: var(--wp--preset--color--gw-deep-blue, #0b3d63);
    text-decoration: underline;
}

/* --- NEWSLETTER band ------------------------------------------------- */
.gw-newsletter { color: #fff; }
.gw-newsletter h2,
.gw-newsletter p { color: #fff; }
.gw-newsletter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin: 0.6rem auto 0.4rem;
    max-width: 520px;
}
.gw-newsletter-form input[type="email"] {
    flex: 1 1 240px;
    min-width: 0;
    padding: 0.7rem 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    background: #fff;
    color: #0a2a44;
}
.gw-newsletter-form input[type="email"]:focus {
    outline: 2px solid var(--wp--preset--color--gw-mint, #7fb6a3);
    outline-offset: 2px;
}
.gw-newsletter-form .gw-newsletter-submit {
    background: var(--wp--preset--color--gw-mint, #7fb6a3);
    color: #0a2a44;
    font-weight: 600;
    font-family: inherit;
    border: 0;
    border-radius: 4px;
    padding: 0.7rem 1.2rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.12s ease;
}
.gw-newsletter-form .gw-newsletter-submit:hover { background: #6ea895; }
.gw-newsletter-fineprint {
    text-align: center;
    color: #cbd5e1 !important;
    font-size: 0.8rem !important;
    margin: 0.5rem auto 0 !important;
}
.gw-newsletter-fineprint a { color: var(--wp--preset--color--gw-mint, #7fb6a3); }

/* --- PER-CATEGORY rows ---------------------------------------------- */
.gw-cat-row-head { margin-bottom: 1rem; align-items: end; gap: 1rem; }
.gw-cat-row-head .gw-section-h2 { padding-top: 0.5rem; margin-bottom: 0; }
.gw-cat-row-head .gw-section-h2::before { width: 36px; }
.gw-cat-row-head p { margin: 0; }
.gw-cat-row-head a { color: var(--wp--preset--color--gw-deep-blue, #0b3d63); text-decoration: none; }
.gw-cat-row-head a:hover { text-decoration: underline; }
.gw-card-mini .wp-block-post-title a {
    color: var(--wp--preset--color--gw-deep-blue-2, #0a2a44);
    text-decoration: none;
}
.gw-card-mini .wp-block-post-title a:hover { text-decoration: underline; }

/* --- ÜBER UNS lead-in ------------------------------------------------ */
.gw-aboutlead h2 { color: var(--wp--preset--color--gw-deep-blue-2, #0a2a44); }

/* --- Generic spacer fall-through ------------------------------------ */
.gw-section + .gw-section { border-top: 0; }
