/*
Theme Name: matteo-giannone-child
Theme URI: https://www.matteogiannone.com/
Description: Child theme minimale di GeneratePress per il sito personale di Matteo Giannone.
Author: Matteo Giannone
Template: generatepress
Version: 1.0.0
Text Domain: matteo-giannone-child
WPVibe: yes
*/

:root {
  --mg-ink: #20272B;
  --mg-petrol: #155E63;
  --mg-copper: #B66A3C;
  --mg-ivory: #F7F5F0;
  --mg-white: #FFFFFF;
  --mg-muted: #667276;
  --mg-border: #DAD7CF;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--mg-ivory);
  color: var(--mg-ink);
  font-family: "Aptos", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--mg-petrol);
  text-decoration-thickness: .08em;
  text-underline-offset: .16em;
}

a:hover,
a:focus {
  color: var(--mg-copper);
}

.site-header,
.main-navigation,
.site-footer {
  background: var(--mg-ivory);
}

.site-header {
  border-bottom: 1px solid var(--mg-border);
}

.site-branding .main-title,
.site-branding .site-title {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.site-branding .main-title a,
.site-branding .site-title a {
  color: var(--mg-ink);
  text-decoration: none;
}

.site-description {
  color: var(--mg-muted);
}

.main-navigation .main-nav ul li a {
  color: var(--mg-ink);
  font-weight: 600;
  letter-spacing: .01em;
}

.main-navigation .main-nav ul li > a:hover,
.main-navigation .main-nav ul li.current-menu-item > a,
.main-navigation .main-nav ul li.current-menu-ancestor > a {
  color: var(--mg-petrol);
  background: transparent;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--mg-ink);
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: -0.025em;
}

button,
input[type="button"],
input[type="reset"],
input[type="submit"],
.wp-block-button__link {
  background: var(--mg-petrol);
  border-radius: 2px;
  color: var(--mg-white);
  font-weight: 700;
}

button:hover,
input[type="button"]:hover,
input[type="reset"]:hover,
input[type="submit"]:hover,
.wp-block-button__link:hover {
  background: var(--mg-copper);
  color: var(--mg-white);
}

.site-footer {
  border-top: 1px solid var(--mg-border);
  color: var(--mg-muted);
}

::selection {
  background: var(--mg-petrol);
  color: var(--mg-white);
}


/* Visual refinement: September 2026 */
body {
  line-height: 1.7;
}

.grid-container {
  max-width: 1180px;
}

.site-header .inside-header {
  padding-top: 16px;
  padding-bottom: 16px;
}

.site-branding .main-title,
.site-branding .site-title {
  font-size: 24px;
}

.main-navigation .main-nav ul li a {
  padding-left: 14px;
  padding-right: 14px;
  position: relative;
}

.main-navigation .main-nav ul li.current-menu-item > a::after,
.main-navigation .main-nav ul li.current-menu-ancestor > a::after {
  background: var(--mg-copper);
  bottom: 7px;
  content: "";
  height: 2px;
  left: 14px;
  position: absolute;
  right: 14px;
}

#menu-item-277 > a,
#menu-item-269 > a {
  border: 1px solid var(--mg-border);
  border-radius: 999px;
  line-height: 34px;
  margin-left: 10px;
  margin-top: 8px;
  padding: 0 12px;
}

#menu-item-277 > a:hover,
#menu-item-269 > a:hover {
  background: var(--mg-white);
  border-color: var(--mg-petrol);
}

.entry-content {
  font-size: 18px;
}

.page:not(.home) .inside-article {
  padding-top: 64px;
  padding-bottom: 72px;
}

.page:not(.home) .entry-content {
  margin-left: auto;
  margin-right: auto;
  max-width: 800px;
}

.page:not(.home) .entry-content > h1:first-child {
  font-size: clamp(42px, 6vw, 60px);
  line-height: 1.08;
  margin-bottom: 28px;
}

.page:not(.home) .entry-content h2 {
  border-top: 1px solid var(--mg-border);
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1.2;
  margin-top: 58px;
  padding-top: 28px;
}

.page:not(.home) .entry-content h2 + p {
  margin-top: 0;
}

.page:not(.home) .entry-content p {
  margin-bottom: 1.25em;
}

.home .entry-content > .wp-block-group:first-child {
  min-height: 520px;
  display: flex;
  align-items: center;
}

.home .entry-content > .wp-block-group:first-child .wp-block-group__inner-container {
  max-width: 920px;
}

.home .entry-content > .wp-block-group:first-child h1 {
  font-size: clamp(54px, 8vw, 84px) !important;
  margin-bottom: 24px;
}

.home .entry-content > .wp-block-group:first-child h1 + p {
  max-width: 840px;
}

.home .wp-block-buttons {
  gap: 12px;
  margin-top: 30px;
}

.home .wp-block-button__link {
  border-radius: 8px;
  padding: 13px 20px;
  transition: transform .18s ease, background-color .18s ease, border-color .18s ease;
}

.home .wp-block-button__link:hover {
  transform: translateY(-1px);
}

.home .wp-block-button.is-style-outline .wp-block-button__link {
  background: transparent;
  border: 1px solid var(--mg-petrol);
  color: var(--mg-petrol);
}

.home .wp-block-button.is-style-outline .wp-block-button__link:hover {
  background: var(--mg-white);
  color: var(--mg-copper);
  border-color: var(--mg-copper);
}

.home .entry-content > .wp-block-group:nth-child(2) h2,
.home .entry-content > .wp-block-group:nth-child(3) h2 {
  font-size: clamp(34px, 4vw, 46px);
  margin-bottom: 30px;
}

.home .wp-block-columns {
  gap: 22px;
  align-items: stretch;
}

.home .wp-block-columns > .wp-block-column {
  background: var(--mg-white);
  border: 1px solid var(--mg-border);
  border-radius: 10px;
  padding: 28px;
  position: relative;
}

.home .wp-block-columns > .wp-block-column::before {
  background: var(--mg-copper);
  border-radius: 2px;
  content: "";
  height: 3px;
  left: 28px;
  position: absolute;
  top: 0;
  width: 42px;
}

.home .wp-block-columns h3 {
  font-size: 24px;
  line-height: 1.25;
  margin-top: 6px;
}

.home .wp-block-columns p {
  color: var(--mg-muted);
  font-size: 16px;
  margin-bottom: 0;
}

.home .entry-content > .wp-block-group:nth-child(3) .wp-block-group__inner-container {
  max-width: 900px;
}

.site-footer .inside-site-info {
  padding-top: 24px;
  padding-bottom: 24px;
}

.site-footer .copyright-bar {
  font-size: 14px;
}

@media (max-width: 768px) {
  .site-header .inside-header {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .site-branding .main-title,
  .site-branding .site-title {
    font-size: 21px;
  }

  .home .entry-content > .wp-block-group:first-child {
    min-height: auto;
    padding-top: 56px !important;
    padding-bottom: 56px !important;
  }

  .home .entry-content > .wp-block-group:first-child h1 {
    font-size: 48px !important;
  }

  .home .entry-content > .wp-block-group:first-child h1 + p {
    font-size: 19px !important;
  }

  .home .wp-block-columns > .wp-block-column {
    padding: 24px;
  }

  .page:not(.home) .inside-article {
    padding-top: 44px;
    padding-bottom: 52px;
  }

  .page:not(.home) .entry-content {
    font-size: 17px;
  }

  #menu-item-277 > a,
  #menu-item-269 > a {
    border: 0;
    border-radius: 0;
    margin-left: 0;
    margin-top: 0;
    padding-left: 20px;
  }
}

/* Projects */
.page-id-12 .entry-content > h1 + p,
.page-id-261 .entry-content > h1 + p {
  font-size: 21px;
  line-height: 1.6;
  color: var(--mg-muted);
  max-width: 720px;
}

.page-id-12 .entry-content > h2,
.page-id-261 .entry-content > h2 {
  background: var(--mg-white);
  border: 1px solid var(--mg-border);
  border-left: 4px solid var(--mg-copper);
  border-radius: 10px;
  margin-top: 64px;
  padding: 22px 24px;
}

.page-id-12 .entry-content > h2 + p,
.page-id-261 .entry-content > h2 + p {
  font-size: 19px;
  margin-top: 26px;
}

.page-id-12 .entry-content > h2:last-of-type,
.page-id-261 .entry-content > h2:last-of-type {
  background: transparent;
  border-left-width: 1px;
}

/* Media timeline */
.page-id-16 .entry-content,
.page-id-264 .entry-content {
  position: relative;
}

.page-id-16 .entry-content > h1 + p,
.page-id-264 .entry-content > h1 + p {
  font-size: 21px;
  line-height: 1.6;
  color: var(--mg-muted);
}

.page-id-16 .entry-content > h2,
.page-id-264 .entry-content > h2 {
  border-top: 0;
  margin-left: 30px;
  padding-top: 0;
  position: relative;
}

.page-id-16 .entry-content > h2::before,
.page-id-264 .entry-content > h2::before {
  background: var(--mg-copper);
  border: 5px solid var(--mg-ivory);
  border-radius: 50%;
  content: "";
  height: 14px;
  left: -43px;
  position: absolute;
  top: 10px;
  width: 14px;
  z-index: 2;
}

.page-id-16 .entry-content > h2::after,
.page-id-264 .entry-content > h2::after {
  background: var(--mg-border);
  content: "";
  height: calc(100% + 180px);
  left: -36px;
  position: absolute;
  top: 20px;
  width: 1px;
  z-index: 1;
}

.page-id-16 .entry-content > h2:last-of-type::after,
.page-id-264 .entry-content > h2:last-of-type::after {
  display: none;
}

.page-id-16 .entry-content > h2 ~ p,
.page-id-16 .entry-content > h2 ~ h3,
.page-id-264 .entry-content > h2 ~ p,
.page-id-264 .entry-content > h2 ~ h3 {
  margin-left: 30px;
}

.page-id-16 .entry-content h3,
.page-id-264 .entry-content h3 {
  color: var(--mg-petrol);
  font-size: 22px;
  font-style: italic;
  line-height: 1.35;
  margin-bottom: 18px;
}

.page-id-16 .entry-content p > a[target="_blank"],
.page-id-264 .entry-content p > a[target="_blank"] {
  display: inline-block;
  border-bottom: 1px solid var(--mg-border);
  font-weight: 700;
  padding-bottom: 3px;
  text-decoration: none;
}

.page-id-16 .entry-content > h2:last-of-type,
.page-id-264 .entry-content > h2:last-of-type {
  border-top: 1px solid var(--mg-border);
  margin-left: 0;
  padding-top: 28px;
}

.page-id-16 .entry-content > h2:last-of-type::before,
.page-id-264 .entry-content > h2:last-of-type::before {
  display: none;
}

.page-id-16 .entry-content > h2:last-of-type ~ p,
.page-id-264 .entry-content > h2:last-of-type ~ p {
  margin-left: 0;
}

@media (max-width: 768px) {
  .page-id-12 .entry-content > h2,
  .page-id-261 .entry-content > h2 {
    padding: 18px 20px;
  }

  .page-id-16 .entry-content > h2,
  .page-id-264 .entry-content > h2,
  .page-id-16 .entry-content > h2 ~ p,
  .page-id-16 .entry-content > h2 ~ h3,
  .page-id-264 .entry-content > h2 ~ p,
  .page-id-264 .entry-content > h2 ~ h3 {
    margin-left: 20px;
  }

  .page-id-16 .entry-content > h2::before,
  .page-id-264 .entry-content > h2::before {
    left: -32px;
  }

  .page-id-16 .entry-content > h2::after,
  .page-id-264 .entry-content > h2::after {
    left: -25px;
  }
}

/* Home hero portrait */
.home .entry-content > .wp-block-group:first-child .wp-block-group__inner-container {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, .75fr);
  column-gap: clamp(36px, 5vw, 72px);
  align-items: center;
}

.home .entry-content > .wp-block-group:first-child .wp-block-group__inner-container > * {
  grid-column: 1;
}

.home .entry-content > .wp-block-group:first-child .mg-hero-photo {
  align-self: stretch;
  border: 1px solid var(--mg-border);
  border-radius: 16px;
  box-shadow: 0 14px 34px rgba(32, 39, 43, .08);
  grid-column: 2;
  grid-row: 1 / span 4;
  margin: 0;
  min-height: 390px;
  overflow: hidden;
}

.home .entry-content > .wp-block-group:first-child .mg-hero-photo img {
  display: block;
  height: 100%;
  min-height: 390px;
  object-fit: cover;
  object-position: center center;
  width: 100%;
}

@media (max-width: 900px) {
  .home .entry-content > .wp-block-group:first-child .wp-block-group__inner-container {
    grid-template-columns: 1fr;
    row-gap: 28px;
  }

  .home .entry-content > .wp-block-group:first-child .mg-hero-photo {
    grid-column: 1;
    grid-row: auto;
    min-height: 360px;
    max-width: 560px;
    width: 100%;
  }

  .home .entry-content > .wp-block-group:first-child .mg-hero-photo img {
    min-height: 360px;
  }
}

@media (max-width: 600px) {
  .home .entry-content > .wp-block-group:first-child {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }

  .home .entry-content > .wp-block-group:first-child .wp-block-group__inner-container {
    row-gap: 16px;
  }

  .home .entry-content > .wp-block-group:first-child .mg-hero-photo {
    min-height: 300px;
    border-radius: 12px;
    margin-bottom: 0;
  }

  .home .entry-content > .wp-block-group:first-child .mg-hero-photo img {
    min-height: 300px;
  }

  .home .entry-content > .wp-block-group:nth-child(2) {
    margin-top: 0 !important;
    padding-top: 16px !important;
  }
}
