/*
Theme Name: Shortgame Light Theme
Theme URI: https://shortgame.golf/
Author: Nextgolf / SHORTGAME.GOLF
Description: Tema WordPress leggero per SHORTGAME.GOLF. Home con hero fullscreen mobile-first, header con menu editabile, logo reverse dedicato, titoli pagina nascondibili e gestione oscuramento hero.
Version: 1.0.3
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
Text Domain: shortgame-light-theme
*/

:root {
  --sg-red: #d9252b;
  --sg-teal: #0e5d66;
  --sg-dark: #101010;
  --sg-text: #242424;
  --sg-muted: #666666;
  --sg-bg: #ffffff;
  --sg-soft: #f7f7f7;
  --sg-header-height: 86px;
  --sg-admin-offset: 0px;
}

body.admin-bar { --sg-admin-offset: 32px; }

@media (max-width: 782px) {
  body.admin-bar { --sg-admin-offset: 46px; }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--sg-bg);
  color: var(--sg-text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 18px;
  line-height: 1.55;
  overflow-x: hidden;
}

body.sg-menu-open { overflow: hidden; }

a { color: var(--sg-red); }

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

.sg-site {
  width: 100%;
  min-height: 100vh;
}

.sg-main { width: 100%; }

.sg-content {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 120px 0 72px;
}

body.sg-hide-page-title .sg-page-title {
  display: none !important;
}

.sg-page-title {
  margin: 0 0 28px;
  color: var(--sg-dark);
  font-size: clamp(36px, 5vw, 68px);
  line-height: 1;
  font-weight: 950;
  letter-spacing: -0.05em;
  text-transform: uppercase;
}

/* HEADER / MENU */
.sg-header {
  position: fixed;
  top: var(--sg-admin-offset);
  left: 0;
  z-index: 2000;
  width: 100%;
  height: var(--sg-header-height);
  display: flex;
  align-items: center;
  padding: 0 clamp(22px, 4vw, 56px);
  background: rgba(8, 8, 8, 0.72);
  border-bottom: 1px solid rgba(255,255,255,0.13);
  backdrop-filter: blur(12px);
  transition: background .22s ease, border-color .22s ease, box-shadow .22s ease;
  overflow: visible;
}

body:not(.home) .sg-header,
.sg-header.sg-scrolled,
body.sg-menu-open .sg-header {
  background: rgba(16, 16, 16, 0.98);
  border-bottom-color: rgba(255,255,255,0.08);
  box-shadow: 0 12px 34px rgba(0,0,0,.16);
}

.sg-header-inner {
  width: min(1480px, 100%);
  height: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  align-items: center;
  column-gap: clamp(28px, 4vw, 64px);
}

.sg-brand {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 230px;
  max-width: 230px;
  height: var(--sg-header-height);
  text-decoration: none;
  color: #fff;
  overflow: hidden;
}

.sg-brand-logo {
  display: block;
  width: auto !important;
  height: auto !important;
  max-width: 210px !important;
  max-height: 48px !important;
  object-fit: contain;
  object-position: left center;
}

.sg-brand-text {
  color: #ffffff;
  font-size: 23px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: -0.045em;
  text-transform: uppercase;
  text-shadow: 0 3px 14px rgba(0,0,0,.35);
  white-space: nowrap;
}

.sg-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
  min-width: 0;
  height: 100%;
  overflow: visible;
}

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

.sg-menu {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(14px, 1.5vw, 26px);
  height: 100%;
  min-width: 0;
}

.sg-menu > li {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
  flex: 0 0 auto;
}

.sg-menu a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 4px;
  color: #ffffff;
  text-decoration: none;
  font-size: clamp(13px, 0.88vw, 16px);
  line-height: 1;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .045em;
  border-radius: 999px;
  transition: background .18s ease, color .18s ease;
  text-align: center;
  white-space: nowrap;
}

.sg-menu a:hover,
.sg-menu a:focus,
.sg-menu .current-menu-item > a,
.sg-menu .current_page_item > a {
  background: rgba(255,255,255,.13);
  color: #ffffff;
  padding-left: 14px;
  padding-right: 14px;
}

.sg-menu .sub-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 230px;
  padding: 10px;
  background: #111111;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  box-shadow: 0 22px 48px rgba(0,0,0,.24);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}

.sg-menu li:hover > .sub-menu,
.sg-menu li:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.sg-menu .sub-menu a {
  width: 100%;
  justify-content: flex-start;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 14px;
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
  text-align: left;
}

.sg-menu-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--sg-red);
  color: #fff;
  text-decoration: none;
  font-size: clamp(13px, .9vw, 15px);
  line-height: 1;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .045em;
  white-space: nowrap;
  border: 2px solid rgba(255,255,255,.8);
  box-shadow: 0 12px 28px rgba(0,0,0,.18);
  flex: 0 0 auto;
}

.sg-menu-toggle {
  display: none;
  width: 48px;
  height: 48px;
  border: 2px solid rgba(255,255,255,.65);
  border-radius: 999px;
  background: rgba(0,0,0,.14);
  color: #fff;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
}

.sg-menu-toggle span,
.sg-menu-toggle span::before,
.sg-menu-toggle span::after {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 999px;
  transition: transform .2s ease, opacity .2s ease;
  content: "";
}

.sg-menu-toggle span::before { transform: translateY(-7px); }
.sg-menu-toggle span::after { transform: translateY(5px); }

body.sg-menu-open .sg-menu-toggle span { background: transparent; }
body.sg-menu-open .sg-menu-toggle span::before { transform: translateY(0) rotate(45deg); }
body.sg-menu-open .sg-menu-toggle span::after { transform: translateY(-2px) rotate(-45deg); }

/* HERO HOME */
.sg-hero {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  isolation: isolate;
  color: #fff;
  background-color: #111;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

.sg-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: linear-gradient(rgba(0,0,0,.42), rgba(0,0,0,.34));
}

.sg-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(circle at center, rgba(0,0,0,.01) 0%, rgba(0,0,0,.24) 100%);
}

.sg-hero-inner {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: calc(var(--sg-header-height) + var(--sg-admin-offset) + 42px) 0 72px;
  text-align: center;
}

.sg-hero-title {
  margin: 0 auto;
  max-width: 1120px;
  color: #fff;
  font-size: clamp(42px, 7vw, 96px);
  line-height: .95;
  font-weight: 950;
  letter-spacing: .045em;
  text-transform: uppercase;
  font-style: italic;
  text-shadow: 0 6px 26px rgba(0,0,0,.38);
}

.sg-hero-subtitle {
  margin: 26px auto 0;
  max-width: 980px;
  color: #fff;
  font-size: clamp(21px, 3vw, 42px);
  line-height: 1.22;
  font-weight: 850;
  font-style: italic;
  text-shadow: 0 5px 20px rgba(0,0,0,.42);
}

.sg-hero-actions {
  width: min(100%, 980px);
  margin: clamp(46px, 7vw, 86px) auto 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 34px;
  align-items: stretch;
}

.sg-hero-btn {
  min-height: 78px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 18px 28px;
  border: 4px solid #fff;
  border-radius: 10px;
  color: #fff;
  text-decoration: none;
  text-transform: uppercase;
  font-size: clamp(17px, 1.5vw, 23px);
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: .01em;
  text-align: center;
  box-shadow: 0 14px 34px rgba(0,0,0,.28);
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.sg-hero-btn:hover,
.sg-hero-btn:focus {
  transform: translateY(-3px);
  box-shadow: 0 18px 46px rgba(0,0,0,.36);
  color: #fff;
}

.sg-hero-btn-red { background: var(--sg-red); }
.sg-hero-btn-teal { background: var(--sg-teal); }

.sg-hero-footer-text {
  margin: clamp(54px, 9vw, 110px) auto 0;
  max-width: 980px;
  color: rgba(255,255,255,.96);
  font-size: clamp(17px, 1.7vw, 27px);
  line-height: 1.35;
  font-weight: 500;
  text-shadow: 0 4px 18px rgba(0,0,0,.45);
}

.sg-after-hero { width: 100%; }

/* FOOTER FALLBACK */
.sg-simple-footer {
  width: 100%;
  padding: 28px 20px;
  background: #101010;
  color: rgba(255,255,255,.78);
  text-align: center;
  font-size: 14px;
}

.sg-simple-footer a { color: #fff; }

/* Gutenberg / plugin compatibility */
.entry-content,
.wp-block-post-content { width: 100%; }

.entry-content > *,
.wp-block-post-content > * {
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
}

.entry-content > .alignfull,
.wp-block-post-content > .alignfull {
  max-width: none;
  width: 100%;
}

.entry-content > .alignwide,
.wp-block-post-content > .alignwide { max-width: 1280px; }

button, input, select, textarea { font: inherit; }

@media (max-width: 1280px) {
  .sg-header-inner {
    grid-template-columns: 200px minmax(0, 1fr);
    column-gap: 24px;
  }

  .sg-brand {
    width: 200px;
    max-width: 200px;
  }

  .sg-brand-logo {
    max-width: 185px !important;
    max-height: 42px !important;
  }

  .sg-nav { gap: 16px; }

  .sg-menu { gap: 12px; }

  .sg-menu a {
    font-size: 13px;
    letter-spacing: .03em;
  }

  .sg-menu-cta {
    padding: 0 18px;
    font-size: 13px;
  }
}

/* Mobile/tablet: hamburger anticipato per evitare voci compresse o su due righe */
@media (max-width: 1180px) {
  .sg-header-inner {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .sg-brand {
    width: auto;
    max-width: calc(100vw - 120px);
  }

  .sg-brand-logo {
    max-height: 44px !important;
    max-width: 220px !important;
  }

  .sg-menu-toggle {
    display: inline-flex;
  }

  .sg-nav {
    position: fixed;
    z-index: 1999;
    top: calc(var(--sg-header-height) + var(--sg-admin-offset));
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    width: 100%;
    height: calc(100svh - var(--sg-header-height) - var(--sg-admin-offset));
    overflow-y: auto;
    background: rgba(14,14,14,.985);
    border-top: 1px solid rgba(255,255,255,.10);
    padding: 20px 22px 34px;
    box-shadow: 0 24px 54px rgba(0,0,0,.32);
  }

  body.sg-menu-open .sg-nav {
    display: block;
  }

  .sg-menu {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    height: auto;
    width: 100%;
  }

  .sg-menu > li {
    height: auto;
    display: block;
    width: 100%;
  }

  .sg-menu a {
    width: 100%;
    justify-content: flex-start;
    min-height: 54px;
    padding: 0 18px;
    border-radius: 14px;
    background: rgba(255,255,255,.075);
    max-width: none;
    font-size: 16px;
    line-height: 1;
    text-align: left;
    white-space: nowrap;
    letter-spacing: .035em;
  }

  .sg-menu a:hover,
  .sg-menu a:focus,
  .sg-menu .current-menu-item > a,
  .sg-menu .current_page_item > a {
    padding-left: 18px;
    padding-right: 18px;
    background: rgba(255,255,255,.14);
  }

  .sg-menu .sub-menu {
    position: static;
    min-width: 0;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 8px 0 0 14px;
  }

  .sg-menu .sub-menu a {
    min-height: 46px;
    background: rgba(255,255,255,.04);
    font-size: 15px;
  }

  .sg-menu-cta {
    width: 100%;
    margin-top: 16px;
    min-height: 54px;
    font-size: 15px;
    border-radius: 14px;
  }
}

@media (max-width: 900px) {
  .sg-hero { min-height: 100svh; background-position: center center; }

  .sg-hero-inner {
    width: min(100% - 32px, 720px);
    padding: calc(var(--sg-header-height) + var(--sg-admin-offset) + 28px) 0 54px;
  }

  .sg-hero-actions {
    grid-template-columns: 1fr;
    gap: 18px;
    width: min(100%, 520px);
    margin-top: 44px;
  }

  .sg-hero-btn {
    min-height: 66px;
    border-width: 3px;
    border-radius: 9px;
  }

  .sg-hero-footer-text { margin-top: 42px; }
}

@media (max-width: 560px) {
  :root { --sg-header-height: 72px; }

  body { font-size: 16px; }

  .sg-header { padding: 0 24px; }

  .sg-brand-logo {
    max-height: 38px !important;
    max-width: 190px !important;
  }

  .sg-brand-text { font-size: 19px; }

  .sg-nav {
    padding: 18px 24px 30px;
  }

  .sg-menu a {
    min-height: 54px;
    font-size: 15px;
  }

  .sg-hero {
    min-height: 100svh;
    align-items: center;
    background-position: center top;
  }

  .sg-hero-inner {
    width: min(100% - 28px, 440px);
    padding: calc(var(--sg-header-height) + var(--sg-admin-offset) + 24px) 0 38px;
  }

  .sg-hero-title {
    font-size: clamp(36px, 12vw, 54px);
    line-height: .98;
    letter-spacing: .02em;
  }

  .sg-hero-subtitle {
    margin-top: 18px;
    font-size: clamp(19px, 6vw, 28px);
    line-height: 1.18;
  }

  .sg-hero-actions {
    margin-top: 34px;
    gap: 14px;
    width: 100%;
  }

  .sg-hero-btn {
    min-height: 58px;
    padding: 15px 18px;
    border-width: 3px;
    border-radius: 8px;
    font-size: 16px;
    letter-spacing: 0;
  }

  .sg-hero-footer-text {
    margin-top: 34px;
    font-size: 16px;
    line-height: 1.35;
  }

  .sg-content {
    width: min(100% - 28px, 1180px);
    padding: 96px 0 48px;
  }
}

@media (max-width: 380px) {
  .sg-hero-title { font-size: 34px; }
  .sg-hero-subtitle { font-size: 18px; }
  .sg-hero-btn { font-size: 15px; }
  .sg-brand-logo { max-width: 165px !important; }
}
