/*
Theme Name: Clilot Blog
Theme URI: https://blog.clilot.com/
Description: Tema del blog de Clilot, con el diseño de clilot.com.
Version: 1.0.3
Text Domain: clilot-blog
*/

@font-face {
  font-family: 'Work Sans';
  src: url('assets/fonts/WorkSans-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Work Sans';
  src: url('assets/fonts/WorkSans-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Fraunces';
  src: url('assets/fonts/Fraunces-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}

/* Same palette as the app (AppTheme / AppColors) */
:root {
  --primary: #16815f;
  --on-primary: #ffffff;
  --background: #f5f6f8;
  --surface: #ffffff;
  --surface-muted: #eef0f4;
  --border: #e1e5ec;
  --text: #202735;
  --muted-text: #626b80;
  --shadow: 0 1px 2px rgb(32 39 53 / 0.06), 0 8px 24px rgb(32 39 53 / 0.08);
  --radius-small: 8px;
  --radius-medium: 12px;
  --radius-large: 16px;
  --font-body: 'Work Sans', system-ui, sans-serif;
  --font-heading: 'Fraunces', Georgia, serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #69d3ad;
    --on-primary: #14161f;
    --background: #0e1016;
    --surface: #181b24;
    --surface-muted: #222633;
    --border: #2b303e;
    --text: #ecedf2;
    --muted-text: #9197a9;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.3);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
}

::selection {
  background: color-mix(in srgb, var(--primary) 25%, transparent);
}

h1,
h2,
h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 16px;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.2rem, 6vw, 3.4rem);
}

h2 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
}

h3 {
  font-size: 1.25rem;
}

p {
  margin: 0 0 16px;
}

a {
  color: var(--primary);
}

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

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
  z-index: 10;
  padding: 8px 16px;
  background: var(--surface);
  border-radius: var(--radius-small);
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--background) 85%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

@supports (animation-timeline: scroll()) {
  .site-header::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 100%;
    height: 2px;
    background: var(--primary);
    transform: scaleX(0);
    transform-origin: left;
    pointer-events: none;
    animation-name: grow-x;
    animation-timing-function: linear;
    animation-fill-mode: both;
    animation-timeline: scroll(root);
  }

  @keyframes grow-x {
    from {
      transform: scaleX(0);
    }
    to {
      transform: scaleX(1);
    }
  }
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.3rem;
}

.brand img {
  border-radius: var(--radius-small);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-left: auto;
  margin-right: 24px;
}

.header-nav a {
  color: var(--muted-text);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}

.header-nav a:hover {
  color: var(--primary);
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 100px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s, filter 0.15s, background-color 0.15s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:focus-visible,
.header-nav a:focus-visible,
.footer-links a:focus-visible,
.post-card a:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 4px;
}

.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-small {
  min-height: 40px;
  padding: 0 18px;
  font-size: 0.95rem;
}

/* Footer */

.site-footer {
  margin-top: 40px;
  padding: 32px 0;
  border-top: 1px solid var(--border);
  color: var(--muted-text);
  font-size: 0.95rem;
}

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

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links a,
.site-footer p a {
  color: inherit;
}

.footer-links a:hover,
.site-footer p a:hover {
  color: var(--primary);
}

.site-footer p {
  margin: 0;
}


body.admin-bar {
  min-height: calc(100vh - var(--wp-admin--admin-bar--height, 32px));
}

.admin-bar .site-header {
  top: var(--wp-admin--admin-bar--height, 32px);
}

main {
  flex: 1;
  min-width: 0;
  scroll-margin-top: 64px;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.lang-menu {
  position: relative;
  flex-shrink: 0;
  font-size: 0.88rem;
}

.lang-menu summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 100px;
  color: var(--muted-text);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  transition: background-color 0.15s, color 0.15s;
}

.lang-menu summary::-webkit-details-marker {
  display: none;
}

.lang-menu summary:hover,
.lang-menu[open] summary {
  background: var(--surface-muted);
  color: var(--text);
}

.lang-short {
  display: none;
}

.lang-chevron {
  width: 6px;
  height: 6px;
  margin: -3px 2px 0 4px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}

.lang-menu[open] .lang-chevron {
  margin-top: 3px;
  transform: rotate(225deg);
}

.lang-menu ul {
  position: absolute;
  right: 0;
  width: 210px;
  margin: 12px 0 0;
  padding: 6px;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.lang-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
}

.lang-code {
  color: var(--muted-text);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
}

.lang-menu a:hover {
  background: var(--surface-muted);
}

.lang-menu a[aria-current="page"] {
  background: color-mix(in srgb, var(--primary) 10%, var(--surface));
  color: var(--primary);
  font-weight: 600;
}

.lang-menu a[aria-current="page"] .lang-code {
  color: inherit;
}

.lang-menu summary:focus-visible,
.lang-menu a:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

@media (max-width: 620px) {
  .lang-menu ul { position: fixed; top: 64px; right: 12px; left: auto; margin-top: 8px; }
  .lang-name { display: none; }
  .lang-short { display: inline; }
}

.header-cta {
  flex-shrink: 0;
}


.header-nav .blog-link {
  color: var(--primary);
}

.blog-heading {
  padding: clamp(40px, 7vw, 80px) 0;
  background: radial-gradient(circle at 82% 22%, color-mix(in srgb, var(--primary) 17%, transparent), transparent 42%), var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-wrap: anywhere;
}

.blog-heading h1 {
  margin: 0;
}

.archive-description {
  margin-top: 16px;
  color: var(--muted-text);
}

.archive-description > :last-child {
  margin-bottom: 0;
}

.post-index {
  padding-top: clamp(24px, 5vw, 56px);
  padding-bottom: clamp(24px, 5vw, 56px);
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.post-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.post-card-image {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border);
}

.post-card-content {
  padding: clamp(20px, 4vw, 32px);
  overflow-wrap: anywhere;
}

.post-date {
  display: block;
  margin-bottom: 10px;
  color: var(--muted-text);
  font-size: 0.875rem;
}

.post-card h2 {
  margin-bottom: 12px;
  font-size: clamp(1.5rem, 3vw, 2rem);
  text-wrap: pretty;
}

.post-card h2 a {
  color: var(--text);
  text-decoration: none;
}

.post-card h2 a:hover {
  color: var(--primary);
  text-decoration: underline;
}

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

.post-excerpt > :last-child {
  margin-bottom: 0;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 32px;
}

.page-numbers {
  padding: 6px 12px;
  border-radius: var(--radius-small);
}

a.page-numbers {
  background: var(--surface);
  border: 1px solid var(--border);
  text-decoration: none;
}

a.page-numbers:hover {
  border-color: var(--primary);
}

.page-numbers.current {
  color: var(--on-primary);
  background: var(--primary);
}

.article-container {
  max-width: 760px;
  padding-top: clamp(32px, 7vw, 72px);
  padding-bottom: 48px;
  overflow-wrap: anywhere;
}

.back-to-blog {
  display: inline-block;
  margin-bottom: 24px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.back-to-blog:hover {
  text-decoration: underline;
}

.article-heading {
  margin-bottom: 28px;
}

.article-image {
  width: 100%;
  height: auto;
  margin-bottom: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
}

.article-content h2,
.article-content h3 {
  margin-top: 1.5em;
}

.article-content img {
  height: auto;
}

.article-content > .wp-block-image {
  margin-block-start: 32px;
}

.article-content .wp-block-image img {
  border-radius: var(--radius-large);
}

.article-content p img,
.article-content .emoji {
  display: inline;
}

.article-content figcaption {
  color: var(--muted-text);
  font-size: 0.9rem;
}

.article-content blockquote {
  margin-inline: 0;
  padding-left: 18px;
  border-left: 3px solid var(--primary);
}

.article-content pre {
  overflow-x: auto;
  padding: 16px;
  border-radius: var(--radius-small);
  background: var(--surface-muted);
}

.article-content .alignleft {
  float: left;
  margin: 0 20px 12px 0;
}

.article-content .alignright {
  float: right;
  margin: 0 0 12px 20px;
}

.article-content .aligncenter {
  margin-inline: auto;
}

.article-content {
  display: flow-root;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.article-tags a {
  display: block;
  padding: 4px 12px;
  border-radius: 100px;
  background: var(--surface-muted);
  font-size: 0.85rem;
  text-decoration: none;
}

.article-comments {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
  scroll-margin-top: 72px;
}

.comment-list,
.comment-list .children {
  padding-left: 16px;
  list-style: none;
}

.comment-body {
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
  background: var(--surface);
}

.comment-author .avatar {
  display: inline-block;
  margin-right: 4px;
  border-radius: 50%;
  vertical-align: middle;
}

.comment-metadata {
  margin: 6px 0 10px;
  font-size: 0.82rem;
}

.comment-form label {
  display: block;
  margin-bottom: 4px;
}

.comment-form-cookies-consent label {
  display: inline;
}

.comment-form input:not([type="checkbox"], [type="submit"]),
.comment-form textarea,
.post-password-form input[type="password"] {
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.comment-form textarea {
  width: 100%;
}

.comment-form input[type="submit"],
.post-password-form input[type="submit"] {
  min-height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 100px;
  background: var(--primary);
  color: var(--on-primary);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.not-found {
  padding-top: 100px;
  padding-bottom: 100px;
  text-align: center;
}

@media (max-width: 960px) {
  .header-nav:not(:has(.blog-link)),
  .header-nav a:not(.blog-link) { display: none; }
  .header-nav { margin-right: 0; }
  .lang-menu { margin-left: auto; }
  .header-nav:has(.blog-link) + .lang-menu { margin-left: 0; }
}

@media (max-width: 640px) {
  .post-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 480px) {
  .header-inner { gap: 8px; padding: 0 12px; }
  .header-cta { font-size: 0.8rem; padding: 0 10px; }
  .brand { gap: 6px; font-size: 1.1rem; }
  .brand img { width: 28px; height: 28px; }
  .lang-menu summary { padding: 0 8px; }

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

@media (max-width: 360px) {
  .lang-short { display: none; }
  .header-inner { column-gap: 6px; }
  .lang-menu summary { column-gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .site-header::after {
    animation: none;
  }

  .btn {
    transition: none;
  }
}
