/* ══════════════════════════════════════════════════════════════
   Espresso Theme — Dark Mode
   ══════════════════════════════════════════════════════════════ */

/* ── CSS Variable Overrides ───────────────────────────────── */
body.dark-mode {
    --mde-black: #e8e8e8;
    --mde-white: #1a1a1a;
    --mde-cream: #1e1e1e;
    --mde-gray-100: #242424;
    --mde-gray-200: #333333;
    --mde-gray-400: #888888;
    --mde-gray-600: #aaaaaa;
    --mde-primary: #e8373b;
}

/* ── Body Base ────────────────────────────────────────────── */
body.dark-mode {
    background: #121212;
    color: #e8e8e8;
}

/* ── Transitions ──────────────────────────────────────────── */
body {
    transition: background-color 0.3s ease, color 0.3s ease;
}

.md-espresso-header__nav,
.md-espresso-header__fullmenu,
.md-espresso-card--standard,
.espresso-single__stickybar,
.espresso-inline-related,
.md-espresso-poll,
.proto-kiosk,
.rep-cat__sec-card {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* ══════════════════════════════════════════════════════════════
   HEADER
   ══════════════════════════════════════════════════════════════ */

/* Nav bar */
body.dark-mode .md-espresso-header__nav {
    background: #1e1e1e;
    border-bottom-color: #333;
}

body.dark-mode .md-espresso-header__menu-item > a {
    color: #ccc;
}

body.dark-mode .md-espresso-header__menu-item > a:hover {
    color: #fff;
}

/* Sticky header */
body.dark-mode .md-espresso-header__sticky {
    background: #1e1e1e;
    border-bottom-color: #333;
}

body.dark-mode .md-espresso-header__sticky-menu a {
    color: #ccc;
}

/* Fullscreen menu */
body.dark-mode .md-espresso-header__fullmenu {
    background: #1a1a1a;
}

body.dark-mode .md-espresso-header__fullmenu-search {
    background: #242424;
}

body.dark-mode .md-espresso-header__fullmenu-search-form {
    background: #2a2a2a;
    border-color: #444;
}

body.dark-mode .md-espresso-header__fullmenu-search-form input {
    color: #e0e0e0;
}

body.dark-mode .md-espresso-header__fullmenu-group-title {
    color: #e8373b;
}

body.dark-mode .md-espresso-header__fullmenu-group-links .is-main a {
    color: #ccc;
}

body.dark-mode .md-espresso-header__fullmenu-group-links .is-sub a {
    color: #888;
}

body.dark-mode .md-espresso-header__fullmenu-cats {
    border-bottom-color: #333;
}

body.dark-mode .md-espresso-header__fullmenu-group {
    border-bottom-color: #333;
}

body.dark-mode .md-espresso-header__fullmenu-social-icons a {
    color: #999;
}

/* ══════════════════════════════════════════════════════════════
   HOMEPAGE
   ══════════════════════════════════════════════════════════════ */

/* Standard cards */
body.dark-mode .md-espresso-card--standard {
    background: #1e1e1e;
}

/* Proto sidebar / typos */
body.dark-mode .md-espresso-proto {
    background: #1e1e1e;
    border-color: #333;
}

body.dark-mode .md-espresso-typos__frame {
    background: #2a2a2a;
    border-color: #2a2a2a;
}

/* Popular items */
body.dark-mode .md-espresso-popular__item {
    border-bottom-color: #333;
}

/* Newsletter */
body.dark-mode .md-espresso-newsletter__input {
    background: #2a2a2a;
    color: #e0e0e0;
}

/* Poll */
body.dark-mode .md-espresso-poll {
    background: #1e1e1e;
}

body.dark-mode .md-espresso-poll__btn {
    border-color: #444;
    color: #ccc;
}

/* Beaute section */
body.dark-mode .md-espresso-section--beaute {
    background: #121212;
}

/* Agenda */
body.dark-mode .md-espresso-agenda__item::before {
    border-color: #121212;
}

/* Section headers / dividers */
body.dark-mode .md-espresso-sh__line {
    background: #333;
}

/* Featured split card */
body.dark-mode .md-espresso-card--featured-split .md-espresso-card__body {
    background: #1e1e1e;
}

/* ══════════════════════════════════════════════════════════════
   SINGLE POST
   ══════════════════════════════════════════════════════════════ */

body.dark-mode .espresso-single__content {
    color: #ccc;
}

body.dark-mode .espresso-single__content h1,
body.dark-mode .espresso-single__content h2,
body.dark-mode .espresso-single__content h3,
body.dark-mode .espresso-single__content h4,
body.dark-mode .espresso-single__content h5,
body.dark-mode .espresso-single__content h6 {
    color: #e0e0e0;
}

/* Sticky reading bar */
body.dark-mode .espresso-single__stickybar {
    background: #1e1e1e;
    border-bottom-color: #333;
}

body.dark-mode .espresso-single__stickybar-title {
    color: #ccc;
}

body.dark-mode .espresso-single__stickybar-share a,
body.dark-mode .espresso-single__stickybar-share button {
    color: #999;
}

/* Tags */
body.dark-mode .espresso-single__tags {
    border-top-color: #333;
}

/* Sidebar */
body.dark-mode .espresso-single__sidebar-item {
    border-bottom-color: #2a2a2a;
}

body.dark-mode .espresso-single__sidebar-miss {
    border-bottom-color: #2a2a2a;
}

/* Inline related */
body.dark-mode .espresso-inline-related {
    background: #1e1e1e;
    border-color: #333;
}

body.dark-mode .espresso-inline-related__title {
    color: #e0e0e0;
}

/* Proto single */
body.dark-mode .proto-single__viewer {
    background: #1a1a1a;
}

body.dark-mode .proto-single__cover {
    background: #2a2a2a;
}

body.dark-mode .proto-single__arrow {
    background: #2a2a2a;
    color: #e0e0e0;
}

body.dark-mode .proto-single__content {
    color: #ccc;
}

/* ══════════════════════════════════════════════════════════════
   CATEGORY / ARCHIVE
   ══════════════════════════════════════════════════════════════ */

body.dark-mode .espresso-category__header,
body.dark-mode .espresso-archive__header {
    border-bottom-color: #333;
}

body.dark-mode .espresso-category__featured-body {
    background: #1e1e1e;
}

body.dark-mode .espresso-category__list-item {
    border-bottom-color: #2a2a2a;
}

body.dark-mode .espresso-category__date-sep {
    border-bottom-color: #e8373b;
}

body.dark-mode .espresso-category__sidebar-item {
    border-bottom-color: #2a2a2a;
}

/* Pagination */
body.dark-mode .espresso-category__pagination .page-numbers,
body.dark-mode .espresso-category__pagination a,
body.dark-mode .espresso-archive__pagination .page-numbers,
body.dark-mode .espresso-archive__pagination a {
    border-color: #444;
    background: #1e1e1e;
}

body.dark-mode .espresso-category__pagination a:hover,
body.dark-mode .espresso-archive__pagination a:hover {
    background: #2a2a2a;
    border-color: #888;
}

/* Proto kiosk */
body.dark-mode .proto-kiosk {
    background: #121212;
}

body.dark-mode .proto-kiosk__recent {
    background: #121212;
}

body.dark-mode .proto-kiosk__card-cover,
body.dark-mode .proto-kiosk__recent-cover {
    box-shadow:
        0 3px 12px rgba(0,0,0,0.3),
        0 1px 3px rgba(0,0,0,0.2);
}

body.dark-mode .proto-kiosk__pagination .page-numbers,
body.dark-mode .proto-kiosk__pagination a {
    border-color: #444;
    background: #1e1e1e;
}

body.dark-mode .proto-kiosk__pagination a:hover {
    background: #2a2a2a;
    border-color: #888;
}

/* Reportaz */
body.dark-mode .rep-cat__sec-card {
    background: #1e1e1e;
}

body.dark-mode .rep-cat__item {
    border-bottom-color: #2a2a2a;
}

body.dark-mode .rep-cat__item:hover {
    background: #1e1e1e;
}

body.dark-mode .rep-cat__date-sep {
    border-bottom-color: #e8373b;
}

/* ══════════════════════════════════════════════════════════════
   TOGGLE SWITCH — Header
   ══════════════════════════════════════════════════════════════ */

.md-espresso-darkmode-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
}

.md-espresso-darkmode-toggle__track {
    width: 44px;
    height: 24px;
    background: rgba(255,255,255,0.2);
    border-radius: 12px;
    position: relative;
    transition: background 0.3s ease;
}

body.dark-mode .md-espresso-darkmode-toggle__track {
    background: rgba(255,255,255,0.3);
}

.md-espresso-darkmode-toggle__thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.35s cubic-bezier(0.68, -0.4, 0.32, 1.4);
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

body.dark-mode .md-espresso-darkmode-toggle__thumb {
    transform: translateX(20px);
    background: #333;
}

.md-espresso-darkmode-toggle__icon {
    width: 14px;
    height: 14px;
}

.md-espresso-darkmode-toggle__icon--sun {
    color: #d51317;
}

.md-espresso-darkmode-toggle__icon--moon {
    display: none;
    color: #f5d742;
}

body.dark-mode .md-espresso-darkmode-toggle__icon--sun {
    display: none;
}

body.dark-mode .md-espresso-darkmode-toggle__icon--moon {
    display: block;
}

/* ── Toggle in fullscreen menu topbar ─────────────────────── */
.md-espresso-darkmode-menu {
    display: flex;
    align-items: center;
}

.md-espresso-darkmode-menu .md-espresso-darkmode-toggle__track {
    background: rgba(255,255,255,0.25);
}

body.dark-mode .md-espresso-darkmode-menu .md-espresso-darkmode-toggle__track {
    background: rgba(255,255,255,0.35);
}

body.dark-mode .md-espresso-darkmode-menu .md-espresso-darkmode-toggle__thumb {
    background: #f5d742;
}

/* Fullmenu bottom dark mode */
body.dark-mode .md-espresso-header__fullmenu-bottom {
    border-top-color: #333;
}

body.dark-mode .md-espresso-header__fullmenu-pages a {
    color: #888;
}

body.dark-mode .md-espresso-header__fullmenu-social-icons a {
    color: #999;
}
