/*
Theme Name: Aghostino Theme
Theme URI: https://aghostino.local
Author: Aghostino
Author URI: https://aghostino.local
Description: Tema WordPress ispirato a Framer.com con supporto Elementor, pannello di amministrazione personalizzato per header, footer, logo e colori.
Version: 1.0.10
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: aghostino-theme
Tags: elementor, custom-colors, custom-logo, custom-menu, full-width-template, two-columns, blog
*/

/* ============================================================
   CSS CUSTOM PROPERTIES (Variables)
   ============================================================ */
:root {
    --color-bg: #441e6d;
    --color-primary: #ffffff;
    --color-secondary: #9e7eb0;
    --color-bg-dark: #2d1449;
    --color-bg-light: #5a2e8a;
    --color-border: rgba(158, 126, 176, 0.2);
    --color-text-muted: rgba(255, 255, 255, 0.6);
    --color-hover: #b89fd0;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --header-height: 64px;
    --container-max: 1200px;
    --border-radius: 8px;
    --border-radius-lg: 16px;
    --transition: 0.2s ease;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 8px 40px rgba(0, 0, 0, 0.4);
}

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

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

body {
    font-family: var(--font-main);
    background-color: var(--color-bg);
    color: var(--color-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

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

a:hover {
    color: var(--color-secondary);
}

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

ul, ol {
    list-style: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: var(--font-main);
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    color: var(--color-primary);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.75rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p {
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
}

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

.site-main {
    flex: 1;
    padding-top: var(--header-height);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-bg);
    border: 1.5px solid var(--color-primary);
}

.btn-primary:hover {
    background-color: transparent;
    color: var(--color-primary);
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-primary);
    border: 1.5px solid var(--color-border);
}

.btn-secondary:hover {
    border-color: var(--color-secondary);
    color: var(--color-secondary);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-muted);
    border: none;
    padding: 8px 12px;
}

.btn-ghost:hover {
    color: var(--color-primary);
}

/* ============================================================
   ELEMENTOR COMPATIBILITY
   ============================================================ */
.elementor-section,
.elementor-container,
.elementor-widget-wrap {
    background-color: transparent;
}

.elementor-page .site-main {
    padding-top: var(--header-height);
}

/* Quando Elementor gestisce il contenuto, il wrapper non aggiunge padding extra */
.page-content-elementor {
    padding: 0;
    margin: 0;
}
.page-content-elementor .page-article {
    padding: 0;
    margin: 0;
}

.elementor-kit-1 {
    --e-global-color-primary: var(--color-primary);
    --e-global-color-secondary: var(--color-secondary);
    --e-global-color-text: var(--color-primary);
    --e-global-color-accent: var(--color-secondary);
}

/* Aree Elementor */
.elementor-location-header,
.elementor-location-footer {
    position: relative;
    z-index: 100;
}

/* ============================================================
   UTILITIES
   ============================================================ */
.text-muted { color: var(--color-text-muted); }
.text-secondary { color: var(--color-secondary); }
.text-center { text-align: center; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    background-color: var(--color-secondary);
    color: var(--color-bg);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.divider {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 24px 0;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ============================================================
   ADMIN BAR ADJUSTMENT
   ============================================================ */
.admin-bar .site-header {
    top: 32px;
}

@media screen and (max-width: 782px) {
    .admin-bar .site-header {
        top: 46px;
    }
}

/* ============================================================
   SCROLLBAR PERSONALIZZATA
   ============================================================ */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--color-secondary);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-hover);
}

/* ============================================================
   ARCHIVE / INDEX – POST GRID & CARD
   ============================================================ */
.site-main {
    padding: calc(var(--header-height) + 48px) 0 72px;
    min-height: 60vh;
}

/* Homepage con pagina selezionata: fullscreen senza padding né container */
.site-main--fullscreen {
    padding: 0;
    margin: 0;
    width: 100%;
    min-height: 100vh;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 28px;
}

/* ---- Post Card ---- */
.post-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.post-card:hover {
    border-color: rgba(158, 126, 176, 0.5);
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.post-card-thumbnail {
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 9;
}

.post-card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease;
    display: block;
}

.post-card:hover .post-card-thumbnail img {
    transform: scale(1.04);
}

.post-card-body {
    padding: 22px 22px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.post-card-cat {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-secondary);
    text-decoration: none;
    transition: color var(--transition);
}

.post-card-cat:hover {
    color: var(--color-primary);
}

.post-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.02em;
    margin: 0;
}

.post-card-title a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition);
}

.post-card-title a:hover {
    color: var(--color-secondary);
}

.post-card-excerpt {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    line-height: 1.65;
    margin: 0;
    flex: 1;
}

.post-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.35);
    margin-top: 2px;
}

.post-card-meta::before {
    content: '';
    display: block;
    width: 100%;
    height: 1px;
    background: var(--color-border);
    margin-bottom: 4px;
    order: -1;
    flex-basis: 100%;
}

.post-card-date::after {
    content: '·';
    margin-left: 10px;
}

.post-card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-secondary);
    text-decoration: none;
    margin-top: 4px;
    transition: color var(--transition), gap var(--transition);
}

.post-card-link:hover {
    color: var(--color-primary);
    gap: 9px;
}

/* Paginazione */
.pagination {
    margin-top: 52px;
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-muted);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--color-border);
    text-decoration: none;
    transition: color var(--transition), background-color var(--transition), border-color var(--transition);
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current {
    color: var(--color-primary);
    background: rgba(158, 126, 176, 0.15);
    border-color: rgba(158, 126, 176, 0.45);
}

@media (max-width: 640px) {
    .posts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .post-card-body {
        padding: 18px;
    }
}
