/* =========================================================================
   Shahad.studio theme styles (front end + editor)
   ========================================================================= */

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { -webkit-font-smoothing: antialiased; overflow-wrap: break-word; }
body.sh-menu-open { overflow: hidden; }
img { height: auto; max-width: 100%; }
:focus-visible { outline: 3px solid var(--wp--preset--color--mint, #82C5B0); outline-offset: 2px; }

/* Arabic pages: body + headings in IBM Plex Sans Arabic, logo stays Bricolage (handled by the plugin CSS). */
[dir="rtl"] body,
[dir="rtl"] .editor-styles-wrapper,
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] h4, [dir="rtl"] h5, [dir="rtl"] h6,
[dir="rtl"] .wp-block-post-title,
[dir="rtl"] .wp-element-button, [dir="rtl"] .wp-block-button__link {
	font-family: var(--wp--preset--font-family--ibm-plex-sans-arabic, "IBM Plex Sans Arabic", Tahoma, sans-serif);
	letter-spacing: 0;
}
[dir="rtl"] h1, [dir="rtl"] .wp-block-post-title { font-weight: 700; line-height: 1.3; }
[dir="rtl"] body { line-height: 1.9; }

/* Backgrounds: the site is white; these pages sit on lilac per the designs
   (notebook post, game page, Games in Arabic, the /tree links page, plain pages with the white card, 404). */
body.single-post,
body.single-game,
body.page-template-default,
body.page-template-page-links,
body.error404,
body.sh-bg-lilac { background-color: var(--wp--preset--color--lilac, #F6F0F8); }
/* Phones: at least 20px from the screen edges everywhere */
@media (max-width: 600px) {
	.sh-header-inner, .sh-footer-inner, .sh-nav { padding-left: 20px; padding-right: 20px; }
}

/* Page scaffold */
.sh-main { padding-top: 2.5rem; padding-bottom: 3rem; }
.sh-main > * + * { margin-block-start: 2.5rem; }
.sh-canvas { padding-top: 0; }
.sh-canvas > .wp-block-post-content > *:first-child { margin-top: 0; }
.sh-section { margin-block: 3.5rem; }
.sh-section-title { font-family: var(--wp--preset--font-family--bricolage-grotesque); font-size: var(--wp--preset--font-size--xx-large); font-weight: 700; letter-spacing: -0.02em; margin: 0 0 1.25rem; line-height: 1.1; }
.sh-page-title { margin: 0 0 0.75rem; font-size: var(--wp--preset--font-size--hero); }
[dir="rtl"] .sh-section-title { font-family: var(--wp--preset--font-family--ibm-plex-sans-arabic); letter-spacing: 0; }
/* Hero: headline 68px / 1.02 / -0.03em (about 44px on phones), description 19px / 1.6 / #4A4152 / max 540px */
.sh-hero { padding-block: 3rem 3.5rem; margin-top: 0 !important; }
.sh-hero-title { font-size: 68px; line-height: 1.02; letter-spacing: -0.03em; margin: 0.5rem 0 1.1rem; max-width: 13ch; }
[dir="rtl"] .sh-hero-title { font-size: 56px; max-width: 18ch; line-height: 1.25; letter-spacing: 0; }
.sh-hero-text, .sh-hero .sh-hero-text.has-large-font-size { font-size: 19px !important; line-height: 1.6; color: #4A4152; max-width: 540px; margin: 0 0 1.5rem; }
.sh-hero-photo img { aspect-ratio: 0.82; object-fit: cover; width: 100%; }
@media (max-width: 781px) {
	.sh-hero { padding-block: 2rem 2.5rem; }
	.sh-hero-columns .wp-block-column:first-child { max-width: 260px; margin: 0 auto; }
}
@media (max-width: 600px) {
	.sh-hero-title { font-size: 44px; }
	[dir="rtl"] .sh-hero-title { font-size: 38px; }
	.sh-hero-text, .sh-hero .sh-hero-text.has-large-font-size { font-size: 17px !important; }
}

/* Image blocks without a photo yet: show a soft placeholder instead of nothing */
.wp-block-image img:not([src]), .wp-block-image img[src=""] { display: block; width: 100%; aspect-ratio: 4 / 3; background: #E4D3E8; border-radius: 20px; }
.wp-block-image.is-style-arch img:not([src]), .wp-block-image.is-style-arch img[src=""] { aspect-ratio: 0.82; background: #D0B0D7; }

/* Core block styles */
.wp-block-image.is-style-arch img { border-radius: 999px 999px 28px 28px; }
.wp-block-image.is-style-rounded-photo img { border-radius: 20px; }
.wp-block-separator.is-style-dashed-mint { border-style: dashed; border-color: var(--wp--preset--color--mint); border-bottom-width: 1.5px; width: 100%; opacity: 1; }
.wp-block-separator.is-style-dashed-lilac { border-style: dashed; border-color: var(--wp--preset--color--light-purple); border-bottom-width: 1.5px; width: 100%; opacity: 1; }
.wp-block-button.is-style-pill-mint .wp-block-button__link { background: var(--wp--preset--color--light-mint); color: var(--wp--preset--color--dark); }
.wp-block-button.is-style-pill-mint .wp-block-button__link:hover { background: var(--wp--preset--color--mint); color: var(--wp--preset--color--dark); }
.wp-block-button.is-style-pill-white .wp-block-button__link { background: #fff; color: var(--wp--preset--color--dark); box-shadow: 0 2px 10px rgba(122, 79, 143, 0.10); }
.wp-block-button.is-style-pill-white .wp-block-button__link:hover { color: var(--wp--preset--color--deep-purple); background: #fff; }
.wp-block-button.is-style-pill-dark .wp-block-button__link { background: var(--wp--preset--color--dark); color: #fff; }
.wp-block-button.is-style-pill-dark .wp-block-button__link:hover { background: #3a3044; color: #fff; }
.wp-block-button__link { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.wp-block-group.is-style-white-card { background: #fff; border-radius: 24px; padding: clamp(1.25rem, 4vw, 3rem); box-shadow: 0 10px 30px rgba(122, 79, 143, 0.08); }
.wp-block-group.is-style-mint-panel { background: var(--wp--preset--color--light-mint); border-radius: 28px; padding: clamp(1.25rem, 4vw, 2.5rem); color: var(--wp--preset--color--dark); }
.wp-block-group.is-style-lilac-panel { background: var(--wp--preset--color--lilac); border-radius: 24px; padding: clamp(1.25rem, 4vw, 2.5rem); }
.wp-block-group.is-style-white-card > :first-child, .wp-block-group.is-style-mint-panel > :first-child, .wp-block-group.is-style-lilac-panel > :first-child { margin-top: 0; }
.wp-block-heading.is-style-handwritten { font-family: var(--sh-font-hand, Caveat, "IBM Plex Sans Arabic", cursive); color: var(--wp--preset--color--deep-purple); font-weight: 500; letter-spacing: 0; }
p.is-style-eyebrow { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--wp--preset--color--deep-purple); margin-bottom: 0.25rem; }
[dir="rtl"] p.is-style-eyebrow { letter-spacing: 0; font-size: 0.85rem; }

/* Numbered steps list */
ol.is-style-steps { list-style: none; padding: 0; margin: 0; counter-reset: sh-step; }
ol.is-style-steps > li { position: relative; padding-inline-start: 3.2rem; margin-bottom: 1.25rem; counter-increment: sh-step; min-height: 2.4rem; }
ol.is-style-steps > li::before {
	content: counter(sh-step);
	position: absolute;
	inset-inline-start: 0;
	top: 0;
	width: 2.4rem;
	height: 2.4rem;
	border-radius: 50%;
	background: #E8D6EC;
	color: var(--wp--preset--color--dark);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-family: var(--wp--preset--font-family--bricolage-grotesque);
	font-weight: 700;
}
[dir="rtl"] ol.is-style-steps > li::before { font-family: var(--wp--preset--font-family--ibm-plex-sans-arabic); }
/* A steps list split by a photo continues its numbering (List block "Start value"). */
ol.is-style-steps[start="2"]{counter-reset:sh-step 1}ol.is-style-steps[start="3"]{counter-reset:sh-step 2}ol.is-style-steps[start="4"]{counter-reset:sh-step 3}ol.is-style-steps[start="5"]{counter-reset:sh-step 4}ol.is-style-steps[start="6"]{counter-reset:sh-step 5}ol.is-style-steps[start="7"]{counter-reset:sh-step 6}ol.is-style-steps[start="8"]{counter-reset:sh-step 7}ol.is-style-steps[start="9"]{counter-reset:sh-step 8}ol.is-style-steps[start="10"]{counter-reset:sh-step 9}ol.is-style-steps[start="11"]{counter-reset:sh-step 10}ol.is-style-steps[start="12"]{counter-reset:sh-step 11}ol.is-style-steps[start="13"]{counter-reset:sh-step 12}ol.is-style-steps[start="14"]{counter-reset:sh-step 13}ol.is-style-steps[start="15"]{counter-reset:sh-step 14}ol.is-style-steps[start="16"]{counter-reset:sh-step 15}ol.is-style-steps[start="17"]{counter-reset:sh-step 16}ol.is-style-steps[start="18"]{counter-reset:sh-step 17}ol.is-style-steps[start="19"]{counter-reset:sh-step 18}ol.is-style-steps[start="20"]{counter-reset:sh-step 19}ol.is-style-steps[start="21"]{counter-reset:sh-step 20}ol.is-style-steps[start="22"]{counter-reset:sh-step 21}ol.is-style-steps[start="23"]{counter-reset:sh-step 22}ol.is-style-steps[start="24"]{counter-reset:sh-step 23}ol.is-style-steps[start="25"]{counter-reset:sh-step 24}ol.is-style-steps[start="26"]{counter-reset:sh-step 25}ol.is-style-steps[start="27"]{counter-reset:sh-step 26}ol.is-style-steps[start="28"]{counter-reset:sh-step 27}ol.is-style-steps[start="29"]{counter-reset:sh-step 28}ol.is-style-steps[start="30"]{counter-reset:sh-step 29}

/* Search form */
.sh-search-form .wp-block-search__input { border-radius: 999px; border: 1.5px solid var(--wp--preset--color--light-purple); padding: 10px 18px; min-height: 44px; background: #fff; }
.sh-search-form .wp-block-search__button { border-radius: 999px; background: var(--wp--preset--color--deep-purple); color: #fff; border: 0; min-height: 44px; min-width: 44px; }

/* -------------------------------------------------------------------------
   Notebook page (single post)
   ------------------------------------------------------------------------- */
.sh-notebook {
	--sh-line-h: 32px;
	position: relative;
	background-color: var(--wp--preset--color--paper, #FFFDF8);
	background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--sh-line-h) - 1px), rgba(122, 79, 143, 0.12) calc(var(--sh-line-h) - 1px), rgba(122, 79, 143, 0.12) var(--sh-line-h));
	background-position: 0 80px;
	border-radius: 18px;
	box-shadow: 0 16px 40px rgba(122, 79, 143, 0.10);
	padding: 76px clamp(1.25rem, 5vw, 4.5rem) 3rem clamp(3.4rem, 8vw, 6.5rem);
	line-height: var(--sh-line-h);
	overflow: hidden;
}
[dir="rtl"] .sh-notebook { padding: 76px clamp(3.4rem, 8vw, 6.5rem) 3rem clamp(1.25rem, 5vw, 4.5rem); }
.sh-notebook::before { /* purple margin line */
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	inset-inline-start: clamp(2.4rem, 6vw, 4.8rem);
	width: 2px;
	background: var(--wp--preset--color--light-purple, #D0B0D7);
	opacity: 0.9;
}
.sh-notebook::after { /* punched holes along the top */
	content: "";
	position: absolute;
	top: 18px;
	left: 0;
	right: 0;
	height: 16px;
	background-image: radial-gradient(circle at 8px 8px, #ebe3ee 5px, #f3edf4 6px, transparent 7px);
	background-size: 64px 16px;
	background-position: 20px 0;
	background-repeat: repeat-x;
}
.sh-notebook > * { position: relative; z-index: 1; }
.sh-notebook p, .sh-notebook li { line-height: var(--sh-line-h); }
.sh-notebook h1, .sh-notebook h2, .sh-notebook h3 { line-height: 1.15; }
.sh-notebook .sh-post-title { margin: 0.25rem 0 0.5rem; font-size: clamp(2rem, 4.5vw, 3.2rem); }
.sh-notebook .sh-post-hero img { border-radius: 20px; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.sh-notebook .wp-block-image img, .sh-notebook figure img { border-radius: 16px; }
.sh-notebook .wp-block-image figcaption { color: #6b6273; font-size: 0.85rem; text-align: start; margin-top: 0.4rem; }
.sh-notebook .wp-block-post-content > * + * { margin-block-start: var(--sh-line-h); }
.sh-notebook .wp-block-post-content > h2, .sh-notebook .wp-block-post-content > h3 { margin-block-start: calc(var(--sh-line-h) * 1.5); }
.sh-notebook .wp-block-post-content > .sh-handwritten, .sh-notebook .wp-block-post-content > .wp-block-shahad-handwritten-note { margin-block-start: 0.25rem; }
.sh-notebook .wp-block-columns { gap: 1.5rem; }
.sh-notebook .sh-sticky { margin-top: 10px; }
.sh-notebook .wp-block-separator { margin-block: 2rem; }
.sh-pattern-row { align-items: flex-start; }
.sh-pattern-row .sh-supplies { max-width: 320px; margin-inline-start: auto; }
@media (max-width: 600px) {
	.sh-notebook { --sh-line-h: 30px; padding-top: 64px; border-radius: 14px; }
	.sh-notebook::after { background-size: 48px 16px; top: 14px; }
	.sh-pattern-row .sh-supplies { margin-inline-start: 0; }
}

/* Page card */
.sh-page-card .wp-block-post-title { margin-top: 0; font-size: clamp(1.9rem, 4vw, 2.8rem); }

/* Games page: white page, full-width lilac header band */
.sh-games-hero { padding-block: 3rem 3.25rem; margin-top: 0 !important; }
.sh-games-hero h1 { font-size: 76px; line-height: 1; letter-spacing: -0.03em; margin: 0 0 0.5rem; }
[dir="rtl"] .sh-games-hero h1 { font-size: 60px; line-height: 1.2; letter-spacing: 0; }
.sh-games-hero .sh-handwritten { font-size: 32px; margin: 0 0 1rem; }
[dir="rtl"] .sh-games-hero .sh-handwritten { font-size: 24px; }
.sh-games-hero .sh-games-lead, .sh-games-hero p:not(.sh-handwritten) { font-size: 18px; line-height: 1.65; max-width: 560px; color: #4A4152; margin: 0; }
.sh-games-page { margin-top: 2.5rem; }
.sh-games-page > * + * { margin-block-start: 0; }
@media (max-width: 600px) {
	.sh-games-hero { padding-block: 2rem 2.25rem; }
	.sh-games-hero h1 { font-size: 44px; }
	[dir="rtl"] .sh-games-hero h1 { font-size: 36px; }
	.sh-games-hero .sh-handwritten { font-size: 26px; }
	.sh-games-hero .sh-games-lead, .sh-games-hero p:not(.sh-handwritten) { font-size: 16px; }
	.sh-games-page { margin-top: 1.75rem; }
}
/* old two-column layout (kept for pages that still use it) */
.sh-games-layout { gap: 2.5rem; }
.sh-games-sidebar > * + * { margin-top: 2rem; }
.sh-games-sidebar .sh-sticky { margin-inline: 4px; }
@media (max-width: 781px) {
	.sh-games-layout { gap: 1.5rem; }
	.sh-games-sidebar { margin-top: 1rem; }
}

/* Game single */
.sh-game-single-card .wp-block-post-title { margin-top: 0; font-size: clamp(1.8rem, 4vw, 2.6rem); }
.sh-game-single-cover img { border-radius: 18px; aspect-ratio: 3 / 4; object-fit: cover; width: 100%; }

/* Links page */
.sh-links-page { padding-top: 2.5rem; padding-bottom: 4rem; min-height: 100vh; }
.sh-links-page > .wp-block-post-content > * + * { margin-block-start: 1.75rem; }
.sh-links-page .sh-logo-big { margin-bottom: -0.5rem; }
.sh-links-page .sh-handwritten.has-text-align-center { margin-top: 0.25rem; }
.sh-links-page .sh-lang-centered { margin-top: 0; }
.sh-links-row { gap: 1.5rem; align-items: center; }
.sh-links-row .wp-block-column > * + * { margin-top: 1rem; }
.sh-links-row .sh-social { margin-top: 1.25rem; }
.sh-hirfa-card .sh-hirfa-card-title { font-family: var(--wp--preset--font-family--bricolage-grotesque); font-size: 1.35rem; font-weight: 700; margin: 0; }
[dir="rtl"] .sh-hirfa-card .sh-hirfa-card-title { font-family: var(--wp--preset--font-family--ibm-plex-sans-arabic); }
.sh-hirfa-card .sh-hirfa-card-title a { color: var(--wp--preset--color--dark); text-decoration: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.sh-hirfa-card .sh-handwritten { margin: 0; font-size: 1.2rem; }
@media (max-width: 600px) {
	.sh-links-row { flex-direction: column; }
	.sh-links-row .wp-block-column { flex-basis: 100% !important; width: 100%; }
}

/* Hirfa Crafts section: mint box, photo a third of the width at full height, text centred beside it */
.sh-hirfa { background: var(--wp--preset--color--light-mint, #ADE0D1); border-radius: 32px; padding: 48px; color: var(--wp--preset--color--dark); }
.sh-hirfa .sh-hirfa-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 40px; align-items: stretch; margin: 0; }
.sh-hirfa .sh-hirfa-columns > .wp-block-column { flex-basis: auto !important; width: auto; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.sh-hirfa .sh-hirfa-photo .wp-block-image, .sh-hirfa .sh-hirfa-photo figure { height: 100%; margin: 0; }
.sh-hirfa .sh-hirfa-photo img { width: 100%; height: 100%; min-height: 320px; object-fit: cover; border-radius: 20px; display: block; }
.sh-hirfa p.is-style-eyebrow { color: #24584A; margin-bottom: 0.5rem; }
.sh-hirfa h2 { font-size: 40px; line-height: 1.1; margin: 0 0 0.9rem; }
.sh-hirfa p:not(.is-style-eyebrow) { font-size: 17px; line-height: 1.6; max-width: 56ch; margin: 0 0 1.4rem; }
.sh-hirfa .wp-block-buttons { margin: 0; }
[dir="rtl"] .sh-hirfa h2 { font-size: 34px; line-height: 1.3; }
@media (max-width: 781px) {
	.sh-hirfa { padding: 24px; border-radius: 24px; }
	.sh-hirfa .sh-hirfa-columns { grid-template-columns: 1fr; gap: 22px; }
	.sh-hirfa .sh-hirfa-photo img { min-height: 0; aspect-ratio: 4 / 3; }
	.sh-hirfa h2 { font-size: 30px; }
}

/* 404 */
.sh-404 { text-align: center; }
.sh-404 .sh-search-form { max-width: 420px; margin: 1.5rem auto 0; }

/* Mobile breathing room */
@media (max-width: 600px) {
	.sh-main { padding-top: 1.5rem; }
	.sh-section { margin-block: 2.5rem; }
	.wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column { flex-basis: 100% !important; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.sh-btn, .sh-tile img { transition: none; }
}
