/*
Theme Name: Federico Gargiani
Theme URI: https://federicogargiani.it
Author: Federico Gargiani
Author URI: https://federicogargiani.it
Description: Portfolio professionale per consulenza SEO e Web Marketing — direzione Inverted Bold con Space Grotesk, dark hero e accenti arancio.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 6.9
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: federico-gargiani
*/

:root {
  --fg-white: #FFFFFF;
  --fg-black: #0A0A0A;
  --fg-orange: #FF6A1A;
  --fg-muted: rgba(255,255,255,0.6);
  --fg-line: rgba(255,255,255,0.12);
  --fg-grid: rgba(255,255,255,0.05);
}

html, body {
  background: var(--fg-black);
  color: var(--fg-white);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.wp-site-blocks > footer { margin-block-start: 0; }

a { text-decoration: none; }

/* === HEADER === */
.fg-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(10,10,10,0.7);
  border-bottom: 1px solid var(--fg-line);
}
body.admin-bar .fg-header {
  top: var(--wp-admin--admin-bar--height, 32px);
}
.fg-header .wp-block-group { margin: 0; }
.fg-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 21px;
  letter-spacing: -0.02em;
  color: var(--fg-white);
}
.fg-logo-mark {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1.5px solid var(--fg-white);
  position: relative;
  margin-right: 4px;
  overflow: visible;
}
.fg-logo-mark svg { display: block; }
.fg-logo-mark::after {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--fg-orange);
  bottom: -3px;
  right: -3px;
}
.fg-logo-growth-mark {
  width: 56px;
  height: 56px;
  border: 0;
  margin-right: 2px;
}
.fg-logo-growth-mark::after { display: none; }
.fg-logo-growth-mark svg {
  width: 56px;
  height: 56px;
}
.fg-logo-text {
  display: grid;
  gap: 2px;
  line-height: 1;
}
.fg-logo-name {
  display: block;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.fg-logo-dot { color: var(--fg-orange); }
.fg-logo-sub {
  display: block;
  color: var(--fg-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.fg-header .fg-logo {
  gap: 16px;
  font-size: 32px;
}
.fg-header .fg-logo-growth-mark,
.fg-header .fg-logo-growth-mark svg {
  width: 82px;
  height: 82px;
}
.fg-header .fg-logo-sub {
  font-size: 13.5px;
}
.fg-nav a {
  color: var(--fg-white);
  font-size: 14px;
  font-weight: 500;
  opacity: 0.75;
  transition: opacity 0.2s;
}
.fg-nav a:hover { opacity: 1; }
.fg-cta-pill .wp-block-button__link {
  background: var(--fg-orange);
  color: var(--fg-black);
  padding: 10px 20px;
  border-radius: 100px;
  font-weight: 600;
  font-size: 14px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.fg-cta-pill .wp-block-button__link:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(255,106,26,0.35);
}

/* === GRID BACKGROUND === */
.fg-grid-bg {
  position: relative;
}
.fg-grid-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--fg-grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--fg-grid) 1px, transparent 1px);
  background-size: 80px 80px;
  z-index: 0;
}
.fg-grid-bg > * { position: relative; z-index: 1; }

/* === HERO === */
.fg-hero { padding: 100px 0 80px; position: relative; }

.fg-tagline {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--fg-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 12px;
}
.fg-tagline::before {
  content: '';
  width: 32px;
  height: 1px;
  background: var(--fg-orange);
}

.fg-headline {
  font-size: clamp(48px, 9vw, 132px) !important;
  font-weight: 700;
  line-height: 0.95 !important;
  letter-spacing: -0.04em !important;
  max-width: 1100px;
}
.fg-headline em {
  font-style: normal;
  position: relative;
  display: inline-block;
}
.fg-headline em::after {
  content: '';
  position: absolute;
  left: -2px;
  right: -2px;
  bottom: 0.08em;
  height: 0.14em;
  background: var(--fg-orange);
  z-index: -1;
  opacity: 0.9;
}
.fg-headline strong {
  position: relative;
  display: inline-block;
  color: var(--fg-orange);
  font-weight: 700;
}
.fg-headline strong::after {
  content: '';
  position: absolute;
  inset: -8px -12px;
  background: radial-gradient(ellipse at center, rgba(255,106,26,0.35), transparent 70%);
  z-index: -1;
  filter: blur(24px);
}

.fg-sub {
  font-size: 19px !important;
  color: var(--fg-muted) !important;
  max-width: 540px;
  line-height: 1.55 !important;
}

.fg-btn-primary .wp-block-button__link {
  background: var(--fg-orange);
  color: var(--fg-black);
  padding: 16px 28px;
  border-radius: 100px;
  font-weight: 600;
  font-size: 15px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.fg-btn-primary .wp-block-button__link:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(255,106,26,0.4);
}
.fg-btn-ghost .wp-block-button__link {
  background: transparent;
  color: var(--fg-white);
  padding: 16px 4px;
  border-radius: 0;
  font-weight: 500;
  font-size: 15px;
  border-bottom: 1px solid var(--fg-line);
  transition: border-color 0.2s;
}
.fg-btn-ghost .wp-block-button__link:hover {
  border-color: var(--fg-white);
  background: transparent;
}

/* === METRICS STRIP === */
.fg-metrics {
  border-top: 1px solid var(--fg-line);
  border-bottom: 1px solid var(--fg-line);
  margin-top: 4rem !important;
}
.fg-metrics > .wp-block-column {
  padding: 32px 28px;
  border-right: 1px solid var(--fg-line);
  position: relative;
}
.fg-metrics > .wp-block-column:last-child { border-right: none; }
.fg-metric-num {
  font-size: 44px !important;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1 !important;
}
.fg-metric-num.has-orange-color { color: var(--fg-orange); }
.fg-metric-label {
  margin-top: 10px !important;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px !important;
  color: var(--fg-muted) !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.fg-metric-idx {
  position: absolute;
  top: 16px;
  right: 18px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--fg-muted);
  opacity: 0.5;
}

/* === SECTION TITLES === */
.fg-section-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px !important;
  color: var(--fg-muted) !important;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.fg-section-tag::before {
  content: '';
  width: 32px;
  height: 1px;
  background: var(--fg-orange);
}
.fg-section-title {
  font-size: clamp(36px, 5vw, 64px) !important;
  font-weight: 700;
  line-height: 1.05 !important;
  letter-spacing: -0.03em !important;
  max-width: 900px;
}

/* === SERVICES === */
.fg-services-grid > .wp-block-column {
  border: 1px solid var(--fg-line);
  padding: 36px 32px;
  transition: border-color 0.3s, transform 0.3s;
}
.fg-services-grid > .wp-block-column:hover {
  border-color: var(--fg-orange);
  transform: translateY(-4px);
}
.fg-services-grid h3 {
  font-size: 1.4rem !important;
  margin-top: 1.5rem !important;
}
.fg-service-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--fg-orange);
  letter-spacing: 0.1em;
}
.fg-services-grid p {
  color: var(--fg-muted) !important;
  font-size: 0.95rem !important;
  line-height: 1.6 !important;
}
.fg-process-grid > .wp-block-column > .wp-block-group {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 1.5rem;
}
.fg-process-num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.4rem;
  font-weight: 600;
  color: var(--fg-orange);
  line-height: 1;
  margin-bottom: 0.25rem !important;
}
.fg-process-grid h3 {
  font-size: 1.25rem !important;
  margin-top: 1rem !important;
}
.fg-process-grid p {
  color: var(--fg-muted) !important;
  font-size: 0.95rem !important;
  line-height: 1.6 !important;
}

/* === BIG METRICS === */
.fg-big-metrics > .wp-block-column {
  padding: 3rem 1.5rem;
  border-right: 1px solid var(--fg-line);
}
.fg-big-metrics > .wp-block-column:last-child { border-right: none; }
.fg-big-num {
  font-size: clamp(56px, 8vw, 96px) !important;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1 !important;
  color: var(--fg-orange) !important;
}
.fg-big-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px !important;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted) !important;
  margin-top: 0.8rem !important;
}

/* === CASE STUDIES === */
.fg-cases-grid > .wp-block-column {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--fg-line);
  padding: 32px;
}
.fg-case-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--fg-orange);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.fg-case-uplift {
  font-size: 2.5rem !important;
  font-weight: 700;
  color: var(--fg-orange) !important;
  letter-spacing: -0.03em;
  line-height: 1 !important;
  margin-top: 1.5rem !important;
}
.fg-cases-grid h3 {
  font-size: 1.3rem !important;
  margin-top: 1rem !important;
}
.fg-cases-grid p {
  color: var(--fg-muted) !important;
  font-size: 0.95rem !important;
}

/* === ABOUT === */
.fg-about {
  border-top: 1px solid var(--fg-line);
  border-bottom: 1px solid var(--fg-line);
}
.fg-signature {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem !important;
  color: var(--fg-muted) !important;
  letter-spacing: 0.08em;
  margin-top: 2rem !important;
}

/* === CTA BAND === */
.fg-cta-band {
  border-top: 1px solid var(--fg-line);
  position: relative;
  overflow: hidden;
}
.fg-cta-band::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 600px;
  height: 600px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255,106,26,0.18), transparent 70%);
  pointer-events: none;
}
.fg-cta-band > * { position: relative; }
.fg-cta-headline {
  font-size: clamp(40px, 7vw, 88px) !important;
  font-weight: 700;
  line-height: 1 !important;
  letter-spacing: -0.04em !important;
  max-width: 1000px;
  margin: 0 auto !important;
  text-align: center;
}

/* === FOOTER === */
.fg-footer {
  border-top: 1px solid var(--fg-line);
  padding: 4rem 0 2rem !important;
}
.fg-footer p, .fg-footer a {
  font-size: 0.875rem;
  color: var(--fg-muted);
}
.fg-footer-mono {
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.75rem !important;
}

/* === PAGE TITLE === */
.fg-page-title-section {
  padding: 8rem 0 5rem !important;
  border-bottom: 1px solid var(--fg-line);
}
.fg-page-title-section .wp-block-post-title {
  font-size: clamp(44px, 7vw, 96px) !important;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1 !important;
  position: relative;
  display: inline-block;
}
.fg-page-title-section .wp-block-post-title::after {
  content: '';
  display: block;
  width: 80px;
  height: 4px;
  background: var(--fg-orange);
  margin-top: 1.5rem;
}

/* === EQUAL CARDS === */
.equal-cards > .wp-block-column {
  display: flex;
  flex-direction: column;
  flex-grow: 0;
}
.equal-cards > .wp-block-column > .wp-block-group {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.equal-cards .cta-bottom {
  margin-top: auto;
  justify-content: flex-start;
}

/* === ANIMATIONS === */
html.js .fade-up {
  opacity: 0;
  transform: translateY(30px);
  animation: fgFadeUp 0.8s ease forwards;
}
.fade-up.delay-1 { animation-delay: 0.15s; }
.fade-up.delay-2 { animation-delay: 0.3s; }
.fade-up.delay-3 { animation-delay: 0.45s; }
.fade-up.delay-4 { animation-delay: 0.6s; }

html.js .slide-in-left {
  opacity: 0;
  transform: translateX(-40px);
  animation: fgSlideX 0.8s ease forwards;
}

.hover-lift { transition: transform 0.3s ease, box-shadow 0.3s ease; }
.hover-lift:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

html.js .animate-on-scroll {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes fgFadeUp {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fgSlideX {
  to { opacity: 1; transform: translateX(0); }
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
  main > .wp-block-group.alignfull,
  .fg-page-title-section,
  .fg-footer .wp-block-columns,
  .fg-footer > .wp-block-group {
    padding-right: 20px !important;
    padding-left: 20px !important;
  }
  .fg-header > .wp-block-group {
    padding-top: 14px !important;
    padding-right: 20px !important;
    padding-bottom: 14px !important;
    padding-left: 20px !important;
  }
  .fg-header .fg-logo {
    gap: 10px;
    max-width: 100%;
    min-width: 0;
    font-size: clamp(20px, 5.8vw, 24px);
  }
  .fg-header .fg-logo-growth-mark,
  .fg-header .fg-logo-growth-mark svg {
    width: clamp(52px, 15vw, 62px);
    height: clamp(52px, 15vw, 62px);
  }
  .fg-header .fg-logo-text {
    min-width: 0;
  }
  .fg-header .fg-logo-name,
  .fg-header .fg-logo-sub {
    white-space: nowrap;
  }
  .fg-header .fg-logo-sub {
    font-size: clamp(9px, 2.6vw, 10.5px);
    letter-spacing: 0.05em;
  }
  .fg-tagline,
  .fg-section-tag {
    flex-wrap: wrap;
    gap: 8px;
    font-size: 11px !important;
    letter-spacing: 0.08em;
  }
  .fg-tagline::before,
  .fg-section-tag::before {
    width: 24px;
  }
  .fg-headline {
    font-size: clamp(38px, 10.5vw, 48px) !important;
    overflow-wrap: normal;
    word-break: normal;
  }
  .fg-headline em {
    white-space: nowrap;
  }
  .fg-section-title {
    font-size: clamp(30px, 9vw, 46px) !important;
  }
  .fg-cta-headline {
    font-size: clamp(34px, 10vw, 56px) !important;
  }
  .fg-services-grid,
  .fg-process-grid,
  .fg-cases-grid,
  .fg-big-metrics,
  .fg-metrics {
    flex-wrap: wrap !important;
  }
  .fg-services-grid > .wp-block-column,
  .fg-process-grid > .wp-block-column,
  .fg-cases-grid > .wp-block-column,
  .fg-big-metrics > .wp-block-column,
  .fg-metrics > .wp-block-column {
    flex-basis: 100% !important;
  }
  .fg-btn-primary .wp-block-button__link,
  .fg-btn-ghost .wp-block-button__link {
    white-space: normal;
  }
  .fg-footer > .wp-block-group {
    flex-wrap: wrap !important;
    gap: 12px;
  }
  .fg-footer-mono {
    overflow-wrap: anywhere;
  }
  .fg-hero { padding: 64px 0 48px; }
  .fg-metrics > .wp-block-column { border-right: none; border-bottom: 1px solid var(--fg-line); }
  .fg-metrics > .wp-block-column:last-child { border-bottom: none; }
  .fg-big-metrics > .wp-block-column { border-right: none; border-bottom: 1px solid var(--fg-line); padding: 2rem 1rem; }
  .fg-big-metrics > .wp-block-column:last-child { border-bottom: none; }
  .fg-services-grid > .wp-block-column { padding: 28px 24px; }
}

@media (max-width: 380px) {
  main > .wp-block-group.alignfull,
  .fg-page-title-section,
  .fg-footer .wp-block-columns,
  .fg-footer > .wp-block-group {
    padding-right: 16px !important;
    padding-left: 16px !important;
  }
  .fg-header > .wp-block-group {
    padding-right: 16px !important;
    padding-left: 16px !important;
  }
  .fg-header .fg-logo {
    gap: 8px;
    font-size: 19px;
  }
  .fg-header .fg-logo-growth-mark,
  .fg-header .fg-logo-growth-mark svg {
    width: 48px;
    height: 48px;
  }
  .fg-header .fg-logo-sub {
    font-size: 8.5px;
    letter-spacing: 0.03em;
  }
  .fg-headline {
    font-size: clamp(34px, 11vw, 40px) !important;
  }
  .fg-sub {
    font-size: 17px !important;
  }
}

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html.js .animate-on-scroll, html.js .fade-up, html.js .slide-in-left {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* === EDITOR VISIBILITY === */
.editor-styles-wrapper .fade-up,
.editor-styles-wrapper .slide-in-left,
.editor-styles-wrapper .animate-on-scroll {
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
  transition: none !important;
}
