/*
Theme Name: MMASM Child
Theme URI: https://mmasm.eu/
Description: Child theme editorial para MMASM.
Author: Emily
Template: twentytwentyfour
Version: 1.1.0
Text Domain: mmasm-child
*/

/* =========================================================
   MMASM — Editorial Mediterranean System v1
   ========================================================= */

:root{
  --mmasm-bg: #f6f2e8;         /* arena clara */
  --mmasm-paper: #fffdf8;      /* papel */
  --mmasm-ink: #1e2f38;        /* tinta principal */
  --mmasm-muted: #5e6d74;      /* texto secundario */
  --mmasm-sea: #1f4e5f;        /* azul mediterráneo */
  --mmasm-terra: #b86f52;      /* terracota */
  --mmasm-olive: #6d7d4e;      /* olivo */
  --mmasm-line: #dfd5c5;       /* línea suave */
  --mmasm-radius: 14px;
  --mmasm-shadow: 0 10px 30px rgba(22, 35, 44, .08);
  --mmasm-max: 1160px;
}

html, body {
  background: radial-gradient(circle at 20% 0%, #fbf8f2 0%, var(--mmasm-bg) 52%, #efe7da 100%);
  color: var(--mmasm-ink);
}

body {
  line-height: 1.68;
  text-rendering: optimizeLegibility;
}

/* Layout shell */
.wp-site-blocks,
.wp-block-group.alignfull > .wp-block-group__inner-container,
main.wp-block-group {
  max-width: var(--mmasm-max);
  margin-inline: auto;
}

/* Header */
header.wp-block-template-part,
.wp-site-blocks > header {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(8px);
  background: color-mix(in srgb, var(--mmasm-paper) 88%, white 12%);
  border-bottom: 1px solid var(--mmasm-line);
}

.wp-block-site-title,
.wp-block-site-title a {
  letter-spacing: .01em;
  text-decoration: none;
}

.wp-block-site-title a {
  font-weight: 700;
}

.wp-block-navigation .wp-block-navigation-item__content {
  font-weight: 560;
  color: var(--mmasm-ink);
}

.wp-block-navigation .wp-block-navigation-item__content:hover {
  color: var(--mmasm-sea);
}

/* Typography */
h1, h2, h3, h4 {
  letter-spacing: -0.018em;
  line-height: 1.15;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2rem, 3.2vw, 3.3rem);
}

h2 {
  font-size: clamp(1.45rem, 2.2vw, 2.25rem);
}

p,
li,
.wp-block-post-excerpt__excerpt {
  color: color-mix(in srgb, var(--mmasm-ink) 88%, black 12%);
}

.has-small-font-size,
small,
.wp-block-post-date,
.wp-block-post-author,
.wp-block-post-terms {
  color: var(--mmasm-muted);
}

/* Hero/intro blocks and section cards */
main .wp-block-group,
main .wp-block-columns {
  border-radius: var(--mmasm-radius);
}

main > .wp-block-group,
main > article,
main .wp-block-query {
  margin-block: clamp(1.2rem, 1.8vw, 2rem);
}

main .wp-block-group:has(> h1),
main .wp-block-group:has(> h2),
main article {
  background: color-mix(in srgb, var(--mmasm-paper) 92%, #fff 8%);
  border: 1px solid var(--mmasm-line);
  box-shadow: var(--mmasm-shadow);
  padding: clamp(1rem, 1.4vw, 1.7rem);
}

/* Links */
a {
  color: var(--mmasm-sea);
  text-decoration-thickness: .09em;
  text-underline-offset: .17em;
  transition: color .2s ease;
}

a:hover {
  color: color-mix(in srgb, var(--mmasm-sea) 72%, var(--mmasm-terra) 28%);
}

/* Buttons */
.wp-block-button__link,
button,
input[type=submit] {
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--mmasm-sea) 45%, black 6%);
  background: linear-gradient(180deg, color-mix(in srgb, var(--mmasm-sea) 88%, white 12%), var(--mmasm-sea));
  color: #f7fbfc;
  font-weight: 620;
  padding: .72rem 1.15rem;
  box-shadow: 0 8px 20px rgba(31, 78, 95, .2);
}

.wp-block-button__link:hover,
button:hover,
input[type=submit]:hover {
  transform: translateY(-1px);
  filter: saturate(1.07);
}

/* Latest posts list as magazine cards */
.wp-block-post-template {
  display: grid;
  gap: 1.05rem;
}

.wp-block-post-template > li,
.wp-block-latest-posts__list > li {
  background: var(--mmasm-paper);
  border: 1px solid var(--mmasm-line);
  border-left: 5px solid color-mix(in srgb, var(--mmasm-terra) 70%, var(--mmasm-sea) 30%);
  border-radius: 12px;
  padding: 1rem 1rem .9rem;
  box-shadow: 0 6px 16px rgba(24, 39, 48, .06);
}

.wp-block-post-title a {
  text-decoration: none;
  color: var(--mmasm-ink);
}

.wp-block-post-title a:hover {
  color: var(--mmasm-sea);
}

/* Quote + separators */
blockquote {
  border-left: 4px solid var(--mmasm-terra);
  background: color-mix(in srgb, var(--mmasm-terra) 8%, var(--mmasm-paper) 92%);
  margin: 1.2rem 0;
  padding: .9rem 1rem;
  border-radius: 8px;
}

hr,
.wp-block-separator {
  border-color: var(--mmasm-line);
  opacity: .7;
}

/* Footer */
footer.wp-block-template-part,
.wp-site-blocks > footer {
  margin-top: 2rem;
  background: linear-gradient(180deg, color-mix(in srgb, var(--mmasm-paper) 82%, #fff 18%), #f2eadf);
  border-top: 1px solid var(--mmasm-line);
}

footer h2,
footer .wp-block-heading {
  color: var(--mmasm-sea);
  font-size: 1rem;
  letter-spacing: .01em;
  text-transform: uppercase;
}

footer a {
  color: var(--mmasm-ink);
}

footer a:hover {
  color: var(--mmasm-terra);
}

/* Utility polish */
img {
  border-radius: 10px;
}

::selection {
  background: color-mix(in srgb, var(--mmasm-sea) 35%, white 65%);
  color: #11212a;
}

/* Mobile */
@media (max-width: 780px) {
  .wp-site-blocks,
  main,
  article {
    padding-inline: .8rem;
  }

  .wp-block-navigation .wp-block-navigation__container {
    gap: .55rem;
  }

  .wp-block-post-template > li,
  .wp-block-latest-posts__list > li {
    padding: .85rem .8rem;
  }
}

/* Pilot cleanup: oculta enlaces de preview en navegación pública */
.wp-block-navigation a[href*='preview'],
.wp-block-navigation a[href*='sample-page'] {
  display: none !important;
}

/* ===== MMASM v2 refinements ===== */
:root {
  --mmasm-display: "Cardo", "Iowan Old Style", "Times New Roman", serif;
}

h1,
h2,
h3,
.wp-block-post-title,
.wp-block-post-title a {
  font-family: var(--mmasm-display);
  letter-spacing: -0.022em;
}

.mmasm-hero h1 {
  font-size: clamp(2.2rem, 4.4vw, 4rem);
  line-height: 1.02;
  margin-bottom: .45rem;
}

.mmasm-featured-topic {
  border: 1px solid var(--mmasm-line);
  border-left: 6px solid var(--mmasm-terra);
  border-radius: 12px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--mmasm-paper) 92%, white 8%), color-mix(in srgb, var(--mmasm-bg) 84%, white 16%));
  box-shadow: 0 8px 20px rgba(20, 36, 46, .08);
}

.mmasm-featured-topic h3 {
  margin-top: .2rem;
  font-size: clamp(1.35rem, 2vw, 2rem);
}

.mmasm-featured-topic .has-small-font-size {
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--mmasm-sea);
  font-weight: 650;
}

/* 2-column editorial grid for latest posts */
.mmasm-posts-grid .wp-block-post-template {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.mmasm-posts-grid .wp-block-post-template > li {
  height: 100%;
}

@media (max-width: 900px) {
  .mmasm-posts-grid .wp-block-post-template {
    grid-template-columns: 1fr;
  }
}

/* v4: footer cleanup + utility app link */
footer nav[aria-label='Xarxes socials'],
footer nav[aria-label='Redes sociales'],
footer nav[aria-label='Social links'],
footer h2:has(+ nav[aria-label='Xarxes socials']) {
  display: none !important;
}

.mmasm-footer-app-link {
  max-width: 1160px;
  margin: .8rem auto 1.4rem;
  padding: .6rem 1rem;
  font-size: .95rem;
  text-align: right;
}

.mmasm-footer-app-link a {
  color: var(--mmasm-sea);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--mmasm-sea) 45%, white 55%);
}

.mmasm-footer-app-link a:hover {
  color: var(--mmasm-terra);
  border-bottom-color: color-mix(in srgb, var(--mmasm-terra) 55%, white 45%);
}
