/*
Theme Name: Madara Doujin Child
Description: Base do Madara para o projeto Doujin.
Template: madara
Version: 1.0.0
Text Domain: madara-doujin-child
*/

body.wp-child-theme-madara-doujin-child {
    --doujin-bg: #0e0c0f;
    --doujin-surface: #171217;
    --doujin-footer-bg: #0a090b;
    --doujin-ruby: #cc2940;
    --doujin-accent: #ff6576;
    --doujin-text: #f4f1f2;
    --doujin-muted: #b6a6ae;
    --doujin-line: rgb(244 241 242 / 11%);
    --doujin-gutter: clamp(16px, 3vw, 44px);
    --doujin-catalog-gutter: clamp(16px, 2vw, 40px);
    --doujin-catalog-width: 1380px;
    --primary-color: var(--doujin-ruby);
    --secondary-color: var(--doujin-accent);
    --madara-main-color: var(--doujin-ruby);
    --border-dark-color: #342b32;
    margin: 0;
    background-color: var(--doujin-bg);
    color: var(--doujin-muted);
    font-family: Inter, system-ui, -apple-system, sans-serif;
}

:where(body.wp-child-theme-madara-doujin-child) *,
:where(body.wp-child-theme-madara-doujin-child) *::before,
:where(body.wp-child-theme-madara-doujin-child) *::after {
    box-sizing: border-box;
}

:where(body.wp-child-theme-madara-doujin-child) a {
    text-decoration: none;
}

:where(body.wp-child-theme-madara-doujin-child) img {
    max-width: 100%;
    height: auto;
}

body.wp-child-theme-madara-doujin-child .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* Dark theme styling for WP-Manga login/register modals (zero Bootstrap dependency). */
body.wp-child-theme-madara-doujin-child .modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1050;
    overflow: auto;
    padding: 16px;
    background: rgb(6 4 7 / 76%);
    backdrop-filter: blur(3px);
}

body.wp-child-theme-madara-doujin-child .modal.show,
body.wp-child-theme-madara-doujin-child .modal.in {
    display: flex;
    align-items: center;
    justify-content: center;
}

body.wp-child-theme-madara-doujin-child.modal-open {
    overflow: hidden;
}

body.wp-child-theme-madara-doujin-child .modal-dialog {
    position: relative;
    width: min(440px, 100%);
    margin: auto;
}

body.wp-child-theme-madara-doujin-child .modal .modal-content {
    position: relative;
    background: var(--doujin-surface);
    color: var(--doujin-text);
    border: 1px solid var(--doujin-line);
    border-radius: 10px;
    box-shadow: 0 20px 50px rgb(0 0 0 / 65%);
}

body.wp-child-theme-madara-doujin-child .modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 10px 14px;
    border-bottom: 1px solid var(--doujin-line);
}

body.wp-child-theme-madara-doujin-child .modal .modal-body {
    padding: 18px 22px 22px;
}

body.wp-child-theme-madara-doujin-child .modal .modal-body h3 {
    margin: 0 0 12px;
    font-size: 1.25rem;
    color: var(--doujin-text);
}

body.wp-child-theme-madara-doujin-child .modal .modal-body h3 a {
    color: inherit;
}

body.wp-child-theme-madara-doujin-child .modal .modal-body p {
    margin: 0 0 12px;
}

body.wp-child-theme-madara-doujin-child .modal .modal-body label {
    display: block;
    font-size: 0.875rem;
    color: var(--doujin-text);
}

body.wp-child-theme-madara-doujin-child .modal .modal-body .forgetmenot label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

body.wp-child-theme-madara-doujin-child .modal .modal-body .nav a,
body.wp-child-theme-madara-doujin-child .modal .modal-body .backtoblog,
body.wp-child-theme-madara-doujin-child .modal .modal-body .backtoblog a {
    color: var(--doujin-muted);
    font-size: 0.85rem;
}

body.wp-child-theme-madara-doujin-child .modal .modal-body button.backtoblog {
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-size: 0.85rem;
    color: var(--doujin-muted);
}

body.wp-child-theme-madara-doujin-child .modal .modal-body :is(.nav a, button.backtoblog):hover {
    color: var(--doujin-accent);
}

body.wp-child-theme-madara-doujin-child .modal .close {
    padding: 2px 8px;
    border: 0;
    background: transparent;
    color: var(--doujin-text);
    font-size: 1.5rem;
    line-height: 1;
    opacity: 0.75;
    text-shadow: none;
    cursor: pointer;
}

body.wp-child-theme-madara-doujin-child .modal .close:hover {
    opacity: 1;
    color: var(--doujin-accent);
}

body.wp-child-theme-madara-doujin-child .modal .modal-body input[type="text"],
body.wp-child-theme-madara-doujin-child .modal .modal-body input[type="email"],
body.wp-child-theme-madara-doujin-child .modal .modal-body input[type="password"] {
    width: 100%;
    margin-top: 5px;
    padding: 9px 12px;
    border-radius: 6px;
    border: 1px solid var(--doujin-line);
    background: var(--doujin-bg);
    color: var(--doujin-text);
}

body.wp-child-theme-madara-doujin-child .modal .modal-body input[type="submit"] {
    width: 100%;
    padding: 10px 16px;
    border: 0;
    border-radius: 6px;
    background: var(--doujin-ruby);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

body.wp-child-theme-madara-doujin-child.text-ui-light,
body.wp-child-theme-madara-doujin-child.text-ui-light .body-wrap {
    background-color: var(--doujin-bg);
    color: var(--doujin-muted);
}

body.wp-child-theme-madara-doujin-child.text-ui-light .site-header :is(.c-header__top, .main-navigation, .search-main-menu),
body.wp-child-theme-madara-doujin-child.text-ui-light .off-canvas {
    background: var(--doujin-surface);
}

body.wp-child-theme-madara-doujin-child.text-ui-light .site-header .c-sub-header-nav {
    background: var(--doujin-bg);
    border-bottom-color: var(--doujin-line);
}

body.wp-child-theme-madara-doujin-child.text-ui-light :is(.c-breadcrumb-wrapper, .c-search-header__wrapper) {
    background-color: var(--doujin-surface);
}

/* Madara renders its stock gray search artwork as an inline background. */
body.wp-child-theme-madara-doujin-child.text-ui-light :is(.c-breadcrumb-wrapper, .c-search-header__wrapper)[style*="bg-search-dark.jpg"] {
    background-image: none !important;
}

body.wp-child-theme-madara-doujin-child.text-ui-light .site-content :is(
    input:not([type]), input[type="text"], input[type="search"], input[type="email"],
    input[type="url"], input[type="password"], input[type="number"], input[type="tel"],
    textarea, select, select option
) {
    background-color: var(--doujin-surface);
    border-color: var(--doujin-line);
    color: var(--doujin-text);
}

body.wp-child-theme-madara-doujin-child.reading-manga.text-ui-light .c-selectpicker select.selectpicker {
    background-color: var(--doujin-surface);
}

body.wp-child-theme-madara-doujin-child.text-ui-light .site-content .ratings_stars:is(.ion-ios-star, .ion-ios-star-half),
body.wp-child-theme-madara-doujin-child.text-ui-light .profile-manga .tab-summary .post-rating i:is(.ion-ios-star, .ion-ios-star-half) {
    color: var(--doujin-accent);
}

body.wp-child-theme-madara-doujin-child .site-footer {
    background: var(--doujin-footer-bg);
    border-top: 1px solid var(--doujin-line);
    padding: 0;
    color: var(--doujin-muted);
    font-family: Inter, system-ui, -apple-system, sans-serif;
}

body.wp-child-theme-madara-doujin-child .doujin-footer__container {
    width: min(var(--doujin-catalog-width), 100% - var(--doujin-catalog-gutter) * 2);
    margin-inline: auto;
}

body.wp-child-theme-madara-doujin-child .doujin-footer__main {
    padding-block: clamp(28px, 3.5vw, 44px) clamp(22px, 3vw, 34px);
}

body.wp-child-theme-madara-doujin-child .doujin-footer__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) repeat(2, minmax(150px, 1fr));
    gap: clamp(22px, 3vw, 48px);
    align-items: start;
}

body.wp-child-theme-madara-doujin-child .doujin-footer__logo {
    display: inline-flex;
    align-items: center;
    max-width: 158px;
    color: var(--doujin-text);
    font-size: 1.25rem;
    font-weight: 760;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
}

body.wp-child-theme-madara-doujin-child .doujin-footer__logo img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 46px;
    object-fit: contain;
}

body.wp-child-theme-madara-doujin-child .doujin-footer__logo:hover,
body.wp-child-theme-madara-doujin-child .doujin-footer__logo:focus-visible {
    color: var(--doujin-accent);
}

body.wp-child-theme-madara-doujin-child .doujin-footer__about {
    margin: 0;
    max-width: 44ch;
    color: var(--doujin-muted);
    font-size: 0.875rem;
    line-height: 1.6;
}

body.wp-child-theme-madara-doujin-child .doujin-footer__title {
    margin: 0 0 12px;
    color: var(--doujin-text);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

body.wp-child-theme-madara-doujin-child .doujin-footer__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

body.wp-child-theme-madara-doujin-child .doujin-footer__list a {
    color: var(--doujin-muted);
    font-size: 0.875rem;
    line-height: 1.4;
    transition: color 0.15s ease;
}

body.wp-child-theme-madara-doujin-child .doujin-footer__list a:hover,
body.wp-child-theme-madara-doujin-child .doujin-footer__list a:focus-visible {
    color: var(--doujin-accent);
}

body.wp-child-theme-madara-doujin-child .site-footer .bottom-footer {
    background: transparent;
    border-top: 1px solid var(--doujin-line);
    padding-block: 16px;
}

body.wp-child-theme-madara-doujin-child .doujin-footer__bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
}

body.wp-child-theme-madara-doujin-child .site-footer .copyright p {
    margin: 0;
    color: var(--doujin-muted);
    font-size: 0.8125rem;
    line-height: 1.5;
}

body.wp-child-theme-madara-doujin-child .doujin-footer__menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
}

body.wp-child-theme-madara-doujin-child .site-footer .nav-footer a {
    color: var(--doujin-text);
    font-size: 0.8125rem;
}

body.wp-child-theme-madara-doujin-child .site-footer .nav-footer a:hover,
body.wp-child-theme-madara-doujin-child .site-footer .nav-footer a:focus-visible {
    color: var(--doujin-accent);
}

@media (max-width: 720px) {
    body.wp-child-theme-madara-doujin-child .doujin-footer__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    body.wp-child-theme-madara-doujin-child .doujin-footer__brand {
        grid-column: 1 / -1;
    }
    body.wp-child-theme-madara-doujin-child .doujin-footer__bottom {
        flex-direction: column;
        align-items: flex-start;
    }
}
