/*
Theme Name: IDIS 3
Template: idis-template2
Description: Tema hijo de IDIS. Espaciado y tipografía unificados, menú compacto, modo claro y oscuro automático, cards con año y aporte, scroll infinito sin repeticiones. Para volver atrás, activá de nuevo "IDIS Template".
Version: 1.0.0
Author: Proyecto IDIS
Text Domain: idis3
*/

/* ---------- Tokens ---------- */
:root {
  --s1: 4px; --s2: 8px; --s3: 16px; --s4: 24px; --s5: 40px; --s6: 64px;
  --pad: var(--s5);
  --col: 720px;

  --bg: #ffffff;
  --fg: #151515;
  --muted: #6b6965;
  --line: #dedfe0;
  --field: #ffffff;

  --idis: #00853f;
  --link: #00853f;
  --link-visited: #22a05a;
  --link-hover: #48bb78;
  --card-hover-bg: #00853f;
  --card-hover-fg: #ffffff;
  --leido: rgba(0, 0, 0, .2);

  --f: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --t-entry: 700 28px/1.2 var(--f);
  --t-card: 700 16px/1.25 var(--f);
  --t-meta: 400 12px/1.5 var(--f);
  --t-body: 400 16px/1.6 var(--f);
  --t-foot: 400 12px/1.5 var(--f);
  --t-card-body: 400 12px/1.5 var(--f);
  color-scheme: light;
}
html[data-theme="dark"] {
  --bg: #1c1b19;
  --fg: #ebe8e2;
  --muted: #9a968e;
  --line: #3a3834;
  --field: #24231f;
  --link: #3fbf78;
  --link-visited: #62cd91;
  --link-hover: #8fe0b2;
  --leido: rgba(255, 255, 255, .12);
  color-scheme: dark;
}

/* ---------- Base ---------- */
html, body { background: var(--bg) !important; color: var(--fg); }
body { font: var(--t-body); }
body, input, textarea, .box, #boxes, h1, h2, h3 { font-family: var(--f); }
p { margin: 0 0 var(--s3); }
h1, h2, h3 { color: var(--fg); }

a { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: currentColor; transition: color .15s, text-decoration-thickness .15s; }
a:visited { color: var(--link-visited); }
a:hover, a:focus-visible { color: var(--link-hover); text-decoration: underline; text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--link-hover); outline-offset: 2px; }
blockquote { border-left: 3px solid var(--idis); color: var(--fg); font-size: 16px; margin: var(--s4) 0; padding-left: var(--s4); }
.main_separator { color: var(--line); }

/* Botón de modo del tema anterior */
.custom-switch, #darkSwitch { display: none !important; }

/* ---------- Página ---------- */
.idis3-page { padding: var(--pad) !important; }
@media (max-width: 767px) { :root { --pad: var(--s3); } }

/* ---------- Encabezado ---------- */
#idis3-header { margin-bottom: var(--s4); }
.idis3-top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s5); padding-bottom: var(--s3); border-bottom: 1px solid var(--line); }
#idis3-header #site-title { float: none; width: auto; padding: 0; font-size: 60px; line-height: 1; font-weight: 700; text-transform: uppercase; }
#idis3-header #site-title a, #idis3-header #site-title a:visited { color: var(--fg); text-decoration: none; }
.idis3-nav { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); font: 400 14px/1.4 var(--f); }
.idis3-nav a, .idis3-nav a:visited { color: var(--fg); text-decoration: none; }
.idis3-nav a:hover, .idis3-nav a.is-current { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; }
.idis3-right { display: flex; align-items: center; gap: var(--s4); margin-left: auto; }
.idis3-fadu { display: block; line-height: 0; text-decoration: none; }
.idis3-fadu img { height: 32px; width: auto; display: block; }
.idis3-only-dark { display: none !important; }
html[data-theme="dark"] .idis3-only-dark { display: block !important; }
html[data-theme="dark"] .idis3-only-light { display: none !important; }
.idis3-icon, .idis3-icon:visited { color: var(--fg); display: inline-flex; line-height: 0; text-decoration: none; }
.idis3-icon:hover { color: var(--link-hover); }
#idis3-header #search { float: none; width: 220px; padding: 0; margin: 0; }
#idis3-header #search form { margin: 0; }
#idis3-header .idis-bq-wrap { max-width: none; }
#idis3-header .idis-bq-input, #search input[type=text] { width: 100%; font-size: 13px; padding: var(--s2) var(--s3); border: 1px solid var(--line); border-radius: 0; background: var(--field); color: var(--fg); }
#idis3-header .idis-bq-input:focus { border-color: var(--idis); box-shadow: none; }

@media (max-width: 900px) {
  .idis3-right { margin-left: 0; width: 100%; }
  #idis3-header #search { flex: 1; width: auto; }
}

/* Barra sobre la grilla */
.idis3-bar { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding-top: var(--s3); font: var(--t-meta); color: var(--muted); }
.idis3-bar-l { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s2) var(--s4); }
#idis3-count { color: var(--fg); }
.idis3-bar-r { display: flex; gap: var(--s2); }
.idis3-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--fg); cursor: pointer; }
.idis3-btn:hover { color: var(--link-hover); border-color: currentColor; }
.idis3-btn svg { display: none; }
#idis3-orden[data-mode="rand"] .i-rand, #idis3-orden[data-mode="asc"] .i-asc, #idis3-orden[data-mode="desc"] .i-desc { display: block; }
html[data-theme="light"] #idis3-tema .i-moon, html[data-theme="dark"] #idis3-tema .i-sun { display: block; }

/* Filtros del buscador dentro de la barra */
#idis3-filtros .idis-bq-bar { margin: 0; font: var(--t-meta); gap: var(--s1) var(--s4); }
#idis3-filtros .idis-bq-f { color: var(--fg) !important; }

/* ---------- Grilla de cards ---------- */
#boxes { margin-top: 0; }
.box { width: 210px; margin-bottom: var(--s5); color: var(--fg); }
.box .texts { border: 20px solid var(--card-hover-bg); background: var(--card-hover-bg); color: var(--card-hover-fg); }
.box .categories { padding: var(--s3) 0 var(--s2); font: var(--t-meta); }
.box h1 { font: var(--t-card); margin: 0; padding: 0 0 var(--s2); }
.box p { font: var(--t-card-body); margin: 0; }
.box .posted { font: var(--t-meta); padding-top: var(--s2); color: var(--muted); }
.box a, .box a:visited { text-decoration: none; }
.box h1 a, .box h1 a:visited { color: var(--fg); }
.box h1 a:hover { color: var(--link-hover); text-decoration: underline; text-decoration-thickness: 1px; }
.box .categories a, .box .posted a { color: var(--muted); }
.box .categories a:hover, .box .posted a:hover { color: var(--link-hover); text-decoration: underline; }
.box .texts a, .box .texts a:visited, .box .texts h1 a, .box .texts .posted, .box .texts .posted a, .box .texts .categories a { color: var(--card-hover-fg) !important; }
.box img { width: 100%; height: auto; margin: 0; }
.js .box .posted { visibility: hidden; }
.js .box.idis3-ok .posted { visibility: visible; }
.box .posted > span:not(.entry-date):not(.main_separator) { display: none; }
.idis3-sentinel { height: 1px; }
.infinitescroll, #infscr-loading { display: none !important; }
.idis3-loading { text-align: center; font: var(--t-meta); color: var(--muted); padding: var(--s4) 0; }

/* ---------- Entrada abierta ---------- */
body.single #content > .row,
body.single #content > .container,
body.single #content .recent {
  width: var(--col); max-width: 100%;
  margin: 0 0 0 auto !important; padding: 0 !important;
}
body.single #content > .row > * { padding-left: 0; padding-right: 0; margin-left: 0; }
body.single #content > .row > h1 { font: var(--t-entry); margin: 0 0 var(--s2); padding-top: 0 !important; }
body.single .entry-meta { font: var(--t-meta); color: var(--muted); padding: 0 0 var(--s5); flex-wrap: wrap; text-align: left; justify-content: flex-start; }
body.single .entry-meta a { color: var(--muted); }
body.single .entry-meta a:hover { color: var(--link-hover); }
body.single .entry-meta .main_separator { padding: 0 var(--s2) !important; }
body.single [id^="post-"], body.single [id^="post-"] .column, body.single [id^="post-"] .row, body.single [id^="post-"] [class*="col"] {
  width: 100% !important; max-width: 100% !important; margin-left: 0 !important; margin-right: 0 !important;
  padding-left: 0 !important; padding-right: 0 !important; float: none !important; columns: auto !important; flex: none;
}
body.single [id^="post-"] .column { font: var(--t-body); }
body.single [id^="post-"] .column p { margin: 0 0 var(--s3); }
body.single [id^="post-"] .column > *:last-child { margin-bottom: 0; }
body.single [id^="post-"] img,
body.single [id^="post-"] video,
body.single [id^="post-"] figure,
body.single [id^="post-"] .wp-caption,
body.single [id^="post-"] .alignleft,
body.single [id^="post-"] .alignright,
body.single [id^="post-"] .aligncenter {
  float: none !important; display: block; max-width: 100% !important; height: auto; margin: var(--s4) 0 !important; text-align: left;
}
body.single [id^="post-"] p > a > img, body.single [id^="post-"] p > img { margin: 0 !important; }
body.single [id^="post-"] iframe, body.single [id^="post-"] embed, body.single [id^="post-"] object {
  display: block; width: 100% !important; max-width: 100%; height: auto !important; aspect-ratio: 16 / 9; margin: 0; border: 0;
}
body.single [id^="post-"] [style*="text-align: center"], body.single [id^="post-"] [style*="text-align:center"] { text-align: left !important; }
body.single .entry-utility { font: var(--t-meta); color: var(--muted); padding: var(--s5) 0 0; }
body.single .entry-tags { margin: 0; }
body.single .entry-tags span { font-weight: 700; color: var(--fg); }
body.single .entry-tags a { color: var(--muted); }
body.single .entry-tags a:hover { color: var(--link-hover); }
#nav-above, .navigation .nav-previous, .navigation .nav-next, #social, .twitter-share-button, .fb-like, fb\:like { display: none !important; }
body.single .recent { margin-top: var(--s5) !important; padding-top: var(--s5) !important; border-top: 1px solid var(--line); }
body.single .recent .footerSingelRandom { font: var(--t-meta); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 var(--s4); }
body.single .recent #boxes { margin-left: 0; }
#comments { padding: 0; width: var(--col); max-width: 100%; margin-left: auto; }

/* ---------- Pie ---------- */
#footer { font: var(--t-foot); color: var(--muted); padding: var(--s4) 0 0; margin-top: var(--s5); border-top: 1px solid var(--line); }
#footer #site-info { float: none; width: auto; padding: 0; line-height: inherit; }
#footer a, #footer a:visited { color: var(--fg); font-weight: 700; text-decoration: none; }

/* ---------- Modo oscuro: piezas heredadas ---------- */
html[data-theme="dark"] input[type="text"], html[data-theme="dark"] textarea { background: var(--field); color: var(--fg); border-color: var(--line); }
html[data-theme="dark"] .bg-white, html[data-theme="dark"] .bg-light { background-color: var(--bg) !important; }
