/*
Theme Name:   Youtube4DL
Theme URI:    https://www.youtube4dl.com/
Author:       Youtube4DL
Description:  Fast, focused theme for the Youtube4DL YouTube downloader. Pairs with the Youtube4DL Downloader plugin for the download tool, SEO, ads and one-click site setup.
Version:      1.0.0
Requires at least: 6.2
Requires PHP: 7.4
License:      GPL-2.0-or-later
Text Domain:  y4dl
*/

/* ---------------------------------------------------------------
   Tokens (brand colours come from the plugin as --y4-*)
---------------------------------------------------------------- */
:root {
	--ink: var(--y4-ink, #14162b);
	--primary: var(--y4-primary, #2b3ae8);
	--accent: var(--y4-accent, #ffc531);
	--paper: #f6f7fb;
	--white: #fff;
	--line: #dde0ee;
	--text: #1d2036;
	--muted: #5d6180;
	--on-dark: rgba(255, 255, 255, .92);
	--on-dark-muted: rgba(255, 255, 255, .64);
	--font: var(--y4-font, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
	--wrap: 1120px;
	--gutter: clamp(16px, 4vw, 32px);
	--r-lg: 18px;
	--r-md: 12px;
	--r-sm: 8px;
}

/* ---------------------------------------------------------------
   Base
---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }
body {
	margin: 0;
	background: var(--white);
	color: var(--text);
	font-family: var(--font);
	font-size: 17px;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}
img, svg, video { max-width: 100%; height: auto; }
a { color: var(--primary); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.15; margin: 0; }
p { margin: 0 0 1em; }
.y4-wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.y4-skip { position: absolute; left: -9999px; top: 8px; z-index: 100; padding: 10px 16px; background: var(--accent); color: var(--ink); font-weight: 700; border-radius: var(--r-sm); }
.y4-skip:focus { left: 8px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Expanded display type: the one typographic voice of the site */
.y4-hero-title, .y4-page-title, .y4-section-title, .y4-logo-text, .y4-prose h2 {
	font-stretch: 125%;
	font-weight: 800;
	letter-spacing: -.025em;
}

/* ---------------------------------------------------------------
   Header
---------------------------------------------------------------- */
.y4-header { background: var(--ink); color: var(--on-dark); position: relative; z-index: 20; }
.y4-header-in { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 24px; }
.y4-logo { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.y4-logo:hover { text-decoration: none; }
.y4-logo-mark { display: inline-flex; }
.y4-logo-text { font-size: 21px; font-weight: 780; letter-spacing: -.02em; }
.custom-logo-link img { display: block; max-height: 44px; width: auto; }

.y4-nav-menu { display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; }
.y4-nav-menu a {
	position: relative; display: block; padding: 10px 12px;
	color: var(--on-dark); font-size: 15px; font-weight: 550; text-decoration: none; border-radius: var(--r-sm);
}
.y4-nav-menu a:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.y4-nav-menu a[aria-current="page"]::after {
	content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 3px; border-radius: 2px; background: var(--accent);
}
.y4-nav-toggle { display: none; }

@media (max-width: 900px) {
	.y4-nav-toggle {
		display: inline-flex; align-items: center; gap: 10px; height: 42px; padding: 0 14px;
		color: #fff; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .18); border-radius: 10px;
		font: 600 15px/1 var(--font); cursor: pointer;
	}
	.y4-burger, .y4-burger::before, .y4-burger::after { display: block; width: 16px; height: 2px; background: currentColor; border-radius: 2px; position: relative; transition: transform .2s; }
	.y4-burger::before, .y4-burger::after { content: ""; position: absolute; left: 0; }
	.y4-burger::before { top: -5px; }
	.y4-burger::after { top: 5px; }
	.y4-menu-open .y4-burger { background: transparent; }
	.y4-menu-open .y4-burger::before { transform: translateY(5px) rotate(45deg); }
	.y4-menu-open .y4-burger::after { transform: translateY(-5px) rotate(-45deg); }
	.y4-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--ink); border-top: 1px solid rgba(255, 255, 255, .1); padding: 8px var(--gutter) 20px; }
	.y4-menu-open .y4-nav { display: block; }
	.y4-nav-menu { flex-direction: column; align-items: stretch; }
	.y4-nav-menu a { padding: 14px 4px; font-size: 17px; border-bottom: 1px solid rgba(255, 255, 255, .08); border-radius: 0; }
	.y4-nav-menu a[aria-current="page"]::after { left: auto; right: 4px; top: 50%; bottom: auto; width: 8px; height: 8px; border-radius: 50%; transform: translateY(-50%); }
}

/* ---------------------------------------------------------------
   Dark bands: hero and page heads. Their bottom edge is a strip of
   film – the site's one decorative motif.
---------------------------------------------------------------- */
.y4-on-dark { position: relative; background: var(--ink); color: var(--on-dark); }
.y4-on-dark::after {
	content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 18px;
	background:
		radial-gradient(circle at 50% 50%, var(--paper) 0 3px, transparent 3.5px) 0 50% / 22px 18px repeat-x;
	opacity: .14;
}
.y4-hero { padding: 36px 0 92px; }
.y4-hero-title {
	max-width: 15ch; margin: 8px 0 18px;
	color: #fff; font-size: clamp(40px, 6.6vw, 80px); line-height: .98;
}
.y4-hero-lead { max-width: 54ch; margin: 0 0 32px; color: var(--on-dark-muted); font-size: clamp(17px, 1.7vw, 20px); line-height: 1.55; }
.y4-hero .ytc-deck { --hole: rgba(255, 255, 255, .55); background-color: #23264a; }

.y4-pagehead { padding: 40px 0 64px; }
.y4-page-title { max-width: 22ch; margin: 6px 0 12px; color: #fff; font-size: clamp(32px, 4.8vw, 56px); line-height: 1.04; }
.y4-page-lead { max-width: 60ch; margin: 0; color: var(--on-dark-muted); font-size: 18px; }

.y4-crumbs ol { display: flex; flex-wrap: wrap; gap: 4px 0; margin: 0; padding: 0; list-style: none; font-size: 14px; }
.y4-crumbs li { color: var(--on-dark-muted); }
.y4-crumbs li + li::before { content: "/"; margin: 0 10px; opacity: .5; }
.y4-crumbs a { color: var(--on-dark-muted); text-decoration: none; }
.y4-crumbs a:hover { color: #fff; text-decoration: underline; }

/* ---------------------------------------------------------------
   Sections
---------------------------------------------------------------- */
.y4-section-title { margin: 0 0 28px; font-size: clamp(26px, 3.2vw, 38px); line-height: 1.08; }

.y4-steps { padding: 72px 0 24px; background: var(--white); }
.y4-steps-list { counter-reset: step; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; border-top: 2px solid var(--ink); }
.y4-steps-list li { counter-increment: step; padding: 24px 28px 8px 0; }
.y4-steps-list li + li { padding-left: 28px; border-left: 1px solid var(--line); }
.y4-steps-list li::before {
	content: counter(step);
	display: block; margin-bottom: 14px;
	color: var(--primary); font-size: 52px; line-height: 1; font-weight: 800; font-stretch: 125%;
}
.y4-steps-list h3 { margin: 0 0 6px; font-size: 19px; font-weight: 720; }
.y4-steps-list p { margin: 0; color: var(--muted); font-size: 16px; }
@media (max-width: 760px) {
	.y4-steps-list { grid-template-columns: 1fr; }
	.y4-steps-list li, .y4-steps-list li + li { display: grid; grid-template-columns: 56px 1fr; column-gap: 12px; padding: 20px 0; border-left: 0; border-bottom: 1px solid var(--line); }
	.y4-steps-list li::before { grid-row: span 2; font-size: 40px; margin: 0; }
}

/* ---------------------------------------------------------------
   Long-form content
---------------------------------------------------------------- */
.y4-article { padding: 56px 0 72px; background: var(--white); }
.y4-prose { max-width: 720px; }
.y4-prose > *:first-child { margin-top: 0; }
.y4-prose h2 { margin: 2.2em 0 .6em; font-size: clamp(24px, 2.6vw, 30px); line-height: 1.15; }
.y4-prose h3 { margin: 1.8em 0 .5em; font-size: 20px; font-weight: 720; }
.y4-prose p, .y4-prose li { color: #2b2e48; }
.y4-prose strong { color: var(--ink); }
.y4-prose ul, .y4-prose ol { margin: 0 0 1.2em; padding-left: 1.3em; }
.y4-prose ul { list-style: none; padding-left: 0; }
.y4-prose ul > li { position: relative; padding-left: 22px; margin-bottom: .5em; }
.y4-prose ul > li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 8px; height: 8px; border-radius: 2px; background: var(--primary); }
.y4-prose ol > li { margin-bottom: .5em; padding-left: 4px; }
.y4-prose ol > li::marker { color: var(--primary); font-weight: 750; }
.y4-prose figure { margin: 1.6em 0; }
.y4-prose .wp-block-table { overflow-x: auto; }
.y4-prose table { width: 100%; border-collapse: collapse; font-size: 16px; }
.y4-prose th { text-align: left; padding: 10px 14px 10px 0; border-bottom: 2px solid var(--ink); color: var(--ink); font-weight: 700; }
.y4-prose td { padding: 12px 14px 12px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.y4-prose em { color: var(--muted); }
.y4-featured { margin: 0 0 32px; }
.y4-featured img { border-radius: var(--r-lg); display: block; }

/* ---------------------------------------------------------------
   FAQ
---------------------------------------------------------------- */
.y4-faq { padding: 72px 0; background: var(--paper); }
.y4-faq-list { max-width: 820px; border-top: 2px solid var(--ink); }
.y4-qa { border-bottom: 1px solid var(--line); }
.y4-qa summary {
	position: relative; display: block; padding: 20px 48px 20px 0;
	color: var(--ink); font-size: 18px; font-weight: 680; cursor: pointer; list-style: none;
}
.y4-qa summary::-webkit-details-marker { display: none; }
.y4-qa summary::before, .y4-qa summary::after {
	content: ""; position: absolute; right: 8px; top: 50%; width: 16px; height: 2.5px; border-radius: 2px; background: var(--primary); transition: transform .2s;
}
.y4-qa summary::after { transform: rotate(90deg); }
.y4-qa[open] summary::after { transform: rotate(0); }
.y4-qa summary:hover { color: var(--primary); }
.y4-qa-a { padding: 0 48px 18px 0; color: #2b2e48; }
.y4-qa-a p:last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------
   Guides list
---------------------------------------------------------------- */
.y4-guides { padding: 72px 0; background: var(--white); }
.y4-faq + .y4-guides { padding-top: 64px; }
.y4-article + .y4-guides { padding-top: 0; }
.y4-guide-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; margin: 0; padding: 0; list-style: none; border-top: 2px solid var(--ink); }
.y4-guide-list li { border-bottom: 1px solid var(--line); }
.y4-guide-list a { display: block; padding: 18px 0; text-decoration: none; }
.y4-guide-t { display: block; color: var(--ink); font-size: 18px; font-weight: 700; line-height: 1.3; }
.y4-guide-d { display: block; margin-top: 4px; color: var(--muted); font-size: 15px; }
.y4-guide-list a:hover .y4-guide-t { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 760px) { .y4-guide-list { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------
   Inline tool sections (guides, posts)
---------------------------------------------------------------- */
.y4-try { padding: 64px 0; background: var(--paper); }
.y4-try .y4-section-title { margin-bottom: 8px; }
.y4-try-lead { margin: 0 0 24px; color: var(--muted); }
.y4-missing { padding: 16px; border: 2px dashed var(--line); border-radius: var(--r-md); color: var(--muted); }

/* ---------------------------------------------------------------
   Blog listing
---------------------------------------------------------------- */
.y4-listing { padding-top: 48px; padding-bottom: 72px; }
.y4-post-list { max-width: 780px; margin: 0; padding: 0; list-style: none; border-top: 2px solid var(--ink); }
.y4-post-item { padding: 26px 0; border-bottom: 1px solid var(--line); }
.y4-post-date { margin: 0 0 4px; color: var(--muted); font-size: 14px; }
.y4-post-title { font-size: 24px; font-weight: 750; font-stretch: 112%; letter-spacing: -.015em; margin: 0 0 8px; }
.y4-post-title a { color: var(--ink); text-decoration: none; }
.y4-post-title a:hover { color: var(--primary); text-decoration: underline; }
.y4-post-excerpt { margin: 0; color: #2b2e48; }
.y4-empty-state { max-width: 560px; padding: 32px 0; color: var(--muted); }
.navigation.pagination { margin-top: 32px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 6px; }
.nav-links .page-numbers { display: inline-flex; align-items: center; min-width: 42px; height: 42px; padding: 0 12px; border-radius: 10px; border: 1.5px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600; justify-content: center; }
.nav-links .page-numbers.current { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------------------------------------------------------------
   Footer
---------------------------------------------------------------- */
.y4-footer { background: var(--ink); color: var(--on-dark-muted); padding: 64px 0 28px; font-size: 15px; }
.y4-foot-top { display: grid; grid-template-columns: minmax(220px, 1fr) 2.6fr; gap: 48px; padding-bottom: 40px; }
.y4-foot-brand p { margin: 16px 0 0; max-width: 32ch; }
.y4-foot-mail { color: #fff; font-weight: 600; }
.y4-foot-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.y4-foot-title { margin: 6px 0 12px; color: #fff; font-size: 15px; font-weight: 700; }
.y4-foot-menu { margin: 0; padding: 0; list-style: none; }
.y4-foot-menu li { margin: 0 0 8px; }
.y4-foot-menu a { color: var(--on-dark-muted); text-decoration: none; }
.y4-foot-menu a:hover { color: #fff; text-decoration: underline; }
.y4-foot-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, .12); font-size: 13px; }
.y4-foot-bottom p { margin: 0; }
@media (max-width: 900px) {
	.y4-foot-top { grid-template-columns: 1fr; gap: 32px; }
	.y4-foot-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 24px; }
}

/* ---------------------------------------------------------------
   Ads and plugin bits
---------------------------------------------------------------- */
.y4-ad { margin: 24px auto; padding: 0 var(--gutter); text-align: center; overflow: hidden; }
.y4-ad--header { margin: 12px auto; }
.y4-ad--below_tool { margin: 28px auto 0; }
.y4-prose .y4-ad { padding: 0; margin: 28px 0; }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
