/*
Theme Name: Medialy Studio
Theme URI: https://medialy.online/
Description: Theme for the Medialy mobile game studio. Studio pages in neutral brand colours, a candy-styled page per game, games post type, editable texts (Customizer), built-in contact form. Works alongside ThirstyAffiliates and Yoast SEO.
Version: 3.0.1
Requires at least: 6.2
Requires PHP: 7.4
Text Domain: medialy
*/

/* VOICE  a small independent studio making casual phone games in several genres
   IDEA   studio pages stay genre-neutral (periwinkle, navy, green, cream); each game
          gets its own page in its own look – Roll Over! is candy and pastel
   COLOUR white, ink #1d1846, sky #6f9dff→#b9a3ff, jelly #3fcf73, cream #fdf1dd
   TYPE   Lilita One (titles) + Nunito (text)
   LAYOUT hero: copy left, artwork right; phone: copy, then the whole artwork */

:root {
	--bg: #fff;
	--ink: #1d1846;
	--ink-2: #4b4772;
	--line: #e6e3f3;
	--sky: #6f9dff;
	--sky-2: #b9a3ff;
	--sky-pale: #eef2ff;
	--biscuit: #e9b56b;
	--biscuit-pale: #fdf1dd;
	--jelly: #3fcf73;
	--candy: #ff4f87;
	--candy-d: #d92f68;
	--display: "Lilita One", "Arial Rounded MT Bold", system-ui, sans-serif;
	--text: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
	--r: 18px;
}

*, *::before, *::after { box-sizing: border-box; min-width: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.6 var(--text); overflow-x: clip; }
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p { margin: 0 0 1em; }
h1, h2, h3, h4 { margin: 0 0 .45em; font-weight: 400; line-height: 1.08; letter-spacing: -.01em; }
:focus-visible { outline: 3px solid var(--candy); outline-offset: 3px; border-radius: 6px; }
.screen-reader-text, .hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 10px; }
.skip-link:focus { left: 8px; }

.wrap { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: max(5vw, 16px); }
.band { padding-block: clamp(48px, 7vw, 96px); }
.band--tight { padding-block: clamp(28px, 4vw, 56px); }

.page-title, .hero-title, .section-title, .sub-title, .footer-title, .brand span, .game-card__title { font-family: var(--display); }
.section-title { font-size: clamp(32px, 4vw, 48px); }
.sub-title { font-size: 24px; }
.lead { font-size: clamp(18px, 1.7vw, 21px); color: var(--ink-2); max-width: 62ch; }
.small, .meta { font-size: 15px; color: var(--ink-2); }

/* Buttons and links */
.btn {
	display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 24px;
	border-radius: 999px; border: 2px solid var(--ink); background: var(--ink); color: #fff;
	font: 800 16px/1 var(--text); text-decoration: none; white-space: nowrap; cursor: pointer;
	box-shadow: 0 4px 0 #0e0b2a; transition: transform .15s, box-shadow .15s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 #0e0b2a; }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #0e0b2a; }
.btn--light { background: #fff; color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.text-link { font-weight: 800; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.text-link:hover { color: var(--candy-d); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: #fff; border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; font-size: 27px; line-height: 1; }
.custom-logo { max-height: 42px; width: auto; }
.nav-list { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; }
.nav-list a { display: block; padding: 10px 14px; border-radius: 999px; font-weight: 700; text-decoration: none; }
.nav-list a:hover, .nav-list .current-menu-item > a { background: var(--sky-pale); }
.nav-toggle { display: none; width: 44px; height: 44px; padding: 11px 9px; border: 0; background: none; cursor: pointer; }
.nav-toggle span[aria-hidden] { display: block; height: 3px; margin: 4px 0; border-radius: 2px; background: var(--ink); transition: transform .2s, opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(4) { transform: translateY(-7px) rotate(-45deg); }

/* Hero: copy left, artwork right */
.hero { background: linear-gradient(135deg, var(--sky), var(--sky-2)); color: #fff; overflow: hidden; }
.hero-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); align-items: center; min-height: clamp(520px, 42vw, 620px); }
.hero-copy { padding-block: clamp(48px, 6vw, 88px); }
.hero-title { font-size: clamp(44px, 5.2vw, 70px); line-height: 1.02; margin-bottom: 22px; text-shadow: 0 3px 0 rgba(29, 24, 70, .18); }
.hero-lead { font-size: clamp(18px, 1.6vw, 21px); font-weight: 600; max-width: 40ch; }
.hero .btn--light { border-color: #fff; }
.hero-figure { align-self: stretch; display: flex; align-items: center; justify-content: center; }
.hero-figure img, .hero-figure svg { width: 100%; height: auto; max-height: 560px; object-fit: contain; }
/* Higgsfield hero: the picture fills the band; its quiet left side carries the copy */
.hero--photo { position: relative; background: linear-gradient(160deg, #d9d2fd 0%, #b3b0fb 55%, #a3a5fc 100%); color: var(--ink); }
.hero--photo .hero-figure { position: absolute; inset: 0; z-index: 0; }
.hero--photo .hero-figure picture { display: block; height: 100%; }
.hero--photo .hero-figure img { position: absolute; top: 0; right: 0; width: auto; height: 100%; max-width: none; max-height: none; -webkit-mask-image: linear-gradient(to right, transparent, #000 30%); mask-image: linear-gradient(to right, transparent, #000 30%); }
.hero--photo .hero-grid { position: static; }
.hero--photo .hero-copy { position: relative; z-index: 1; }
.hero--photo .hero-title { text-shadow: none; }
.hero--photo .hero-lead { color: var(--ink-2); }
.hero--photo .btn--light { border-color: var(--ink); }

/* Game cards: equal height, 4:3 media on top; the grid grows with each new game */
.games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 24px; }
.game-card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
.game-card__media { aspect-ratio: 4 / 3; overflow: hidden; background: var(--accent, var(--sky-pale)); }
.game-card__media > picture, .game-card__media > img, .game-card__media > svg { display: block; width: 100%; height: 100%; }
.game-card__media img, .game-card__media svg { width: 100%; height: 100%; object-fit: cover; }
.game-card--icon .game-card__media { display: grid; place-items: center; background: linear-gradient(135deg, #a8bfff, #d3c6ff); }
.game-card--icon .game-card__media > picture { width: 52%; height: auto; }
.game-card--icon .game-card__media img { aspect-ratio: 1; height: auto; }
.game-card__body { display: flex; flex-direction: column; flex: 1; padding: 22px 24px 24px; }
.game-card__title { font-size: 27px; margin-bottom: 8px; }
.game-card__title a { text-decoration: none; }
.game-card__title a:hover { color: var(--candy-d); }
.game-card__tagline { color: var(--ink-2); }
.game-card__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: auto; padding-top: 8px; }
.btn--sm { min-height: 40px; padding: 9px 18px; font-size: 15px; }
.app-icon { border-radius: 22.37%; box-shadow: 0 0 0 1px rgba(29, 24, 70, .08), 0 18px 36px -18px rgba(29, 24, 70, .55); }
.soon { display: inline-flex; align-items: center; min-height: 36px; padding: 6px 16px; border-radius: 999px; background: var(--sky-pale); color: var(--ink); font-weight: 800; font-size: 15px; }
.soon--big { min-height: 46px; padding: 10px 22px; font-size: 17px; background: #fff; }
.store-badge { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 10px; border-radius: 11px; background: #000; color: #fff; font: 700 15px/1.05 var(--text); text-decoration: none; }
.store-badge small { display: block; font-size: 10px; font-weight: 600; }

/* What we make */
.make { background: #fceddc; }
.make-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 4vw, 56px); }
.make-icon { width: 120px; height: 120px; margin-bottom: 18px; }
.make-icon img, .make-icon svg { width: 120px; height: 120px; object-fit: contain; }
.make-item p { color: var(--ink-2); margin: 0; }

/* Studio */
.studio { background: var(--sky-pale); }
.studio-grid .lead { margin-bottom: 1.2em; }
.studio-grid, .closing-grid, .two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(32px, 6vw, 96px); align-items: start; }
.checks { margin: 0; padding: 0; list-style: none; }
.checks li { position: relative; padding: 12px 0 12px 40px; border-bottom: 1px solid rgba(29, 24, 70, .12); font-weight: 600; }
.checks li::before { content: ""; position: absolute; left: 0; top: 13px; width: 24px; height: 24px; border-radius: 7px; background: var(--jelly) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px no-repeat; }

/* Careers + contact */
.closing { background: var(--jelly); }
.closing-grid > div { display: flex; flex-direction: column; align-items: flex-start; height: 100%; }
.closing p { max-width: 46ch; font-weight: 600; }
.closing .btn--light { margin-top: auto; }
.mail-big { font: 400 clamp(22px, 2.4vw, 30px)/1.2 var(--display); overflow-wrap: anywhere; }
.mail-big a { text-decoration: none; border-bottom: 3px solid currentColor; }

/* Inner pages */
.page-head { background: linear-gradient(135deg, var(--sky), var(--sky-2)); color: #fff; padding-block: clamp(40px, 6vw, 80px); }
.page-title { font-size: clamp(38px, 5vw, 60px); max-width: 22ch; }
.page-head .lead { color: #fff; font-weight: 600; }
.prose { font-size: 18px; line-height: 1.7; }
.prose--narrow { max-width: 760px; }
.prose h2 { font: 400 30px/1.15 var(--display); margin: 1.6em 0 .5em; }
.prose h3 { font: 400 23px/1.2 var(--display); margin: 1.4em 0 .4em; }
.prose a { font-weight: 700; text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose img { border-radius: var(--r); }
.prose table { display: block; overflow-x: auto; border-collapse: collapse; }
.prose th, .prose td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.side-games { display: grid; gap: 20px; max-width: 380px; }
.careers-art { margin: 0; max-width: 420px; }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.panel { padding: clamp(22px, 3.5vw, 40px); border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
.contact-aside p { margin-bottom: 1.6em; }

/* News */
.posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 32px 24px; }
.post-card__media { display: block; aspect-ratio: 16 / 10; overflow: hidden; margin-bottom: 14px; border-radius: var(--r); background: var(--sky-pale); }
.post-card__media img, .post-card__media .art { width: 100%; height: 100%; object-fit: cover; }
.post-card__title { font: 400 24px/1.15 var(--display); }
.post-card__title a { text-decoration: none; }
.post-card__excerpt { color: var(--ink-2); }
.article-cover img { width: 100%; border-radius: var(--r); margin-top: 32px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 40px; }
.pagination .page-numbers { display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; font-weight: 800; text-decoration: none; }
.pagination .current { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Forms */
.contact-form { display: grid; gap: 18px; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field { display: grid; gap: 6px; }
.field span { font-weight: 800; font-size: 15px; }
input[type="text"], input[type="email"], input[type="search"], input[type="url"], select, textarea {
	width: 100%; padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); font: inherit; font-size: 16px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sky); box-shadow: 0 0 0 4px rgba(111, 157, 255, .25); }
.contact-form .btn { justify-self: start; }
.notice { margin: 0; padding: 12px 16px; border-radius: 12px; font-weight: 700; }
.notice--success { background: #e3f8eb; color: #136b37; }
.notice--error { background: #ffe5ee; color: #a3123f; }
.search-form { display: flex; gap: 10px; max-width: 520px; }
.socials { display: flex; gap: 8px; margin-top: 14px; }
.socials a { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--sky-pale); color: var(--ink); }

/* Footer */
.site-footer { background: var(--ink); color: #dcd9f2; padding-bottom: 28px; }
.site-footer a { color: #fff; }
.site-footer .brand { color: #fff; margin-bottom: 16px; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 32px; }
.footer-brand p { margin: 0; line-height: 1.8; }
.footer-title { font-size: 20px; color: #fff; }
.site-footer ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.site-footer ul a { text-decoration: none; }
.site-footer ul a:hover { text-decoration: underline; }
.footer-bottom { margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .15); font-size: 14px; }
.footer-bottom p { margin: 0; }

/* Roll Over! game page: the game's own pastel look */
.ro-hero { background: linear-gradient(160deg, #8fb1ff 0%, #c9b8ff 60%, #ffd1e3 100%); color: var(--ink); }
.ro-hero-grid { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: clamp(24px, 5vw, 64px); align-items: center; padding-block: clamp(40px, 6vw, 80px); }
.ro-hero .page-title { max-width: 16ch; }
.ro-hero .lead { color: var(--ink); font-weight: 600; max-width: 44ch; }
.ro-gallery-band { background: linear-gradient(#ffd1e3, #fff 70%); padding-block: 8px clamp(40px, 6vw, 80px); }
.ro-gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(14px, 2.4vw, 32px); margin: 0; padding: 0; list-style: none; }
.phone { padding: 8px; border-radius: 36px; background: var(--ink); box-shadow: 0 24px 40px -24px rgba(29, 24, 70, .6); }
.phone img { width: 100%; height: auto; aspect-ratio: 600 / 1300; border-radius: 28px; object-fit: cover; }
.plays { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 3vw, 40px); margin: 18px 0 0; padding: 0; list-style: none; }
.step-art { width: 100%; height: auto; margin: 0 0 14px; padding: 14px 10px 6px; border-radius: var(--r); background: var(--sky-pale); }
.step-shot { display: block; margin: 0 0 14px; }
.step-shot img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: var(--r); background: var(--sky-pale); }
.plays .sub-title { margin-bottom: 6px; }
.plays p { color: var(--ink-2); margin: 0; }
.ro-features { background: var(--biscuit-pale); }
.ro-features .checks li { font-weight: 600; }
.link-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; font-size: 19px; }

/* Studio images (brief F) */
.wide-figure { margin: 0 0 8px; }
.wide-figure img { width: 100%; height: auto; border-radius: var(--r); }
.side-figure { margin: 0; }
.side-figure img { width: 100%; height: auto; border-radius: var(--r); }

/* Roll Over! legal pages (served by the medialy-rollover mu-plugin) */
.medialy-rollover .mro-doc h1, .medialy-rollover .mro-doc h2, .medialy-rollover .mro-doc h3 { font-family: var(--display); font-weight: 400; }

/* WP core */
.aligncenter { margin-inline: auto; }
.alignleft { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.wp-caption-text, figcaption { color: var(--ink-2); font-size: 14px; }
.comments-area { margin: 32px 0 56px; }
.comment-list { list-style: none; padding: 0; }

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

/* Narrow laptop / 720px pane */
@media (max-width: 900px) {
	.nav-toggle { display: block; }
	.site-nav { position: absolute; top: 68px; left: 0; right: 0; display: none; padding: 8px max(5vw, 16px) 18px; background: #fff; border-bottom: 1px solid var(--line); }
	.site-nav.is-open { display: block; }
	.nav-list { flex-direction: column; }
	.nav-list a { padding: 14px 12px; font-size: 18px; }
	.hero-grid { grid-template-columns: minmax(0, 1fr); min-height: 0; gap: 0; }
	.hero-copy { padding-bottom: 8px; max-width: 640px; }
	.hero-figure { padding-bottom: 32px; }
	.hero-figure img, .hero-figure svg { max-width: 560px; max-height: none; }
	.hero--photo .hero-figure { position: static; padding-bottom: 0; margin-inline: calc(-1 * max(5vw, 16px)); }
	.hero--photo .hero-figure img { position: static; width: 100%; height: auto; aspect-ratio: 4 / 5; -webkit-mask-image: linear-gradient(to bottom, transparent, #000 12%); mask-image: linear-gradient(to bottom, transparent, #000 12%); }
	.hero--photo .hero-grid { min-height: 0; }
	.ro-gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 16px; padding-bottom: 12px; margin-inline: calc(-1 * max(5vw, 16px)); padding-inline: max(5vw, 16px); scroll-padding-inline: max(5vw, 16px); }
	.ro-gallery .phone { flex: 0 0 min(58vw, 260px); scroll-snap-align: start; }
	.make-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
	.make-item { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 4px 20px; align-items: start; }
	.make-icon, .make-icon img, .make-icon svg { width: 96px; height: 96px; }
	.make-icon { grid-row: span 2; margin: 0; }
	.footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.footer-brand { grid-column: 1 / -1; }
}

/* Phone */
@media (max-width: 600px) {
	body { font-size: 16px; }
	.ro-hero-grid { grid-template-columns: minmax(0, 1fr); }
	.ro-icon { width: 160px; }
	.plays, .studio-grid, .closing-grid, .two-col, .contact-grid, .field-row { grid-template-columns: minmax(0, 1fr); }
	.closing-grid { gap: 48px; }
	.prose { font-size: 17px; }
	.plays { gap: 22px; }
	.plays li { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 4px 16px; align-items: start; }
	.plays .step-art { grid-row: span 2; margin: 0; padding: 8px 4px 2px; }
	.plays .step-shot { grid-row: span 2; margin: 0; }
	.plays .sub-title { font-size: 21px; align-self: end; }
}
