/*
Theme Name: WF-Studio Blog
Theme URI: https://webfuengirola.es
Author: WF Studio
Author URI: https://webfuengirola.es
Description: Tema de blog para WF Studio — diseño web en Fuengirola. Réplica fiel del diseño del sitio estático.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: wf-studio-blog
Tags: blog, custom-colors, custom-menu, featured-images, post-thumbnails
*/

/* ============================================================
   VARIABLES
   ============================================================ */
:root {
  --color-bg:           #f9f8f6;
  --color-surface:      #ffffff;
  --color-surface-warm: #f3f1ed;
  --color-border:       #e8e4df;
  --color-text:         #1a1a1a;
  --color-text-muted:   #6b6560;
  --color-accent:       #1a1a1a;
  --color-whatsapp:     #25d366;
  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-pill: 999px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:  0 4px 16px rgba(0,0,0,.07), 0 2px 6px rgba(0,0,0,.04);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.10), 0 4px 12px rgba(0,0,0,.06);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --header-h: 72px;
  --max-w: 1200px;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

ul, ol { list-style: none; }

/* ============================================================
   LAYOUT HELPERS
   ============================================================ */
.container {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 48px);
}

/* ============================================================
   TYPOGRAPHY HELPERS
   ============================================================ */
.section-label {
  display: inline-block;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  margin-bottom: 20px;
}

.section-title {
  font-size: clamp(1.9rem, 3.5vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1.1;
  margin-bottom: 16px;
}

.section-sub {
  font-size: 1rem;
  color: var(--color-text-muted);
  line-height: 1.65;
  max-width: 540px;
}

/* ============================================================
   BADGE
   ============================================================ */
.badge {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: var(--color-surface-warm);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  padding: 3px 10px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font);
  font-size: .88rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  padding: 10px 22px;
  cursor: pointer;
  border: none;
  transition: opacity .15s, box-shadow .15s, transform .15s;
  text-decoration: none;
}

.btn--primary {
  background: var(--color-text);
  color: #fff;
}
.btn--primary:hover { opacity: .82; }

.btn--ghost {
  background: transparent;
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
}
.btn--ghost:hover { background: var(--color-surface-warm); }

.btn--whatsapp {
  background: var(--color-whatsapp);
  color: #fff;
}
.btn--whatsapp:hover { opacity: .88; }

.btn--sm { font-size: .8rem; padding: 7px 16px; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(249,248,246,.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
}

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo-mark {
  width: 36px;
  height: 36px;
  background: var(--color-text);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .82rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.03em;
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.logo-name {
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--color-text);
}

.logo-sub {
  font-size: .7rem;
  color: var(--color-text-muted);
  font-weight: 400;
}

/* Nav */
.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  font-size: .85rem;
  font-weight: 500;
  color: var(--color-text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  transition: color .15s, background .15s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-text);
  background: var(--color-surface-warm);
}

.nav-link.active {
  font-weight: 600;
}

/* Header CTA */
.header-cta { flex-shrink: 0; }

@media (max-width: 768px) {
  .site-nav { display: none; }
  .logo-text { display: none; }
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--color-text);
  color: rgba(255,255,255,.7);
  padding: 72px 0 40px;
  margin-top: 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  margin-bottom: 32px;
}

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
}

.footer-brand .logo-name { color: #fff; }
.footer-brand .logo-sub { color: rgba(255,255,255,.45); }
.footer-brand .logo-mark { background: rgba(255,255,255,.15); color: #fff; }

.footer-tagline {
  font-size: .88rem;
  color: rgba(255,255,255,.5);
  margin-top: 12px;
  line-height: 1.55;
}

.footer-col-title {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
  margin-bottom: 16px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  font-size: .88rem;
  color: rgba(255,255,255,.6);
  transition: color .15s;
}

.footer-links a:hover { color: #fff; }

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

.footer-copy {
  font-size: .8rem;
  color: rgba(255,255,255,.35);
}

.footer-legal {
  display: flex;
  gap: 20px;
}

.footer-legal a {
  font-size: .8rem;
  color: rgba(255,255,255,.35);
  transition: color .15s;
}

.footer-legal a:hover { color: rgba(255,255,255,.65); }

/* ============================================================
   BLOG HERO
   ============================================================ */
.blog-hero {
  background: var(--color-text);
  color: #fff;
  padding: 80px 0 72px;
}

.blog-hero .section-label {
  color: rgba(255,255,255,.5);
  border-color: rgba(255,255,255,.3);
}

.blog-hero .section-title { color: #fff; }

.blog-hero .section-sub {
  color: rgba(255,255,255,.65);
}

/* ============================================================
   POSTS GRID
   ============================================================ */
.posts-section { padding: 80px 0 120px; }

.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

@media (max-width: 960px) {
  .posts-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .posts-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   POST CARD
   ============================================================ */
.post-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s, transform .2s;
}

.post-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.post-card__img-wrap {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.post-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s;
}

.post-card__img-wrap:hover .post-card__img {
  transform: scale(1.04);
}

.post-card__body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.post-card__title {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -.02em;
}

.post-card__title a { color: var(--color-text); }
.post-card__title a:hover { opacity: .75; }

.post-card__excerpt {
  font-size: .9rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  flex: 1;
}

.post-card__meta {
  font-size: .78rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ============================================================
   SINGLE POST
   ============================================================ */
.single-post { padding: 60px 0 80px; }

.single-post__inner {
  max-width: 740px;
  margin-inline: auto;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
  color: var(--color-text-muted);
  margin-bottom: 32px;
}

.breadcrumb a:hover { color: var(--color-text); }

.single-post__header {
  margin-bottom: 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.single-post__title {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1.12;
}

.single-post__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .85rem;
  color: var(--color-text-muted);
}

.single-post__featured-img {
  margin-bottom: 40px;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.single-post__featured-img img {
  width: 100%;
  height: auto;
  display: block;
}

.single-post__content {
  font-size: 1.08rem;
  line-height: 1.82;
  color: var(--color-text);
}

.single-post__content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 2.5em 0 .8em;
  letter-spacing: -.03em;
}

.single-post__content h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 2em 0 .6em;
}

.single-post__content p { margin-bottom: 1.4em; }

.single-post__content a {
  color: var(--color-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.single-post__content blockquote {
  border-left: 3px solid var(--color-text);
  padding-left: 1.5rem;
  margin: 2em 0;
  color: var(--color-text-muted);
  font-style: italic;
}

.single-post__content ul,
.single-post__content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.4em;
  list-style: revert;
}

.single-post__content li { margin-bottom: .5em; }

.single-post__content img {
  border-radius: var(--radius-md);
  margin: 2em 0;
}

.single-post__content pre {
  background: var(--color-surface-warm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  overflow-x: auto;
  font-size: .88rem;
  margin-bottom: 1.4em;
}

.single-post__content code {
  font-size: .88em;
  background: var(--color-surface-warm);
  padding: .1em .4em;
  border-radius: 4px;
}

.single-post__content pre code {
  background: transparent;
  padding: 0;
  font-size: inherit;
}

/* ============================================================
   POST NAVIGATION
   ============================================================ */
.post-nav {
  display: flex;
  gap: 16px;
  margin-top: 64px;
  padding-top: 40px;
  border-top: 1px solid var(--color-border);
}

.post-nav__link {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: box-shadow .2s;
  text-decoration: none;
}

.post-nav__link:hover { box-shadow: var(--shadow-md); }

.post-nav__link--next { text-align: right; }

.post-nav__label {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.post-nav__title {
  font-size: .92rem;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.4;
}

@media (max-width: 540px) {
  .post-nav { flex-direction: column; }
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  margin-top: 64px;
  display: flex;
  justify-content: center;
}

.pagination .nav-links {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  font-size: .88rem;
  font-weight: 600;
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  transition: all .15s;
  text-decoration: none;
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current {
  background: var(--color-text);
  color: #fff;
  border-color: var(--color-text);
}

.pagination .page-numbers.dots {
  border-color: transparent;
  background: transparent;
}

/* ============================================================
   CTA BLOG
   ============================================================ */
.cta-blog {
  background: var(--color-surface-warm);
  border-top: 1px solid var(--color-border);
  padding: 96px 0;
}

.cta-blog__inner { max-width: 560px; }

.cta-blog__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 32px;
}

/* ============================================================
   NO POSTS
   ============================================================ */
.no-posts {
  text-align: center;
  padding: 80px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  color: var(--color-text-muted);
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.sidebar-widget {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.sidebar-widget__title {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}

/* ============================================================
   404
   ============================================================ */
.error-404 {
  padding: 120px 0;
  text-align: center;
}

.error-404__code {
  font-size: 8rem;
  font-weight: 800;
  letter-spacing: -.05em;
  color: var(--color-border);
  line-height: 1;
  margin-bottom: 16px;
}

.error-404__title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.error-404__sub {
  color: var(--color-text-muted);
  margin-bottom: 32px;
}

/* ============================================================
   SEARCH RESULTS
   ============================================================ */
.search-hero {
  background: var(--color-surface-warm);
  border-bottom: 1px solid var(--color-border);
  padding: 56px 0 48px;
}

.search-hero .section-title { margin-bottom: 24px; }

/* ============================================================
   ARCHIVE
   ============================================================ */
.archive-hero {
  background: var(--color-text);
  color: #fff;
  padding: 80px 0 72px;
}

.archive-hero .section-title { color: #fff; }
.archive-hero .section-label {
  color: rgba(255,255,255,.5);
  border-color: rgba(255,255,255,.3);
}

/* ============================================================
   PAGE (STATIC)
   ============================================================ */
.page-content { padding: 60px 0 100px; }

.page-content__inner {
  max-width: 740px;
  margin-inline: auto;
}

.page-content__title {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -.04em;
  margin-bottom: 40px;
}

/* ============================================================
   SEARCH FORM
   ============================================================ */
.search-form {
  display: flex;
  gap: 8px;
  max-width: 480px;
}

.search-form input[type="search"] {
  flex: 1;
  font-family: var(--font);
  font-size: .9rem;
  padding: 10px 16px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-text);
  outline: none;
  transition: border-color .15s;
}

.search-form input[type="search"]:focus {
  border-color: var(--color-text);
}

/* ============================================================
   UTILITIES
   ============================================================ */
.screen-reader-text {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.wp-block-image img { border-radius: var(--radius-md); }

/* ============================================================
   RESPONSIVE MISC
   ============================================================ */
@media (max-width: 600px) {
  .cta-blog { padding: 64px 0; }
  .posts-section { padding: 56px 0 80px; }
  .blog-hero { padding: 56px 0 48px; }
  .single-post { padding: 40px 0 60px; }
}
