/*
Theme Name:        HipotecaJoven
Theme URI:         https://www.hipotecajoven.es
Author:            HipotecaJoven Team
Author URI:        https://www.hipotecajoven.es
Description:       Tema WordPress para blog de hipotecas para jóvenes en España. Diseño editorial moderno con TailwindCSS, calculadora hipotecaria dinámica, comparativa de bancos y slots de AdSense integrados.
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:       hipotecajoven
Tags:              blog, finance, mortgage, tailwindcss, adsense-ready, seo-ready, responsive
*/

/* ═══════════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'DM Sans', sans-serif;
  background-color: #faf8f4;
  color: #1c2129;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1,h2,h3,h4,h5,h6 { font-family: 'Syne', sans-serif; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

/* ═══════════════════════════════════════════════
   NOISE TEXTURE OVERLAY
═══════════════════════════════════════════════ */
body::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  opacity: 0.02;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ═══════════════════════════════════════════════
   RANGE SLIDERS
═══════════════════════════════════════════════ */
input[type=range] {
  -webkit-appearance: none; appearance: none;
  height: 6px; border-radius: 999px;
  background: #d0d4d9; outline: none; cursor: pointer;
  width: 100%;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: #1da36d; border: 3px solid #faf8f4;
  box-shadow: 0 0 0 2px #1da36d; cursor: pointer;
  transition: transform 0.15s;
}
input[type=range]::-webkit-slider-thumb:hover { transform: scale(1.2); }
input[type=range]::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: #1da36d; border: 3px solid #faf8f4;
  box-shadow: 0 0 0 2px #1da36d; cursor: pointer; border: none;
}

/* ═══════════════════════════════════════════════
   SCROLL ANIMATIONS
═══════════════════════════════════════════════ */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.animate-on-scroll.visible { opacity: 1; transform: translateY(0); }

/* ═══════════════════════════════════════════════
   CALCULADORA TOGGLES
═══════════════════════════════════════════════ */
.toggle-bg { transition: background 0.2s; }
.toggle-dot { transition: transform 0.2s; }

/* ═══════════════════════════════════════════════
   WORDPRESS CORE CLASSES
═══════════════════════════════════════════════ */
.alignwide  { margin-left: -2rem; margin-right: -2rem; }
.alignfull  { margin-left: calc(-50vw + 50%); margin-right: calc(-50vw + 50%); width: 100vw; }
.aligncenter { margin-left: auto; margin-right: auto; }

/* Screen reader */
.screen-reader-text {
  border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%);
  height: 1px; margin: -1px; overflow: hidden;
  padding: 0; position: absolute; width: 1px; word-wrap: normal !important;
}
.screen-reader-text:focus {
  background-color: #f1f1f1; border-radius: 3px; clip: auto !important;
  clip-path: none; color: #21759b; display: block; font-size: 0.875rem;
  font-weight: bold; height: auto; left: 5px; line-height: normal;
  padding: 15px 23px 14px; text-decoration: none; top: 5px; width: auto; z-index: 100000;
}

/* ═══════════════════════════════════════════════
   COMMENTS
═══════════════════════════════════════════════ */
.comment-list { list-style: none; padding: 0; }
.comment-list .comment { padding: 1.25rem 0; border-bottom: 1px solid #e9ebed; }
.comment-author .fn { font-family: 'Syne', sans-serif; font-weight: 700; color: #1c2129; }
.comment-metadata { font-size: 0.75rem; color: #7e8998; margin-top: 0.25rem; }
.comment-content { font-size: 0.9rem; color: #62707f; margin-top: 0.5rem; line-height: 1.6; }
#respond { margin-top: 2rem; }
#respond .comment-form-comment label,
#respond .comment-form-author label,
#respond .comment-form-email label { font-size: 0.8rem; font-weight: 600; color: #424c58; display: block; margin-bottom: 0.25rem; }
#respond input[type="text"],
#respond input[type="email"],
#respond textarea {
  width: 100%; padding: 0.6rem 0.9rem; border: 1px solid #d0d4d9; border-radius: 0.75rem;
  font-size: 0.875rem; color: #1c2129; background: white; transition: border-color 0.2s;
}
#respond input:focus, #respond textarea:focus { outline: none; border-color: #1da36d; }
#respond .submit {
  background: #1da36d; color: white; border: none; cursor: pointer;
  padding: 0.65rem 1.5rem; border-radius: 999px; font-weight: 600; font-size: 0.875rem;
  transition: background 0.2s;
}
#respond .submit:hover { background: #138357; }

/* ═══════════════════════════════════════════════
   SEARCH FORM
═══════════════════════════════════════════════ */
.search-form { display: flex; gap: 0.5rem; }
.search-field {
  flex: 1; padding: 0.6rem 1rem; border: 1px solid #d0d4d9; border-radius: 999px;
  font-size: 0.875rem; outline: none;
}
.search-field:focus { border-color: #1da36d; }
.search-submit {
  background: #1da36d; color: white; border: none; padding: 0.6rem 1.25rem;
  border-radius: 999px; font-size: 0.875rem; font-weight: 600; cursor: pointer;
}

/* ═══════════════════════════════════════════════
   PAGINATION
═══════════════════════════════════════════════ */
.pagination { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; }
.pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2.25rem; height: 2.25rem; padding: 0 0.5rem;
  border-radius: 0.6rem; font-size: 0.875rem; font-weight: 500;
  color: #62707f; border: 1px solid #e9ebed; background: white; text-decoration: none;
  transition: all 0.2s;
}
.pagination .page-numbers:hover { border-color: #1da36d; color: #1da36d; }
.pagination .page-numbers.current { background: #1da36d; color: white; border-color: #1da36d; }

/* ═══════════════════════════════════════════════
   ADSENSE PLACEHOLDER (desarrollo)
═══════════════════════════════════════════════ */
.adsense-placeholder {
  background: repeating-linear-gradient(45deg, #e9ebed, #e9ebed 10px, #f5f6f7 10px, #f5f6f7 20px);
  border: 2px dashed #aab1ba; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #62707f; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  min-height: 90px;
}

/* ═══════════════════════════════════════════════
   AMORTIZATION TABLE
═══════════════════════════════════════════════ */
.amort-table th, .amort-table td { padding: 0.6rem 1rem; }

/* ═══════════════════════════════════════════════
   PROSE OVERRIDES (artículos)
═══════════════════════════════════════════════ */
.prose h2 { font-size: 1.6rem; margin-top: 2rem; margin-bottom: 0.75rem; }
.prose h3 { font-size: 1.25rem; margin-top: 1.5rem; margin-bottom: 0.5rem; }
.prose ul li { margin-bottom: 0.35rem; }
.prose table { font-size: 0.9rem; width: 100%; border-collapse: collapse; }
.prose table th { background: #f5f6f7; padding: 0.6rem 0.75rem; text-align: left; font-size: 0.8rem; color: #62707f; }
.prose table td { padding: 0.6rem 0.75rem; border-bottom: 1px solid #e9ebed; }

/* ═══════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════ */
@media (max-width: 640px) {
  .prose h2 { font-size: 1.35rem; }
  .prose h3 { font-size: 1.1rem; }
}
