/*
Theme Name: Tuvinieku akadēmija
Theme URI: https://www.pacientuakademija.lv
Description: Custom theme for Tuvinieku akadēmija — an information platform for relatives of oncology patients. Converted from an approved static Vanilla HTML/CSS/JS prototype. Ships with a help-contact custom post type, topic/situation taxonomies, and native (plugin-free) global settings. No page builder, no parent theme.
Author: Tuvinieku akadēmija
Version: 1.4.2
Requires at least: 6.4
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tuvinieku-akademija
Tags: custom-theme, health, accessibility-ready
*/

/*
 * The full design lives in assets/css/styles.css and assets/css/responsive.css
 * (copied verbatim from the approved prototype and enqueued in inc/enqueue.php).
 * This file only carries the required WordPress theme header plus a couple of
 * admin-editor niceties. Do NOT put layout styles here.
 */

/* ---- Theme-level additions (front-end block styles) ---- */
.is-style-ta-important {
	border-left: 4px solid var(--color-primary, #ae4e29);
	background: var(--color-primary-soft, #f3dcc7);
	padding: 1rem 1.25rem;
	border-radius: var(--radius-sm, 6px);
}
.is-style-ta-info {
	background: var(--color-secondary-soft, #eae1f0);
	padding: 1.25rem 1.5rem;
	border-radius: var(--radius-md, 10px);
}
.is-style-ta-download {
	border: 1px solid var(--color-border, #e3d5c2);
	border-radius: var(--radius-md, 10px);
	padding: 1rem 1.25rem;
	background: var(--color-surface, #fff);
}
/* Document download element (single post attachments) */
.doc-list { list-style: none; margin: 1.5rem 0; padding: 0; display: grid; gap: .75rem; }
.doc-item {
	display: flex; align-items: center; gap: .9rem;
	border: 1px solid var(--color-border, #e3d5c2);
	border-radius: var(--radius-md, 10px);
	padding: .85rem 1rem; background: var(--color-surface, #fff);
	text-decoration: none; color: inherit;
}
.doc-item:hover { border-color: var(--color-primary, #ae4e29); }
.doc-item__icon { flex: 0 0 auto; color: var(--color-primary, #ae4e29); }
.doc-item__body { display: flex; flex-direction: column; }
.doc-item__name { font-weight: 700; }
.doc-item__meta { font-size: .85rem; color: var(--color-ink-faint, #8a7c71); }
.doc-item__cta { margin-left: auto; font-weight: 600; color: var(--color-primary, #ae4e29); white-space: nowrap; }
/* Responsive video wrapper for oEmbeds already handled by responsive-embeds;
   local <video> gets a light aspect box */
.wp-block-video video { width: 100%; height: auto; border-radius: var(--radius-md, 10px); }

/* ---- WordPress-specific UI not present in the static prototype ---- */
/* Search form */
.search-form { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.search-form__input {
	flex: 1 1 auto; min-width: 200px;
	padding: .7rem .9rem;
	border: 1px solid var(--color-border, #e3d5c2);
	border-radius: var(--radius-sm, 6px);
	background: var(--color-surface, #fff);
	color: var(--color-ink, #2a211c);
	font: inherit;
}
.search-form__input:focus-visible { outline: 2px solid var(--color-focus, #83381c); outline-offset: 2px; }
.page-intro__search { margin-top: 1.25rem; max-width: 520px; }

/* Pagination (the_posts_pagination) */
.pagination { margin-top: 2.5rem; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; }
.pagination .page-numbers {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 2.5rem; padding: .5rem .75rem;
	border: 1px solid var(--color-border, #e3d5c2);
	border-radius: var(--radius-sm, 6px);
	text-decoration: none; color: var(--color-ink, #2a211c); font-weight: 600;
}
.pagination .page-numbers.current { background: var(--color-primary, #ae4e29); color: var(--color-on-dark, #f8f1e7); border-color: var(--color-primary, #ae4e29); }
.pagination a.page-numbers:hover { border-color: var(--color-primary, #ae4e29); }

/* Misc WP additions */
.entry-terms { margin-top: 1.5rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.link-row__type { display: block; font-size: .8rem; color: var(--color-ink-faint, #8a7c71); font-weight: 500; }
.help-contact__fields--single { margin-top: 1.5rem; display: grid; gap: .6rem; }
.site-footer__socials { list-style: none; margin: 1rem 0 0; padding: 0; display: flex; gap: 1rem; flex-wrap: wrap; }
.site-footer__socials a { text-decoration: none; }
.footer-map--live { padding: 0; overflow: hidden; }
.footer-map--live iframe { width: 100%; height: 100%; min-height: 220px; border: 0; display: block; }

/* ---- Single-post Featured Image (natural aspect ratio, never stretched) ----
   Fixes the old .article-hero-image (aspect-ratio:16/9) distorting real photos.
   Only the single-post featured <img> uses these classes; the placeholder box
   and in-content Gutenberg images are untouched. */
.article-featured-image {
	width: 100%;
	max-width: 100%;
	margin: 0 auto;
	overflow: hidden;
	border-radius: var(--radius-md, 16px);
}
.article-featured-image__img {
	display: block;
	width: 100%;
	height: auto;      /* key rule — preserve the image's natural proportion */
	max-width: 100%;
}

/* ---- Unified post-card media (fixed ratio, cover-cropped, never distorted) ----
   The card image classes already set the aspect-ratio box (article 4:3, topic
   16:9). Real <img>s previously stretched because they had no object-fit. These
   rules make every real card image cover-crop centrally, so cards keep identical
   heights and no image is deformed. Placeholders (figure.placeholder-image) are
   unaffected and occupy the exact same box. This does NOT touch the single-post
   featured image (.article-featured-image__img) or the Help section. */
img.article-card__image,
img.topic-card__image,
img.relative-support__image {
	display: block;
	width: 100%;
	/* Height comes from the class's aspect-ratio box (4:3 / 16:9), NOT height:100%
	   — that would let a flex card stretch the image. object-fit crops instead. */
	height: auto;
	object-fit: cover;
	object-position: center center;
}

/* ---- "Par projektu" demo gallery (placeholder grid, admin-replaceable) ---- */
.about-gallery {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 1rem;
	margin: 2.5rem 0 1rem;
}
.about-gallery__item {
	aspect-ratio: 4 / 3;
	width: 100%;
}
@media (min-width: 48em) {
	.about-gallery { grid-template-columns: repeat(4, 1fr); }
}

/* ---- 404 page (two-column on desktop, single column on mobile) ---- */
.error-404 {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2rem;
	align-items: center;
}
.error-404__content { max-width: 34rem; }
.error-404__search { max-width: 420px; }
.error-404__art {
	aspect-ratio: 4 / 3;
	width: 100%;
	order: -1; /* art above text on mobile */
}
@media (min-width: 48em) {
	.error-404 {
		grid-template-columns: 1.1fr 0.9fr;
		gap: 3rem;
	}
	.error-404__art { order: 0; }
}
