/*
Theme Name: Nerdgate Pro Custom
Theme URI: https://nerdgate.it
Author: Federico Cavallaro
Description: Tema magazine ad alte prestazioni ispirato a Navid Pro, progettato su misura per Nerdgate.
Version: 1.4.0
Text Domain: nerdgate-theme
*/

:root {
    --bg-body: #f4f6f8;
    --bg-card: #ffffff;
    --text-main: #111827;
    --text-muted: #6b7280;
    --accent: #e11d48;
    --accent-hover: #be123c;
    --dark-bar: #0f172a;
    --border-radius: 12px;
    --container-width: 1280px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 10px 20px rgba(0, 0, 0, 0.12);
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Outfit', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

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

.ng-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Badge Categoria / Tag stile Navid --- */
.ng-badge {
    display: inline-block;
    background-color: var(--accent);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 6px;
    margin-bottom: 10px;
}

/* --- Header Principale & Menu a Tendina (Dropdown) --- */
.ng-header {
    background-color: var(--bg-card);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.ng-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px;
}

.ng-branding .custom-logo-link img {
    max-height: 60px;
    width: auto;
}

.ng-logo-text {
    font-family: var(--font-heading);
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.ng-logo-text span {
    color: var(--accent);
}

.ng-nav ul {
    display: flex;
    list-style: none;
    gap: 24px;
    align-items: center;
    margin: 0;
    padding: 0;
}

.ng-nav li {
    position: relative;
}

.ng-nav a {
    font-weight: 600;
    font-size: 0.95rem;
    display: block;
    padding: 8px 0;
}

.ng-nav a:hover {
    color: var(--accent);
}

.ng-nav ul.sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-card);
    box-shadow: var(--shadow-hover);
    border-radius: var(--border-radius);
    min-width: 200px;
    padding: 10px 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.25s ease;
    z-index: 999;
}

.ng-nav li:hover > ul.sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.ng-nav ul.sub-menu li {
    width: 100%;
}

.ng-nav ul.sub-menu a {
    padding: 8px 20px;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
}

.ng-nav ul.sub-menu a:hover {
    background-color: var(--bg-body);
    color: var(--accent);
}

/* --- Hero Magazine Grid a 5 Blocchi (Bento Layout) --- */
.ng-hero-grid-5 {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: 240px 240px;
    gap: 20px;
    margin: 30px 0;
}

.ng-hero-card {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    padding: 20px;
    color: #fff;
    background-color: #000;
}

.ng-hero-card.hero-main {
    grid-column: 1;
    grid-row: 1 / span 2;
}

.hero-main .ng-hero-title {
    font-size: 1.7rem;
}

.ng-hero-card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.75;
    transition: transform 0.4s ease, opacity 0.3s ease;
}

.ng-hero-card:hover img {
    transform: scale(1.05);
    opacity: 0.6;
}

.ng-hero-overlay {
    position: relative;
    z-index: 2;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    margin: -20px;
    padding: 35px 20px 20px;
    width: calc(100% + 40px);
}

.ng-hero-title {
    font-family: var(--font-heading);
    font-weight: 800;
    line-height: 1.25;
    color: #fff;
    font-size: 1rem;
}

/* --- Titoli Sezioni e Paginazione --- */
.ng-section-header {
    display: flex;
    align-items: center;
    margin: 40px 0 24px;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 10px;
}

.ng-section-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    text-transform: uppercase;
    position: relative;
}

.ng-section-title::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 0;
    width: 60px;
    height: 4px;
    background-color: var(--accent);
}

/* --- Griglia Articoli Standard --- */
.ng-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.ng-post-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
}

.ng-post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.ng-card-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #1f2937;
}

.ng-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ng-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.ng-card-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.35;
}

.ng-card-title a:hover {
    color: var(--accent);
}

.ng-card-meta {
    margin-top: auto;
    padding-top: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
}

/* --- Layout Recensione a 2 Colonne (Contenuto + Scheda Tecnica) --- */
.ng-review-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
    align-items: start;
    margin: 40px auto;
    max-width: var(--container-width);
}

.ng-review-main {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: var(--shadow-sm);
}

/* Sidebar / Box Scheda Tecnica */
.ng-tech-sidebar {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 100px;
}

.ng-tech-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent);
    color: var(--text-main);
}

.ng-tech-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ng-tech-item {
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 8px;
}

.ng-tech-label {
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ng-tech-value {
    color: var(--text-main);
    font-weight: 600;
    margin-top: 2px;
}

/* --- Testo Giustificato (Articoli e Pagine) --- */
.ng-entry-content,
.ng-single-wrap,
.ng-review-main {
    text-align: justify;
    text-justify: inter-word;
}

/* --- Articolo Singolo & Pagine --- */
.ng-single-wrap {
    max-width: 860px;
    margin: 40px auto;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: var(--shadow-sm);
}

.ng-single-title {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    line-height: 1.2;
    margin-bottom: 16px;
}

.ng-single-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.ng-single-thumb {
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 28px;
}

.ng-entry-content {
    font-size: 1.08rem;
    line-height: 1.8;
}

.ng-entry-content p {
    margin-bottom: 1.4em;
}

.ng-entry-content h2, .ng-entry-content h3 {
    font-family: var(--font-heading);
    margin: 1.6em 0 0.6em;
}

/* --- Footer --- */
.ng-footer {
    background-color: var(--dark-bar);
    color: #9ca3af;
    padding: 50px 0 30px;
    margin-top: 60px;
    font-size: 0.9rem;
}

.ng-footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 30px;
    padding-top: 20px;
    text-align: center;
}

@media (max-width: 1024px) {
    .ng-hero-grid-5 {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }
    .ng-hero-card.hero-main {
        grid-column: 1;
        grid-row: auto;
        min-height: 320px;
    }
    .ng-hero-card {
        min-height: 220px;
    }
    .ng-review-layout {
        grid-template-columns: 1fr;
    }
    .ng-tech-sidebar {
        position: static;
    }
    .ng-single-wrap, .ng-review-main {
        padding: 24px 18px;
    }
}
