/*
Theme Name: Giovanni Lucini (Kadence Child)
Theme URI: https://giovannilucini.it
Description: Child theme of Kadence for Giovanni Lucini personal branding site.
Author: Giovanni Lucini
Version: 1.1.0
Template: kadence
Text Domain: kadence-gl-child
*/

/* ========================================
   DESIGN TOKENS
   ======================================== */

:root {
    --gl-accent: #1E3A4C;
    --gl-accent-secondary: #415243;
    --gl-bg: #F5F1EA;
    --gl-surface: #FBF8F3;
    --gl-text: #1F2933;
    --gl-muted: #6A7178;
    --gl-border: #D9D3CA;
    --gl-white: #FFFFFF;
    --gl-font-heading: 'Figtree', sans-serif;
    --gl-font-body: 'Inter', sans-serif;
    --gl-content-width: 800px;
    --gl-wide-width: 1200px;
    --gl-header-height: 64px;
}

/* ========================================
   BASE
   ======================================== */

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--gl-bg) !important;
    color: var(--gl-text);
    font-family: var(--gl-font-body);
    font-size: 1.0625rem;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--gl-font-heading);
    font-weight: 600;
    color: var(--gl-text);
    line-height: 1.2;
}

h1 { font-size: 2.5rem; margin-bottom: 1rem; }
h2 { font-size: 1.75rem; margin-top: 2.5rem; margin-bottom: 1rem; }
h3 { font-size: 1.25rem; margin-top: 1.5rem; margin-bottom: 0.5rem; }

a {
    color: var(--gl-accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

/* ========================================
   LAYOUT — BLOCK CONTENT
   ======================================== */

.entry-content > .wp-block-group,
.entry-content > .wp-block-columns,
.entry-content > .wp-block-heading,
.entry-content > .wp-block-paragraph,
.entry-content > .wp-block-list,
.entry-content > .wp-block-image,
.entry-content > .wp-block-buttons,
.entry-content > .wp-block-shortcode {
    max-width: var(--gl-wide-width);
    margin-left: auto;
    margin-right: auto;
}

.wp-block-group.has-background {
    padding-left: 2rem;
    padding-right: 2rem;
}

/* Constrained layout override for Kadence compat */
.is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
    max-width: var(--gl-content-width);
    margin-left: auto !important;
    margin-right: auto !important;
}

.is-layout-constrained > .alignwide {
    max-width: var(--gl-wide-width);
}

/* ========================================
   HEADER
   ======================================== */

.gl-header {
    background: var(--gl-surface);
    border-bottom: 1px solid var(--gl-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--gl-header-height);
}

.admin-bar .gl-header {
    top: 32px;
}

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

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

.gl-site-title {
    font-family: var(--gl-font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gl-text);
    text-decoration: none;
    white-space: nowrap;
}

.gl-site-title:hover {
    color: var(--gl-accent);
}

/* Desktop navigation */
.gl-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.gl-nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.25rem;
}

.gl-nav-menu li {
    list-style: none;
}

.gl-nav-menu a {
    font-family: var(--gl-font-body);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gl-muted);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}

.gl-nav-menu a:hover {
    color: var(--gl-text);
    background: rgba(0,0,0,0.04);
}

.gl-nav-menu .current-menu-item > a,
.gl-nav-menu .current-menu-ancestor > a {
    color: var(--gl-accent);
    font-weight: 600;
}

/* Language switcher */
.gl-lang-switch {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8125rem;
    font-weight: 500;
}

.gl-lang-switch a {
    color: var(--gl-muted);
    text-decoration: none;
    padding: 0.25rem 0.375rem;
}

.gl-lang-switch a:hover {
    color: var(--gl-text);
}

.gl-lang-switch .gl-lang-current {
    color: var(--gl-accent);
    font-weight: 700;
}

.gl-lang-switch .gl-lang-sep {
    color: var(--gl-border);
}

/* Header CTA */
.gl-header-cta {
    display: inline-block;
    background: var(--gl-accent);
    color: var(--gl-white) !important;
    font-family: var(--gl-font-body);
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    border-radius: 4px;
    text-decoration: none;
    transition: background 0.2s;
    white-space: nowrap;
}

.gl-header-cta:hover {
    background: var(--gl-accent-secondary);
    color: var(--gl-white) !important;
}

/* Mobile hamburger */
.gl-hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    width: 44px;
    height: 44px;
    position: relative;
}

.gl-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--gl-text);
    margin: 5px auto;
    transition: transform 0.3s, opacity 0.3s;
}

.gl-hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.gl-hamburger.active span:nth-child(2) {
    opacity: 0;
}

.gl-hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile menu */
.gl-mobile-menu {
    display: none;
    background: var(--gl-surface);
    border-bottom: 1px solid var(--gl-border);
    padding: 1rem 1.5rem 1.5rem;
}

.gl-mobile-menu.open {
    display: block;
}

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

.gl-mobile-menu .menu li {
    list-style: none;
}

.gl-mobile-menu .menu a {
    display: block;
    padding: 0.75rem 0;
    font-size: 1rem;
    font-weight: 500;
    color: var(--gl-text);
    border-bottom: 1px solid var(--gl-border);
}

.gl-mobile-menu .menu .current-menu-item > a {
    color: var(--gl-accent);
    font-weight: 600;
}

.gl-mobile-menu .gl-mobile-extras {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 1rem;
}

@media (max-width: 768px) {
    .gl-nav-menu,
    .gl-lang-switch,
    .gl-header-cta {
        display: none;
    }

    .gl-hamburger {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* ========================================
   FOOTER
   ======================================== */

.gl-footer {
    background: var(--gl-text);
    color: var(--gl-white);
    padding: 2.5rem 1.5rem;
    margin-top: 0;
}

.gl-footer-inner {
    max-width: var(--gl-wide-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gl-footer-copy {
    font-size: 0.8125rem;
    color: rgba(255,255,255,0.7);
}

.gl-footer-social a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: color 0.2s;
}

.gl-footer-social a:hover {
    color: var(--gl-white);
}

.gl-footer-social svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

@media (max-width: 768px) {
    .gl-footer-inner {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* ========================================
   BREADCRUMBS
   ======================================== */

.gl-breadcrumbs {
    max-width: var(--gl-wide-width);
    margin: 0 auto;
    padding: 1rem 1.5rem 0;
    font-size: 0.8125rem;
    color: var(--gl-muted);
}

.gl-breadcrumbs a {
    color: var(--gl-muted);
    text-decoration: none;
}

.gl-breadcrumbs a:hover {
    color: var(--gl-accent);
}

.gl-breadcrumbs .gl-sep {
    margin: 0 0.375rem;
}

/* ========================================
   CONTACT CTA BAND
   ======================================== */

.gl-cta-band {
    background: var(--gl-accent);
    color: var(--gl-white);
    text-align: center;
    padding: 4rem 1.5rem;
    margin-top: 4rem;
}

.gl-cta-band h2 {
    color: var(--gl-white);
    font-size: 1.75rem;
    margin-top: 0;
    margin-bottom: 0.75rem;
}

.gl-cta-band p {
    color: var(--gl-border);
    max-width: 500px;
    margin: 0 auto 1.5rem;
    font-size: 1rem;
}

.gl-cta-band .gl-btn {
    display: inline-block;
    background: var(--gl-white);
    color: var(--gl-accent);
    padding: 0.75rem 2rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s;
}

.gl-cta-band .gl-btn:hover {
    background: rgba(255,255,255,0.9);
    transform: translateY(-1px);
}

/* ========================================
   SCROLL TO TOP
   ======================================== */

.gl-scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 44px;
    height: 44px;
    background: var(--gl-accent);
    color: var(--gl-white);
    border: none;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, background 0.2s;
    z-index: 999;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.gl-scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.gl-scroll-top:hover {
    background: var(--gl-accent-secondary);
}

/* ========================================
   ARCHIVE CARDS
   ======================================== */

.gl-card {
    position: relative;
    background: var(--gl-surface);
    border: 1px solid var(--gl-border);
    border-radius: 6px;
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.gl-card-link {
    text-decoration: none;
    color: inherit;
}

.gl-card-link::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 6px;
}

.gl-card h3 {
    margin-top: 0.25rem;
}

.gl-card h3 a {
    color: var(--gl-text);
    text-decoration: none;
}

/* Theme badges */
.gl-badge {
    display: inline-block;
    font-size: 0.75rem;
    padding: 0.25rem 0.625rem;
    background: var(--gl-surface);
    border: 1px solid var(--gl-border);
    border-radius: 100px;
    color: var(--gl-muted);
    margin-right: 0.375rem;
    margin-bottom: 0.375rem;
}

/* ========================================
   404 PAGE
   ======================================== */

.gl-404 {
    text-align: center;
    padding: 6rem 1.5rem;
    max-width: 600px;
    margin: 0 auto;
}

.gl-404 h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.gl-404 p {
    font-size: 1.125rem;
    color: var(--gl-muted);
    margin-bottom: 2rem;
}

.gl-404-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.gl-404-links a {
    font-weight: 500;
}

/* ========================================
   UTILITIES
   ======================================== */

.gl-text-muted { color: var(--gl-muted); }
.gl-text-center { text-align: center; }
.gl-text-small { font-size: 0.8125rem; }

/* Fix Kadence page layout for pages using default template */
.page-template-default .entry-content-wrap,
.single .entry-content-wrap {
    padding: 0 1.5rem;
}

/* Override Kadence content containment */
.site-container .content-wrap {
    max-width: 100%;
    padding: 0;
}

.entry.content-bg {
    background: transparent;
    max-width: 100%;
}

/* Responsive images */
.entry-content img {
    max-width: 100%;
    height: auto;
}

/* WP Block overrides for Kadence */
.wp-block-button__link {
    font-family: var(--gl-font-body);
    font-weight: 600;
}

.wp-block-columns {
    gap: 2rem;
}

@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }

    .wp-block-columns {
        flex-direction: column;
    }

    .entry-content-wrap {
        padding: 0 1rem;
    }
}
