/*
Theme Name: Absolute Knowledge Magazine
Theme URI: https://www.absolute-knowledge.com/
Description: Editorial science-magazine child theme for Absolute Knowledge, built on GeneratePress.
Author: Absolute Knowledge
Template: generatepress
Version: 1.0.0
Text Domain: ak-magazine
*/

:root {
	--ak-red: #d7262e;
	--ak-red-dark: #a91d24;
	--ak-ink: #15171a;
	--ak-text: #2b2f36;
	--ak-muted: #6b7280;
	--ak-line: #e7e5e1;
	--ak-paper: #faf8f5;
	--ak-white: #ffffff;
	--ak-serif: "Newsreader", Georgia, "Times New Roman", serif;
	--ak-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	--ak-radius: 6px;
	--ak-max: 1240px;
}

/* ---------- Base ---------- */
body {
	background: var(--ak-paper);
	color: var(--ak-text);
	font-family: var(--ak-sans);
	font-size: 17px;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
}
a { color: var(--ak-red); text-decoration: none; }
a:hover, a:focus { color: var(--ak-red-dark); }
h1, h2, h3, h4, h5, h6,
.entry-title, .widget-title {
	font-family: var(--ak-serif);
	color: var(--ak-ink);
	font-weight: 600;
	letter-spacing: -0.01em;
	line-height: 1.2;
}
.grid-container, .site-content, .inside-header, .inside-navigation, .inside-site-info, .footer-widgets-container {
	max-width: var(--ak-max);
}
::selection { background: var(--ak-red); color: #fff; }

/* ---------- Top bar ---------- */
.ak-topbar {
	background: var(--ak-ink);
	color: #cfd2d6;
	font-size: 13px;
}
.ak-topbar .ak-wrap {
	display: flex; justify-content: space-between; align-items: center;
	padding: 8px 24px; max-width: var(--ak-max); margin: 0 auto;
}
.ak-topbar a { color: #fff; font-weight: 500; }
.ak-topbar a:hover { color: #ffb3b6; }
.ak-yt { display: inline-flex; align-items: center; gap: 6px; }
.ak-yt svg { width: 18px; height: 18px; fill: #ff3d3d; }

/* ---------- Header ---------- */
.site-header { background: var(--ak-white); border-bottom: 1px solid var(--ak-line); }
.inside-header { padding: 22px 24px; }
.ak-brand { display: flex; align-items: center; gap: 14px; color: var(--ak-ink); }
.ak-brand:hover { color: var(--ak-ink); }
.ak-brand img { width: 52px; height: 52px; border-radius: 10px; }
.ak-brand-text { display: flex; flex-direction: column; }
.ak-brand-name {
	font-family: var(--ak-serif); font-weight: 700; font-size: 28px;
	letter-spacing: 0.06em; line-height: 1;
}
.ak-brand-name span { color: var(--ak-red); }
.ak-brand-tag { font-size: 13px; color: var(--ak-muted); margin-top: 6px; letter-spacing: 0.02em; }

.inside-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.site-branding { flex: 1 1 auto; }
.ak-brand-name, .ak-brand-tag { white-space: nowrap; }
.main-navigation .main-nav ul li[class*="current-menu-"] > a,
.main-navigation .main-nav ul li.current-post-parent > a { color: var(--ak-ink); }
.main-navigation .main-nav ul li[class*="current-menu-"]:hover > a { color: var(--ak-red); }

/* ---------- Navigation ---------- */
.main-navigation, .main-navigation ul ul { background: var(--ak-white); }
.main-navigation { border-bottom: 1px solid var(--ak-line); }
.main-navigation .main-nav ul li a {
	font-family: var(--ak-sans); font-size: 14px; font-weight: 600;
	text-transform: uppercase; letter-spacing: 0.06em;
	color: var(--ak-ink); line-height: 54px; padding: 0 16px;
}
.main-navigation .main-nav ul li:hover > a { color: var(--ak-red); }
.main-navigation .main-nav ul li.current-menu-item > a { color: var(--ak-red) !important; }
.main-navigation .main-nav ul li.current-menu-item > a { box-shadow: inset 0 -3px 0 var(--ak-red); }
.main-navigation .menu-toggle { color: var(--ak-ink); font-weight: 600; }
.main-navigation .main-nav ul ul li a { text-transform: none; letter-spacing: 0; line-height: 1.4; padding: 12px 16px; }

/* ---------- Home: hero ---------- */
.ak-home, .ak-archive { flex: 1 1 100%; min-width: 0; width: 100%; }
.ak-home { max-width: var(--ak-max); margin: 0 auto; padding: 32px 24px 8px; }
.ak-hero { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(0,1fr); gap: 28px; margin-bottom: 44px; }
.ak-hero-main { position: relative; border-radius: var(--ak-radius); overflow: hidden; min-height: 480px; background: var(--ak-ink); }
.ak-hero-main img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.ak-hero-main:hover img { transform: scale(1.03); }
.ak-hero-main::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 35%, rgba(0,0,0,.82) 100%); }
.ak-hero-main .ak-hero-body { position: absolute; left: 0; right: 0; bottom: 0; padding: 32px; z-index: 2; }
.ak-hero-main h2 { color: #fff; font-size: clamp(28px, 3.2vw, 42px); margin: 10px 0 12px; }
.ak-hero-main h2 a { color: #fff; }
.ak-hero-main p { color: rgba(255,255,255,.86); font-size: 17px; margin: 0; max-width: 640px; }
.ak-hero-side { display: flex; flex-direction: column; gap: 22px; }
.ak-hero-side .ak-card { flex: 1; }

/* ---------- Cards ---------- */
.ak-kicker {
	display: inline-block; font-family: var(--ak-sans); font-size: 12px; font-weight: 700;
	text-transform: uppercase; letter-spacing: 0.1em; color: var(--ak-red);
}
.ak-hero-main .ak-kicker { color: #fff; background: var(--ak-red); padding: 4px 10px; border-radius: 3px; }
.ak-card { background: var(--ak-white); border-radius: var(--ak-radius); overflow: hidden; display: flex; flex-direction: column; border: 1px solid var(--ak-line); transition: box-shadow .25s ease, transform .25s ease; }
.ak-card:hover { box-shadow: 0 12px 30px rgba(21,23,26,.10); transform: translateY(-2px); }
.ak-card-img { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #e9e6e1; }
.ak-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ak-card-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.ak-card h3 { font-size: 21px; margin: 0; }
.ak-card h3 a { color: var(--ak-ink); }
.ak-card h3 a:hover { color: var(--ak-red); }
.ak-card p { margin: 0; color: var(--ak-muted); font-size: 15px; line-height: 1.55; }
.ak-meta { font-size: 13px; color: var(--ak-muted); margin-top: auto; }

/* ---------- Section heads & grids ---------- */
.ak-section { margin: 0 0 48px; }
.ak-section-head { display: flex; justify-content: space-between; align-items: baseline; border-top: 3px solid var(--ak-ink); padding-top: 12px; margin-bottom: 22px; }
.ak-section-head h2 { font-size: 26px; margin: 0; }
.ak-section-head a { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.ak-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 26px; }
.ak-grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.ak-grid-4 .ak-card h3 { font-size: 18px; }

/* ---------- Topic chips ---------- */
.ak-topics { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 40px; }
.ak-topics a { background: var(--ak-white); border: 1px solid var(--ak-line); color: var(--ak-ink); padding: 8px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; }
.ak-topics a:hover { border-color: var(--ak-red); color: var(--ak-red); }

/* ---------- YouTube band ---------- */
.ak-yt-band { background: var(--ak-ink); color: #fff; border-radius: var(--ak-radius); padding: 34px 38px; display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 8px 0 48px; }
.ak-yt-band h2 { color: #fff; margin: 0 0 6px; font-size: 28px; }
.ak-yt-band p { margin: 0; color: #c9ccd1; }
.ak-btn { display: inline-flex; align-items: center; gap: 8px; background: var(--ak-red); color: #fff !important; padding: 12px 22px; border-radius: 999px; font-weight: 700; font-size: 15px; white-space: nowrap; }
.ak-btn:hover { background: var(--ak-red-dark); }
.ak-btn svg { width: 18px; height: 18px; fill: #fff; }

/* ---------- Archive & blog list ---------- */
.ak-archive { max-width: var(--ak-max); margin: 0 auto; padding: 36px 24px; }
.ak-archive-head { margin-bottom: 30px; }
.ak-archive-head h1 { font-size: clamp(32px, 4vw, 48px); margin: 6px 0 8px; }
.ak-archive-head .ak-desc { color: var(--ak-muted); max-width: 720px; }
.ak-pagination { margin: 40px 0 10px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.ak-pagination .page-numbers { min-width: 42px; height: 42px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--ak-line); border-radius: 999px; background: var(--ak-white); color: var(--ak-ink); font-weight: 600; }
.ak-pagination .page-numbers.current, .ak-pagination .page-numbers:hover { background: var(--ak-ink); border-color: var(--ak-ink); color: #fff; }

/* ---------- Single article ---------- */
.single .site-content { padding-top: 0; }
.single .inside-article { background: transparent; padding: 0; }
.ak-article-head { max-width: 820px; margin: 0 auto; padding: 44px 24px 26px; text-align: center; }
.ak-article-head h1 { font-size: clamp(32px, 4.4vw, 52px); margin: 12px 0 16px; }
.ak-article-head .ak-meta { font-size: 14px; }
.ak-article-hero { max-width: 1080px; margin: 0 auto 36px; padding: 0 24px; }
.ak-article-hero img { width: 100%; height: auto; max-height: 620px; object-fit: cover; border-radius: var(--ak-radius); display: block; }
.single .entry-content { font-family: var(--ak-serif); font-size: 20px; line-height: 1.72; color: #22252b; }
.single .entry-content h2 { font-size: 30px; margin-top: 1.6em; }
.single .entry-content h3 { font-size: 24px; margin-top: 1.4em; }
.single .entry-content img { border-radius: var(--ak-radius); height: auto; }
.single .entry-content blockquote { border-left: 4px solid var(--ak-red); background: var(--ak-white); padding: 16px 22px; font-style: italic; }
.single .entry-content a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.single .entry-content .ak-update { font-family: var(--ak-sans); font-size: 16px; border-radius: var(--ak-radius); }
.single .entry-content .ez-toc-container, .single .entry-content #ez-toc-container { font-family: var(--ak-sans); font-size: 15px; border-radius: var(--ak-radius); background: var(--ak-white); border: 1px solid var(--ak-line); }
.ak-tags { margin: 30px 0 0; display: flex; flex-wrap: wrap; gap: 8px; font-family: var(--ak-sans); }
.ak-tags a { font-size: 13px; background: var(--ak-white); border: 1px solid var(--ak-line); color: var(--ak-muted); padding: 4px 12px; border-radius: 999px; }
.ak-tags a:hover { color: var(--ak-red); border-color: var(--ak-red); }

/* ---------- Share bar ---------- */
.ak-share { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 36px 0 8px; padding: 18px 0; border-top: 1px solid var(--ak-line); border-bottom: 1px solid var(--ak-line); font-family: var(--ak-sans); }
.ak-share-label { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--ak-ink); margin-right: 6px; }
.ak-share a, .ak-share button {
	display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px;
	border: 1px solid var(--ak-line); background: var(--ak-white); color: var(--ak-ink) !important;
	font-size: 14px; font-weight: 600; cursor: pointer; line-height: 1; text-decoration: none !important;
	font-family: var(--ak-sans);
}
.ak-share a:hover, .ak-share button:hover { border-color: var(--ak-ink); }
.ak-share svg { width: 16px; height: 16px; fill: currentColor; }
.ak-share .ak-share-native { display: none; }
.ak-share.has-native .ak-share-native { display: inline-flex; }
.ak-share .is-copied { background: var(--ak-ink); color: #fff !important; border-color: var(--ak-ink); }

/* ---------- Related ---------- */
.ak-related { margin: 50px 0 10px; }
.ak-related .ak-grid { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; }
.ak-related .ak-card h3 { font-size: 17px; }
.ak-related .ak-card p { display: none; }
@media (max-width: 1100px) { .ak-related .ak-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }

/* ---------- Comments ---------- */
.comments-area { background: var(--ak-white); border: 1px solid var(--ak-line); border-radius: var(--ak-radius); padding: 28px; margin-top: 30px; }
.comments-area input[type="text"], .comments-area input[type="email"], .comments-area input[type="url"], .comments-area textarea {
	background: var(--ak-paper); border: 1px solid var(--ak-line); border-radius: var(--ak-radius); width: 100%; max-width: 100%;
}
.comments-area .form-submit .submit, button, html input[type="button"], input[type="reset"], input[type="submit"], a.button {
	background: var(--ak-red); color: #fff; border-radius: 999px; font-weight: 700; padding: 12px 24px; border: 0;
}
.comments-area .form-submit .submit:hover, input[type="submit"]:hover { background: var(--ak-red-dark); color: #fff; }
.comment-reply-title, .comments-title { font-family: var(--ak-serif); }
.search-form .search-submit { border-radius: 0 var(--ak-radius) var(--ak-radius) 0; padding: 10px 16px; }
.ak-share button { background: var(--ak-white); }
.ak-footer p { margin: 14px 0 20px; }
.inside-right-sidebar { position: sticky; top: 20px; }

/* ---------- Sidebar ---------- */
.sidebar .widget { background: var(--ak-white); border: 1px solid var(--ak-line); border-radius: var(--ak-radius); padding: 22px; }
.sidebar .widget-title { font-size: 18px; border-bottom: 2px solid var(--ak-ink); padding-bottom: 8px; margin-bottom: 14px; }
.sidebar .widget ul li { font-size: 15px; }
.widget_tag_cloud .tagcloud a { font-size: 13px !important; display: inline-block; margin: 0 6px 8px 0; padding: 4px 10px; border: 1px solid var(--ak-line); border-radius: 999px; color: var(--ak-ink); }
.widget_tag_cloud .tagcloud a:hover { border-color: var(--ak-red); color: var(--ak-red); }

/* ---------- Footer ---------- */
.site-footer { background: var(--ak-ink); color: #b8bcc3; }
.ak-footer { max-width: var(--ak-max); margin: 0 auto; padding: 48px 24px 24px; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.ak-footer h4 { color: #fff; font-size: 16px; font-family: var(--ak-sans); text-transform: uppercase; letter-spacing: .1em; margin: 0 0 14px; }
.ak-footer a { color: #e6e8eb; }
.ak-footer a:hover { color: #ffb3b6; }
.ak-footer ul { list-style: none; margin: 0; padding: 0; }
.ak-footer li { margin: 0 0 8px; }
.ak-footer .ak-brand { color: #fff; }
.ak-footer .ak-brand-tag { color: #9ca1a9; }
.ak-footer p { font-size: 15px; }
.site-info { background: #0e0f11; color: #8b9098; font-size: 13px; }
.site-info a { color: #c9ccd1; }

/* ---------- Ads ---------- */
.ak-ad-label { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--ak-muted); text-align: center; margin-bottom: 6px; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
	.ak-hero { grid-template-columns: minmax(0,1fr); }
	.ak-hero-side { flex-direction: row; }
	.ak-grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 768px) {
	body { font-size: 16px; }
	.ak-topbar .ak-tagline { display: none; }
	.inside-header { padding: 16px; }
	.ak-brand img { width: 42px; height: 42px; }
	.ak-brand-name { font-size: 21px; }
	.ak-brand-tag { display: none; }
	.ak-home, .ak-archive { padding: 20px 16px; }
	.ak-hero-main { min-height: 0; }
	.ak-hero-main img { position: static; display: block; width: 100%; aspect-ratio: 16 / 9; height: auto; }
	.ak-hero-main::after { display: none; }
	.ak-hero-main .ak-hero-body { position: static; padding: 20px 20px 24px; }
	.ak-hero-main h2 { font-size: 26px; }
	.ak-hero-main p { font-size: 15px; }
	.ak-topics { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; margin-bottom: 28px; -webkit-overflow-scrolling: touch; }
	.ak-topics a { white-space: nowrap; }
	.main-navigation .menu-toggle { font-size: 15px; text-transform: uppercase; letter-spacing: .08em; }
	.ak-hero-side { flex-direction: column; }
	.ak-grid, .ak-grid-4, .ak-related .ak-grid { grid-template-columns: minmax(0,1fr); gap: 20px; }
	.ak-yt-band { flex-direction: column; align-items: flex-start; padding: 26px; }
	.ak-footer { grid-template-columns: 1fr; gap: 28px; }
	.single .entry-content { font-size: 18px; }
	.ak-article-head { padding: 28px 16px 18px; }
	.ak-article-hero { padding: 0; }
	.ak-article-hero img { border-radius: 0; }
}

html, body { overflow-x: hidden; }
/* ---------- Mobile & tablet side margins ---------- */
.entry-content { overflow-wrap: break-word; word-wrap: break-word; }
.entry-content iframe, .entry-content video, .entry-content embed, .entry-content object { max-width: 100%; }
.entry-content table { display: block; max-width: 100%; overflow-x: auto; }
.entry-content pre { max-width: 100%; overflow-x: auto; white-space: pre-wrap; }
@media (max-width: 1024px) {
	.single .inside-article { padding-left: 22px !important; padding-right: 22px !important; }
	.single .ak-related { padding: 0 22px; }
	.single .comments-area { margin-left: 16px; margin-right: 16px; padding: 22px; }
	.single #right-sidebar .inside-right-sidebar { padding: 0 16px; position: static; }
	.ak-article-head { padding-left: 22px; padding-right: 22px; }
}
@media (max-width: 768px) {
	.single .entry-content { font-size: 18px; line-height: 1.68; }
	.single .entry-content h2 { font-size: 25px; }
	.single .entry-content h3 { font-size: 21px; }
	.ak-article-head h1 { font-size: 30px; }
	.single .ak-share { gap: 8px; }
	.single .ak-share a, .single .ak-share button { padding: 8px 12px; font-size: 13px; }
}

img { max-width: 100%; }