/*
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.3
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;
}

/*
 * Improved image alignment with text wrapping and proper padding
 * Custom styles for better image presentation
 */

/* Только первое изображение размера medium обтекает слева */
img.alignleft.size-medium:first-of-type {
  float: left;
  margin: 0 1rem 1rem 0;   /* отступы: справа и снизу */
  height: auto;
  max-width: 45%;          /* чтобы тексту было где течь */
}

/* Сброс float для остальных medium изображений */
img.alignleft.size-medium:not(:first-of-type) {
  float: none;
  display: block;
  margin: 1rem auto;
}

/* Большие изображения всегда блочные на 100% ширины */
img.alignleft.size-large,
img.alignright.size-large,
img.aligncenter.size-large,
img.size-large {
  float: none !important;
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 1rem auto;
}

/* Если используете фигуры/блоки WordPress - только для medium */
figure.alignleft .size-medium:first-of-type,
.wp-block-image.alignleft .size-medium:first-of-type {
  float: left;
  margin: 0 1rem 1rem 0;
}

/* Сброс float для фигур с large изображениями */
figure.alignleft .size-large,
figure.alignright .size-large,
.wp-block-image.alignleft .size-large,
.wp-block-image.alignright .size-large {
  float: none !important;
  display: block;
  width: 100%;
  margin: 1rem auto;
}

/* Обтекание вправо (на всякий случай) */
img.alignright,
figure.alignright,
.wp-block-image.alignright {
  float: right;
  margin: 0 0 1rem 1rem;
}

/* Center-aligned images */
.wp-block-image.aligncenter,
.aligncenter,
img.aligncenter {
	display: block;
	margin: 2rem auto !important;
	clear: both;
}

/* Full-width images */
.wp-block-image.alignfull {
	margin: 2rem 0;
	clear: both;
}

/* Wide-aligned images */
.wp-block-image.alignwide {
	margin: 2rem auto;
	clear: both;
}

/* General image styling improvements */
.wp-block-image img,
img {
	height: auto;
	max-width: 100%;
	border-radius: 8px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Image captions */
.wp-block-image figcaption,
.wp-caption-text {
	margin-top: 0.75rem;
	text-align: center;
	font-style: italic;
	color: var(--wp--preset--color--accent-4);
}

/* Сброс обтекания у контейнера, чтобы он «обнимал» флоаты */
.entry-content::after,
.post-content::after {
  content: "";
  display: table;
  clear: both;
}

/* Оптимизация навигации для десктопа - сжатие интервалов между пунктами меню */
@media (min-width: 782px) {
  .wp-block-navigation .wp-block-navigation__container {
    gap: 1.5rem !important;
  }
  
  .wp-block-navigation .wp-block-navigation-item {
    margin-right: 0 !important;
  }
  
  .wp-block-navigation .wp-block-navigation-item .wp-block-navigation-item__content {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
    font-size: 0.95rem !important;
  }
}

/* Мобильная адаптация: картинка сверху по центру, без флоата */
@media (max-width: 600px) {
  img.alignleft.size-medium:first-of-type,
  img.alignleft,
  figure.alignleft,
  .wp-block-image.alignleft,
  img.alignright,
  figure.alignright,
  .wp-block-image.alignright {
    float: none !important;
    display: block;
    margin: 0 auto 1rem;   /* центрируем */
    max-width: 100%;
    width: 100%;
  }
}
