/* Cully Online: site-wide design tweaks, mobile first. Loaded on every public page. */

/* ---------- Quick links ---------- */
.cn-ql { margin: 8px 0 40px; }
.entry-content .cn-ql h2 { margin: 0 0 14px !important; font-size: 1.5em; }
.cn-ql-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cn-ql-grid a, .cn-ql-chips a {
	display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px;
	background: #fff; border: 1px solid #e1e6e1; border-radius: 12px; color: #1e4d2b !important;
	font-weight: 600; font-size: 15px; line-height: 1.25; text-decoration: none !important;
	box-shadow: 0 2px 8px rgba(20, 40, 25, .04); transition: border-color .15s, background .15s;
}
.cn-ql-grid a:hover, .cn-ql-chips a:hover { border-color: #2f7a45; background: #eef4ee; }
.cn-ql-ico { flex: none; width: 40px; height: 40px; padding: 9px; border-radius: 50%; background: #e9f0ea; color: #2f7a45; }
.cn-ql-chips { display: none; }
@media (min-width: 640px) { .cn-ql-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 981px) { .cn-ql-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } .cn-ql-grid a { flex-direction: column; justify-content: center; text-align: center; min-height: 112px; padding: 16px 10px; } }

/* ---------- Phones and tablets ---------- */
@media (max-width: 980px) {
	/* Pinned, compact header so the menu is always one tap away. */
	#main-header { position: fixed !important; top: 0 !important; left: 0; right: 0; z-index: 99990; box-shadow: 0 1px 0 #e1e6e1, 0 4px 14px rgba(20, 40, 25, .06); }
	.admin-bar #main-header { top: 46px !important; }
	#page-container { padding-top: 64px !important; }
	#main-header .container { height: 64px; display: flex; align-items: center; justify-content: space-between; width: 100% !important; max-width: none; padding: 0 16px; box-sizing: border-box; }
	#main-header .container::before, #main-header .container::after { display: none !important; content: none !important; }
	#main-header .logo_container { width: auto !important; height: auto !important; position: static !important; display: flex; flex: none !important; align-items: center; margin: 0; float: none; }
	#main-header #logo { height: 40px !important; max-height: none !important; max-width: none !important; width: auto !important; margin: 0 !important; }
	#et-top-navigation { padding: 0 !important; margin: 0 !important; float: none !important; display: flex; align-items: center; gap: 4px; }
	#et_top_search, #et_search_icon { margin: 0 !important; }
	.mobile_menu_bar { padding: 12px 10px !important; }
	.mobile_menu_bar:before { font-size: 34px !important; }
	#et_search_icon:before { font-size: 22px !important; }
	#mobile_menu1 li a, .et_mobile_menu li a { padding: 15px 5% !important; font-size: 17px !important; }
	/* The menu scrolls inside the pinned header, and sections fold away (see cully-site.js). */
	#main-header .et_mobile_menu { max-height: calc(100vh - 64px) !important; max-height: calc(100dvh - 64px) !important; overflow-y: auto !important; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
	#main-header .et_mobile_menu li.menu-item-has-children { position: relative; }
	#main-header .et_mobile_menu.cn-accordion li.menu-item-has-children > a { padding-right: 64px !important; }
	#main-header .et_mobile_menu.cn-accordion li ul { display: none !important; }
	#main-header .et_mobile_menu.cn-accordion li.cn-open > ul { display: block !important; }
	.cn-sub-toggle { position: absolute; right: 0; top: 0; width: 60px; height: 54px; border: 0; background: none; padding: 0; cursor: pointer; color: #1e4d2b; display: flex; align-items: center; justify-content: center; }
	.cn-sub-toggle::before { content: ""; width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .2s; }
	.cn-open > .cn-sub-toggle::before { transform: translateY(2px) rotate(-135deg); }
	#main-content .container { padding-top: 14px !important; }

	/* A banner that no longer fills the first screen. */
	.cy-hero { padding: 28px 18px !important; margin-bottom: 18px !important; border-radius: 14px !important; }
	.cy-hero h1 { font-size: 1.7em !important; margin-bottom: 8px !important; }
	.cy-hero p { font-size: .98em !important; margin-bottom: 12px !important; line-height: 1.5 !important; }
	.cy-hero .cy-kicker { margin-bottom: 8px !important; }
	.cy-hero .cy-chips { display: none !important; }
	.cy-hero .cy-btn { margin: 4px 3px 0 !important; padding: 12px 18px !important; font-size: .95em; }

	/* Quick links as a swipeable row under the banner. */
	.cn-ql-chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 0 16px; padding: 2px 2px 8px; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
	.cn-ql-chips::-webkit-scrollbar { display: none; }
	.cn-ql-chips a { flex: none; scroll-snap-align: start; min-height: 48px; padding: 6px 16px 6px 8px; border-radius: 999px; white-space: nowrap; gap: 8px; }
	.cn-ql-chips .cn-ql-ico { width: 34px; height: 34px; padding: 7px; }
}

@media (max-width: 640px) {
	/* Easier to tap and to read. */
	.cn-tabs a { padding: 14px 14px !important; }
	.cn-sec-head a, .cn-home-all { display: inline-block; padding: 10px 0; }
	.cy-card a { display: inline-block; padding: 10px 0; }
	.cn-label { font-size: 12px; }
	.cn-meta { font-size: 13.5px; }
	.cn-sum { font-size: 15px; }
	.cy-card { padding: 20px 18px !important; }
	.cn-home-topics a { padding: 13px 16px; }
	.cy-band a:not(.cy-btn) { display: inline-block; padding: 10px 0; }
	#footer-widgets a, #footer-bottom a { display: inline-block; padding: 11px 0; }
	#footer-widgets li { margin-bottom: 0; }
	#et-footer-nav .bottom-nav a { display: inline-block; padding: 13px 8px; }
	#et-footer-nav .bottom-nav li { padding-right: 0; }

	/* Tables become readable cards instead of scrolling sideways. */
	table.cy-tbl, table.cy-tbl tbody, table.cy-tbl tr, table.cy-tbl th, table.cy-tbl td { display: block; width: 100% !important; box-sizing: border-box; }
	table.cy-tbl tr.cn-headrow { display: none; }
	table.cy-tbl tr { padding: 12px 14px; border-bottom: 1px solid #edf2ed; }
	table.cy-tbl tr:last-child { border-bottom: 0; }
	table.cy-tbl th { background: none !important; padding: 0 0 4px !important; border: 0 !important; font-size: 1.02em; }
	table.cy-tbl td { padding: 2px 0 !important; border: 0 !important; background: none !important; }
	table.cy-tbl td[data-label]::before { content: attr(data-label); display: block; margin-top: 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #5d6860; }
}

@media (max-width: 420px) {
	.cn-ql-grid { gap: 10px; }
	.cn-ql-grid a { gap: 9px; padding: 8px 10px; font-size: 14.5px; }
	.cn-ql-grid .cn-ql-ico { width: 34px; height: 34px; padding: 7px; }
}

@media (prefers-reduced-motion: reduce) {
	.cn-ql-grid a, .cn-ql-chips a { transition: none; }
}
