/* ── Estils del blog d'automatitza.cat ──
   Reutilitza les variables, el nav, els botons i el peu de la pàgina principal. */

:root {
  --bg:      #faf9f7;
  --bg2:     #f2f0ec;
  --surface: #ffffff;
  --border:  #e4e1db;
  --accent:  #2d6a4f;
  --accent-l:#52b788;
  --text:    #1a1a1a;
  --muted:   #6b6560;
  --light:   #a09890;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { background: var(--bg); color: var(--text); font-family: 'Outfit', sans-serif; font-size: 16px; line-height: 1.7; overflow-x: hidden; }

/* ── NAV ── */
#nav { position: fixed; top: 0; left: 0; right: 0; z-index: 900; display: flex; align-items: center; justify-content: space-between; padding: 1.2rem 6vw; background: rgba(250,249,247,.97); backdrop-filter: blur(12px); box-shadow: 0 1px 0 var(--border); }
.nav-logo { font-weight: 600; font-size: 1rem; color: var(--text); text-decoration: none; }
.nav-logo span { color: var(--accent); }
.nav-links { display: flex; gap: 2.2rem; list-style: none; align-items: center; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: .88rem; transition: color .2s; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-cta { background: var(--accent) !important; color: white !important; padding: .5rem 1.3rem; border-radius: 100px; font-weight: 500; font-size: .85rem !important; transition: opacity .2s; }
.nav-cta:hover { opacity: .85; }
.nav-hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: .3rem; background: none; border: none; }
.nav-hamburger span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; }
@media(max-width: 640px) {
  .nav-links { display: none; position: fixed; top: 61px; left: 0; right: 0; background: var(--surface); flex-direction: column; gap: 0; border-bottom: 1px solid var(--border); padding: .5rem 0; box-shadow: 0 8px 24px rgba(0,0,0,.06); }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: .8rem 6vw; font-size: .95rem; }
  .nav-cta { margin: .5rem 6vw !important; text-align: center !important; display: block !important; border-radius: 100px !important; }
  .nav-hamburger { display: flex; }
}

/* ── BOTONS ── */
.btn-primary { background: var(--accent); color: white; padding: .8rem 1.8rem; font-weight: 500; font-size: .92rem; border: none; cursor: pointer; text-decoration: none; border-radius: 100px; display: inline-flex; align-items: center; gap: .4rem; transition: opacity .2s, transform .2s, box-shadow .2s; font-family: 'Outfit', sans-serif; }
.btn-primary:hover { opacity: .9; transform: translateY(-2px); box-shadow: 0 6px 24px rgba(45,106,79,.22); }
.btn-ghost { border: 1px solid var(--border); color: var(--muted); padding: .8rem 1.8rem; font-weight: 400; font-size: .92rem; text-decoration: none; border-radius: 100px; display: inline-flex; align-items: center; transition: border-color .2s, color .2s; font-family: 'Outfit', sans-serif; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ── SECCIONS GENERALS ── */
section { padding: 7rem 6vw; scroll-margin-top: 80px; }
.section-tag { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); font-weight: 500; margin-bottom: 1rem; display: block; }
h2 { font-family: 'Playfair Display', serif; font-weight: 600; font-size: clamp(1.9rem, 4vw, 3rem); letter-spacing: -.02em; line-height: 1.15; margin-bottom: 1rem; }
h2 em { font-style: italic; color: var(--accent); }
.intro-text { font-size: 1rem; color: var(--muted); font-weight: 300; max-width: 520px; margin-bottom: 3.5rem; line-height: 1.8; }
.service-more { display: inline-flex; align-items: center; gap: .4rem; margin-top: 1.2rem; font-size: .82rem; color: var(--accent); font-weight: 500; text-decoration: none; transition: gap .2s; }
.service-more:hover { gap: .7rem; }

/* ── ÍNDEX DEL BLOG ── */
.blog-index { padding-top: 9rem; }
.posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }
.post-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .3s, transform .3s; }
.post-card:hover { box-shadow: 0 8px 32px rgba(0,0,0,.06); transform: translateY(-3px); }
.post-card-img { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg2); }
.post-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-card-body { padding: 1.8rem 2rem 2rem; display: flex; flex-direction: column; flex: 1; }
.post-card h3 { font-family: 'Playfair Display', serif; font-weight: 600; font-size: 1.2rem; line-height: 1.3; margin: .5rem 0 .7rem; }
.post-card h3 a { color: var(--text); text-decoration: none; }
.post-card h3 a:hover { color: var(--accent); }
.post-card-resum { color: var(--muted); font-size: .9rem; line-height: 1.8; font-weight: 300; flex: 1; }
.post-meta { font-size: .78rem; color: var(--light); letter-spacing: .02em; }
.post-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1rem; }
.post-tag { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; color: var(--accent); background: rgba(45,106,79,.1); padding: .2rem .6rem; border-radius: 100px; }

/* ── PÀGINA DE POST ── */
.post { max-width: 760px; margin: 0 auto; padding: 9rem 6vw 6rem; }
.post-back { display: inline-block; font-size: .82rem; color: var(--muted); text-decoration: none; margin-bottom: 2rem; transition: color .2s; }
.post-back:hover { color: var(--accent); }
.post-header .post-meta { margin-bottom: 1rem; }
.post h1 { font-family: 'Playfair Display', serif; font-weight: 600; font-size: clamp(2rem, 4.2vw, 3rem); line-height: 1.15; letter-spacing: -.02em; margin-bottom: 1.2rem; }
.post-lead { font-size: 1.1rem; color: var(--muted); font-weight: 300; line-height: 1.8; }
.post-header .post-tags { margin-top: 1.4rem; }
.post-hero-img { margin: 2.8rem 0 0; }
.post-hero-img img { width: 100%; height: auto; border-radius: 14px; display: block; box-shadow: 0 16px 48px rgba(0,0,0,.09); background: var(--bg2); }

.post-body { margin-top: 3rem; font-size: 1.02rem; line-height: 1.85; color: var(--text); }
.post-body > * + * { margin-top: 1.3rem; }
.post-body h2 { font-size: clamp(1.5rem, 3vw, 1.9rem); margin-top: 2.8rem; margin-bottom: .2rem; }
.post-body h3 { font-family: 'Playfair Display', serif; font-weight: 600; font-size: 1.3rem; margin-top: 2.2rem; line-height: 1.3; }
.post-body h4 { font-size: 1.02rem; font-weight: 600; margin-top: 1.8rem; }
.post-body p { font-weight: 300; }
.post-body strong { font-weight: 600; }
.post-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--accent-l); }
.post-body a:hover { text-decoration-color: var(--accent); }
.post-body ul, .post-body ol { padding-left: 1.4rem; font-weight: 300; }
.post-body li + li { margin-top: .4rem; }
.post-body li::marker { color: var(--accent); }
.post-body blockquote { border-left: 3px solid var(--accent-l); padding: .6rem 0 .6rem 1.4rem; color: var(--muted); font-style: italic; background: var(--bg2); border-radius: 0 10px 10px 0; }
.post-body blockquote > * + * { margin-top: .8rem; }
.post-body code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; background: var(--bg2); border: 1px solid var(--border); border-radius: 5px; padding: .1em .4em; }
.post-body pre { background: #1e2a24; color: #e8f1ec; border-radius: 10px; padding: 1.2rem 1.4rem; overflow-x: auto; font-size: .86rem; line-height: 1.6; }
.post-body pre code { background: none; border: none; padding: 0; color: inherit; font-size: inherit; }
.post-body img { max-width: 100%; height: auto; border-radius: 10px; display: block; }
.post-body figure { margin: 2rem 0; }
.post-body figcaption { font-size: .8rem; color: var(--light); text-align: center; margin-top: .6rem; }
.post-body hr { border: none; height: 1px; background: var(--border); margin: 2.5rem 0; }
.post-body table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.post-body th, .post-body td { border: 1px solid var(--border); padding: .6rem .8rem; text-align: left; }
.post-body th { background: var(--bg2); font-weight: 600; }

.post-footer { margin-top: 4rem; }
.post-share { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1.4rem 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); font-size: .85rem; }
.post-share span { color: var(--light); }
.post-share a { color: var(--muted); text-decoration: none; border: 1px solid var(--border); padding: .35rem .9rem; border-radius: 100px; transition: all .2s; }
.post-share a:hover { border-color: var(--accent); color: var(--accent); }
.post-cta { margin-top: 3rem; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 2.4rem; text-align: center; position: relative; overflow: hidden; }
.post-cta::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 60% 80% at 80% 50%, rgba(82,183,136,.08) 0%, transparent 70%); }
.post-cta h2 { font-size: 1.5rem; position: relative; }
.post-cta p { color: var(--muted); font-weight: 300; font-size: .95rem; max-width: 480px; margin: 0 auto 1.6rem; position: relative; }
.post-cta .btn-primary { position: relative; }

/* ── FOOTER ── */
body > footer { border-top: 1px solid var(--border); padding: 2rem 6vw; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.footer-logo { font-weight: 600; font-size: .92rem; }
.footer-logo span { color: var(--accent); }
body > footer p { font-size: .8rem; color: var(--light); }
.footer-links { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.footer-links a { font-size: .8rem; color: var(--light); text-decoration: none; }
.footer-links a:hover { color: var(--accent); }
.footer-legal { max-width: 640px; margin: .25rem auto 0; line-height: 1.5; opacity: .85; }
.footer-legal a { color: var(--light); text-decoration: underline; }
.footer-legal a:hover { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .post-card, .btn-primary { transition: none; }
}
