/**
 * MokaByte - Articolo CSS v2
 * Versione con titolo nella hero
 */

/* ==========================================================================
   VARIABILI
   ========================================================================== */
:root {
    --color-primary: #32903F;
    --color-primary-dark: #287a33;
    --color-text: #333;
    --color-text-light: #555;
    --color-text-muted: #777;
    --color-bg: #fff;
    --color-bg-alt: #f9f9f9;
    --color-border: #e0e0e0;
    --font-main: 'Open Sans', Arial, Helvetica, sans-serif;
    --max-width: 1200px;
    --content-width: 800px;
}

/* ==========================================================================
   RESET & BASE
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--color-text);
    background: var(--color-bg);
}

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

a:hover {
    text-decoration: underline;
}

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

ul, ol {
    padding-left: 1.5rem;
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.site-header {
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo img {
    height: 40px;
    width: auto;
}

.logo .tagline {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    display: none;
}

@media (min-width: 768px) {
    .logo .tagline {
        display: block;
    }
}

/* Menu Toggle */
.menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    transition: 0.3s;
}

@media (min-width: 992px) {
    .menu-toggle {
        display: none;
    }
}

/* Navigation */
.main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.main-nav.open {
    display: block;
}

@media (min-width: 992px) {
    .main-nav {
        display: block;
        position: static;
        background: none;
        border: none;
        box-shadow: none;
    }
}

.menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

@media (min-width: 992px) {
    .menu {
        display: flex;
        gap: 0.25rem;
    }
}

.menu > li > a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--color-text);
    font-size: 0.9rem;
    font-weight: 500;
}

.menu > li > a:hover {
    color: var(--color-primary);
    text-decoration: none;
}

/* Submenu */
.submenu {
    list-style: none;
    display: none;
    background: var(--color-bg);
    min-width: 220px;
}

@media (min-width: 992px) {
    .has-submenu {
        position: relative;
    }

    .has-submenu > .submenu {
        position: absolute;
        top: 100%;
        left: 0;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        border: 1px solid var(--color-border);
        z-index: 100;
    }

    .submenu .has-submenu > .submenu {
        top: 0;
        left: 100%;
    }

    .has-submenu:hover > .submenu {
        display: block;
    }
}

.submenu a {
    display: block;
    padding: 0.6rem 1rem;
    color: var(--color-text);
    font-size: 0.85rem;
}

.submenu a:hover {
    background: var(--color-bg-alt);
    color: var(--color-primary);
    text-decoration: none;
}

@media (max-width: 991px) {
    .has-submenu.open > .submenu {
        display: block;
    }

    .submenu {
        padding-left: 1rem;
        border-left: 2px solid var(--color-primary);
        margin-left: 1rem;
    }
}

/* ==========================================================================
   HERO CON TITOLO
   ========================================================================== */
.hero {
    position: relative;
    width: 100%;
    min-height: 60vh;
    overflow: hidden;
}

.hero > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    top: 0;
    display: flex;
    align-items: stretch;
    padding: 2.5rem 1.5rem;
    background: linear-gradient(
        to top,
        rgba(0,0,0,0.85) 0%,
        rgba(0,0,0,0.5) 40%,
        rgba(0,0,0,0.1) 100%
    );
}

.hero-content {
    max-width: var(--content-width);
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    align-items: flex-start;
}

.hero-top-block {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
}

.hero-main-block {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.hero-meta {
    margin-top: auto;
}
.hero-meta {
    margin-top: auto;
}

/* Tag categoria */
.hero-tags {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.hero-content .category {
    display: inline-block;
    background: var(--color-primary);
    color: #fff;
    padding: 0.4rem 1rem;
    border-radius: 2px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.7rem;
    letter-spacing: 1px;
    margin-bottom: 1.25rem;
    text-decoration: none;
    transition: background 0.2s ease;
}

.hero-content .category:hover {
    background: var(--color-primary-dark);
    text-decoration: none;
}

/* Titolo hero */
.hero-title {
    color: #fff;
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.15;
    margin: 0;
    text-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.hero-title--center {
    text-align: center;
}

@media (min-width: 768px) {
    .hero-title {
        font-size: 3.5rem;
    }
}

@media (min-width: 992px) {
    .hero-title {
        font-size: 4rem;
    }
}

/* Sottotitolo hero */
.hero-subtitle {
    color: rgba(255,255,255,0.9);
    font-size: 1.15rem;
    font-weight: 400;
    line-height: 1.5;
    margin: 0 0 1.25rem 0;
    max-width: 600px;
}

@media (min-width: 768px) {
    .hero-subtitle {
        font-size: 1.35rem;
    }
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.2);
}

.hero-meta .author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.8);
}

.hero-meta-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.hero-meta .author-name {
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
}

.hero-meta a.author-name:hover {
    text-decoration: underline;
}

.hero-meta .date {
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
}

/* ==========================================================================
   CONTAINER & ARTICLE LAYOUT
   ========================================================================== */
.container {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.container-wide {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.article-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 992px) {
    .article-layout {
        grid-template-columns: 1fr 300px;
        gap: 3rem;
    }
}

.article {
    min-width: 0;
}

/* ==========================================================================
   SIDEBAR
   ========================================================================== */
.article-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (min-width: 992px) {
    .article-sidebar {
        position: sticky;
        top: 100px;
        align-self: start;
    }
}

.sidebar-box {
    padding: 1.25rem;
    background: var(--color-bg-alt);
    border-radius: 6px;
    border: 1px solid var(--color-border);
}

.sidebar-box h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--color-text);
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--color-primary);
}

/* Series & Same Issue Box in Sidebar */
.sidebar-box.series-box,
.sidebar-box.same-issue-box {
    border-radius: 6px;
}

.sidebar-box .series-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-box .series-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.9rem;
}

.sidebar-box .series-list li:last-child {
    border-bottom: none;
}

.sidebar-box .series-list li a {
    color: var(--color-text);
    text-decoration: none;
}

.sidebar-box .series-list li a:hover {
    color: var(--color-primary);
}

.sidebar-box .series-list li.current {
    font-weight: 600;
    color: var(--color-primary);
}

.sidebar-box .series-list li.current::before {
    content: "▸ ";
}

/* Same Issue Box in Sidebar */
.same-issue-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.same-issue-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.9rem;
}

.same-issue-list li:last-child {
    border-bottom: none;
}

.same-issue-list li a {
    color: var(--color-text);
    text-decoration: none;
    display: block;
}

.same-issue-list li a:hover {
    color: var(--color-primary);
}

/* ==========================================================================
   ARTICLE CONTENT
   ========================================================================== */
.article-content {
    font-size: 1.05rem;
    line-height: 1.8;
}

.article-introduzione {
    font-style: italic;
}

.article-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 2.5rem 0 1rem;
    color: var(--color-text);
}

.article-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 2rem 0 0.75rem;
    color: var(--color-text);
}

.article-content p {
    margin-bottom: 1.25rem;
}

.article-content ul,
.article-content ol {
    margin-bottom: 1.25rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

.article-content strong {
    font-weight: 600;
}

.article-content em {
    font-style: italic;
}

.article-content figure {
    margin: 2rem 0;
}

.article-content figcaption {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    text-align: center;
    margin-top: 0.5rem;
    font-style: italic;
}

.article-content blockquote {
    border-left: 4px solid var(--color-primary);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--color-text-light);
}

.article-content a {
    text-decoration: underline;
}

/* ==========================================================================
   ARTICLE FOOTER & TAGS
   ========================================================================== */
.article-footer {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.tags span {
    font-weight: 600;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.tags a {
    background: var(--color-bg-alt);
    color: var(--color-text-light);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    border: 1px solid var(--color-border);
}

.tags a:hover {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
    text-decoration: none;
}

/* ==========================================================================
   AUTHOR BOX
   ========================================================================== */
.author-box {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--color-primary);
    color: #fff;
    border-radius: 8px;
    margin: 3rem 0;
}

.author-box img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.author-box h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.author-box p {
    font-size: 0.9rem;
    line-height: 1.6;
    opacity: 0.9;
    margin-bottom: 0.75rem;
}

.author-link {
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
}

.author-link:hover {
    text-decoration: underline;
}

@media (max-width: 600px) {
    .author-box {
        flex-direction: column;
        text-align: center;
    }

    .author-box img {
        margin: 0 auto;
    }
}

/* ==========================================================================
   RELATED ARTICLES
   ========================================================================== */
.related {
    margin: 3rem 0;
}

.related h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.related-grid {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 600px) {
    .related-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.related-card {
    padding: 1.25rem;
    background: var(--color-bg-alt);
    border-radius: 6px;
    border: 1px solid var(--color-border);
}

.related-card h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.related-card h3 a {
    color: var(--color-text);
}

.related-card h3 a:hover {
    color: var(--color-primary);
}

.related-card p {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    line-height: 1.5;
}

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

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
    display: grid;
    gap: 2rem;
}

@media (min-width: 768px) {
    .footer-inner {
        grid-template-columns: 2fr 1fr 1fr;
    }
}

.footer-brand img {
    height: 35px;
    margin-bottom: 0.75rem;
}

.footer-brand p {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.footer-links h4,
.footer-social h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    letter-spacing: 0.5px;
}

.footer-links ul,
.footer-social ul {
    list-style: none;
    padding: 0;
}

.footer-links li,
.footer-social li {
    margin-bottom: 0.5rem;
}

.footer-links a,
.footer-social a {
    color: var(--color-text-light);
    font-size: 0.9rem;
}

.footer-links a:hover,
.footer-social a:hover {
    color: var(--color-primary);
}

.footer-bottom {
    text-align: center;
    padding: 1.5rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* ==========================================================================
   UTILITIES
   ========================================================================== */
@media print {
    .site-header,
    .site-footer,
    .related,
    .menu-toggle,
    .hero-overlay {
        display: none;
    }

    .hero {
        max-height: 200px;
    }

    .container {
        max-width: 100%;
    }
}
.hero-number-link {
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.hero-number-link {
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-block;
    margin-top: 0;
    margin-bottom: 0.5rem;
}
