/*
Theme Name:  Geekinati (Divi child)
Template:    Divi
Description: Geekinati.com child theme. Holds only what Divi 5 cannot do natively: the light/dark switch and skeleton loaders. Everything else lives in Divi (Theme Builder, Global Colors, presets).
Version:     1.0.1
Text Domain: geekinati-divi
*/

/* Light variant: redefine the Divi global colors (dark is the default set in Divi). */
html[data-theme="light"] {
	--gcid-gk-bg: #f7f5fb;
	--gcid-gk-surface: #ffffff;
	--gcid-gk-surface-2: #eeeaf6;
	--gcid-gk-border: #d9d2e8;
	--gcid-gk-text: #16101f;
	--gcid-gk-muted: #554d68;
	--gcid-gk-pink: #b0285c;
	--gcid-gk-cyan: #0b6b78;
	--gcid-gk-yellow: #7a5d00;
	--gcid-gk-purple: #6a35b0;
	color-scheme: light;
}
html { color-scheme: dark; }
body { background-color: var(--gcid-gk-bg); color: var(--gcid-gk-text); }
/* Text that would otherwise take Divi's fixed default color follows the theme. */
body, .gk-body, .gk-body p, .gk-body li, .gk-body blockquote { color: var(--gcid-gk-text) !important; }
.gk-body h1, .gk-body h2, .gk-body h3, .gk-body h4 { color: var(--gcid-gk-text) !important; }
.gk-body a { color: var(--gcid-gk-cyan); }
.gk-breadcrumbs, .gk-breadcrumbs span { color: var(--gcid-gk-muted) !important; }
.gk-breadcrumbs a { color: var(--gcid-gk-cyan) !important; }

/* Theme toggle button (a Divi Icon/Button module with class gk-theme-toggle). */
.gk-theme-toggle { cursor: pointer; }
.gk-theme-toggle .gk-icon-sun { display: none; }
html[data-theme="light"] .gk-theme-toggle .gk-icon-sun { display: inline; }
html[data-theme="light"] .gk-theme-toggle .gk-icon-moon { display: none; }

/* Skeleton loaders: shimmer behind card images until the lazy image has loaded. */
.gk-card .et_pb_image_wrap,
.gk-card .gk-thumb {
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: linear-gradient(100deg, var(--gcid-gk-surface) 30%, var(--gcid-gk-surface-2) 50%, var(--gcid-gk-surface) 70%);
	background-size: 300% 100%;
	animation: gk-shimmer 1.4s ease-in-out infinite;
}
.gk-card img { width: 100%; height: 100%; object-fit: cover; transition: opacity .3s ease; }
html.gk-js .gk-card img:not(.gk-loaded) { opacity: 0; }
@keyframes gk-shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) {
	.gk-card .et_pb_image_wrap, .gk-card .gk-thumb { animation: none; }
	.gk-card img { transition: none; }
	.gk-card { transition: none !important; }
}

/* ---- Card polish Divi has no single setting for ---- */
.gk-card, .gk-card .et_pb_module, .gk-list-item .et_pb_module, .gk-byline .et_pb_module, .gk-sidebar .et_pb_module { margin-bottom: 0 !important; }
.gk-card { overflow: hidden; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.gk-card:hover { transform: translateY(-4px); border-color: var(--gcid-gk-pink) !important; box-shadow: 0 0 0 1px var(--gcid-gk-pink), 0 6px 20px rgba(232, 87, 139, .18); }
.gk-card .gk-thumb, .gk-card .gk-thumb .et_pb_image_wrap { width: 100%; max-width: 100%; }
.gk-card-title a, .gk-list-title a { color: inherit; }
.gk-card-title a:hover, .gk-list-title a:hover { color: var(--gcid-gk-cyan); }
.gk-card-title h3, .gk-dek p { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.gk-card-title h3 { -webkit-line-clamp: 3; }
.gk-dek p { -webkit-line-clamp: 2; }
.gk-tag p { text-transform: uppercase; }

/* Related articles (Divi Blog module) matched to the card look */
.gk-related .et_pb_post { overflow: hidden; padding: 0 0 16px !important; margin-bottom: 0 !important; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.gk-related .et_pb_post:hover { transform: translateY(-4px); border-color: var(--gcid-gk-pink) !important; box-shadow: 0 6px 20px rgba(232, 87, 139, .18); }
.gk-related .et_pb_image_container { margin: 0 0 14px !important; }
.gk-related .et_pb_image_container img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.gk-related .entry-title, .gk-related .post-meta, .gk-related .post-content { padding-left: 16px; padding-right: 16px; }
.gk-related .entry-title a { color: inherit; }
.gk-related .entry-title a:hover { color: var(--gcid-gk-cyan); }
.gk-related .post-meta a { color: var(--gcid-gk-pink); }
@media (prefers-reduced-motion: reduce) { .gk-related .et_pb_post { transition: none; } }

/* Archive: first card spans two columns on wide screens */
@media (min-width: 981px) {
	.gk-archive-grid > .gk-card:first-child { grid-column: span 2; grid-row: span 2; }
	.gk-archive-grid > .gk-card:first-child .gk-card-title h3 { font-size: 30px !important; }
}

/* Compact list items */
.gk-mini-thumb { flex: 0 0 112px; width: 112px !important; margin: 0 !important; }
.gk-mini-thumb img { aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; }
.gk-trending { counter-reset: gk-rank; }
.gk-trending .gk-list-item { counter-increment: gk-rank; align-items: flex-start !important; }
.gk-trending .gk-list-item::before { content: counter(gk-rank); font-family: "Chakra Petch", sans-serif; font-weight: 700; font-size: 28px; line-height: 1; color: var(--gcid-gk-pink); min-width: 28px; }

/* Hero overlay for readable text on any image */
.gk-hero-card { position: relative; overflow: hidden; }
.gk-hero-card::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(6, 2, 13, 0) 25%, rgba(6, 2, 13, .94) 100%); pointer-events: none; }
.gk-hero-card > * { position: relative; z-index: 1; }
.gk-hero-card h2 a { color: #fff; }

/* Section headings with "See all" */
.gk-section-head .et_pb_text_inner { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; border-bottom: 2px solid var(--gcid-gk-pink); padding-bottom: 8px; }
.gk-section-head h2 { padding-bottom: 0; }
.gk-see-all { white-space: nowrap; }

/* Header */
.gk-logo a { color: var(--gcid-gk-pink) !important; text-shadow: 0 0 12px rgba(232, 87, 139, .3); }
.gk-mini-thumb.et_pb_module { flex: 0 0 112px !important; width: 112px !important; max-width: 112px !important; }
.gk-logo-sm { font-family: "Chakra Petch", sans-serif; font-weight: 700; font-size: 22px; letter-spacing: 2px; color: var(--gcid-gk-pink); }
.gk-theme-toggle { background: transparent !important; border: 1px solid var(--gcid-gk-border) !important; color: var(--gcid-gk-yellow) !important; border-radius: 999px !important; width: 40px; height: 40px; padding: 0 !important; font-size: 20px; line-height: 1; }
.gk-theme-toggle:hover, .gk-theme-toggle:focus-visible { border-color: var(--gcid-gk-yellow); }

/* Article */
.gk-hero-img img { width: 100%; aspect-ratio: 21 / 9; object-fit: cover; border-radius: 0 0 14px 14px; }
.gk-byline .gk-avatar.et_pb_module { width: 40px !important; max-width: 40px !important; flex: 0 0 40px; }
.gk-byline .gk-avatar img { width: 40px !important; height: 40px !important; border-radius: 50%; object-fit: cover; }
.gk-share a { display: inline-block; margin-left: 6px; padding: 4px 10px; border: 1px solid var(--gcid-gk-border); border-radius: 999px; color: var(--gcid-gk-cyan); }
.gk-share a:hover { border-color: var(--gcid-gk-cyan); }
.gk-body { font-size: 18px; line-height: 1.75; }
.gk-body h2 { font-family: "Chakra Petch", sans-serif; font-weight: 700; margin-top: 1.4em; }
.gk-card-title h3, .gk-list-title h4, .gk-section-head h2 { padding-bottom: 0 !important; }
.gk-dek p, .gk-meta p, .gk-tag p { padding-bottom: 0 !important; }
.gk-prolist, .gk-conlist { white-space: pre-line; padding-bottom: 0 !important; }
.gk-score-wrap .et_pb_text_inner { display: flex; align-items: baseline; gap: 6px; }
.gk-score-wrap p { padding-bottom: 0 !important; }
.gk-score { line-height: 1; }
.gk-score-out { color: var(--gcid-gk-muted); font-size: 16px; }
.gk-review-box { box-shadow: inset 4px 0 0 var(--gcid-gk-yellow); }

/* Sidebar ad placeholder: fixed size so nothing shifts when ads arrive */
.gk-ad { display: flex; align-items: center; justify-content: center; width: 100%; max-width: 300px; min-height: 600px; margin: 0 auto; border: 1px dashed var(--gcid-gk-border); border-radius: 12px; color: var(--gcid-gk-muted); font-size: 13px; }

/* Pagination */
.gk-pagination ul { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 8px 0 0; }
.gk-pagination a, .gk-pagination span { display: inline-block; padding: 8px 14px; border: 1px solid var(--gcid-gk-border); border-radius: 8px; color: var(--gcid-gk-text); font-family: "Chakra Petch", sans-serif; font-weight: 700; }
.gk-pagination .current { background: var(--gcid-gk-pink); border-color: var(--gcid-gk-pink); color: var(--gcid-gk-bg); }

/* Phone and tablet type scale for the big headlines */
@media (max-width: 980px) {
	.gk-hero-card h2 { font-size: 32px !important; }
	.gk-article-title h1 { font-size: 38px !important; }
	.gk-archive-head h1 { font-size: 36px !important; }
}
@media (max-width: 767px) {
	.gk-hero-card h2 { font-size: 26px !important; }
	.gk-article-title h1 { font-size: 30px !important; }
	.gk-article-dek p { font-size: 18px !important; }
	.gk-archive-head h1 { font-size: 30px !important; }
	.gk-logo p { font-size: 22px !important; }
}

/* Filled pink controls use the background color as text: 6:1 in both modes (white on pink is only 3.4:1 in dark). */
.gk-newsletter .et_pb_newsletter_button { background: var(--gcid-gk-pink) !important; border-color: var(--gcid-gk-pink) !important; color: var(--gcid-gk-bg) !important; }
/* Until Mailchimp is connected Divi renders an empty signup module; hide it rather than show a bare bar. */
.gk-newsletter .et_pb_signup:not(:has(form)) { display: none !important; }
.gk-newsletter input { background: var(--gcid-gk-surface-2) !important; color: var(--gcid-gk-text) !important; border: 1px solid var(--gcid-gk-border) !important; }

/* Visible keyboard focus everywhere */
a:focus-visible, button:focus-visible, input:focus-visible, .gk-theme-toggle:focus-visible { outline: 2px solid var(--gcid-gk-cyan) !important; outline-offset: 2px; }

/* Footer */
.gk-footer-links ul { list-style: none; padding: 0; }
.gk-footer-links a { color: var(--gcid-gk-muted); }
.gk-footer-links a:hover { color: var(--gcid-gk-cyan); }
