/* =====================================================================
   A-Town Mobile Layout  v1.1.25
   Responsive layer for the "Local News" theme.
   - Desktop (wider than 1040px) is NOT changed by anything in this file.
   - 768px-1040px : fluid "tablet" layout (content + sidebar side by side)
   - 767px and below : single column; sidebar (ads) drops below the articles
   ===================================================================== */

/* The theme has an old iPhone hack (width:102%) that causes sideways scrolling. */
.atown-menu-toggle { display: none; }
/* Spanish-news button: phones only. On desktop/tablet the original sidebar widget is used instead. */
.atown-es { display: none; max-width: 1000px; margin: 8px auto 0; text-align: right; box-sizing: border-box; }
.atown-es a { display: inline-flex; align-items: center; gap: 8px; padding: 3px 12px; font: bold 12px/1.3 Arial, Helvetica, sans-serif; letter-spacing: .3px; color: #f2f2f2; background: linear-gradient(#444, #333); border: 1px solid #5a5a5a; border-left: 3px solid #e3703b; border-radius: 4px; text-decoration: none; }
.atown-es a::before { content: "ES"; display: inline-block; padding: 0 5px; font: bold 10px/16px Arial, Helvetica, sans-serif; letter-spacing: .5px; color: #fff; background: #e3703b; border-radius: 2px; }
.atown-es a::after { content: "\203A"; color: #e3703b; font-size: 17px; line-height: 1; }
.atown-es a:hover, .atown-es a:active { background: #555; color: #fff; text-decoration: none; }
@media (max-width: 1040px) { .atown-es { padding: 0 12px; } }
.atown-top5 { display: none; }

@media (max-width: 1040px) {

	html, body { width: 100% !important; min-width: 0; overflow-x: hidden; }
	body { -webkit-text-size-adjust: 100%; }
	*, *::before, *::after { box-sizing: border-box; }
	img, video, iframe, embed, object { max-width: 100%; }
	img { height: auto; }

	/* ---- Fixed 1000px containers become fluid ---- */
	#header_top, #header, #header_bg .slidemenu, #info_area, #before_wrapper,
	#wrapper, #header_bg #top_sidebar, #bottom_elements, #footer-widget-area,
	#subhead, #subhead_slider, #subhead_no_bg {
		width: auto !important;
		max-width: 1000px;
	}
	#header_top, #header, #info_area, #header_bg #top_sidebar { padding-left: 12px; padding-right: 12px; }
	#before_wrapper, #wrapper, #bottom_elements, #footer-widget-area { margin-left: 10px; margin-right: 10px; }

	/* ---- Header ---- */
	#header { height: auto; padding-top: 10px; padding-bottom: 10px; }
	#header #logo { position: static; }
	#header #logo img { width: 100%; max-width: 429px; height: auto; display: block; }
	#header_bg #top_sidebar { position: relative; }
	#header_bg #top_sidebar ul { position: static; float: none; width: 100%; }
	#top_sidebar ul li { float: none; padding-left: 0 !important; width: 100%; }
	#top_sidebar .widget_search .s { width: 100%; max-width: 100%; }
	#top_sidebar .widget_search form { display: flex; gap: 6px; }
	#top_sidebar .widget_search input[type="text"], #top_sidebar .widget_search input[type="search"] { flex: 1; min-width: 0; }
	/* ---- Header order on phones and tablets: logo first, then the search box, then the menu.
	   (Also removes the grey gap that used to sit above the search box.) ---- */
	#header_bg { display: flex; flex-direction: column; }
	#header_bg > #header { order: 1; padding-bottom: 6px; }
	#header_bg > #top_sidebar { order: 2; padding-top: 0; padding-bottom: 12px; }
	#header_bg > #menu_bg { order: 3; }
	#header_bg > #info_area_bg { order: 4; }
	#header_bg > #header { height: auto !important; }
	#header_bg > #top_sidebar { margin: 0 auto !important; padding-top: 14px !important; width: 100% !important; box-sizing: border-box; padding-left: 12px; padding-right: 12px; }
	/* Search box is about as wide as the logo text (not the full screen width), centered under the logo */
	#header_bg #top_sidebar ul { margin: 0 auto !important; padding: 0 !important; width: 94% !important; max-width: 403px; position: relative !important; left: -2.67%; }
	/* (the logo picture has a little blank space on its right, so its visible letters sit ~2.7% left of the picture's middle; nudge the search to match) */
	#header_bg #top_sidebar .widget-container, #header_bg #top_sidebar li { margin: 0; }

	/* ---- Info / breadcrumb bar ---- */
	#info_area { height: auto; line-height: 1.4; padding-top: 6px; padding-bottom: 6px; }
	.breadcrumbs { padding-bottom: 0; }
	#below_menu_sidebar { float: none; }

	/* ---- Fluid layout for tablets ---- */
	#container_bg { display: flex; align-items: flex-start; gap: 10px; }
	#container_bg > .clear { display: none; }
	#container_bg #content, #container_bg #content_right { float: none; width: auto; flex: 1 1 auto; min-width: 0; }
	#container_bg #content_full { width: 100%; }
	#sidebar_right { float: none; flex: 0 0 280px; width: 280px; }

	/* ---- Hero slider + "Promoted Articles" (before-content area) ----
	   The slider is stacked: big picture on top, headline list underneath. */
	#before_wrapper .content_widgets { padding: 10px; }
	#before_wrapper .su-column { float: none !important; width: 100% !important; margin: 0 0 10px 0 !important; clear: both; }
	.post_slider { display: flex; flex-direction: column; width: 100% !important; height: auto !important; max-width: 100%; }
	.post_slider .ui-tabs-panel { order: 1; width: 100% !important; height: auto !important; max-width: 100%; position: relative; }
	.post_slider .ui-tabs-panel img { width: 100% !important; height: auto !important; max-height: 340px; object-fit: contain; background: #000; display: block; }
	.post_slider .ui-tabs-panel .info { position: static; opacity: 1; }
	.post_slider .info h2 { font-size: 18px; }
	.post_slider .info p { display: none; }
	.post_slider ul.ui-tabs-nav { order: 2; position: static !important; left: auto !important; width: 100% !important; }
	.post_slider ul.ui-tabs-nav li { display: block; float: none; clear: both; width: 100%; }
	.post_slider li.ui-tabs-nav-item a { display: flex !important; align-items: center; gap: 10px; height: auto; min-height: 56px; padding: 4px 8px; }
	.post_slider ul.ui-tabs-nav li img { float: none !important; flex: 0 0 80px; width: 80px !important; height: 50px !important; aspect-ratio: auto; object-fit: cover; margin: 0 !important; }
	.post_slider ul.ui-tabs-nav li span.ps_title { padding: 0; flex: 1; font-size: 14px; }
}

/* =====================================================================
   PHONES AND SMALL TABLETS
   ===================================================================== */
@media (min-width: 768px) and (max-width: 1040px) {
	/* Tablets: the logo is centered, so the search box is centered under it */
	#header_bg #top_sidebar ul { width: 403px !important; max-width: 100%; margin: 0 auto !important; left: -11.5px; }
}
@media (max-width: 767px) {

	body { font-size: 16px; line-height: 1.5; }

	/* ---- Top utility bar ---- */
	#header_top { padding-top: 8px; padding-bottom: 8px; font-size: 13px; }
	#header_top .menu-top-container, #header_top .tagline { float: none; width: 100%; }
	/* The four utility links become a tidy 2 x 2 grid of tap-friendly buttons.
	   The first one ("Subscribe") is highlighted in the site's orange. */
	#header_top .menu-top-container ul { margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
	#header_top .menu-top-container ul li { float: none; margin: 0; padding: 0; }
	#header_top .menu-top-container ul li:last-child:nth-child(odd) { grid-column: 1 / -1; }
	#header_top .menu-top-container ul li a {
		display: flex; align-items: center; justify-content: center; text-align: center;
		min-height: 34px; padding: 3px 6px; line-height: 1.2; margin: 0;
		border: 1px solid #5a5a5a !important; border-radius: 4px;
		background: linear-gradient(#444, #333); color: #f2f2f2;
		font-size: 13px; font-weight: bold; line-height: 1.2; text-decoration: none;
	}
	#header_top .menu-top-container ul li:first-child a { background: #e3703b; border-color: #e3703b !important; color: #fff; }
	#header_top .menu-top-container ul li a:hover, #header_top .menu-top-container ul li a:active { text-decoration: none; background: #555; }
	#header_top .menu-top-container ul li:first-child a:hover, #header_top .menu-top-container ul li:first-child a:active { background: #cf5f2c; }
	#header_top .tagline_seperator, #header_top .tagline { display: none; }


	/* ---- Main menu: collapsed behind a button ---- */
	#menu_bg { position: relative; min-height: 47px; } /* reserve the Menu button space so the page does not jump when mobile.js adds it */
	.atown-menu-toggle {
		display: flex; align-items: center; gap: 10px; width: 100%;
		min-height: 46px; padding: 0 14px; margin: 0;
		background: #3a3a3a; color: #fff; border: 0; border-bottom: 1px solid #222;
		font: bold 15px/1 Arial, Helvetica, sans-serif; text-transform: uppercase; letter-spacing: .5px;
		cursor: pointer; border-radius: 0;
	}
	.atown-burger, .atown-burger::before, .atown-burger::after {
		display: block; width: 22px; height: 2px; background: #fff; position: relative; content: "";
	}
	.atown-burger::before { position: absolute; top: -7px; left: 0; }
	.atown-burger::after { position: absolute; top: 7px; left: 0; }
	.atown-menu-open .atown-burger { background: transparent; }
	.atown-menu-open .atown-burger::before { top: 0; transform: rotate(45deg); }
	.atown-menu-open .atown-burger::after { top: 0; transform: rotate(-45deg); }

	#header_bg .slidemenu { height: auto; padding: 0; display: none; }
	.atown-menu-open #header_bg .slidemenu, .atown-menu-open #main_menu { display: block; }
	#header_bg .slidemenu ul { width: 100%; }
	#header_bg .slidemenu ul li, #header_bg .slidemenu ul li.first-child-divider { float: none; display: block; height: auto; border: 0; box-shadow: none; }
	#header_bg .slidemenu ul li.first-child-divider { display: none; }
	#header_bg .slidemenu ul li a {
		display: block; height: auto; min-height: 46px; line-height: 46px; padding: 0 16px;
		border-right: 0; border-bottom: 1px solid #555; box-shadow: none; font-size: 15px;
	}
	/* Sub-menus (e.g. "Region") are always open, indented, inside the menu */
	#header_bg .slidemenu ul li ul,
	#header_bg .slidemenu ul li ul li ul {
		position: static !important; display: block !important; visibility: visible !important;
		width: 100% !important; box-shadow: none; left: auto !important; top: auto !important;
	}
	#header_bg .slidemenu ul li ul li { padding: 0; background: #2e2e2e !important; }
	#header_bg .slidemenu ul li ul li a { width: 100%; padding-left: 32px; color: #ddd; border-bottom: 1px solid #444; line-height: 42px; min-height: 42px; }


	/* ---- Phones: "Top Stories" list replaces the hero slider ---- */
	#before_wrapper .post_slider, #before_wrapper .su-column:has(.post_slider) { display: none !important; }
	.atown-es { display: block; margin: 8px 8px 0; padding: 0; text-align: center; }
	/* On phones the button above replaces the sidebar copy of the link */
	#custom_html-2, .widget_text:has(a[href*="translate.google.com"]) { display: none !important; }
	.atown-es a { display: flex; justify-content: center; padding: 4px 10px; font-size: 13px; }
	.atown-top5 { display: block; margin: 10px 8px 0; padding: 10px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.07); }
	.atown-top5 ul { list-style: none; margin: 0; padding: 0; }
	.atown-top5 li { margin: 0; padding: 0; }
	.atown-top5-title { margin: 0 0 8px; padding: 4px 10px; background: #e3703b; color: #fff; font: bold 13px/1.3 Arial, Helvetica, sans-serif; text-transform: uppercase; }
	.atown-top5 li a { display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 6px 8px; color: #222; font: bold 13.5px/1.3 Arial, Helvetica, sans-serif; text-decoration: none; background: linear-gradient(#fafafa, #ececec); border-left: 3px solid #e3703b; }
	.atown-top5 li + li a { border-top: 1px solid #d6d6d6; }
	.atown-top5 li img { flex: 0 0 80px; width: 80px; height: 50px; object-fit: cover; padding: 2px; background: #fff; border: 1px solid #cfcfcf; box-sizing: content-box; margin: 0; }
	.atown-top5 li a:hover, .atown-top5 li a:focus, .atown-top5 li a:active { background: #fbe4d8; color: #111; }

	/* ---- Main layout: single column ---- */
	#wrapper, #before_wrapper, #bottom_elements, #footer-widget-area { margin-left: 8px; margin-right: 8px; }
	#container_bg { display: block; }
	#container_bg #content, #container_bg #content_right, #container_bg #content_full {
		float: none; width: 100%; padding: 12px;
	}
	#sidebar_right, #container_bg #primary { float: none; width: 100%; }
	#sidebar_right { margin-top: 10px; }
	#primary .widget-container { padding: 12px; }

	/* Shortcode columns (home page category blocks) stack */
	.su-column { float: none !important; width: 100% !important; margin: 0 0 10px 0 !important; clear: both; }

	/* News listings: thumbnail left, text right */
	.news-listing-wrapper-s2, .news-listing-wrapper-s3, .news-listing-wrapper-s4 { font-size: 15px; line-height: 1.4; }
	.news-listing-wrapper-s2 .news-main-post .news-listing-title { font-size: 20px; }
	.news-listing-wrapper-s2 .news-list-posts .news-listing-title { font-size: 16px; }
	.news-listing-image { float: left; width: 38%; max-width: 180px; margin: 0 12px 6px 0; }
	.news-listing-image img, .news-listing-wrapper-s2 .news-main-post img { width: 100% !important; height: auto !important; margin-right: 0; }
	.news-listing-wrapper-s2 .news-listing-image { float: left; }
	.news-listing-meta { font-size: 12px; }
	.news-listing-wrapper .news-main-post, .news-listing-wrapper .news-list-posts { float: none; width: 100%; }
	.news-listing-wrapper .news-list-posts .news-listing-item { margin-left: 0; }
	.su-heading-shell { font-size: 16px; }

	/* Category / archive grids */
	.evenpost, .oddpost { float: none; width: 100%; clear: both; }
	.loop-featured-img img { width: 100%; }

	/* ---- Article pages ---- */
	h1.entry-title-single { font-size: 26px; line-height: 1.25; }
	h2.entry-title, .loop-main-post h2.entry-title { font-size: 21px; }
	.entry-content { font-size: 17px; line-height: 1.65; }
	.entry-meta, .entry-utility { font-size: 13px; }
	.entry-content img, .wp-caption, .alignleft, .alignright, .aligncenter { max-width: 100% !important; height: auto; }
	.alignleft, .alignright { float: none; display: block; margin: 0 auto 12px; }
	.wp-caption { width: auto !important; }
	.single-post-img-left, .single-post-img-right { float: none; }
	[style*="width: 610px"], [style*="width:610px"] { width: auto !important; max-width: 100% !important; }
	.entry-content table { display: block; max-width: 100%; overflow-x: auto; }
	.entry-content iframe, .entry-content embed, .entry-content video { max-width: 100%; }
	.fb-comments, .fb-comments span, .fb-comments iframe { width: 100% !important; }
	#commentform, #respond input, #respond textarea, textarea, .wpcf7 input, .wpcf7 textarea { width: 100% !important; max-width: 100%; }
	input[type="text"], input[type="email"], input[type="search"], input[type="password"], select, textarea { font-size: 16px; max-width: 100%; } /* 16px stops iPhone zoom-on-focus */
	#container_bg .not-found .searchform input.s { width: 100%; }

	/* ---- AdRotate / sidebar ads: centered, never wider than the screen ---- */
	#primary .adrotate_widgets-t, .g, .g-col, .a-single, .adrotate_widgets { max-width: 100%; }
	.g { width: auto !important; margin-left: auto; margin-right: auto; text-align: center; }
	.g-col { float: none !important; margin: 0 auto 12px; }
	.g img, .g-col img, .a-single img { max-width: 100%; height: auto; margin: 0 auto; display: block; }
	.widget_ajaxed_ads, .widget_adrotate_widgets, #primary .widget_text { text-align: center; }
	/* All pages: sidebar ads sit two per row instead of one under another */
	#adrotate_widgets-2 .g { display: flex; flex-wrap: nowrap; gap: 16px; justify-content: center; align-items: flex-start; width: auto !important; margin: 0 auto 16px !important; padding: 0 4px; }
	#adrotate_widgets-2 .g-col { flex: 1 1 0; min-width: 0; margin: 0 !important; }
	#adrotate_widgets-2 .g-col a { display: block; }
	#adrotate_widgets-2 .g-col img { width: 100%; height: auto; }

	/* ---- Directory (Sabai) ---- */
	#sabai-content, #sabai-body, .sabai-row, .sabai-directory-listing { max-width: 100%; }
	.sabai-col-sm-1, .sabai-col-sm-2, .sabai-col-sm-3, .sabai-col-sm-4, .sabai-col-sm-6, .sabai-col-sm-8, .sabai-col-sm-9 { float: none; width: 100%; }
	.sabai-directory-map, .sabai-directory-map-canvas { max-width: 100%; }

	/* ---- Footer ---- */
	#bottom_elements { padding: 12px; }
	#copyright, #footer_navigation, #footer_navigation ul { float: none; width: 100%; }
	#copyright { margin-bottom: 8px; }
	#footer_navigation ul { margin: 0; display: flex; flex-wrap: wrap; }
	#footer_navigation ul li { float: none; }
	#footer_navigation ul li a { display: block; padding: 8px 12px 8px 0; margin-right: 12px; font-size: 13px; }
	#footer-widget-area #footer_section_1, #footer-widget-area #footer_section_2 { float: none; width: 100%; padding: 0; border: 0; }
}

/* Very small phones */
@media (max-width: 380px) {
	.news-listing-image { width: 34%; margin-right: 10px; }
	h1.entry-title-single { font-size: 23px; }
}

/* ---- Darker text, whole site (v1.1.25): body/gray text #616161 -> #222. Links, menus, buttons untouched. ---- */
html body,
body.home, body.single, body.page, body.archive,
body,
#content .entry-content,
.entry-content p, .entry-content li, .entry-content em, .entry-content strong,
.excerpt, .entry-meta, .entry-meta span, .cat-links, .cat-links span,
#bottom_elements, .size-wrap, .size-wrap div,
.news-listing-wrapper-s2 span, .authorinfo p {
	color: #222;
}
.entry-title-single, .entry-content h1, .entry-content h2, .entry-content h3, .entry-content h4 { color: #1a1a1a; }
.breadcrumbs_title, .breadcrumb, .authorinfo_title, .authorinfo_title span { color: #444 !important; }
.breadcrumb a { color: #444; }
html body { color: #222 !important; }
