/*
Theme Name: Saga Theme Elementor Adapted
Theme URI: https://example.com/saga-theme
Author: Perplexity
Author URI: https://www.perplexity.ai
Description: Theme profesional para WordPress con enfoque UX, SEO técnico, opciones de personalización de header/footer y compatibilidad con Elementor.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: saga-theme
Tags: blog, custom-logo, custom-menu, featured-images, theme-options, translation-ready, elementor, full-width-template, custom-colors
*/

:root {
  --saga-bg: #f7f6f2;
  --saga-surface: #fbfbf9;
  --saga-surface-2: #f1efe9;
  --saga-text: #28251d;
  --saga-text-muted: #6e6a62;
  --saga-border: rgba(40,37,29,0.12);
  --saga-primary: #01696f;
  --saga-primary-hover: #0c4e54;
  --saga-header-bg: #f9f8f5;
  --saga-header-text: #28251d;
  --saga-footer-bg: #171614;
  --saga-footer-text: #f9f8f4;
  --saga-radius-sm: 10px;
  --saga-radius-md: 16px;
  --saga-radius-lg: 24px;
  --saga-shadow-sm: 0 2px 10px rgba(25, 23, 20, 0.06);
  --saga-shadow-md: 0 14px 40px rgba(25, 23, 20, 0.1);
  --saga-container: 1200px;
  --saga-content: 760px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--saga-text);
  background: var(--saga-bg);
  line-height: 1.65;
  font-size: 16px;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--saga-primary); text-decoration: none; }
a:hover { color: var(--saga-primary-hover); }
button, input, textarea, select { font: inherit; }
.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 !important; width: 1px; word-wrap: normal !important;
}
.screen-reader-text:focus {
  clip: auto !important; clip-path: none; height: auto; width: auto;
  background: #fff; color: #000; left: 10px; top: 10px; padding: 10px 14px; z-index: 99999;
}
.site-container, .saga-container {
  width: min(calc(100% - 32px), var(--saga-container));
  margin-inline: auto;
}
.entry-content > *, .page-content > * {
  width: min(100%, var(--saga-content));
  margin-inline: auto;
}
.alignwide { width: min(100%, 1100px); margin-inline: auto; }
.alignfull { width: 100%; max-width: 100%; }
.site-header {
  position: sticky; top: 0; z-index: 99;
  background: color-mix(in srgb, var(--saga-header-bg) 92%, transparent);
  color: var(--saga-header-text);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--saga-border);
}
.site-header__inner {
  min-height: 82px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.branding { display: flex; align-items: center; gap: 14px; color: inherit; }
.branding__title {
  font-size: clamp(1.25rem, 1rem + 1vw, 1.8rem);
  font-weight: 800; letter-spacing: -0.03em; color: inherit;
}
.branding__tagline { color: var(--saga-text-muted); font-size: 0.92rem; }
.custom-logo-link img { max-height: 54px; width: auto; }
.main-navigation ul {
  display: flex; align-items: center; gap: 18px; list-style: none; margin: 0; padding: 0;
}
.main-navigation a {
  color: var(--saga-header-text);
  font-weight: 600;
  padding: 10px 0;
  position: relative;
}
.main-navigation a::after {
  content: ""; position: absolute; left: 0; bottom: 4px; width: 100%; height: 2px;
  background: var(--saga-primary); transform: scaleX(0); transform-origin: left;
  transition: transform .25s ease;
}
.main-navigation a:hover::after,
.main-navigation .current-menu-item > a::after,
.main-navigation .current_page_item > a::after { transform: scaleX(1); }
.menu-toggle {
  display: none; border: 1px solid var(--saga-border); background: var(--saga-surface);
  border-radius: 999px; padding: 10px 14px;
}
.hero {
  padding: 88px 0 56px;
}
.hero__grid {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center;
}
.hero__copy h1, .entry-title, .page-title {
  font-size: clamp(2.4rem, 2rem + 2.2vw, 4.7rem);
  line-height: 1.02; letter-spacing: -0.05em; margin: 0 0 18px;
}
.hero__copy p {
  font-size: 1.05rem; color: var(--saga-text-muted); max-width: 58ch; margin: 0 0 28px;
}
.saga-button,
.wp-block-button__link,
button,
input[type="submit"] {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 14px 22px; border-radius: 999px;
  border: 1px solid transparent; background: var(--saga-primary); color: #fff; font-weight: 700;
  box-shadow: var(--saga-shadow-sm); transition: .25s ease;
}
.saga-button:hover,
.wp-block-button__link:hover,
button:hover,
input[type="submit"]:hover { transform: translateY(-1px); background: var(--saga-primary-hover); color: #fff; }
.saga-button--ghost {
  background: transparent; color: var(--saga-text); border-color: var(--saga-border); box-shadow: none;
}
.hero-card, .card, .widget, .wp-block-group.is-style-saga-surface {
  background: var(--saga-surface);
  border: 1px solid var(--saga-border);
  border-radius: var(--saga-radius-md);
  box-shadow: var(--saga-shadow-sm);
}
.hero-card { padding: 28px; }
.content-area {
  display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 40px; padding: 48px 0 80px;
}
.content-area.no-sidebar { grid-template-columns: minmax(0,1fr); }
article.post, article.page, .archive-card {
  background: var(--saga-surface);
  border: 1px solid var(--saga-border);
  border-radius: var(--saga-radius-lg);
  padding: 30px;
  margin-bottom: 26px;
}
.entry-meta, .archive-meta, .site-footer small {
  color: var(--saga-text-muted); font-size: 0.92rem;
}
.entry-title { font-size: clamp(2rem, 1.4rem + 1.8vw, 3.25rem); margin-bottom: 12px; }
.entry-content h2, .page-content h2, .comment-content h2 { font-size: clamp(1.6rem, 1.3rem + 1vw, 2.3rem); }
.entry-content h3, .page-content h3, .comment-content h3 { font-size: clamp(1.25rem, 1.12rem + .6vw, 1.7rem); }
.entry-content p, .page-content p, .widget p, li { max-width: 72ch; }
.sidebar .widget { padding: 22px; margin-bottom: 24px; }
.widget-title { margin-top: 0; margin-bottom: 14px; font-size: 1.1rem; }
.site-footer {
  background: var(--saga-footer-bg);
  color: var(--saga-footer-text);
  padding: 56px 0 26px;
  margin-top: 56px;
}
.site-footer a { color: var(--saga-footer-text); }
.site-footer__grid {
  display: grid; grid-template-columns: 1.2fr .8fr .8fr; gap: 24px; margin-bottom: 28px;
}
.footer-title { margin-top: 0; margin-bottom: 12px; font-size: 1.05rem; }
.footer-menu, .footer-menu ul { list-style: none; padding: 0; margin: 0; }
.footer-menu li { margin-bottom: 10px; }
.post-thumbnail { border-radius: calc(var(--saga-radius-lg) - 8px); overflow: hidden; margin-bottom: 22px; }
input[type="text"], input[type="email"], input[type="search"], input[type="url"], input[type="password"], textarea, select {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--saga-border);
  background: #fff;
}
input:focus, textarea:focus, select:focus {
  outline: 2px solid color-mix(in srgb, var(--saga-primary) 35%, white);
  border-color: var(--saga-primary);
}
.posts-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 24px;
}
.archive-card h2 { font-size: 1.55rem; margin-top: 0; }
.not-found { text-align: center; padding: 70px 20px; }
.pagination, .posts-navigation, .post-navigation { margin-top: 34px; }
.pagination .nav-links, .posts-navigation .nav-links, .post-navigation .nav-links {
  display: flex; justify-content: space-between; gap: 16px;
}
@media (max-width: 1024px) {
  .hero__grid, .content-area, .site-footer__grid { grid-template-columns: 1fr; }
  .posts-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .menu-toggle { display: inline-flex; }
  .main-navigation {
    position: absolute; top: 100%; left: 16px; right: 16px; display: none;
    background: var(--saga-surface); border: 1px solid var(--saga-border); border-radius: 20px; padding: 16px;
    box-shadow: var(--saga-shadow-md);
  }
  .main-navigation.toggled { display: block; }
  .main-navigation ul { flex-direction: column; align-items: flex-start; }
}


/* Elementor adaptation */
.elementor-page #content,
.elementor-page .site-main,
.elementor-page .entry-content,
.elementor-page .page-content,
.elementor-page .content-area {max-width:100%; width:100%;}
.elementor-page .entry-content > *, .elementor-page .page-content > * {width:100%; max-width:100%;}
.elementor-template-full-width .site-main,
.elementor-template-full-width .content-area,
.elementor-template-canvas .site-main,
.elementor-template-canvas .content-area {padding:0; margin:0; width:100%; max-width:100%; display:block;}
.elementor-template-canvas .site-header,
.elementor-template-canvas .site-footer {display:none;}
.elementor-widget-container p:last-child {margin-bottom:0;}
