/* ==================================================================
   Aprende, Ajusta y Crece – styles for the parts WordPress and plugins generate.
   Uses the tokens from site.css.

   1. WordPress basics     4. Blog list + pagination
   2. Generic page / post  5. 404
   3. Forms + buttons      6. Easy Digital Downloads   7. Comments
   ================================================================== */

/* ---------- 1. WordPress basics ---------- */
/* Logged-in bar on top: the sticky header sits below it */
.admin-bar .site-header {
    top: 32px;
}

@media (max-width: 782px) {
    .admin-bar .site-header {
        top: 46px;
    }
}

@media (max-width: 600px) {
    /* On phones WordPress's bar scrolls away with the page */
    .admin-bar .site-header:not(.site-header--overlay) {
        top: 0;
    }
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.site-footer__legal a {
    text-underline-offset: 0.2em;
}

.empty-state {
    font-size: var(--text-lead);
    color: var(--color-text-muted);
    text-align: center;
}

/* ---------- 2. Generic page / post ---------- */
.entry__header {
    margin-bottom: var(--space-block);
}

.entry__header h1 {
    font-size: var(--text-h2);
}

.single .entry__header h1 {
    font-size: clamp(2rem, 1.5rem + 2.4vw, 3.25rem);
}

.entry__image {
    margin-bottom: var(--space-block);
}

.entry__image img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--radius-lg);
}

/* Text written in the editor */
.entry-content > * + * {
    margin-top: 1.35rem;
}

.entry-content h2 {
    margin-top: 2.75rem;
    font-size: var(--text-h3);
}

.entry-content h3 {
    margin-top: 2.25rem;
    font-size: 1.3125rem;
}

.entry-content h4 {
    margin-top: 2rem;
}

.entry-content a {
    color: var(--color-primary);
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 0.2em;
}

.entry-content a:hover {
    color: var(--color-heading);
}

.entry-content ul,
.entry-content ol {
    padding-left: 1.5rem;
}

.entry-content ul {
    list-style: disc;
}

.entry-content ol {
    list-style: decimal;
}

.entry-content li + li {
    margin-top: 0.5rem;
}

.entry-content li::marker {
    color: var(--color-primary);
}

.entry-content blockquote {
    padding-left: 1.5rem;
    border-left: 3px solid var(--color-lavender);
    font-family: var(--font-heading);
    font-size: var(--text-lead);
    color: var(--color-heading);
}

.entry-content img {
    border-radius: var(--radius-md);
}

.entry-content figcaption {
    margin-top: 0.6rem;
    color: var(--color-text-muted);
    font-size: var(--text-small);
    text-align: center;
}

.entry-content hr {
    height: 1px;
    margin-block: 2.5rem;
    border: 0;
    background-color: var(--color-border);
}

.entry-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1rem;
}

.entry-content th,
.entry-content td {
    padding: 0.85rem 0.75rem;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    vertical-align: top;
}

.entry-content th {
    color: var(--color-heading);
    font-weight: 600;
}

.entry-content pre,
.entry-content code {
    border-radius: 6px;
    background-color: var(--color-bg-tint-strong);
    font-size: 0.9em;
}

.entry-content code {
    padding: 0.15em 0.4em;
}

.entry-content pre {
    padding: 1.25rem;
    overflow-x: auto;
}

/* Alignments from the editor */
.aligncenter {
    margin-inline: auto;
    text-align: center;
}

.alignleft {
    float: left;
    margin: 0.4rem 1.5rem 1rem 0;
}

.alignright {
    float: right;
    margin: 0.4rem 0 1rem 1.5rem;
}

@media (max-width: 639.98px) {
    .alignleft,
    .alignright {
        float: none;
        margin: 0;
    }
}

.entry-content::after {
    content: '';
    display: block;
    clear: both;
}

/* Previous / next post */
.entry__footer {
    margin-top: var(--space-block);
    padding-top: var(--space-block);
    border-top: 1px solid var(--color-border);
}

.post-navigation .nav-links {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .post-navigation .nav-links {
        grid-template-columns: 1fr 1fr;
    }

    .post-navigation .nav-next {
        grid-column: 2;
        text-align: right;
    }
}

.post-navigation a {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.1875rem;
    line-height: 1.3;
    color: var(--color-heading);
    text-decoration: none;
}

.post-navigation a:hover {
    color: var(--color-primary);
}

.post-navigation .eyebrow {
    display: block;
    margin-bottom: 0.4rem;
    font-family: var(--font-body);
}

/* ---------- 3. Forms + buttons made by WordPress and plugins ---------- */
.entry-content label,
.comment-form label {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--color-heading);
    font-size: var(--text-small);
    font-weight: 600;
}

.entry-content input:not([type='checkbox']):not([type='radio']):not([type='submit']):not([type='button']):not([type='hidden']),
.entry-content select,
.entry-content textarea,
.comment-form input:not([type='checkbox']):not([type='submit']),
.comment-form textarea,
.search-form input[type='search'] {
    width: 100%;
    min-height: 50px;
    padding: 0.8rem 1.1rem;
    border: 1.5px solid #8e7ba0;
    border-radius: var(--radius-sm);
    background-color: #fff;
    font: inherit;
    font-size: 1rem;
    color: var(--color-text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.entry-content input:focus,
.entry-content select:focus,
.entry-content textarea:focus,
.comment-form input:focus,
.comment-form textarea:focus {
    outline: 0;
    border-color: var(--color-heading);
    box-shadow: 0 0 0 4px rgba(181, 151, 199, 0.4);
}

.entry-content input[type='checkbox'],
.entry-content input[type='radio'] {
    width: 18px;
    height: 18px;
    margin-right: 0.5rem;
    accent-color: var(--color-primary);
}

/* Any plugin button looks like the site's buttons.
   !important is needed here: EDD sets its own button colors with very specific selectors. */
.entry-content input[type='submit'],
.entry-content button[type='submit'],
.entry-content .button,
.comment-form input[type='submit'],
.edd-submit,
.edd-submit.button,
.edd_go_to_checkout,
#edd-purchase-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0.85rem 1.85rem !important;
    border: 2px solid var(--color-primary) !important;
    border-radius: var(--radius-pill) !important;
    background: var(--color-primary) !important;
    color: #fff !important;
    font-family: var(--font-body);
    font-size: 1rem !important;
    font-weight: 600 !important;
    line-height: 1.25;
    text-decoration: none !important;
    text-shadow: none !important;
    box-shadow: none !important;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.entry-content input[type='submit']:hover,
.entry-content button[type='submit']:hover,
.entry-content .button:hover,
.comment-form input[type='submit']:hover,
.edd-submit:hover,
.edd-submit.button:hover,
.edd_go_to_checkout:hover,
#edd-purchase-button:hover {
    border-color: var(--color-primary-dark) !important;
    background: var(--color-primary-dark) !important;
    color: #fff !important;
}

/* ---------- 4. Blog list + pagination ---------- */
.post-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background-color: #fff;
    transition: transform 0.35s var(--ease), border-color 0.3s ease;
}

.post-card:hover {
    border-color: var(--color-lavender);
    transform: translateY(-6px);
}

.post-card__image {
    display: block;
    overflow: hidden;
}

.post-card__image img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    transition: transform 0.6s var(--ease);
}

.post-card:hover .post-card__image img {
    transform: scale(1.04);
}

.post-card__body {
    padding: clamp(1.5rem, 3vw, 2rem);
}

.post-card .eyebrow {
    margin-bottom: 0.6rem;
}

.post-card h2 {
    margin-bottom: 0.75rem;
    font-size: var(--text-h3);
}

.post-card h2 a {
    text-decoration: none;
}

/* The whole card is clickable through the title link */
.post-card {
    position: relative;
}

.post-card h2 a::after {
    content: '';
    position: absolute;
    inset: 0;
}

.post-card h2 a:hover {
    color: var(--color-primary);
}

.post-card p:not(.eyebrow) {
    color: var(--color-text-muted);
    font-size: 1rem;
}

.pagination,
.comments-pagination {
    margin-top: var(--space-block);
}

.pagination .nav-links,
.comments-pagination .nav-links,
.page-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.page-numbers,
.page-links > * {
    display: grid;
    place-items: center;
    min-width: 46px;
    height: 46px;
    padding-inline: 0.75rem;
    border: 1.5px solid var(--color-heading);
    border-radius: var(--radius-pill);
    color: var(--color-heading);
    font-size: var(--text-small);
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

a.page-numbers:hover,
.page-numbers.current,
.page-links > a:hover,
.page-links > .current {
    background-color: var(--color-heading);
    color: #fff;
}

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

/* ---------- 5. 404 ---------- */
.error-404 {
    display: grid;
    align-items: center;
    min-height: 70vh;
    background: radial-gradient(120% 90% at 50% 0%, #fff 0%, var(--color-bg-tint) 70%);
    text-align: center;
}

.error-404__code {
    font-family: var(--font-script);
    font-size: clamp(5rem, 3rem + 12vw, 10rem);
    line-height: 1;
    color: var(--color-lavender);
}

.error-404 h1 {
    margin-top: 0.5rem;
    font-size: var(--text-h2);
}

.error-404__text {
    max-width: 34rem;
    margin: 1.25rem auto 2.25rem;
    font-size: var(--text-lead);
    color: var(--color-text-muted);
}

/* ---------- 6. Easy Digital Downloads ---------- */
.download-single__grid {
    display: grid;
    gap: var(--space-block);
    align-items: start;
}

@media (min-width: 900px) {
    .download-single__grid {
        grid-template-columns: 5fr 6fr;
        gap: clamp(3rem, 6vw, 5rem);
    }

    .download-single__image {
        position: sticky;
        top: calc(var(--header-height) + 2rem);
    }
}

.download-single__image img {
    width: 100%;
    border-radius: var(--radius-lg);
}

.download-single__body h1 {
    font-size: var(--text-h2);
}

.download-single .product__price {
    margin: 1.25rem 0 1.75rem;
}

.download-single__buy {
    margin-top: 2.25rem;
    padding-top: 2.25rem;
    border-top: 1px solid var(--color-border);
}

/* Price options (products with several prices) */
.edd_price_options ul {
    display: grid;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
    padding: 0;
    list-style: none;
}

.edd_price_options label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 500;
}

/* Product cards on /downloads/ : the excerpt is one paragraph */
.product .product__text p {
    margin: 0;
}

/* Checkout + cart */
#edd_checkout_cart,
#edd_checkout_form_wrap fieldset {
    margin-bottom: 2rem;
    border: 0;
    padding: 0;
}

#edd_checkout_form_wrap legend {
    margin-bottom: 1.25rem;
    padding: 0;
    font-family: var(--font-heading);
    font-size: 1.3125rem;
    color: var(--color-heading);
}

#edd_checkout_form_wrap p {
    margin-bottom: 1.25rem;
}

#edd_checkout_form_wrap .edd-description {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--color-text-muted);
    font-size: var(--text-small);
    font-weight: 400;
}

#edd_checkout_cart .edd_cart_remove_item_btn,
.edd-cart-item-separator {
    font-size: var(--text-small);
}

.edd_errors,
.edd-alert {
    padding: 1rem 1.25rem;
    border: 0;
    border-radius: var(--radius-sm);
    background-color: #fdecec;
    color: #8a1f1f;
}

.edd-alert-success,
.edd_success {
    background-color: var(--color-bg-tint-strong);
    color: var(--color-heading);
}

/* ---------- 7. Comments ---------- */
.comments__title,
.comment-reply-title {
    margin-bottom: 1.5rem;
    font-family: var(--font-heading);
    font-size: var(--text-h3);
    color: var(--color-heading);
}

.comment-list {
    display: grid;
    gap: 1.25rem;
    margin-bottom: var(--space-block);
}

.comment-list .children {
    display: grid;
    gap: 1.25rem;
    margin-top: 1.25rem;
    padding-left: clamp(1rem, 4vw, 2.5rem);
    list-style: none;
}

.comment-body {
    padding: 1.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background-color: #fff;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
}

.comment-author img {
    border-radius: 50%;
}

.comment-metadata {
    margin: 0.4rem 0 0.9rem;
    color: var(--color-text-muted);
    font-size: var(--text-tiny);
}

.comment-metadata a,
.comment-body .reply a {
    color: inherit;
}

.comment-body .reply {
    margin-top: 0.9rem;
    font-size: var(--text-small);
    font-weight: 600;
}

.comment-form {
    display: grid;
    gap: 1.25rem;
}

.comment-form .comment-notes,
.comment-form .logged-in-as {
    color: var(--color-text-muted);
    font-size: var(--text-small);
}

.comment-form-cookies-consent {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.comment-form-cookies-consent label {
    margin: 0;
    font-weight: 400;
}

/* Blog cards: at most three across, so titles keep a comfortable width */
.post-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}
