/*
Theme Name: Twenty Twenty-Five CalExpeditions
Theme URI: https://calexpeditions.com
Description: Minimal child theme of Twenty Twenty-Five. Single purpose: make the legacy classic-editor content of the 2015-2026 archive render inside narrow viewports. No redesign - no font, colour, or layout changes.
Author: CalExpeditions
Author URI: https://calexpeditions.com
Template: twentytwentyfive
Version: 1.0.0
Requires at least: 6.7
Tested up to: 6.7
Requires PHP: 7.2
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: twentytwentyfive-calexpeditions
*/

/* ---------------------------------------------------------------------------
 * Legacy classic-editor image containment (iPhone overflow fix, 2026-09-23)
 *
 * The imported archive is classic [caption] shortcode output:
 *   <figure class="wp-caption aligncenter" style="width: 525px">
 *     <a href="..."><img class="size-large" width="525" height="394" ...></a>
 *     <figcaption class="wp-caption-text">...</figcaption>
 *   </figure>
 *
 * Twenty Twenty-Five is a block theme: its CSS targets .wp-block-image and
 * leaves .wp-caption and bare <img> unstyled. The 525px figure width is an
 * INLINE style, so only !important can override it - hence the !important on
 * max-width here and nowhere else.
 * ------------------------------------------------------------------------- */

/* The figure itself. Inline `style="width: NNNpx"` needs !important. */
.entry-content .wp-caption,
.wp-block-post-content .wp-caption {
	max-width: 100% !important;
}

/* Images, and the <a> wrapper the shortcode puts around them. */
.entry-content img,
.wp-block-post-content img {
	max-width: 100%;
	height: auto;
}

.entry-content .wp-caption > a,
.wp-block-post-content .wp-caption > a {
	display: inline-block;
	max-width: 100%;
}

/* Captions: wrap long words instead of forcing the figure wider. */
.entry-content .wp-caption-text,
.wp-block-post-content .wp-caption-text {
	max-width: 100%;
	overflow-wrap: break-word;
}

/* Classic galleries also carry inline per-item pixel widths. */
.entry-content .gallery-item,
.wp-block-post-content .gallery-item {
	max-width: 100% !important;
}

/* Alignment classes must not reintroduce overflow. */
.entry-content .aligncenter,
.wp-block-post-content .aligncenter {
	margin-left: auto;
	margin-right: auto;
}

.entry-content .alignleft,
.entry-content .alignright,
.wp-block-post-content .alignleft,
.wp-block-post-content .alignright {
	max-width: 100% !important;
}

/* On phones a floated 525px image cannot sit beside text at all - stack it. */
@media (max-width: 600px) {

	.entry-content .alignleft,
	.entry-content .alignright,
	.wp-block-post-content .alignleft,
	.wp-block-post-content .alignright {
		float: none;
		margin-left: auto;
		margin-right: auto;
	}
}
