/*
Theme Name: All About CSS PMS
Theme URI: https://example.com/
Author: All About CSS PMS
Description: Custom theme that recreates the "All About CSS PMS" design from Site123: white sticky header with logo and uppercase menu, full-screen library hero with yellow title box, search bar, quick-link buttons and a floating contact button.
Version: 1.2.0
Requires at least: 5.8
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: all-about-css-pms
*/

/* ==========================================================================
   Tokens
   ========================================================================== */
:root {
	--accent: #ffd200;
	--accent-rgb: 255, 210, 0;
	--hero-dim: 0.35;
	--ink: #252525;
	--btn-text: #252525;
	--text: #252525;
	--muted: #707070;
	--line: #ebebeb;
	--soft: #fafafa;
	--teal: #2b5163;
	--header-h: 95px;
	--font-body: "Open Sans", "Segoe UI", Arial, sans-serif;
	--font-logo: "Oswald", "Arial Narrow", Impact, sans-serif;
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	font-family: var(--font-body);
	font-size: 16px;
	line-height: 1.7;
	color: var(--text);
	background: #fff;
}

img, svg, video { max-width: 100%; height: auto; }
a { color: var(--teal); }
a:hover { color: #000; }

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
	outline: 3px solid #1a73e8;
	outline-offset: 2px;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	margin: -1px; padding: 0; border: 0;
	overflow: hidden; clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}
.skip-link:focus {
	position: fixed; top: 8px; left: 8px; z-index: 1000;
	width: auto; height: auto; margin: 0; clip: auto;
	padding: 10px 16px; background: #fff; color: #000; font-weight: 700;
}

.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 20px; }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
	position: sticky; top: 0; z-index: 100;
	background: #fff;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }

.header-inner {
	max-width: 1400px; margin: 0 auto; padding: 0 20px;
	min-height: var(--header-h);
	display: flex; align-items: center; justify-content: space-between; gap: 24px;
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.brand-mark { display: block; flex: none; }
.brand-mark img, .brand-mark svg { display: block; width: auto; max-height: 66px; }
.brand-title {
	font-family: var(--font-logo);
	font-weight: 600;
	font-size: 32px;
	line-height: 1;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	color: var(--muted);
	white-space: nowrap;
}

/* Menu */
.primary-menu, .primary-menu ul { list-style: none; margin: 0; padding: 0; }
.primary-menu { display: flex; align-items: center; }
.primary-menu li { position: relative; }
.primary-menu > li > a {
	display: block; padding: 32px 15px;
	font: 700 14px/1.2 var(--font-body);
	letter-spacing: 0.03125em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--muted);
	transition: color 0.15s;
}
.primary-menu > li > a:hover,
.primary-menu > li:focus-within > a,
.primary-menu > .current-menu-item > a,
.primary-menu > .current_page_item > a,
.primary-menu > .current-menu-ancestor > a { color: #000; }

.primary-menu .menu-item-has-children > a::after {
	content: ""; display: inline-block; margin-left: 6px; vertical-align: 2px;
	border-style: solid; border-width: 5px 4px 0 4px;
	border-color: currentColor transparent transparent transparent;
}

.primary-menu .sub-menu {
	position: absolute; top: 100%; right: 0; z-index: 10;
	min-width: 230px; padding: 8px 0;
	background: #fff;
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
	border-top: 3px solid var(--accent);
	opacity: 0; visibility: hidden; transform: translateY(6px);
	transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
}
.primary-menu li:hover > .sub-menu,
.primary-menu li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.primary-menu .sub-menu a {
	display: block; padding: 10px 20px;
	font: 600 14px/1.3 var(--font-body);
	text-transform: uppercase; text-decoration: none; color: var(--muted);
}
.primary-menu .sub-menu a:hover,
.primary-menu .sub-menu .current-menu-item > a { color: #000; background: var(--soft); }

.nav-toggle {
	display: none;
	width: 46px; height: 46px; padding: 0;
	background: transparent; border: 1px solid var(--line); border-radius: 4px;
	cursor: pointer; color: var(--muted);
}
.nav-toggle-icon, .nav-toggle-icon::before, .nav-toggle-icon::after {
	display: block; width: 22px; height: 2px; background: currentColor; margin: 0 auto; position: relative;
}
.nav-toggle-icon::before, .nav-toggle-icon::after { content: ""; position: absolute; left: 0; }
.nav-toggle-icon::before { top: -7px; }
.nav-toggle-icon::after { top: 7px; }

/* ==========================================================================
   Hero (homepage)
   ========================================================================== */
.hero {
	position: relative; isolation: isolate;
	min-height: calc(100vh - var(--header-h));
	min-height: calc(100svh - var(--header-h));
	min-height: max(620px, calc(100svh - var(--header-h)));
	display: flex; align-items: center; justify-content: center;
	padding: 60px 20px 90px;
	background: #8f8171 center / cover no-repeat;
	color: #fff; text-align: center;
}
.hero::before {
	content: ""; position: absolute; inset: 0; z-index: -1;
	background: rgba(0, 0, 0, var(--hero-dim));
}

.hero-pills {
	position: absolute; top: 24px; left: 20px; z-index: 2;
	display: flex; flex-direction: column; gap: 10px;
}
.hero-pills a {
	display: block; width: 167px; padding: 8px 6px;
	background: #222; color: #e8e8e8;
	font: 400 14px/1.4 Arial, Helvetica, sans-serif;
	text-align: center; text-decoration: none;
	border-radius: 3px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
	transition: background 0.15s;
}
.hero-pills a:hover, .hero-pills a:focus-visible { background: #3b4650; color: #fff; }

.hero-inner { width: 100%; max-width: 1110px; }

.hero-title {
	display: inline-block; margin: 0; padding: 10px 30px;
	background: rgba(var(--accent-rgb), 0.86);
	font: 700 clamp(2.2rem, 5.2vw, 59px) / 1.3 var(--font-body);
	letter-spacing: 3px; text-transform: uppercase;
	color: #fff;
	text-shadow: 2px 3px 5px rgba(0, 0, 0, 0.55);
}

.hero-subtitle {
	margin: 18px 0 38px; padding: 6px 0;
	border-top: 2px solid #fff; border-bottom: 2px solid #fff;
	font: italic 700 clamp(1.3rem, 2.9vw, 36px) / 1.5 var(--font-body);
	color: #fff;
	text-shadow: 1px 2px 4px rgba(0, 0, 0, 0.55);
}

/* Search form (used in hero and elsewhere) */
.search-form { display: flex; width: 100%; max-width: 590px; margin: 0 auto; }
.search-form .search-field {
	flex: 1; min-width: 0; height: 64px; padding: 0 20px;
	font: 400 20px var(--font-body); color: var(--ink);
	background: #fff; border: 0; border-radius: 6px 0 0 6px;
}
.search-form .search-field::placeholder { color: #8a8a8a; opacity: 1; }
.search-form .search-submit {
	height: 64px; padding: 0 22px;
	font: 400 20px var(--font-body); text-transform: uppercase; letter-spacing: 0.2px;
	color: var(--ink); background: var(--accent);
	border: 0; border-radius: 0 6px 6px 0; cursor: pointer;
	transition: filter 0.15s;
}
.search-form .search-submit:hover { filter: brightness(0.94); }

.hero-scroll {
	position: absolute; left: 50%; bottom: -23px; z-index: 5;
	width: 46px; height: 46px; margin-left: -23px;
	display: grid; place-items: center;
	background: #222; color: #fff; border-radius: 50%;
	text-decoration: none; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.hero-scroll svg { width: 18px; height: 18px; }

/* Floating contact button */
.float-contact {
	position: fixed; left: 20px; bottom: 20px; z-index: 90;
	width: 66px; height: 66px; display: grid; place-items: center;
	background: #8a8a8a; color: #fff; border-radius: 50%;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
	transition: background 0.15s, transform 0.15s;
}
.float-contact:hover { background: #666; color: #fff; }
.float-contact svg { width: 30px; height: 30px; }

/* ==========================================================================
   Sections, headings, cards
   ========================================================================== */
.section { padding: 80px 0 60px; }
.section + .section { padding-top: 20px; }

.section-title, .page-title {
	margin: 0 0 32px;
	font: 800 clamp(1.6rem, 3.2vw, 2.2rem) / 1.2 var(--font-body);
	text-transform: uppercase; letter-spacing: 0.02em; color: var(--ink);
}
.section-title::after, .page-title::after {
	content: ""; display: block; width: 72px; height: 5px; margin-top: 14px;
	background: var(--accent);
}

.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }

.card {
	display: flex; flex-direction: column;
	background: #fff; border: 1px solid var(--line); border-radius: 4px; overflow: hidden;
	transition: border-color 0.15s;
}
.card:hover { border-color: var(--accent); }
.card-media { display: block; aspect-ratio: 16 / 9; background: var(--soft); }
.card-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card-body { display: flex; flex-direction: column; flex: 1; padding: 20px; }
.card-title { margin: 0 0 8px; font: 700 1.1rem/1.35 var(--font-body); }
.card-title a { color: var(--ink); text-decoration: none; }
.card-title a:hover { text-decoration: underline; }
.card-excerpt { margin: 0 0 16px; color: var(--muted); font-size: 0.95rem; line-height: 1.6; }
.card-link {
	margin-top: auto; align-self: flex-start;
	font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em;
	color: var(--ink); text-decoration: none;
	border-bottom: 3px solid var(--accent);
}
.card-link:hover { color: #000; border-bottom-color: #000; }

.section-more { margin-top: 32px; }
.page-posts { margin-top: 64px; }
.button, .wp-block-button__link, .wp-block-file__button {
	display: inline-block; padding: 12px 26px;
	font: 700 0.9rem/1.2 var(--font-body); text-transform: uppercase; letter-spacing: 0.04em;
	color: var(--btn-text) !important; background: var(--accent);
	border: 0; border-radius: 4px; text-decoration: none; cursor: pointer;
}
.button:hover, .wp-block-button__link:hover, .wp-block-file__button:hover { filter: brightness(0.94); }

.pagination, .posts-navigation { margin-top: 40px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.pagination .page-numbers {
	min-width: 42px; padding: 8px 14px; text-align: center; text-decoration: none;
	color: var(--ink); border: 1px solid var(--line); border-radius: 4px; font-weight: 600;
}
.pagination .page-numbers.current { background: var(--accent); border-color: var(--accent); }

/* ==========================================================================
   Inner pages and posts
   ========================================================================== */
.page-band { background: var(--soft); border-bottom: 1px solid var(--line); padding: 48px 0 40px; }
.page-band .page-title { margin: 0; }
.page-band .entry-meta { margin: 14px 0 0; color: var(--muted); font-size: 0.9rem; }
.page-band .entry-meta a { color: var(--muted); }

.content-wrap { padding: 56px 0 80px; }
.entry-content { max-width: 820px; font-size: 1.05rem; line-height: 1.8; }
.entry-content > *:first-child { margin-top: 0; }
.entry-content h2, .entry-content h3, .entry-content h4 {
	font-family: var(--font-body); font-weight: 800; line-height: 1.3; color: var(--ink); margin: 2em 0 0.6em;
}
.entry-content h2 { font-size: 1.7rem; }
.entry-content h3 { font-size: 1.3rem; }
.entry-content blockquote {
	margin: 1.6em 0; padding: 4px 0 4px 20px; border-left: 5px solid var(--accent); color: var(--muted); font-style: italic;
}
.entry-content table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: 0.95rem; }
.entry-content th { background: var(--ink); color: #fff; text-align: left; }
.entry-content th, .entry-content td { padding: 10px 14px; border: 1px solid var(--line); }
.entry-content tbody tr:nth-child(even) td { background: var(--soft); }
.entry-content .wp-block-file { margin: 1.4em 0; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.entry-thumb { max-width: 820px; margin: 0 0 32px; }
.entry-thumb img { display: block; width: 100%; border-radius: 4px; }
.entry-footer { max-width: 820px; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 0.9rem; color: var(--muted); }
.post-nav { max-width: 820px; display: flex; justify-content: space-between; gap: 20px; margin-top: 32px; }
.post-nav a { font-weight: 700; }
.no-results .search-form { margin: 24px 0 0; max-width: 520px; }
.no-results .search-form .search-field { border: 1px solid var(--line); }

.comments { max-width: 820px; margin-top: 56px; }
.comment-list { padding-left: 20px; }
.comments input[type="text"], .comments input[type="email"], .comments input[type="url"], .comments textarea {
	width: 100%; padding: 10px 12px; border: 1px solid #ccc; border-radius: 4px; font: inherit;
}
.comments .submit { padding: 12px 26px; font: 700 0.9rem var(--font-body); text-transform: uppercase; background: var(--accent); border: 0; border-radius: 4px; cursor: pointer; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: #fff; color: #000; border-top: 1px solid var(--line); padding: 44px 0 36px; font-size: 0.92rem; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 40px; }
.footer-brand { font: 600 1.4rem var(--font-logo); text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); }
.footer-menu { display: flex; flex-wrap: wrap; gap: 8px 24px; list-style: none; margin: 0; padding: 0; }
.footer-menu a { color: #000; text-decoration: none; font-weight: 600; text-transform: uppercase; font-size: 0.8rem; letter-spacing: 0.03125em; }
.footer-menu a:hover { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 3px; text-underline-offset: 4px; }
.footer-note { width: 100%; margin: 12px 0 0; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); }

/* ==========================================================================
   WordPress core alignment classes
   ========================================================================== */
.alignleft { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.wp-caption { max-width: 100%; }
.wp-caption-text, figcaption { font-size: 0.85rem; color: var(--muted); }
.sticky, .bypostauthor, .gallery-caption { display: block; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1180px) {
	.primary-menu > li > a { padding-left: 11px; padding-right: 11px; }
	.brand-title { font-size: 30px; }
}

@media (max-width: 960px) {
	:root { --header-h: 74px; }
	.header-inner { min-height: var(--header-h); }
	.brand-title { font-size: 24px; }
	.brand-mark img, .brand-mark svg { max-height: 48px; }
	.nav-toggle { display: block; }

	.primary-nav {
		position: absolute; top: 100%; left: 0; right: 0;
		background: #fff; box-shadow: 0 8px 14px rgba(0, 0, 0, 0.18);
		max-height: calc(100vh - var(--header-h)); overflow-y: auto;
		display: none;
	}
	.primary-nav.is-open { display: block; }
	.primary-menu { flex-direction: column; align-items: stretch; padding: 8px 0; }
	.primary-menu > li > a { padding: 14px 24px; border-bottom: 1px solid #f0f0f0; }
	.primary-menu .sub-menu {
		position: static; opacity: 1; visibility: visible; transform: none;
		box-shadow: none; border-top: 0; padding: 0; background: var(--soft);
	}
	.primary-menu .sub-menu a { padding-left: 40px; }

	.card-grid { grid-template-columns: repeat(2, 1fr); }

	.hero { padding-top: 110px; }
	.hero-pills { flex-direction: row; flex-wrap: wrap; top: 14px; left: 14px; right: 14px; }
	.hero-pills a { width: auto; padding: 7px 14px; font-size: 13px; }
}

@media (max-width: 600px) {
	.brand-title { font-size: 20px; overflow: hidden; text-overflow: ellipsis; }
	.card-grid { grid-template-columns: 1fr; }
	.hero-title { padding: 6px 16px; letter-spacing: 0.03em; }
	.search-form .search-field, .search-form .search-submit { height: 54px; font-size: 17px; }
	.float-contact { width: 54px; height: 54px; left: 14px; bottom: 14px; }
	.float-contact svg { width: 24px; height: 24px; }
	.section { padding-top: 64px; }
}

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