/*
Theme Name: Arbitrage Italia
Theme URI: https://example.com/arbitrage-italia
Author: Antigravity
Author URI: https://example.com
Description: A fast, mobile-first, AdSense-optimized theme for Italian content sites.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: arbitrage-italia
Tags: blog, news, fast, adsense-ready, accessibility-ready
*/

:root {
    --color-primary: #0056b3;
    /* Professional Blue */
    --color-accent: #e63946;
    /* Alert Red */
    --color-text: #333333;
    --color-text-light: #666666;
    --color-bg: #ffffff;
    --color-bg-alt: #f8f9fa;
    --color-border: #e0e0e0;
    --font-heading: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --container-width: 1200px;
    --gap: 1.5rem;
    --radius: 8px;
    --nav-height: 60px;
}

[data-theme="dark"] {
    --color-primary: #4dabf7;
    --color-accent: #ff6b6b;
    --color-text: #e9ecef;
    --color-text-light: #adb5bd;
    --color-bg: #121212;
    --color-bg-alt: #1e1e1e;
    --color-border: #333;
}

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

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 18px;
    /* High readability */
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    transition: background 0.3s, color 0.3s;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    margin-top: 0;
    line-height: 1.3;
    font-weight: 700;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

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

p {
    margin-bottom: 1.5rem;
}

/* Layout */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--gap);
}

.grid {
    display: grid;
    gap: var(--gap);
}

.main-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: calc(var(--gap) * 2);
    margin-top: var(--gap);
    margin-bottom: var(--gap);
}

@media (min-width: 992px) {
    .main-grid {
        grid-template-columns: 2fr 1fr;
    }
}

/* Header */
.site-header {
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--nav-height);
    display: flex;
    align-items: center;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.site-branding {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--color-primary);
}

/* Navigation */
.main-navigation ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 1.5rem;
}

.main-navigation a {
    color: var(--color-text);
    font-weight: 600;
    font-size: 1rem;
}

.menu-toggle {
    display: none;
}

/* Header Tools */
#dark-mode-toggle {
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    /* Circle */
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--color-text);
    transition: background 0.2s, color 0.2s;
    margin-left: 1rem;
}

#dark-mode-toggle:hover {
    background: var(--color-bg-alt);
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
        background: transparent;
        border: 1px solid var(--color-border);
        border-radius: var(--radius);
        padding: 0.5rem 1rem;
        cursor: pointer;
        color: var(--color-text);
        font-weight: 600;
        margin-right: auto;
        /* Push to left if needed, or stick */
    }

    .main-navigation ul {
        display: none;
        /* Hide list items by default on mobile */
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--color-bg);
        border-bottom: 1px solid var(--color-border);
        padding: 1.5rem;
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    }

    .main-navigation.toggled ul {
        display: flex;
        /* Show when toggled */
    }
}

/* Post Cards */
.post-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.2s;
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.post-thumbnail img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.post-content {
    padding: 1rem;
}

.post-cat {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--color-accent);
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: block;
}

.post-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.post-meta {
    font-size: 0.85rem;
    color: var(--color-text-light);
}

/* Single */
.entry-content {
    font-size: 1.1rem;
}

.entry-header {
    margin-bottom: 2rem;
}

.entry-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.breadcrumbs {
    font-size: 0.9rem;
    color: var(--color-text-light);
    margin-bottom: 1rem;
}

.toc {
    background: var(--color-bg-alt);
    padding: 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 2rem;
    border-left: 4px solid var(--color-primary);
}

.toc ul {
    margin: 0;
    padding-left: 1.5rem;
}

/* Components */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--color-primary);
    color: white;
    border-radius: var(--radius);
    font-weight: 600;
}

.btn:hover {
    text-decoration: none;
    opacity: 0.9;
}

/* Ad Placeholders */
.ad-slot {

    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    margin: 2rem 0;
    padding: 1rem;
    min-height: 100px;
    /* Layout Shift Protection */
    text-align: center;
    overflow: hidden;
}

.ad-slot iframe,
.ad-slot ins,
.ad-slot img,
.ad-slot>div {
    max-width: 100%;
    height: auto;
}

.ad-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    opacity: 0.7;
}

/* Footer */
.site-footer {
    background: var(--color-bg-alt);
    padding: 3rem 0;
    margin-top: 4rem;
    border-top: 1px solid var(--color-border);
}

/* Utilities */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    height: 1px;
    width: 1px;
    overflow: hidden;
    position: absolute;
}

.alignwide {
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.text-center {

    /* Mobile Ad Optimization */
    @media (max-width: 768px) {
        .ad-slot {
            min-height: 280px;
            /* Prepare space for 300x250 or 336x280 ads */
            margin: 1.5rem 0;
        }
    }

    /* End Mobile Ad Optimization */
    /* Comments Area */
    .comments-area {
        margin-top: 3rem;
        padding-top: 2rem;
        border-top: 1px solid var(--color-border);
    }

    .comment-list {
        list-style: none;
        padding: 0;
    }

    .comment-body {
        background: var(--color-bg-alt);
        padding: 1.5rem;
        border-radius: var(--radius);
        margin-bottom: 1.5rem;
        border: 1px solid var(--color-border);
    }

    .comment-meta {
        margin-bottom: 1rem;
        font-size: 0.9rem;
        display: flex;
        justify-content: space-between;
    }

    .fn {
        font-weight: 700;
    }

    /* Comment Form */
    .comment-respond {
        margin-top: 2rem;
        background: var(--color-bg);
        padding: 1.5rem;
        border: 1px solid var(--color-border);
        border-radius: var(--radius);
    }

    .unknown-comment-field {
        display: none;
    }

    /* Hide weird WP fields if any */
    .comment-form p {
        margin-bottom: 1rem;
    }

    .comment-form label {
        display: block;
        font-weight: 600;
        margin-bottom: 0.5rem;
    }

    .comment-form input[type="text"],
    .comment-form input[type="email"],
    .comment-form input[type="url"],
    .comment-form textarea {
        width: 100%;
        padding: 0.8rem;
        border: 1px solid var(--color-border);
        border-radius: 4px;
        font-size: 1rem;
        background: var(--color-bg);
        color: var(--color-text);
    }

    .comment-form input[type="checkbox"] {
        width: auto;
        margin-right: 0.5rem;
    }

    .comment-form .submit {
        background: var(--color-primary);
        color: white;
        border: none;
        padding: 0.8rem 2rem;
        border-radius: var(--radius);
        cursor: pointer;
        font-weight: 700;
        text-transform: uppercase;
        font-size: 0.9rem;
        transition: opacity 0.2s;
    }

    .comment-form .submit:hover {
        opacity: 0.9;
    }

    /* Related Posts */
    .related-posts {
        margin-top: 3rem;
        padding-top: 2rem;
        border-top: 1px solid var(--color-border);
    }

    .related-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
        border-left: 4px solid var(--color-primary);
        padding-left: 1rem;
    }

    .related-item {
        margin-bottom: 1rem;
    }

    .related-item a {
        text-decoration: none;
        color: var(--color-text);
    }

    .related-item h4 {
        font-size: 1.1rem;
        line-height: 1.4;
        margin-top: 0.5rem;
    }

    .related-item:hover h4 {
        color: var(--color-primary);
    }}
