/* Mofix Article Kit – Mohsen Hassani */
:root {
	--mak-accent: #fac921;
	--mak-dark: #2b2a30;
	--mak-ink: #1d1c21;
	--mak-muted: #6b6a73;
	--mak-line: #e7e5ec;
	--mak-soft: #f7f6f9;
	--mak-radius: 14px;
	--mak-ease: cubic-bezier(.2, .7, .2, 1);
}

/* Reading progress */
.mak-progress {
	position: fixed; top: 0; left: 0; height: 4px; width: 100%;
	transform-origin: 0 50%; transform: scaleX(0);
	background: linear-gradient(90deg, var(--mak-accent), #ffe27a);
	z-index: 100000; pointer-events: none;
}
.admin-bar .mak-progress { top: 32px; }
@media (max-width: 782px) { .admin-bar .mak-progress { top: 46px; } }

/* Meta line */
.mak-meta { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; font-size: .85rem; color: var(--mak-muted); margin: 0 0 1.5rem; }
.mak-meta span { display: inline-flex; align-items: center; gap: .4rem; }
.mak-meta span::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--mak-accent); }

/* General article rhythm */
.single-post .wp-block-heading { scroll-margin-top: 90px; }
.single-post h2.wp-block-heading { position: relative; padding-top: .4em; }
.single-post h2.wp-block-heading::after {
	content: ""; display: block; width: 46px; height: 3px; margin-top: .55em;
	background: var(--mak-accent); border-radius: 3px;
}

/* Lead / summary */
.mak-lead { font-size: 1.15rem; line-height: 1.7; color: var(--mak-ink); }
.mak-summary {
	background: var(--mak-dark); color: #f3f2f6; border-radius: var(--mak-radius);
	padding: 1.4rem 1.5rem 1.2rem; margin: 1.8rem 0; position: relative; overflow: hidden;
}
.mak-summary::before {
	content: "Key takeaways"; display: block; font-family: Poppins, sans-serif; font-weight: 600;
	text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; color: var(--mak-accent); margin-bottom: .6rem;
}
.mak-summary ul { margin: 0; padding-left: 1.1rem; }
.mak-summary li { margin: .35rem 0; }
.mak-summary li::marker { color: var(--mak-accent); }
.mak-summary a { color: var(--mak-accent); }

/* Table of contents */
.mak-toc {
	border: 1px solid var(--mak-line); border-radius: var(--mak-radius); background: var(--mak-soft);
	padding: 1rem 1.2rem; margin: 1.5rem 0 2rem;
}
.mak-toc summary { cursor: pointer; font-family: Poppins, sans-serif; font-weight: 600; text-transform: uppercase; font-size: .8rem; letter-spacing: .08em; list-style: none; display: flex; justify-content: space-between; }
.mak-toc summary::-webkit-details-marker { display: none; }
.mak-toc summary::after { content: "+"; font-size: 1.1rem; line-height: 1; transition: transform .3s var(--mak-ease); }
.mak-toc[open] summary::after { transform: rotate(45deg); }
.mak-toc ol { margin: .8rem 0 0; padding: 0; list-style: none; counter-reset: mak; }
.mak-toc li { counter-increment: mak; margin: .15rem 0; }
.mak-toc a { display: flex; gap: .6rem; padding: .3rem .4rem; border-radius: 8px; color: var(--mak-ink); text-decoration: none; font-size: .95rem; transition: background .2s; }
.mak-toc a::before { content: counter(mak, decimal-leading-zero); color: var(--mak-muted); font-variant-numeric: tabular-nums; }
.mak-toc a:hover, .mak-toc a.is-active { background: #fff; box-shadow: inset 3px 0 0 var(--mak-accent); }

/* Callouts */
.mak-tip, .mak-warn, .mak-note {
	border-radius: 12px; padding: 1rem 1.1rem 1rem 3.1rem; position: relative; margin: 1.4rem 0;
}
.mak-tip::before, .mak-warn::before, .mak-note::before {
	position: absolute; left: 1rem; top: 1rem; width: 1.5rem; height: 1.5rem; border-radius: 50%;
	display: grid; place-items: center; font-weight: 700; font-size: .85rem;
}
.mak-tip { background: #fff8dc; }
.mak-tip::before { content: "✓"; background: var(--mak-accent); color: var(--mak-dark); }
.mak-warn { background: #fff0ec; }
.mak-warn::before { content: "!"; background: #e5533d; color: #fff; }
.mak-note { background: #eef3ff; }
.mak-note::before { content: "i"; background: #3a6df0; color: #fff; }

/* Steps timeline */
ol.mak-steps { list-style: none; counter-reset: makstep; padding: 0; margin: 1.6rem 0; position: relative; }
ol.mak-steps::before { content: ""; position: absolute; left: 19px; top: 8px; bottom: 8px; width: 2px; background: var(--mak-line); }
ol.mak-steps > li { counter-increment: makstep; position: relative; padding: 0 0 1.2rem 3.4rem; }
ol.mak-steps > li::before {
	content: counter(makstep); position: absolute; left: 0; top: -2px; width: 40px; height: 40px; border-radius: 50%;
	display: grid; place-items: center; background: var(--mak-dark); color: var(--mak-accent);
	font-family: Poppins, sans-serif; font-weight: 600; box-shadow: 0 0 0 5px #fff;
}

/* Cards grid */
.mak-cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin: 1.5rem 0; }
.mak-card { border: 1px solid var(--mak-line); border-radius: var(--mak-radius); padding: 1.1rem; background: #fff; transition: transform .3s var(--mak-ease), box-shadow .3s var(--mak-ease); }
.mak-card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px -18px rgba(29, 28, 33, .45); }
.mak-card h4 { margin: .2rem 0 .4rem; font-size: 1rem; }
.mak-card p { margin: 0; font-size: .95rem; color: var(--mak-muted); }
.mak-card .mak-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--mak-dark); color: var(--mak-accent); display: grid; place-items: center; font-weight: 700; }

/* Tables */
.mak-table { overflow-x: auto; margin: 1.5rem 0; }
.mak-table table { width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 480px; }
.mak-table th { background: var(--mak-dark); color: #fff; text-align: left; font-family: Poppins, sans-serif; font-weight: 500; }
.mak-table th, .mak-table td { padding: .7rem .8rem; border-bottom: 1px solid var(--mak-line); vertical-align: top; }
.mak-table tr:nth-child(even) td { background: var(--mak-soft); }

/* Checklist */
.mak-checklist { list-style: none !important; padding: 0 !important; margin: 1.2rem 0 !important; }
.mak-checklist li { position: relative; padding: .65rem .8rem .65rem 2.8rem; border: 1px solid var(--mak-line); border-radius: 10px; margin: .45rem 0; cursor: pointer; transition: background .25s, border-color .25s; user-select: none; }
.mak-checklist li::before { content: ""; position: absolute; left: .85rem; top: .8rem; width: 1.2rem; height: 1.2rem; border-radius: 6px; border: 2px solid #c9c6d1; transition: all .25s var(--mak-ease); }
.mak-checklist li.is-done { background: #fffbea; border-color: #f3df8f; }
.mak-checklist li.is-done::before { background: var(--mak-accent); border-color: var(--mak-accent); box-shadow: inset 0 0 0 3px #fffbea; }
.mak-checklist li.is-done > * , .mak-checklist li.is-done { color: var(--mak-muted); }
.mak-checklist-bar { display: flex; align-items: center; gap: .8rem; font-size: .85rem; margin: .4rem 0 1.5rem; }
.mak-checklist-bar .mak-track { flex: 1; height: 8px; background: var(--mak-line); border-radius: 8px; overflow: hidden; }
.mak-checklist-bar .mak-fill { height: 100%; width: 0; background: var(--mak-accent); transition: width .5s var(--mak-ease); }
.mak-checklist-bar button { background: none; border: 1px solid var(--mak-line); border-radius: 6px; padding: .2rem .6rem; cursor: pointer; font-size: .8rem; }

/* Self-check / score tools */
.mak-score { border: 1px solid var(--mak-line); border-radius: var(--mak-radius); padding: 1.2rem; margin: 1.8rem 0; background: linear-gradient(180deg, #fff, var(--mak-soft)); }
.mak-score h4 { margin: 0 0 .3rem; }
.mak-score .mak-q { margin: 1rem 0; }
.mak-score .mak-q p { font-weight: 600; margin: 0 0 .45rem; }
.mak-score .mak-opts { display: flex; flex-wrap: wrap; gap: .45rem; }
.mak-score label { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--mak-line); border-radius: 999px; padding: .35rem .85rem; cursor: pointer; background: #fff; font-size: .92rem; transition: all .2s; }
.mak-score input { position: absolute; opacity: 0; pointer-events: none; }
.mak-score input:checked + span { font-weight: 600; }
.mak-score label:has(input:checked) { background: var(--mak-dark); color: #fff; border-color: var(--mak-dark); }
.mak-score label:has(input:focus-visible) { outline: 2px solid var(--mak-accent); outline-offset: 2px; }
.mak-score .mak-gauge { height: 10px; border-radius: 10px; background: var(--mak-line); overflow: hidden; margin: 1rem 0 .6rem; }
.mak-score .mak-gauge i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #e5533d, var(--mak-accent), #3bb273); transition: width .6s var(--mak-ease); }
.mak-result { display: none; border-radius: 10px; padding: .9rem 1rem; background: #fff; border-left: 4px solid var(--mak-accent); animation: makIn .5s var(--mak-ease); }
.mak-result.is-active { display: block; }
.mak-result p { margin: .2rem 0; }

/* Tabs */
.mak-tabs { margin: 1.8rem 0; }
.mak-tablist { display: flex; gap: .35rem; flex-wrap: wrap; border-bottom: 2px solid var(--mak-line); margin-bottom: 1rem; }
.mak-tablist button { background: none; border: 0; padding: .6rem .9rem; cursor: pointer; font-family: Poppins, sans-serif; font-size: .85rem; color: var(--mak-muted); position: relative; }
.mak-tablist button[aria-selected="true"] { color: var(--mak-ink); font-weight: 600; }
.mak-tablist button[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--mak-accent); }
.mak-tab[hidden] { display: none; }
.mak-tab { animation: makIn .4s var(--mak-ease); }

/* FAQ accordion (core Details block) */
details.mak-faq { border: 1px solid var(--mak-line); border-radius: 12px; margin: .6rem 0; padding: 0; background: #fff; overflow: hidden; }
details.mak-faq summary { cursor: pointer; padding: 1rem 3rem 1rem 1.1rem; font-weight: 600; position: relative; list-style: none; }
details.mak-faq summary::-webkit-details-marker { display: none; }
details.mak-faq summary::after { content: "+"; position: absolute; right: 1.1rem; top: 50%; transform: translateY(-50%); width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--mak-soft); display: grid; place-items: center; transition: transform .3s var(--mak-ease), background .3s; }
details.mak-faq[open] summary::after { transform: translateY(-50%) rotate(45deg); background: var(--mak-accent); }
details.mak-faq > :not(summary) { padding: 0 1.1rem; }
details.mak-faq[open] > :not(summary) { animation: makIn .35s var(--mak-ease); }

/* Code */
.single-post pre { position: relative; background: #1d1c21; color: #f1f0f4; border-radius: 12px; padding: 1rem 1.1rem; overflow-x: auto; font-size: .88rem; }
.mak-copy { position: absolute; top: .5rem; right: .5rem; background: #3a3941; color: #fff; border: 0; border-radius: 6px; padding: .25rem .55rem; font-size: .75rem; cursor: pointer; }

/* Figures and illustrations */
.mak-figure { margin: 2rem 0; }
.mak-figure svg { width: 100%; height: auto; display: block; border-radius: var(--mak-radius); }
.mak-figure figcaption { font-size: .85rem; color: var(--mak-muted); margin-top: .5rem; text-align: center; }

/* CTA */
.mak-cta { background: var(--mak-dark); color: #fff; border-radius: var(--mak-radius); padding: 1.6rem; margin: 2.4rem 0; display: grid; gap: .8rem; position: relative; overflow: hidden; }
.mak-cta::after { content: ""; position: absolute; right: -60px; top: -60px; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(circle, rgba(250, 201, 33, .35), transparent 70%); animation: makFloat 6s ease-in-out infinite; }
.mak-cta h3 { color: #fff; margin: 0; }
.mak-cta p { margin: 0; color: #d9d7df; }
.mak-cta .mak-btns { display: flex; flex-wrap: wrap; gap: .6rem; position: relative; z-index: 1; }
.mak-cta a { display: inline-block; padding: .65rem 1.1rem; border-radius: 8px; text-decoration: none; font-family: Poppins, sans-serif; font-size: .85rem; font-weight: 600; }
.mak-cta a.mak-primary { background: var(--mak-accent); color: var(--mak-dark); }
.mak-cta a.mak-secondary { border: 1px solid #5a5962; color: #fff; }

/* SVG animation helpers */
.mak-draw { stroke-dasharray: 600; stroke-dashoffset: 600; }
.is-visible .mak-draw, .mak-draw.is-visible { animation: makDraw 2.2s var(--mak-ease) forwards; }
.mak-float { animation: makFloat 5s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.mak-pulse { animation: makPulse 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.mak-flow { stroke-dasharray: 6 8; animation: makFlow 1.2s linear infinite; }
.mak-blink { animation: makBlink 1.6s steps(2, start) infinite; }

/* Scroll reveal */
.mak-reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--mak-ease), transform .7s var(--mak-ease); }
.mak-reveal.is-visible { opacity: 1; transform: none; }

@keyframes makIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes makDraw { to { stroke-dashoffset: 0; } }
@keyframes makFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes makPulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.08); opacity: .75; } }
@keyframes makFlow { to { stroke-dashoffset: -28; } }
@keyframes makBlink { to { visibility: hidden; } }

@media (prefers-reduced-motion: reduce) {
	.mak-reveal { opacity: 1; transform: none; transition: none; }
	.mak-float, .mak-pulse, .mak-flow, .mak-blink, .mak-cta::after { animation: none !important; }
	.mak-draw { stroke-dashoffset: 0; animation: none !important; }
}

@media (max-width: 600px) {
	.mak-summary, .mak-cta, .mak-score { padding: 1.1rem; }
	ol.mak-steps > li { padding-left: 3rem; }
	.mak-tip, .mak-warn, .mak-note { padding-left: 2.8rem; }
}

/* The theme floats headings; start every content block on its own line so grids and tables keep their full width. */
.blog-text > :not(.post-counter) {
	clear: both;
}
