/*
Theme Name: Bricks Child
Template: bricks
Version: 1.1
*/

/* aPlaceToGo - tipografia articoli blog. Scope: .brxe-post-content (corpo
   articolo, template singolo blog, condiviso da tutti gli articoli).
   Font e colori del design system esistente: titoli Montserrat, corpo
   testo Georgia, blu primario #1d71b8, navy #19213d, accento #ff9f17. */

.brxe-post-content {
  --aptg-navy: #19213d;
  --aptg-blue: #1d71b8;
  --aptg-blue-tint: rgba(29, 113, 184, 0.07);
  --aptg-orange: #ff9f17;
  --aptg-line: #e3e5ea;
  --aptg-body: #2c3247;

  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.75;
  color: var(--aptg-body);
}

/* --- Ritmo verticale di base --- */

.brxe-post-content > * {
  max-width: 68ch;
}

.brxe-post-content > figure,
.brxe-post-content > .wp-block-table,
.brxe-post-content > .wp-block-image,
.brxe-post-content > .wp-block-embed,
.brxe-post-content > hr {
  max-width: none;
}

.brxe-post-content > * + * {
  margin-top: 1.5rem;
}

/* --- Titoli: grandi, Montserrat, respiro sopra --- */

.brxe-post-content h2,
.brxe-post-content h3,
.brxe-post-content h4,
.brxe-post-content h5,
.brxe-post-content h6 {
  font-family: "Montserrat", sans-serif;
  color: var(--aptg-navy);
  line-height: 1.25;
  font-weight: 700;
  max-width: 30ch;
}

.brxe-post-content h2 {
  margin-top: 3.25rem;
  margin-bottom: 0.25rem;
  font-size: clamp(1.6rem, 1.35rem + 1.1vw, 2.15rem);
  letter-spacing: -0.01em;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--aptg-line);
}

.brxe-post-content > h2:first-child {
  margin-top: 0;
}

.brxe-post-content h3 {
  margin-top: 2.5rem;
  margin-bottom: 0.25rem;
  font-size: clamp(1.3rem, 1.15rem + 0.7vw, 1.6rem);
  color: var(--aptg-blue);
}

.brxe-post-content h4 {
  margin-top: 2rem;
  margin-bottom: 0.25rem;
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.brxe-post-content h5,
.brxe-post-content h6 {
  margin-top: 1.75rem;
  margin-bottom: 0.25rem;
  font-size: 1.05rem;
}

/* --- Paragrafi --- */

.brxe-post-content p {
  margin: 0;
}

/* Attacco editoriale: il primo paragrafo dell'articolo respira di piu
   e apre con un capolettera, per dare subito un tono editoriale. */
.brxe-post-content > p:first-of-type {
  font-size: 1.2em;
  line-height: 1.65;
  color: var(--aptg-navy);
}

.brxe-post-content > p:first-of-type::first-letter {
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  color: var(--aptg-blue);
  float: left;
  font-size: 3.4em;
  line-height: 0.82;
  padding-right: 0.1em;
  margin-top: 0.05em;
}

.brxe-post-content strong {
  color: var(--aptg-navy);
  font-weight: 700;
}

.brxe-post-content em {
  font-style: italic;
}

.brxe-post-content a {
  color: var(--aptg-blue);
  text-decoration: underline;
  text-decoration-color: rgba(29, 113, 184, 0.35);
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  transition: text-decoration-color 0.15s ease;
}

.brxe-post-content a:hover {
  text-decoration-color: var(--aptg-blue);
}

/* --- Elenchi --- */

.brxe-post-content ul.wp-block-list,
.brxe-post-content ol.wp-block-list {
  padding-left: 0;
  margin: 0;
  list-style: none;
}

.brxe-post-content ul.wp-block-list li,
.brxe-post-content ol.wp-block-list li {
  position: relative;
  padding-left: 1.6rem;
  margin-bottom: 0.9rem;
  line-height: 1.7;
}

.brxe-post-content ul.wp-block-list li:last-child,
.brxe-post-content ol.wp-block-list li:last-child {
  margin-bottom: 0;
}

.brxe-post-content ul.wp-block-list > li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--aptg-blue);
}

.brxe-post-content ol.wp-block-list {
  counter-reset: aptg-ol;
}

.brxe-post-content ol.wp-block-list > li {
  counter-increment: aptg-ol;
  padding-left: 2.1rem;
}

.brxe-post-content ol.wp-block-list > li::before {
  content: counter(aptg-ol);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Montserrat", sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  background: var(--aptg-blue);
  border-radius: 50%;
}

.brxe-post-content li ul,
.brxe-post-content li ol {
  margin-top: 0.6rem;
  margin-bottom: 0 !important;
}

/* --- Citazioni --- */

.brxe-post-content blockquote,
.brxe-post-content .wp-block-quote {
  position: relative;
  max-width: none;
  margin: 2.25rem 0;
  padding: 1.5rem 1.75rem 1.5rem 3.25rem;
  background: var(--aptg-blue-tint);
  border-left: 4px solid var(--aptg-blue);
  border-radius: 0 10px 10px 0;
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--aptg-navy);
}

.brxe-post-content blockquote::before,
.brxe-post-content .wp-block-quote::before {
  content: open-quote;
  position: absolute;
  left: 0.9rem;
  top: 0.55rem;
  font-family: Georgia, serif;
  font-style: normal;
  font-size: 2.75rem;
  line-height: 1;
  color: var(--aptg-blue);
  opacity: 0.55;
}

.brxe-post-content blockquote p,
.brxe-post-content .wp-block-quote p {
  margin: 0;
}

.brxe-post-content blockquote p + p,
.brxe-post-content .wp-block-quote p + p {
  margin-top: 0.75rem;
}

.brxe-post-content blockquote cite,
.brxe-post-content .wp-block-quote cite {
  display: block;
  margin-top: 0.9rem;
  font-family: "Montserrat", sans-serif;
  font-style: normal;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--aptg-blue);
}

.brxe-post-content blockquote cite::before,
.brxe-post-content .wp-block-quote cite::before {
  content: "-- ";
}

/* --- Tabelle --- */

.brxe-post-content .wp-block-table {
  margin: 2.25rem 0;
  overflow-x: auto;
}

.brxe-post-content table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-family: Georgia, serif;
  font-size: 0.98rem;
  border: 1px solid var(--aptg-line);
  border-radius: 10px;
  overflow: hidden;
}
.brxe-post-content table tr:first-child td,
.brxe-post-content table th {
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
  background: var(--aptg-navy);
  border: none;
}

.brxe-post-content table td,
.brxe-post-content table th {
  padding: 0.85rem 1.1rem;
  text-align: left;
  border-bottom: 1px solid var(--aptg-line);
  border-right: none;
  vertical-align: top;
}

.brxe-post-content table tr:last-child td {
  border-bottom: none;
}

.brxe-post-content table tr:not(:first-child):nth-child(odd) td {
  background: #f7f8fa;
}

.brxe-post-content table strong {
  color: inherit;
}

.brxe-post-content figcaption.wp-element-caption {
  margin-top: 0.6rem;
  font-family: "Montserrat", sans-serif;
  font-size: 0.85rem;
  font-style: normal;
  color: #767b8a;
  text-align: center;
}

/* --- Immagini --- */

.brxe-post-content .wp-block-image img,
.brxe-post-content figure img {
  border-radius: 12px;
  display: block;
  width: 100%;
  height: auto;
}

/* --- Separatore --- */

.brxe-post-content hr {
  margin: 2.75rem 0;
  border: none;
  border-top: 1px solid var(--aptg-line);
}

/* --- Codice inline --- */

.brxe-post-content code {
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: #f0f1f4;
  color: var(--aptg-navy);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

.brxe-post-content pre {
  max-width: none;
  background: var(--aptg-navy);
  color: #f0f1f4;
  padding: 1.25rem 1.5rem;
  border-radius: 10px;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.6;
}

.brxe-post-content pre code {
  background: none;
  color: inherit;
  padding: 0;
}

/* --- Mobile --- */

@media (max-width: 640px) {
  .brxe-post-content {
    font-size: 17px;
  }

  .brxe-post-content > p:first-of-type::first-letter {
    font-size: 2.6em;
  }

  .brxe-post-content blockquote,
  .brxe-post-content .wp-block-quote {
    padding: 1.25rem 1.25rem 1.25rem 2.5rem;
    font-size: 1.1rem;
  }

  .brxe-post-content table td,
  .brxe-post-content table th {
    padding: 0.65rem 0.75rem;
  }
}

/* --- Aggiornamenti 04/09: colore titoli uniforme come h1, niente restringimento, via la riga sotto h2, meta piu leggibile --- */

.brxe-post-content h2,
.brxe-post-content h3,
.brxe-post-content h4,
.brxe-post-content h5,
.brxe-post-content h6 {
  color: #1d71b8;
  max-width: none;
}

.brxe-post-content h2 {
  border-bottom: none;
  padding-bottom: 0;
}


/* Meta sopra il titolo (data, categoria): in armonia con la nuova tipografia. */
/* important necessario: Bricks genera CSS inline per-elemento con ID (#brxe-xxxxx), piu specifico di una classe. */
.brxe-post-meta.post-meta,
.brxe-post-meta.post-meta a {
  font-family: "Montserrat", sans-serif !important;
  font-style: normal !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em !important;
  color: #1d71b8 !important;
  text-decoration: none !important;
}

#brxe-hhiuds,
#brxe-mriumo {
  margin-bottom: 0.5rem !important;
}
