/* Author-Editable Single-Post Page Builder, Milestone 1 base styles.
   Everything is scoped under .glh-page-layout so it can never leak
   into the sitewide theme header/footer/nav (see §5 of the handoff
   doc). Palette colors arrive as inline CSS custom properties set
   per-post by GPC_Page_Layout::palette_vars(). */

.glh-page-layout {
	--glh-primary: #0b2545;
	--glh-accent: #c9a227;
	--glh-bg: #ffffff;
	background: var( --glh-bg );
	color: #222;
	max-width: 960px;
	margin: 0 auto;
}

.glh-section {
	box-sizing: border-box;
}

.glh-pad-small  { padding: 16px 12px; }
.glh-pad-medium { padding: 32px 16px; }
.glh-pad-large  { padding: 56px 20px; }

.glh-bg-light { background: rgba( 0, 0, 0, 0.03 ); }
.glh-bg-dark  { background: var( --glh-primary ); color: #fff; }
.glh-bg-dark a { color: var( --glh-accent ); }

/* Logo */
.glh-logo-align-left   { text-align: left; }
.glh-logo-align-center { text-align: center; }
.glh-logo-align-right  { text-align: right; }
.glh-logo-img { display: inline-block; height: auto; }
.glh-logo-small  img { max-width: 96px; }
.glh-logo-medium img { max-width: 160px; }
.glh-logo-large  img { max-width: 240px; }

/* About */
.glh-about {
	display: flex;
	flex-wrap: wrap;
	gap: 24px;
	align-items: center;
}
.glh-about-image { flex: 1 1 260px; max-width: 320px; }
.glh-about-image img { width: 100%; height: auto; border-radius: 6px; }
.glh-about-text { flex: 2 1 320px; }
.glh-about-text h2, .glh-text-block h2 { color: var( --glh-primary ); margin-top: 0; }

/* Gallery */
.glh-gallery {
	display: grid;
	gap: 12px;
}
.glh-gallery-grid-2 { grid-template-columns: repeat( 2, 1fr ); }
.glh-gallery-grid-3 { grid-template-columns: repeat( 3, 1fr ); }
.glh-gallery-grid-4 { grid-template-columns: repeat( 4, 1fr ); }
.glh-gallery-carousel { grid-auto-flow: column; grid-auto-columns: 70%; overflow-x: auto; }
.glh-gallery-item img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }

/* Shop */
.glh-shop-grid {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 180px, 1fr ) );
	gap: 20px;
}
.glh-shop-item { border: 1px solid rgba( 0, 0, 0, 0.08 ); border-radius: 6px; padding: 12px; text-align: center; }
.glh-shop-img { width: 100%; height: auto; border-radius: 4px; margin-bottom: 8px; }
.glh-shop-name { font-weight: 600; }
.glh-shop-price { color: var( --glh-primary ); margin: 4px 0; }
.glh-shop-buy {
	display: inline-block;
	margin-top: 6px;
	padding: 6px 16px;
	background: var( --glh-accent );
	color: #1a1a1a;
	text-decoration: none;
	border-radius: 4px;
	font-weight: 600;
}

/* Contact form (Milestone 1: visual scaffold only, inputs disabled, see render_contact_form()) */
.glh-contact-form { display: flex; flex-direction: column; gap: 12px; max-width: 480px; }
.glh-contact-label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.glh-contact-form input, .glh-contact-form textarea {
	padding: 8px 10px;
	border: 1px solid rgba( 0, 0, 0, 0.15 );
	border-radius: 4px;
	font: inherit;
}
.glh-contact-submit {
	align-self: flex-start;
	padding: 8px 20px;
	background: var( --glh-primary );
	color: #fff;
	border: none;
	border-radius: 4px;
	opacity: 0.6;
	cursor: not-allowed;
}

/* Contact form status + honeypot (Milestone 6) */
.glh-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px; height: 1px;
	overflow: hidden;
}
.glh-contact-msg { font-size: 14px; min-height: 1.2em; }
.glh-contact-msg.is-success { color: #1f6f3e; }
.glh-contact-msg.is-error   { color: #a33; }

/* Divider */
.glh-divider-small  { height: 12px; }
.glh-divider-medium { height: 32px; }
.glh-divider-large  { height: 64px; }

@media ( max-width: 600px ) {
	.glh-gallery-grid-3, .glh-gallery-grid-4 { grid-template-columns: repeat( 2, 1fr ); }
}

/* 
   "Design Page" builder UI (Milestones 2 to 5, 7)
   Scoped to the modal, never affects front-end rendering.
 */

.glh-modal-tabs { display: flex; gap: 4px; margin: 4px 0 16px; border-bottom: 1px solid rgba(0,0,0,0.1); }
.glh-tab {
	background: none; border: none; padding: 8px 14px; cursor: pointer;
	font: inherit; color: #555; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.glh-tab.is-active { color: #111; border-bottom-color: var( --glh-primary, #0b2545 ); font-weight: 600; }

.glh-design-intro { font-size: 13px; color: #666; margin-top: 0; }
.glh-design-status { min-height: 1.4em; font-size: 13px; margin: 6px 0; }
.glh-design-status.is-error { color: #a33; }

.glh-palette-block { margin: 12px 0 20px; }
.glh-palette-swatches { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.glh-swatch {
	width: 40px; height: 40px; border-radius: 50%; border: 2px solid transparent;
	cursor: pointer; padding: 0;
}
.glh-swatch.is-selected { border-color: #111; }
.glh-swatch-custom { background: #eee; color: #555; font-weight: 700; font-size: 18px; }
.glh-custom-palette { display: flex; gap: 16px; margin-top: 10px; flex-wrap: wrap; }
.glh-custom-palette label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }

.glh-sections-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.glh-section-row { border: 1px solid rgba(0,0,0,0.12); border-radius: 6px; overflow: hidden; }
.glh-section-row-head {
	display: flex; align-items: center; justify-content: space-between;
	padding: 10px 12px; background: rgba(0,0,0,0.02); cursor: default;
}
.glh-section-row-title { font-weight: 600; }
.glh-section-row-actions { display: flex; gap: 6px; }
.glh-icon-btn {
	background: #fff; border: 1px solid rgba(0,0,0,0.15); border-radius: 4px;
	padding: 4px 9px; cursor: pointer; font-size: 13px;
}
.glh-icon-danger { color: #a33; border-color: rgba(170,51,51,0.3); }
.glh-section-row-body { padding: 14px; border-top: 1px solid rgba(0,0,0,0.08); display: flex; flex-direction: column; gap: 10px; }

.glh-field-row { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.glh-field-note { font-size: 12px; color: #777; margin: 0; }

.glh-image-pick { display: flex; align-items: center; gap: 10px; }
.glh-image-pick-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 4px; }

.glh-gallery-edit { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.glh-gallery-edit-item { position: relative; width: 64px; height: 64px; }
.glh-gallery-edit-item img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }
.glh-gallery-edit-item button { position: absolute; top: -6px; right: -6px; }

.glh-shop-edit-row { border: 1px dashed rgba(0,0,0,0.15); border-radius: 6px; padding: 10px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 8px; }

.glh-add-section-row { display: flex; gap: 8px; margin-bottom: 20px; }
.glh-design-actions { display: flex; align-items: center; gap: 14px; }

@media ( max-width: 600px ) {
	.glh-section-row-actions { flex-wrap: wrap; }
}

/* 
   Brand Page Design panel (My Ads Dashboard sidebar)
 */

/* Self-contained look for this panel wherever it's embedded, the
   My Ads Dashboard already styles .gpc-ads-dash-panel/-panel-title/
   -btn-secondary itself (gpc-ads-dashboard.css, only loaded on that
   page), but this same panel also gets dropped into the URS private
   profile's "Brand Page" tab (see GPC_Premium_Status::add_urs_profile_tab())
   where that stylesheet was never loaded. These rules are scoped
   under .glh-brand-page-panel so they only ever affect this one
   panel, and match the ads-dashboard look closely enough that having
   both loaded on the same page never produces a visible difference. */
.glh-brand-page-panel { background: #fff; border: 1px solid rgba(0,0,0,0.08); border-radius: 10px; padding: 16px 18px; margin-bottom: 16px; }
.glh-brand-page-panel .gpc-ads-dash-panel-title { margin: 0 0 12px; font-size: 16px; font-weight: 800; color: #131b30; }
.glh-brand-page-panel .gpc-ads-dash-btn-secondary {
	display: inline-block; padding: 6px 14px; border: 1px solid rgba(0,0,0,0.15);
	border-radius: 6px; background: #f7f7f8; cursor: pointer; font-size: 13px; color: #131b30;
}
.glh-brand-page-panel .gpc-ads-dash-btn-secondary:hover { background: #efeff1; }

.glh-brand-page-panel .glh-brand-page-intro { margin-top: 0; font-size: 13px; color: #555; }
.glh-brand-page-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.glh-brand-page-list li {
	display: flex; align-items: center; justify-content: space-between; gap: 8px;
	padding: 8px 0; border-bottom: 1px solid rgba(0,0,0,0.06);
}
.glh-brand-page-title { font-weight: 500; flex: 1; }
.glh-brand-page-badge {
	font-size: 11px; background: rgba(31,111,62,0.12); color: #1f6f3e;
	padding: 2px 8px; border-radius: 10px; white-space: nowrap;
}
.glh-brand-page-empty { font-size: 13px; color: #777; }
.glh-brand-page-requirements { margin: 8px 0 0; padding-left: 18px; font-size: 13px; color: #555; }
.glh-brand-page-requirements li { margin-bottom: 6px; }
