/*
Theme Name: PNW Runner Child
Template: DGP_PNW_Theme_v2
Description: Child theme for DGP PNW Theme. Adds the right sidebar to every page except Home. The parent theme files are never edited.
Version: 1.0
Text Domain: pnw-runner-child
*/

/* ---------- Right sidebar layout (mobile first) ----------
   Phones and tablets (900px and narrower): one column, sidebar under the content.
   Wider than 900px: content column + 320px sidebar, 48px gap. */
.pnw-layout{
	width:90%;
	max-width:1200px;
	margin:0 auto;
	display:grid;
	grid-template-columns:minmax(0,1fr);
	gap:36px;
}
.pnw-layout > .content-main{
	min-width:0;          /* stops wide content (tables, Elementor rows) from widening the page */
	overflow-x:clip;      /* last line of defence against sideways scrolling */
}
.pnw-layout > .content-side{
	min-width:0;
	display:flex;
	flex-direction:column;
	gap:22px;
}
@media (min-width:600px) and (max-width:900px){
	/* Tablets: sidebar widgets two across under the content. */
	.pnw-layout > .content-side{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:start}
}
@media (min-width:901px){
	.pnw-layout{grid-template-columns:minmax(0,1fr) 320px;gap:48px;align-items:start}
}

/* The theme's own wrappers are 90% / 1200px wide and centred. Inside the
   content column they should simply fill the column. */
.pnw-layout > .content-main > .container,
.pnw-layout > .content-main > .page-content{
	width:auto;
	max-width:none;
	margin-left:0;
	margin-right:0;
}
.pnw-layout > .content-main > .post-single{
	max-width:none;
	margin:0;
	padding:0 0 32px;
}
.pnw-layout .content-main img{max-width:100%;height:auto}

/* Elementor inside the content column (Default and Full Width pages, race pages). */
.pnw-layout .elementor-section.elementor-section-stretched{
	width:100% !important;
	left:auto !important;
}
.pnw-layout .e-con.e-con-boxed > .e-con-inner{max-width:100%}

/* WP Event Manager race page and events list inside the narrower column. */
.pnw-layout .event-single-wrapper{max-width:none}
.pnw-layout .wpem-single-event-page .wpem-container,
.pnw-layout .event_listings{max-width:100%}

/* ---------- Post lists (blog, category, tag, search, archives) ---------- */
.pnw-archive-title{font-size:2rem;line-height:1.2;margin:0 0 6px}
.pnw-archive-desc{color:#555;margin:0 0 20px}
.pnw-post-list{display:flex;flex-direction:column;gap:22px;margin:24px 0}
.pnw-post-item{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;padding-bottom:22px;border-bottom:1px solid #e6e6e6}
.pnw-post-item h2{font-size:1.35rem;line-height:1.25;margin:0 0 4px}
.pnw-post-item h2 a{color:inherit;text-decoration:none}
.pnw-post-item h2 a:hover{text-decoration:underline}
.pnw-post-meta{font-size:.9rem;color:#666;margin:0 0 6px}
.pnw-post-item p{margin:0}
.pnw-post-thumb img{display:block;width:100%;aspect-ratio:16/9;object-fit:cover;border-radius:10px}
@media (min-width:600px){
	.pnw-post-item.has-thumb{grid-template-columns:200px minmax(0,1fr);align-items:start}
	.pnw-post-thumb img{aspect-ratio:4/3}
}
.pnw-search-form{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0 24px}
.pnw-search-form input[type=search]{flex:1 1 200px;min-height:44px;padding:8px 12px;font-size:16px;border:1px solid #ccc;border-radius:8px}
.pnw-search-form button{min-height:44px;padding:8px 18px;border:0;border-radius:8px;background:#3A653A;color:#fff;font-weight:700;font-size:16px;cursor:pointer}
.pnw-pagination .nav-links{display:flex;flex-wrap:wrap;gap:8px;margin:8px 0 24px}
.pnw-pagination .page-numbers{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;padding:0 12px;border:1px solid #ddd;border-radius:8px;text-decoration:none;color:#222}
.pnw-pagination .page-numbers.current{background:#3A653A;border-color:#3A653A;color:#fff}

/* ---------- Run clubs card (Custom HTML widget in the sidebar) ---------- */
.content-side .w{background:#F7EFE3;border:1px solid #ead9bf;border-radius:14px;padding:16px}
.content-side .clubs .row{display:flex;gap:12px;align-items:center;margin-bottom:12px}
.content-side .clubs .row img{width:64px;height:64px;border-radius:50%;object-fit:cover;border:3px solid #fff;flex:0 0 64px;background:#fff}
.content-side .clubs h3{font-family:"Roboto Slab",Georgia,serif;font-size:19px;line-height:1.2;margin:0}
.content-side .clubs p{font-size:15px;color:#55635A;margin:0}
.content-side .clubs .btn{display:flex;align-items:center;justify-content:center;width:100%;min-height:48px;font-size:16px;font-weight:700;padding:10px 16px;border-radius:10px;background:#3A653A;color:#fff;text-decoration:none}

/* Optional: keep the last sidebar widget (the tall ad) in view while scrolling on desktop. */
@media (min-width:901px){
	.content-side > .widget:last-child{position:sticky;top:16px}
}

/* Text for screen readers only (labels on the search form). */
.screen-reader-text{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
