/*
Theme Name: Impresa Monitor
Theme URI: https://example.com/impresa-monitor
Author: Smart Italy Communications
Description: Tema editoriale WordPress per news economiche e imprese, con homepage configurabile, ricerca in header, advertising slot e lettura continua degli articoli.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: impresa-monitor
*/

:root {
  --im-blue: #063763;
  --im-blue-2: #0b477f;
  --im-pink: #cf2877;
  --im-ink: #07182e;
  --im-muted: #6f7d8d;
  --im-line: #d9e0e8;
  --im-soft: #f5f8fb;
  --im-white: #fff;
  --im-max: 1560px;
  --im-gap: 28px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--im-ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  background: var(--im-white);
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--im-pink);
}

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

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.im-wrap {
  width: min(calc(100% - 48px), var(--im-max));
  margin: 0 auto;
}

.im-site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 3px solid var(--im-blue);
  box-shadow: 0 4px 18px rgba(7, 24, 46, 0.05);
}

.im-topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 30px;
  min-height: 86px;
}

.im-logo {
  color: var(--im-blue);
  font-size: 34px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
}

.im-logo a,
.custom-logo-link {
  color: inherit;
  display: inline-flex;
  align-items: center;
}

.custom-logo {
  max-height: 64px;
  width: auto;
}

.im-logo-mark {
  color: var(--im-pink);
  font-weight: 700;
}

.im-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  padding: 0;
  margin: 0;
  list-style: none;
  font-weight: 700;
  color: var(--im-ink);
}

.im-menu li {
  list-style: none;
}

.im-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.im-search-toggle,
.im-icon-link,
.im-newsletter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
}

.im-search-toggle,
.im-icon-link {
  width: 38px;
  height: 38px;
  color: var(--im-ink);
  background: transparent;
}

.im-newsletter {
  min-height: 42px;
  padding: 0 28px;
  color: var(--im-white);
  background: var(--im-pink);
  border-radius: 2px;
  font-weight: 700;
}

.im-socials {
  display: flex;
  gap: 13px;
}

.im-header-search {
  display: none;
  padding: 16px 0 20px;
  border-top: 1px solid var(--im-line);
}

.im-header-search.is-open {
  display: block;
}

.search-form {
  display: flex;
  gap: 10px;
}

.search-field {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--im-line);
  border-radius: 2px;
  font: inherit;
}

.search-submit,
.im-button,
.im-load-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 22px;
  color: var(--im-white);
  background: var(--im-pink);
  border: 0;
  border-radius: 2px;
  font-weight: 700;
  cursor: pointer;
}

.im-ad {
  width: 100%;
  margin: 28px 0;
  text-align: center;
}

.im-ad:empty {
  display: none;
}

.im-home {
  padding: 28px 0 48px;
}

.im-lead-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(330px, 1fr);
  gap: 34px;
  align-items: stretch;
}

.im-hero-card {
  position: relative;
  min-height: 410px;
  overflow: hidden;
  background: var(--im-blue);
}

.im-hero-card img {
  width: 100%;
  height: 100%;
  min-height: 410px;
  object-fit: cover;
}

.im-hero-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(3, 18, 33, 0.78), rgba(3, 18, 33, 0.14) 72%);
}

.im-hero-copy {
  position: absolute;
  left: 42px;
  bottom: 36px;
  z-index: 2;
  width: min(640px, calc(100% - 64px));
  color: var(--im-white);
}

.im-kicker,
.im-section-title,
.im-card-kicker {
  color: var(--im-blue);
  font-weight: 800;
  text-transform: uppercase;
}

.im-hero-copy .im-kicker,
.im-card-kicker {
  color: var(--im-pink);
  font-size: 14px;
}

.im-hero-copy h1 {
  margin: 8px 0 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 4vw, 58px);
  line-height: 0.96;
}

.im-hero-copy p {
  max-width: 570px;
  margin: 0 0 22px;
  font-size: 18px;
}

.im-side-list {
  padding-left: 26px;
  border-left: 1px solid var(--im-line);
}

.im-side-list h2,
.im-section-title {
  margin: 0 0 18px;
  color: var(--im-blue);
  font-size: 20px;
  line-height: 1.1;
}

.im-side-item {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--im-line);
}

.im-side-item:first-of-type {
  padding-top: 0;
}

.im-side-item img {
  width: 150px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.im-side-item h3,
.im-mini-text h3 {
  margin: 3px 0 4px;
  font-size: 18px;
  line-height: 1.15;
}

.im-date {
  color: var(--im-muted);
  font-size: 13px;
}

.im-section-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--im-gap);
  margin-top: 26px;
}

.im-category-block {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.9fr);
  gap: 18px;
  padding-right: 22px;
  border-right: 1px solid var(--im-line);
}

.im-category-block:last-child {
  border-right: 0;
}

.im-category-block header {
  grid-column: 1 / -1;
}

.im-category-block img {
  width: 100%;
  aspect-ratio: 16 / 8.2;
  object-fit: cover;
}

.im-mini-list article {
  padding: 0 0 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--im-line);
}

.im-mini-list article:last-child {
  border-bottom: 0;
}

.im-focus {
  margin-top: 36px;
  padding-top: 22px;
  border-top: 1px solid var(--im-line);
}

.im-focus-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--im-gap);
}

.im-focus-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  padding-right: 24px;
  border-right: 1px solid var(--im-line);
}

.im-focus-card:last-child {
  border-right: 0;
}

.im-focus-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.im-focus-card h3 {
  margin: 6px 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  line-height: 1.05;
}

.im-opinions {
  margin-top: 42px;
  padding: 28px;
  background: var(--im-soft);
  border-top: 3px solid var(--im-pink);
}

.im-post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--im-gap);
}

.im-post-card {
  border-bottom: 1px solid var(--im-line);
  padding-bottom: 18px;
}

.im-post-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  margin-bottom: 12px;
}

.im-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(135deg, rgba(6, 55, 99, 0.92), rgba(207, 40, 119, 0.72)),
    var(--im-soft);
}

.im-post-card h2,
.im-post-card h3 {
  margin: 0 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  line-height: 1.12;
}

.im-main {
  padding: 36px 0 56px;
}

.im-content-layout {
  display: grid;
  grid-template-columns: minmax(0, 840px) minmax(260px, 360px);
  gap: 56px;
  align-items: start;
  justify-content: center;
}

.im-article {
  padding-bottom: 42px;
  border-bottom: 1px solid var(--im-line);
}

.im-article-header h1 {
  margin: 8px 0 18px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(38px, 5vw, 64px);
  line-height: 0.98;
}

.im-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--im-muted);
  font-size: 14px;
}

.im-meta a {
  color: var(--im-blue);
  font-weight: 700;
}

.im-featured {
  margin: 24px 0;
}

.im-entry {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  line-height: 1.7;
}

.im-entry a {
  color: var(--im-blue-2);
  text-decoration: underline;
}

.im-entry p {
  margin: 0 0 1.3em;
}

.im-author-box {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 20px;
  margin-top: 34px;
  padding: 22px;
  background: var(--im-soft);
  border-left: 4px solid var(--im-blue);
}

.im-author-box img {
  border-radius: 50%;
}

.im-author-box h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.im-next-post {
  margin-top: 26px;
}

.im-sidebar {
  position: sticky;
  top: 116px;
}

.im-widget {
  margin-bottom: 26px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--im-line);
}

.im-archive-title {
  margin: 0 0 26px;
  color: var(--im-blue);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 44px;
}

.im-load-more-wrap {
  margin-top: 28px;
  text-align: center;
}

.im-site-footer {
  padding: 32px 0;
  color: var(--im-white);
  background: var(--im-blue);
}

.im-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

@media (max-width: 1180px) {
  .im-topbar {
    grid-template-columns: 1fr auto;
  }

  .im-nav {
    grid-column: 1 / -1;
    order: 3;
    overflow-x: auto;
    padding-bottom: 14px;
  }

  .im-menu {
    justify-content: flex-start;
    min-width: max-content;
  }

  .im-lead-grid,
  .im-section-row,
  .im-focus-grid,
  .im-content-layout {
    grid-template-columns: 1fr;
  }

  .im-side-list,
  .im-category-block,
  .im-focus-card {
    padding-left: 0;
    padding-right: 0;
    border-left: 0;
    border-right: 0;
  }

  .im-sidebar {
    position: static;
  }
}

@media (max-width: 760px) {
  .im-wrap {
    width: min(calc(100% - 28px), var(--im-max));
  }

  .im-logo {
    font-size: 27px;
  }

  .im-actions {
    gap: 8px;
  }

  .im-newsletter,
  .im-socials {
    display: none;
  }

  .im-hero-card,
  .im-hero-card img {
    min-height: 430px;
  }

  .im-hero-copy {
    left: 22px;
    bottom: 24px;
    width: calc(100% - 44px);
  }

  .im-side-item,
  .im-category-block,
  .im-focus-card,
  .im-post-grid,
  .im-author-box {
    grid-template-columns: 1fr;
  }

  .im-side-item img {
    width: 100%;
  }

  .im-entry {
    font-size: 19px;
  }

  .im-footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }
}
