/*
Theme Name: Twenty Twenty-Five
Theme URI: https://wordpress.org/themes/twentytwentyfive/
Author: the WordPress team
Author URI: https://wordpress.org
Description: Twenty Twenty-Five emphasizes simplicity and adaptability. It offers flexible design options, supported by a variety of patterns for different page types, such as services and landing pages, making it ideal for building personal blogs, professional portfolios, online magazines, or business websites. Its templates cater to various blog styles, from text-focused to image-heavy layouts. Additionally, it supports international typography and diverse color palettes, ensuring accessibility and customization for users worldwide.
Requires at least: 6.7
Tested up to: 6.8
Requires PHP: 7.2
Version: 1.2
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: twentytwentyfive
Tags: one-column, custom-colors, custom-menu, custom-logo, editor-style, featured-images, full-site-editing, block-patterns, rtl-language-support, sticky-post, threaded-comments, translation-ready, wide-blocks, block-styles, style-variations, accessibility-ready, blog, portfolio, news
*/

/*
 * Link styles
 * https://github.com/WordPress/gutenberg/issues/42319
 */
a {
	text-decoration-thickness: 1px !important;
	text-underline-offset: .1em;
}

/* Focus styles */
:where(.wp-site-blocks *:focus) {
	outline-width: 2px;
	outline-style: solid;
}

/* Increase the bottom margin on submenus, so that the outline is visible. */
.wp-block-navigation .wp-block-navigation-submenu .wp-block-navigation-item:not(:last-child) {
	margin-bottom: 3px;
}

/* Increase the outline offset on the parent menu items, so that the outline does not touch the text. */
.wp-block-navigation .wp-block-navigation-item .wp-block-navigation-item__content {
	outline-offset: 4px;
}

/* Remove outline offset from the submenus, otherwise the outline is visible outside the submenu container. */
.wp-block-navigation .wp-block-navigation-item ul.wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	outline-offset: 0;
}

/*
 * Progressive enhancement to reduce widows and orphans
 * https://github.com/WordPress/gutenberg/issues/55190
 */
h1, h2, h3, h4, h5, h6, blockquote, caption, figcaption, p {
	text-wrap: pretty;
}

/*
 * Change the position of the more block on the front, by making it a block level element.
 * https://github.com/WordPress/gutenberg/issues/65934
*/
.more-link {
	display: block;
}


/* ========= Custom Codes ========== */

/* ========= Dark Mode Overrides ========= */
:root[data-theme="dark"],
[data-theme="dark"] body {
  --bg-color: #0d0d0d;
  --text-color: #ffffff;
  --link-color: #66aaff;
}

/* Make sure blocks and global wrappers adapt */
[data-theme="dark"] body,
[data-theme="dark"] .wp-site-blocks,
[data-theme="dark"] .wp-block-group,
[data-theme="dark"] .wp-block-cover__inner-container,
[data-theme="dark"] .wp-block-columns,
[data-theme="dark"] .wp-block-column,
[data-theme="dark"] .entry-content,
[data-theme="dark"] .wp-block-post-content,
[data-theme="dark"] .wp-block {
  background-color: var(--bg-color) !important;
  color: var(--text-color) !important;
  transition: background-color 0.3s, color 0.3s;
}

/* Headings & Text */
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6,
[data-theme="dark"] p {
  color: var(--text-color) !important;
}

/* Links */
[data-theme="dark"] a {
  color: var(--link-color) !important;
  transition: color 0.3s;
}

/* Buttons, inputs, form elements */
[data-theme="dark"] button,
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  background-color: #1a1a1a !important;
  color: var(--text-color) !important;
  border-color: var(--text-color) !important;
}

/* Cover / Group / Media Text blocks */
[data-theme="dark"] .wp-block-cover,
[data-theme="dark"] .wp-block-group,
[data-theme="dark"] .wp-block-media-text {
  background-color: var(--bg-color) !important;
  color: var(--text-color) !important;
}

/* ---------- Dark mode link fixes for post navigation ---------- */
:root[data-theme="dark"] {
  --dt-text: #ffffff;   /* main text */
  --dt-link: #66aaff;   /* primary link color in dark mode (change if you want) */
  --dt-link-hover: #a8d4ff;
}

/* Target the wrapper and links specifically — placed at end of CSS for max priority */
[data-theme="dark"] .wp-block-group .wp-block-post-navigation-link,
[data-theme="dark"] .wp-block-post-navigation-link,
[data-theme="dark"] nav[aria-label="Post navigation"] .wp-block-post-navigation-link {
  color: var(--dt-text) !important;
  background: transparent !important;
}

/* Anchor color (normal, visited, hover, active, focus) */
[data-theme="dark"] .wp-block-post-navigation-link a,
[data-theme="dark"] .post-navigation-link-previous a,
[data-theme="dark"] .post-navigation-link-next a,
[data-theme="dark"] nav[aria-label="Post navigation"] a {
  color: var(--dt-link) !important;
  text-decoration: none !important;
}

/* visited state */
[data-theme="dark"] .wp-block-post-navigation-link a:visited {
  color: var(--dt-link) !important;
}

/* hover / focus / active */
[data-theme="dark"] .wp-block-post-navigation-link a:hover,
[data-theme="dark"] .wp-block-post-navigation-link a:focus,
[data-theme="dark"] .wp-block-post-navigation-link a:active {
  color: var(--dt-link-hover) !important;
  outline: none !important;
}

/* arrows (the ← / →) */
[data-theme="dark"] .wp-block-post-navigation-link__arrow-previous,
[data-theme="dark"] .wp-block-post-navigation-link__arrow-next {
  color: var(--dt-text) !important;
}

/* Ensure strong specificity in case theme styles are more specific */
[data-theme="dark"] .wp-block-group .post-navigation-link-previous a,
[data-theme="dark"] .wp-block-group .post-navigation-link-next a {
  color: var(--dt-link) !important;
}

/* ======================== */
/* Dark Mode - Modal Popups */
/* ======================== */

/* General modal container */
[data-theme="dark"] .modal,
[data-theme="dark"] .wp-block-popup,
[data-theme="dark"] .popup,
[data-theme="dark"] .mfp-content,
[data-theme="dark"] .elementor-lightbox,
[data-theme="dark"] .dialog,
[data-theme="dark"] .modal-content {
  background-color: #1c1c1c !important;
  color: #ffffff !important;
  border-color: rgba(255,255,255,0.15) !important;
  box-shadow: 0 4px 30px rgba(0,0,0,0.8) !important;
}

/* Modal backdrop overlay */
[data-theme="dark"] .modal-backdrop,
[data-theme="dark"] .mfp-bg,
[data-theme="dark"] .elementor-lightbox__background {
  background: rgba(0,0,0,0.85) !important;
}

/* Modal text, headings, and buttons */
[data-theme="dark"] .modal h1,
[data-theme="dark"] .modal h2,
[data-theme="dark"] .modal h3,
[data-theme="dark"] .modal h4,
[data-theme="dark"] .modal p,
[data-theme="dark"] .modal span,
[data-theme="dark"] .modal li,
[data-theme="dark"] .modal a {
  color: #ffffff !important;
}

/* Buttons inside modal */
[data-theme="dark"] .modal button,
[data-theme="dark"] .modal .btn,
[data-theme="dark"] .modal input[type="button"],
[data-theme="dark"] .modal input[type="submit"] {
  background-color: #333 !important;
  color: #fff !important;
  border-color: rgba(255,255,255,0.3) !important;
}

/* Hover/focus states */
[data-theme="dark"] .modal button:hover,
[data-theme="dark"] .modal .btn:hover {
  background-color: #555 !important;
}


/**** Extra ****/

/* Dark-mode course card fix (target known classes) */
[data-theme="dark"] .course-card,
[data-theme="dark"] .course-card * {
  background-color: transparent !important;
  color: inherit !important;
}

/* Force card wrapper background and text color */
[data-theme="dark"] .course-card {
  background-color: #0d0d0d !important;
  color: #ffffff !important;
  border-color: rgba(255,255,255,0.06) !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6) !important;
}

/* Buttons, headings, price etc inside card */
[data-theme="dark"] .course-card h1,
[data-theme="dark"] .course-card h2,
[data-theme="dark"] .course-card h3,
[data-theme="dark"] .course-card h4,
[data-theme="dark"] .course-card h5,
[data-theme="dark"] .course-card p,
[data-theme="dark"] .course-card .course-features,
[data-theme="dark"] .course-card a {
  color: #ffffff !important;
}

/* Generic inline style catches (white backgrounds) */
[data-theme="dark"] [style*="background-color:#fff"],
[data-theme="dark"] [style*="background-color:#ffffff"],
[data-theme="dark"] [style*="background:#fff"],
[data-theme="dark"] [style*="background:#ffffff"] {
  background-color: #0d0d0d !important;
  color: #ffffff !important;
}


/* ============================= */
/* Max Mega Menu - Dark Mode Fix */
/* ============================= */
[data-theme="dark"] .mega-menu-wrap,
[data-theme="dark"] .mega-menu,
[data-theme="dark"] .mega-menu > li.mega-menu-item,
[data-theme="dark"] .mega-sub-menu {
  background-color: #0d0d0d !important; /* deep dark background */
  color: #ffffff !important;
  border-color: rgba(255,255,255,0.15) !important;
}

/* Menu item links */
[data-theme="dark"] .mega-menu a,
[data-theme="dark"] .mega-menu > li.mega-menu-item > a,
[data-theme="dark"] .mega-sub-menu a {
  color: #ffffff !important;
  background: transparent !important;
}

/* Hover / active / focus states */
[data-theme="dark"] .mega-menu a:hover,
[data-theme="dark"] .mega-menu a:focus,
[data-theme="dark"] .mega-current-menu-item > a {
  color: #00b7ff !important; /* bluish highlight */
  background-color: rgba(255,255,255,0.1) !important;
}

/* Dropdown shadow & borders */
[data-theme="dark"] .mega-sub-menu {
  box-shadow: 0 4px 16px rgba(0,0,0,0.6) !important;
  border-color: rgba(255,255,255,0.1) !important;
}

/* Remove white gradient backgrounds if any */
[data-theme="dark"] .mega-menu-wrap [style*="background:#fff"],
[data-theme="dark"] .mega-menu-wrap [style*="background-color:#fff"],
[data-theme="dark"] .mega-menu-wrap [style*="background-color:#ffffff"],
[data-theme="dark"] .mega-menu-wrap [style*="background:#ffffff"] {
  background-color: #0d0d0d !important;
  color: #ffffff !important;
}

/* Make submenu text readable */
[data-theme="dark"] .mega-menu .mega-sub-menu a {
  color: #ffffff !important;
}


/****** Auto Conversion to dark mode *******/

/* === Universal Dark Mode Overrides === */
[data-theme="dark"] {
  /* Global color scheme */
  background-color: #0d0d0d !important;
  color: #ffffff !important;
}

/* Fix ALL elements with white or light backgrounds */
[data-theme="dark"] * {
  /* Backgrounds */
  background-color: transparent !important;
  border-color: rgba(255,255,255,0.2) !important;
  color: #ffffff !important;
}

/* Any hard-coded white backgrounds → dark */
[data-theme="dark"] *[style*="background:#fff"],
[data-theme="dark"] *[style*="background-color:#fff"],
[data-theme="dark"] *[style*="background-color:#ffffff"],
[data-theme="dark"] *[style*="background:#ffffff"],
[data-theme="dark"] .has-background {
  background-color: #121212 !important;
  color: #ffffff !important;
}

/* Invert borders that are pure white */
[data-theme="dark"] *[style*="border-color:#fff"],
[data-theme="dark"] *[style*="border-color:#ffffff"] {
  border-color: rgba(255,255,255,0.3) !important;
}

/* Fix headings, links, paragraphs */
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6,
[data-theme="dark"] p,
[data-theme="dark"] li,
[data-theme="dark"] span,
[data-theme="dark"] div {
  color: #ffffff !important;
}

/* Links */
[data-theme="dark"] a {
  color: #4dabff !important;
}

[data-theme="dark"] a:hover {
  color: #82c7ff !important;
}

/* Cards, containers, blocks that use pure white */
[data-theme="dark"] .wp-block-group,
[data-theme="dark"] .wp-block-columns,
[data-theme="dark"] .wp-block-column,
[data-theme="dark"] .course-card,
[data-theme="dark"] .widget,
[data-theme="dark"] .card,
[data-theme="dark"] .container,
[data-theme="dark"] .entry-content {
  background-color: #1a1a1a !important;
  color: #fff !important;
  border-color: rgba(255,255,255,0.1) !important;
}