@font-face {
    font-family: "Caveat Brush";
    src: url("fonts/CaveatBrush-Regular.ttf") format("truetype");
    font-display: swap;
}

@font-face {
    font-family: "Noto Naskh Arabic";
    src: url("fonts/NotoNaskhArabic-VF.ttf") format("truetype");
    font-weight: 400 700;
    font-display: swap;
}

.egypt-preview {
    --egypt-gold: #c9a227;
    --egypt-teal: #176e70;
    --egypt-ink: #3b3a4a;
}

.egypt-preview .edition-label {
    margin: .25rem 0 0;
    color: var(--muted);
    font-size: .9rem;
    font-weight: 600;
}

.egypt-preview .egypt-page {
    --egypt-inset: clamp(1rem, 4vw, 2.3rem);
    padding: var(--egypt-inset) var(--egypt-inset) 0;
    border-block-end: .45rem solid var(--egypt-gold);
    font-size: clamp(1.04rem, 2.45vw, 1.25rem);
}

.egypt-page :is(.portrait, .family-art, .home-art, .food-art) {
    object-fit: contain;
    mix-blend-mode: multiply;
}

.intro-layout {
    display: grid;
    grid-template-columns: minmax(0, 42%) minmax(0, 1fr);
    align-items: center;
    gap: clamp(.6rem, 3vw, 1.5rem);
}

.egypt-page .portrait {
    width: 100%;
    height: auto;
    max-height: 33rem;
}

.country-chip {
    display: inline-flex;
    padding: .34rem .65rem;
    border-radius: 1.5rem;
    background: #efdfa4;
    color: #624b0d;
    font: 600 clamp(.72rem, 1.5vw, .9rem)/1.2 Fredoka, "Segoe UI", sans-serif;
    letter-spacing: .04em;
}

.egypt-page:not(.cover) .chapter-title {
    margin-block-start: .32rem;
    color: var(--egypt-teal);
    font: 650 clamp(2.45rem, 7vw, 5rem)/1.05 Fredoka, "Segoe UI", sans-serif;
}

.speech-bubble {
    position: relative;
    width: min(100%, 22rem);
    aspect-ratio: 4.05 / 1.84;
    min-height: 6.6rem;
    margin: .2rem 0 .4rem;
    color: #292633;
}

.speech-bubble svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.egypt-page .speech-bubble p {
    position: absolute;
    inset: 62.5% auto auto 56.8%;
    width: 73%;
    margin: 0;
    transform: translate(-50%, -50%);
    font: 500 clamp(.92rem, 2.8vw, 1.35rem)/1.17 Fredoka, "Segoe UI", sans-serif;
    text-align: center;
}

.city-label { text-align: end; }
.story-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    gap: clamp(.75rem, 4vw, 2.1rem);
}

.home-row {
    margin-block-start: clamp(.8rem, 3.2vw, 1.7rem);
    padding-block-start: clamp(.8rem, 3.2vw, 1.7rem);
    border-block-start: 2px dotted #d8c38c;
}

.story-row img { width: 100%; height: auto; }
.story-row .family-art { max-height: 19rem; }
.story-row .home-art { max-height: 17rem; }

.reader-page.egypt-page .story-heading {
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    min-height: 1.9rem;
    padding: .25rem .65rem;
    border-radius: .35rem;
    background: var(--egypt-teal);
    color: white;
    font: 600 clamp(.9rem, 2vw, 1.125rem)/1.2 Fredoka, "Segoe UI", sans-serif;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(.65rem, 2.2vw, 1rem);
}

.detail-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: clamp(.65rem, 2.4vw, 1rem);
    border: 1px solid #e0cf9f;
    border-radius: .75rem;
    background: #fffdf8;
    color: var(--egypt-ink);
    font-size: clamp(1rem, 2.25vw, 1.13rem);
}

.detail-card .detail-art {
    align-self: flex-end;
    width: min(48%, 7rem);
    height: auto;
    margin-block-start: auto;
}

.detail-card .kite-art { width: min(34%, 5rem); margin-inline-end: .4rem; }
.detail-card .pronunciation { white-space: nowrap; }
.detail-card .greeting {
    display: inline-block;
    color: #745a16;
    font: 700 1.23rem/1.35 "Noto Naskh Arabic", "Traditional Arabic", serif;
}

.map-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: .4rem;
    margin-block-start: auto;
    padding-block-start: .65rem;
}

.map-row .egypt-flag {
    width: min(28%, 4.15rem);
    height: auto;
    border-radius: .22rem;
    outline: 1px solid #332a1a26;
}

.map-row .egypt-map { width: min(68%, 10rem); height: auto; }
.signature {
    display: flex;
    align-items: center;
    gap: .7rem;
    margin-block-start: .9rem;
}

.signature .story-heading { align-self: center; }
.signed-name {
    color: var(--book-blue);
    font: 400 clamp(2.3rem, 5.8vw, 3.3rem)/1 "Caveat Brush", Fredoka, cursive;
    transform: rotate(-4deg);
}

.egypt-preview .egypt-page .pn { padding-block: 1.2rem .9rem; }

@media (max-width: 26rem) {
    .intro-layout { grid-template-columns: minmax(0, 37%) minmax(0, 1fr); }
    .story-row { gap: .75rem; }
    .story-row img { max-height: 12rem; }
}

@media (max-width: 22.5rem) {
    .detail-grid { grid-template-columns: minmax(0, 1fr); }
    .detail-card .detail-art { width: min(32%, 5.5rem); }
}
