/**
 * Base styles for Mejor 2024
 * Normalize + Reset + WordPress compatibility classes
 * Replaces parent theme style.css + theme.css
 */

/* === NORMALIZE / RESET === */

html {
  line-height: 1.15;
  -webkit-text-size-adjust: 100%;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: #212121;
  background-color: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  margin-top: .5rem;
  margin-bottom: 1rem;
  font-family: inherit;
  font-weight: 500;
  line-height: 1.2;
  color: inherit;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
  margin-top: 0;
  margin-bottom: .9rem;
}

hr {
  box-sizing: content-box;
  height: 0;
  overflow: visible;
}

pre {
  font-family: monospace, monospace;
  font-size: 1em;
  white-space: pre-wrap;
}

/* --- Links --- */
a {
  background-color: transparent;
  text-decoration: none;
  color: #212121;
}
a:hover, a:active {
  color: #212121;
}
a:not([href]):not([tabindex]) {
  color: inherit;
  text-decoration: none;
}
a:not([href]):not([tabindex]):hover,
a:not([href]):not([tabindex]):focus {
  color: inherit;
  text-decoration: none;
}
a:not([href]):not([tabindex]):focus {
  outline: 0;
}

/* --- Inline text --- */
abbr[title] {
  border-bottom: none;
  text-decoration: underline dotted;
}

b, strong {
  font-weight: bolder;
}

code, kbd, samp {
  font-family: monospace, monospace;
  font-size: 1em;
}

small {
  font-size: 80%;
}

sub, sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}
sub { bottom: -0.25em; }
sup { top: -0.5em; }

/* --- Embedded content --- */
img {
  border-style: none;
  height: auto;
  max-width: 100%;
}

details { display: block; }
summary { display: list-item; }

figcaption {
  font-size: 16px;
  color: #212121;
  line-height: 1.4;
  font-style: italic;
  font-weight: 400;
}

template { display: none; }
[hidden] { display: none; }

/* --- Forms --- */
label {
  display: inline-block;
  line-height: 1;
  vertical-align: middle;
}

button, input, optgroup, select, textarea {
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
  margin: 0;
}

input[type="text"],
input[type="date"],
input[type="email"],
input[type="number"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="url"],
select,
textarea {
  width: 100%;
  border: solid 1px #ccc;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  transition: border-color .2s;
}

input[type="text"]:focus,
input[type="date"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
select:focus,
textarea:focus {
  border-color: #2634ED;
  outline: none;
  box-shadow: 0 0 0 2px rgba(38, 52, 237, 0.1);
}

button, input { overflow: visible; }
button, select { text-transform: none; }

button,
[type="button"],
[type="reset"],
[type="submit"] {
  width: auto;
  -webkit-appearance: button;
}

button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
  border-style: none;
  padding: 0;
}

button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
  outline: 1px dotted ButtonText;
}

/* Default button styles — Mejor blue */
button,
[type="submit"],
[type="button"] {
  display: inline-block;
  font-weight: 400;
  color: #2634ED;
  text-align: center;
  white-space: nowrap;
  user-select: none;
  background-color: transparent;
  border: 1px solid #2634ED;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  border-radius: 30px;
  transition: all .2s;
  cursor: pointer;
}
button:hover, button:focus,
[type="submit"]:hover, [type="submit"]:focus,
[type="button"]:hover, [type="button"]:focus {
  color: #ffffff;
  background-color: #2634ED;
  text-decoration: none;
}
button:focus, [type="submit"]:focus, [type="button"]:focus {
  outline: 2px solid #2634ED;
  outline-offset: 2px;
}

fieldset {
  padding: 0.35em 0.75em 0.625em;
}

legend {
  box-sizing: border-box;
  color: inherit;
  display: table;
  max-width: 100%;
  padding: 0;
  white-space: normal;
}

progress { vertical-align: baseline; }

textarea {
  overflow: auto;
  resize: vertical;
}

[type="checkbox"],
[type="radio"] {
  box-sizing: border-box;
  padding: 0;
}

[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
  height: auto;
}

[type="search"] {
  -webkit-appearance: textfield;
  outline-offset: -2px;
}

[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
}

::-webkit-file-upload-button {
  -webkit-appearance: button;
  font: inherit;
}

select { display: block; }

/* --- Tables --- */
table {
  background-color: transparent;
  width: 100%;
  margin-bottom: 15px;
  font-size: 0.9em;
  border-spacing: 0;
  border-collapse: collapse;
}
table th, table td {
  padding: 15px;
  line-height: 1.5;
  vertical-align: top;
  border: 1px solid #cccccc;
}
table th { font-weight: bold; }
table tbody > tr:nth-child(odd) > td,
table tbody > tr:nth-child(odd) > th {
  background-color: #f7f7f7;
}
table tbody tr:hover > td,
table tbody tr:hover > th {
  background-color: #e9e9e9;
}
@media (max-width: 767px) {
  table table { font-size: 0.8em; }
  table table th, table table td {
    padding: 7px;
    line-height: 1.3;
  }
}

/* --- Lists --- */
dl, dt, dd, ol, ul, li {
  margin-top: 0;
  margin-bottom: 0;
  border: 0;
  outline: 0;
  font-size: 100%;
  vertical-align: baseline;
  background: transparent;
}


/* === WORDPRESS COMPATIBILITY CLASSES === */

.alignright {
  float: right;
  margin-left: 1rem;
}
.alignleft {
  float: left;
  margin-right: 1rem;
}
.aligncenter {
  clear: both;
  display: block;
  margin-left: auto;
  margin-right: auto;
}
.alignwide {
  margin-left: -80px;
  margin-right: -80px;
}
.alignfull {
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  max-width: 100vw;
  width: 100vw;
}
.alignfull img { width: 100vw; }

.wp-caption {
  margin-bottom: 1.25rem;
  max-width: 100%;
}
.wp-caption.alignleft { margin: 5px 20px 20px 0; }
.wp-caption.alignright { margin: 5px 0 20px 20px; }
.wp-caption img {
  display: block;
  margin-left: auto;
  margin-right: auto;
}
.wp-caption-text { margin: 0; }

.gallery-caption {
  display: block;
  font-size: 0.8125rem;
  line-height: 1.5;
  margin: 0;
  padding: 0.75rem;
}

.pagination { margin: 20px auto; }
.sticky { position: relative; display: block; }
.bypostauthor { font-size: inherit; }
.hide { display: none !important; }

/* --- Accessibility --- */
.sr-only,
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.screen-reader-text:focus {
  background-color: #eeeeee;
  clip: auto !important;
  clip-path: none;
  color: #212121;
  display: block;
  font-size: 1rem;
  height: auto;
  left: 5px;
  line-height: normal;
  padding: 15px 23px 14px;
  text-decoration: none;
  top: 5px;
  width: auto;
  z-index: 100000;
}

/* --- Comments --- */
#comments .comment-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: .9em;
}
#comments .comment,
#comments .pingback {
  position: relative;
}
#comments .comment .comment-body,
#comments .pingback .comment-body {
  display: flex;
  flex-direction: column;
  padding: 30px 0 30px 60px;
  border-bottom: 1px solid #cccccc;
}
#comments .comment .avatar,
#comments .pingback .avatar {
  position: absolute;
  left: 0;
  border-radius: 50%;
  margin-right: 10px;
}
#comments .comment-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: .9rem;
}
#comments .reply,
#comments .comment-metadata {
  font-size: 11px;
  line-height: 1;
}
#comments .children {
  position: relative;
  list-style: none;
  margin: 0;
  padding-left: 30px;
}
#comments .children li:last-child { padding-bottom: 0; }
#comments ol.comment-list .children:before {
  display: inline-block;
  font-size: 1em;
  content: '\21AA';
  position: absolute;
  top: 45px;
  left: 0;
  width: auto;
}
@media (max-width: 767px) {
  #comments .comment .comment-body { padding: 30px 0; }
  #comments .children { padding-left: 20px; }
  #comments .comment .avatar {
    position: inherit;
    float: left;
  }
}

/* --- Posts --- */
.post .entry-title a { text-decoration: none; }
.post .wp-post-image {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
}
@media (max-width: 991px) {
  .post .wp-post-image { max-height: 400px; }
}
@media (max-width: 575px) {
  .post .wp-post-image { max-height: 300px; }
}

/* --- Print --- */
@media print {
  *, *:before, *:after {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
  a, a:visited { text-decoration: underline; }
  a[href]:after { content: " (" attr(href) ")"; }
  abbr[title]:after { content: " (" attr(title) ")"; }
  a[href^="#"]:after, a[href^="javascript:"]:after { content: ""; }
  pre { white-space: pre-wrap !important; }
  pre, blockquote {
    page-break-inside: avoid;
    border: 1px solid #cccccc;
  }
  thead { display: table-header-group; }
  tr, img { page-break-inside: avoid; }
  p, h2, h3 { orphans: 3; widows: 3; }
  h2, h3 { page-break-after: avoid; }
}
