:root {
  --bg: #fcfcfc;
  --text: #1f1f1f;
  --muted: #666;
  --line: #dddddd;
  --link: #111;
  --link-hover: #444;
  --max-width: 720px;
}

html {
  font-size: 12px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 2;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.container {
  position: relative;
  width: 100%;
  max-width: 80%;
  margin: 0 auto;
  padding-left: 24px;
  box-sizing: border-box;
}

.page-shell {
  margin-top: 6rem;
  margin-bottom: 4rem;
}

.post {
  max-width: var(--max-width);
  margin: 0 auto;
}

.post-header {
  margin-bottom: 2.5rem;
}

.post-header h1 {
  font-size: clamp(2.1rem, 4vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0;
  font-weight: 700;
}

.post-content p {
  margin: 0 0 1.5rem;
  font-size: 1.08rem;
}

.post-content p:last-child {
  margin-bottom: 0;
}

.post-content {
  color: var(--text);
}

.post-content a,
.post-links a,
.site-footer a,
.post-nav a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.14em;
  transition:
    color 0.2s ease,
    text-decoration-color 0.2s ease;
}

.post-content a:hover,
.post-links a:hover,
.site-footer a:hover,
.post-nav a:hover {
  color: var(--link-hover);
  text-decoration-color: var(--link-hover);
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.5rem 0;
}

.post-links ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-links li {
  margin-bottom: 0.95rem;
  padding-left: 0;
  color: var(--text);
}

.post-links li span {
  color: var(--muted);
  font-size: 0.96rem;
}

.post-nav {
  text-align: center;
  margin-top: 3rem;
}

.site-footer {
  max-width: var(--max-width);
  margin: 5rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}

.site-footer p {
  margin-bottom: 0.6rem;
}

.copyleft {
  display: inline-block;
  transform: rotate(180deg);
}

p {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.giustificato {
  text-align: left;
}

/* Mantieni questi solo se usati in altre pagine */

.highlight-image {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.3s ease-in-out;
  border-radius: 24px;
}

.image-container:hover .highlight-image {
  transform: scale(1.03);
}

.image-overlay {
  position: absolute;
  inset: 0;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.12);
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.image-container:hover .image-overlay {
  opacity: 1;
}

.content-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.text-content,
.image-content {
  flex: 1;
  min-width: 300px;
}

.image-content img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  display: block;
  margin-left: auto;
}

.back-home {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 1000;
  text-decoration: none;
  font-size: 1.6rem;
  line-height: 1;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.back-home:focus,
.back-home:hover {
  text-decoration: underline;
}

.image-content {
  flex: 0 0 auto;
  width: min(100%, 400px);
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.image-content hr {
  width: 100%;
  margin: 8px 0;
  border: none;
  border-top: 1px solid #ccc;
}

.image-content img:first-child {
  width: 400px;
}

.image-content img:last-child {
  width: 84px;
  display: block;
  margin-left: auto;
}

@media (max-width: 767px) {
  .page-shell {
    margin-top: 3rem;
    margin-bottom: 3rem;
  }

  .post-content p {
    font-size: 1rem;
  }

  .site-footer {
    margin-top: 3.5rem;
    font-size: 0.9rem;
  }

  .image-content {
    margin-left: 0;
  }
}

.course-image {
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  box-shadow: 4px 8px 16px rgba(0, 0, 0, 0.15);
  border-radius: 4px;
  cursor: pointer;
}

.course-image:hover,
.course-image:active {
  transform: scale(1.03) translateY(-2px);
  box-shadow: 8px 16px 32px rgba(0, 0, 0, 0.2);
}

.work-list {
  position: relative;
  padding-left: 32px;
}

.work-list::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, #ccc, transparent);
}

.work-year {
  position: relative;
  margin-bottom: 32px;
  transition: transform 0.2s ease;
}

.work-year:hover {
  transform: translateX(4px);
}

.work-year::before {
  content: "";
  position: absolute;
  left: -28px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #555;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #555;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.work-year:hover::before {
  background: #222;
  transform: scale(1.2);
}

.work-year h5 {
  margin-bottom: 8px;
  font-size: 1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #333;
}

.work-year ul {
  margin: 0;
  padding-left: 16px;
}

.work-year ul li {
  margin-bottom: 6px;
  line-height: 1.5;
  opacity: 0.9;
}

.highlight-quote {
  border-left: 3px solid #555;
  padding-left: 16px;
  margin: 20px 0;
  color: #444;
}

.row {
  display: flex;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.14em;
  transition:
    color 0.2s ease,
    text-decoration-color 0.2s ease;
  font-weight: bold;
}

a:hover {
  color: var(--link-hover);
  text-decoration-color: var(--link-hover);
}

.blog-post {
  font-size: 17px;
}
.blog-post .post-content p {
  font-size: 1.08em;
  line-height: 1.8;
}
.blog-post .post-header h1 {
  font-size: clamp(2.2rem, 4vw, 3rem);
}
.blog-post .post {
  max-width: 760px;
}

span {
  font-style: italic;
}

@media (max-width: 767px) {
  .container {
    width: 84%;
    max-width: 84%;
    padding: 0;
  }

  .row {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    flex-wrap: nowrap;
  }

  .text-content,
  .image-content,
  .six.columns,
  .twelve.columns {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    float: none !important;
  }

  .text-content {
    flex: 1 1 0;
    max-width: 36rem;
    order: 1;
  }

  .image-content {
    order: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }

  .image-content img:first-child {
    width: 100%;
    max-width: 100%;
    height: auto;
  }

  .image-content hr {
    width: 100%;
    align-self: stretch;
  }

  .image-content .course-image,
  .image-content img:last-child {
    width: 84px;
    max-width: 84px;
  }

  .text-content h1 {
    font-size: clamp(2.4rem, 11vw, 3.4rem);
    line-height: 1.05;
    margin-bottom: 0.4em;
  }

  .text-content h3 {
    font-size: clamp(1.35rem, 6vw, 1.8rem);
    margin-bottom: 0.9em;
  }

  .text-content p {
    font-size: 1.42rem;
    line-height: 1.75;
    max-width: none;
  }

  .post,
  .blog-post .post {
    max-width: 100%;
  }

  .work-list {
    padding-left: 22px;
  }

  .work-list::before {
    left: 6px;
  }

  .work-year {
    margin-bottom: 24px;
  }

  .work-year::before {
    left: -22px;
  }

  .work-year h5 {
    font-size: 0.92rem;
    line-height: 1.3;
  }

  .work-year ul {
    padding-left: 12px;
  }

  .work-year ul li {
    font-size: 1.32rem;
    line-height: 1.55;
  }
}
