/* biblesociety.tn, the site of the institution. Its own charter, taken from the old logo: teal and sky blue, a humanist
   sans-serif, and the lower edge of the open book as the signature. Nothing is shared with the bookshop's stylesheet. */

@font-face { font-family: "Source Sans 3"; src: url("fonts/source-sans-3-latin-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("fonts/source-sans-3-latin-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("fonts/source-sans-3-latin-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("fonts/ibm-plex-sans-arabic-400.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("fonts/ibm-plex-sans-arabic-500.woff2") format("woff2"); font-weight: 500 600; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("fonts/ibm-plex-sans-arabic-700.woff2") format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }

/* Until Source Sans arrives, a system font scaled to the same proportions, so that the text does not move when it does. */
@font-face { font-family: "Source Sans Fallback"; src: local("Arial"), local("Liberation Sans"), local("Arimo"), local("Roboto"), local("Helvetica"); size-adjust: 93.76%; ascent-override: 109.2%; descent-override: 42.7%; line-gap-override: 0%; }

:root {
    --ink: #0c3440;
    --petrol: #0e5a6b;
    --teal: #39bec1;
    --sky: #29a8de;
    --wash: #e6f7f5;
    --wash-sky: #e8f5fc;
    --line: #c9e4e6;
    --muted: #3f626d;
    --danger: #a4231c;
    --gutter: clamp(18px, 4vw, 44px);
    --font: "Source Sans 3", "Source Sans Fallback", "IBM Plex Sans Arabic", "Segoe UI", system-ui, sans-serif;
}
html[lang="ar"] { --font: "IBM Plex Sans Arabic", "Source Sans 3", "Source Sans Fallback", "Segoe UI", system-ui, sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: #fff; color: var(--ink); font-family: var(--font); font-size: clamp(18px, .3vw + 16.8px, 20px); line-height: 1.55; }
html[lang="ar"] body { line-height: 1.8; }
h1, h2, h3, p, ul, dl, dd, figure { margin: 0; padding: 0; }
ul { list-style: none; }
img, video, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
h1, h2, h3 { font-weight: 700; line-height: 1.08; letter-spacing: -.012em; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3 { line-height: 1.3; letter-spacing: 0; }
h2 { font-size: clamp(32px, 3.6vw + 8px, 56px); }
h3 { font-size: clamp(22px, 1vw + 16px, 27px); line-height: 1.2; }

.wrap { width: min(100% - 2 * var(--gutter), 1240px); margin-inline: auto; }
.narrow { max-width: 860px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 12px; top: -80px; z-index: 40; padding: 10px 16px; background: var(--ink); color: #fff; }
.skip:focus { top: 8px; }
html[dir="rtl"] .arrow { transform: scaleX(-1); }

.button { display: inline-flex; align-items: center; gap: 10px; padding: 13px 22px; border: 0; border-radius: 4px; font-weight: 700; line-height: 1.25; text-decoration: none; cursor: pointer; transition: background-color .15s; }
.button--ink { background: var(--ink); color: #fff; }
.button--ink:hover { background: var(--petrol); }
.button[disabled] { opacity: .65; cursor: progress; }
.textlink { color: var(--petrol); font-weight: 600; text-decoration: underline; text-decoration-color: var(--teal); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.textlink:hover { color: var(--ink); text-decoration-color: var(--sky); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; margin-top: 30px; }
.lead { font-size: clamp(22px, .9vw + 16px, 27px); line-height: 1.4; }

/* ---------- Header ---------- */
.masthead { position: sticky; top: 0; z-index: 30; background: #fff; border-bottom: 1px solid var(--line); }
.masthead__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px clamp(14px, 2vw, 30px); padding-block: 12px; }
.masthead__logo { flex: none; }
.masthead__logo img { width: auto; height: clamp(30px, 2.4vw + 10px, 44px); }
.masthead__nav { display: flex; align-items: center; gap: clamp(14px, 2vw, 30px); margin-inline-start: auto; }
.masthead__nav ul { display: flex; flex-wrap: wrap; align-items: center; gap: 2px clamp(12px, 1.7vw, 26px); }
.masthead__nav a { display: block; padding-block: 6px; font-size: 17px; font-weight: 600; line-height: 1.2; text-decoration: none; border-bottom: 3px solid transparent; }
.masthead__nav a:hover { color: var(--petrol); border-bottom-color: var(--line); }
.masthead__nav a[aria-current="page"] { border-bottom-color: var(--teal); }
.masthead__languages { gap: 2px 4px !important; padding-inline-start: clamp(10px, 1.4vw, 22px); border-inline-start: 1px solid var(--line); }
.masthead__languages a { min-width: 30px; font-size: 15px; text-align: center; color: var(--muted); }
.masthead__languages a[aria-current="true"] { color: var(--ink); border-bottom-color: var(--sky); }
.shoplink { display: inline-flex; flex: none; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 4px; background: var(--sky); color: var(--ink); font-size: 17px; font-weight: 700; line-height: 1.2; text-decoration: none; transition: background-color .15s; }
.shoplink:hover { background: var(--teal); }
.masthead__toggle { display: none; order: 3; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 4px; background: none; cursor: pointer; }
.masthead__burger, .masthead__burger::before, .masthead__burger::after { display: block; width: 20px; height: 2px; background: var(--ink); }
.masthead__burger { position: relative; margin-inline: auto; }
.masthead__burger::before, .masthead__burger::after { content: ""; position: absolute; inset-inline-start: 0; }
.masthead__burger::before { top: -6px; }
.masthead__burger::after { top: 6px; }
@media (max-width: 1039.98px) {
    .masthead__logo { width: clamp(118px, calc(100vw - 230px), 250px); }
    .masthead__logo img { width: 100%; height: auto; }
    .masthead__toggle { display: block; }
    .shoplink { order: 2; margin-inline-start: auto; padding: 9px 10px; font-size: 16px; gap: 6px; }
    .masthead__nav { display: none; order: 4; flex-basis: 100%; flex-direction: column; align-items: stretch; gap: 10px; margin: 0; padding-block: 8px 12px; border-top: 1px solid var(--line); }
    .masthead__toggle[aria-expanded="true"] ~ .masthead__nav { display: flex; }
    .masthead__nav ul { flex-direction: column; align-items: stretch; }
    .masthead__nav a { padding-block: 10px; font-size: 18px; }
    .masthead__languages { flex-direction: row !important; padding-inline-start: 0; padding-top: 6px; border-inline-start: 0; border-top: 1px solid var(--line); }
}

@media (max-width: 359.98px) {
    .masthead__bar { column-gap: 8px; }
    .shoplink .arrow { display: none; }
}

/* ---------- The curve ---------- */
.curve { display: block; width: 100%; height: clamp(34px, 6vw, 90px); }
.curve--paper path { fill: #fff; }
.curve--wash path { fill: var(--wash-sky); }

/* ---------- Home: hero and film ---------- */
.hero { padding-top: clamp(38px, 5.5vw, 84px); background: var(--wash); }
.hero__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(30px, 5vw, 76px); align-items: center; padding-bottom: clamp(26px, 3vw, 44px); }
.hero__welcome { font-size: clamp(20px, 1.2vw + 14px, 26px); font-weight: 600; color: var(--petrol); }
.hero h1 { margin-top: 6px; font-size: clamp(46px, 4.6vw + 22px, 88px); line-height: 1; }
html[lang="ar"] .hero h1 { line-height: 1.2; }
.hero__sub { margin-top: 12px; font-size: clamp(21px, 1vw + 16px, 28px); line-height: 1.25; color: var(--petrol); }
.hero__text { max-width: 33em; margin-top: 20px; }
.film { position: relative; }
.film__frame { position: relative; background: var(--teal); }
.film__frame video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.film__frame::after { content: ""; position: absolute; z-index: -1; inset: 14px -14px -14px 14px; background: var(--sky); }
html[dir="rtl"] .film__frame::after { inset: 14px 14px -14px -14px; }
.film { isolation: isolate; }
.film__play { position: absolute; inset-inline-start: clamp(10px, 1.6vw, 20px); bottom: clamp(10px, 1.6vw, 20px); display: inline-flex; align-items: center; gap: 4px; padding-block: 8px; padding-inline: 8px 16px; border: 0; border-radius: 4px; background: var(--ink); color: #fff; font-weight: 600; font-size: clamp(15px, .4vw + 13px, 18px); line-height: 1.2; white-space: nowrap; cursor: pointer; transition: background-color .15s; }
html[dir="rtl"] .film__play svg { transform: scaleX(-1); }
.film__play:hover { background: var(--petrol); }
@media (max-width: 479.98px) {
    /* The logo of the poster needs the room: the button keeps its spoken name. */
    .film__play { padding: 6px; }
    .film__play span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}
.film__play[hidden] { display: none; }
.film figcaption { margin-top: 30px; font-size: clamp(17px, .3vw + 16px, 19px); line-height: 1.45; color: var(--muted); }
.film figcaption strong { color: var(--ink); font-weight: 600; }
@media (max-width: 859.98px) {
    .hero__grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Mission ---------- */
.mission { padding-block: clamp(46px, 6vw, 96px); }
.mission--tinted { background: var(--wash); }
.mission__grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(28px, 5vw, 76px); align-items: start; }
.mission__head p { margin-top: 12px; color: var(--muted); }
.mission__mark { width: min(100%, 300px); margin-top: clamp(20px, 3vw, 40px); }
.mission__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(30px, 3.6vw, 52px) clamp(26px, 3.6vw, 52px); }
.mission__list li::before { content: ""; display: block; width: 64px; height: 5px; margin-bottom: 16px; background: linear-gradient(90deg, var(--teal) 62%, var(--sky) 62%); }
html[dir="rtl"] .mission__list li::before { background: linear-gradient(270deg, var(--teal) 62%, var(--sky) 62%); }
.mission__list p { margin-top: 8px; color: var(--muted); }
@media (max-width: 859.98px) {
    .mission__grid { grid-template-columns: minmax(0, 1fr); }
    .mission__mark { display: none; }
}
@media (max-width: 599.98px) {
    .mission__list { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Activities and services, home ---------- */
.offer { background: var(--wash-sky); padding-bottom: clamp(46px, 6vw, 92px); }
.offer .curve { background: #fff; margin-bottom: clamp(18px, 3vw, 40px); }
.offer h2 { margin-bottom: clamp(20px, 3vw, 36px); }
.offer__list { border-bottom: 1px solid rgba(12, 52, 64, .22); }
.offer__list a { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-block: clamp(13px, 1.6vw, 22px); border-top: 1px solid rgba(12, 52, 64, .22); font-size: clamp(22px, 1.8vw + 14px, 38px); font-weight: 600; line-height: 1.2; text-decoration: none; transition: color .15s; }
.offer__list .arrow { flex: none; color: var(--petrol); transition: margin .15s; }
.offer__list a:hover { color: var(--petrol); }
.offer__list a:hover .arrow { margin-inline-end: -6px; }

/* ---------- The bookshop ---------- */
.shopband { background: var(--petrol); color: #fff; }
.shopband__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 76px); align-items: center; padding-block: clamp(36px, 5vw, 72px); }
.shopband__photo { width: 100%; aspect-ratio: 1; object-fit: cover; object-position: 50% 72%; }
.shopband__name { font-weight: 600; color: #a9e7ea; }
html[dir="rtl"] .shopband__name { text-align: end; }
.shopband h2 { margin-top: 4px; }
.shopband__copy > p:not(.shopband__name) { max-width: 30em; margin-block: 16px 26px; }
.shopband .button { background: var(--sky); color: var(--ink); }
.shopband .button:hover { background: #fff; }
@media (max-width: 859.98px) {
    .shopband__grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Visit and coordinates ---------- */
.visit { padding-block: clamp(46px, 6vw, 92px); }
.visit__grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: clamp(28px, 5vw, 76px); align-items: start; }
.visit__where p + p { margin-top: 6px; color: var(--muted); }
.visit__where .button { margin-top: 22px; }
.coordinates { display: grid; gap: 14px; }
html[dir="rtl"] .coordinates dd { text-align: right; }
.coordinates dt { font-size: 15px; font-weight: 700; color: var(--petrol); }
.coordinates dd { line-height: 1.4; }
.coordinates dd a { text-underline-offset: 4px; }
.coordinates__social { display: flex; flex-wrap: wrap; gap: 4px 16px; }
@media (max-width: 859.98px) {
    .visit__grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Inner pages ---------- */
.pagehead { padding-top: clamp(32px, 4.4vw, 68px); background: var(--wash); }
.pagehead h1 { font-size: clamp(38px, 3.8vw + 20px, 70px); line-height: 1.04; }
.pagehead p { margin-top: 10px; max-width: 34em; font-size: clamp(20px, .7vw + 16px, 25px); line-height: 1.3; color: var(--petrol); }
.pagehead .wrap { padding-bottom: clamp(14px, 2vw, 28px); }
.story { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: clamp(28px, 5vw, 76px); align-items: center; padding-block: clamp(26px, 4vw, 60px) clamp(46px, 6vw, 92px); }
.story__text > * + * { margin-top: 16px; }
.story__photo { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.pair { padding-block: clamp(46px, 6vw, 92px); }
.pair__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(14px, 2vw, 26px); margin-top: clamp(20px, 3vw, 36px); }
.pair__item { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: clamp(22px, 3vw, 40px); }
.pair__item--house { background: var(--wash); border-top: 5px solid var(--teal); }
.pair__item--shop { background: var(--wash-sky); border-top: 5px solid var(--sky); }
.pair__item .textlink { margin-top: auto; padding-top: 6px; }
.servicelist { margin-top: clamp(26px, 4vw, 54px); border-bottom: 1px solid var(--line); }
.servicelist li { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 10px clamp(26px, 5vw, 76px); padding-block: clamp(22px, 3vw, 40px); border-top: 1px solid var(--line); scroll-margin-top: 84px; }
.servicelist h2 { font-size: clamp(25px, 1.2vw + 18px, 34px); line-height: 1.15; }
.servicelist li:target h2 { color: var(--petrol); }
.closing { padding-block: clamp(30px, 4vw, 56px) clamp(46px, 6vw, 82px); }
.closing .button { margin-top: 22px; }
.narrow.wrap { margin-inline: max(var(--gutter), calc((100% - 1240px) / 2)) auto; width: min(100% - 2 * var(--gutter), 860px); }
@media (max-width: 859.98px) {
    .story, .servicelist li { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 599.98px) {
    .pair__grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Contact ---------- */
.contact { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(30px, 5vw, 76px); align-items: start; padding-block: clamp(24px, 3.4vw, 50px) clamp(46px, 6vw, 86px); }
.contact h2 { font-size: clamp(27px, 1.4vw + 19px, 38px); margin-bottom: clamp(16px, 2vw, 26px); }
.form { position: relative; }
.form__trap { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.form__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.form__field { margin-bottom: 16px; }
.form label { display: block; margin-bottom: 5px; font-size: 16px; font-weight: 600; }
.form input:not([type="hidden"]), .form textarea { display: block; width: 100%; padding: 11px 13px; border: 1px solid #7da6ae; border-radius: 4px; background: #fff; }
html[dir="rtl"] .form input[dir="ltr"] { text-align: end; }
.form textarea { resize: vertical; min-height: 124px; }
.form input:focus, .form textarea:focus { border-color: var(--petrol); outline: 2px solid var(--sky); outline-offset: 0; }
.form [aria-invalid="true"] { border-color: var(--danger); }
.form__hint { margin-top: 4px; font-size: 15px; color: var(--muted); }
.form__error { margin-top: 4px; font-size: 16px; font-weight: 600; color: var(--danger); }
.form__status { margin-top: 16px; padding: 12px 16px; font-weight: 600; }
.form__status--ok { background: var(--wash); border-inline-start: 5px solid var(--teal); }
.form__status--error { background: #fcecea; border-inline-start: 5px solid var(--danger); color: var(--danger); }
[hidden] { display: none !important; }
.map { display: block; width: 100%; height: clamp(300px, 42vw, 480px); border: 0; }
@media (max-width: 859.98px) {
    .contact { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 479.98px) {
    .form__row { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Footer ---------- */
.colophon { background: var(--ink); color: #dcefef; font-size: 17px; }
.colophon__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 3fr) minmax(0, 4fr); gap: clamp(28px, 4vw, 60px); padding-block: clamp(36px, 5vw, 64px) clamp(26px, 3vw, 40px); }
.colophon__house img { width: 150px; }
.colophon__house p { margin-top: 18px; max-width: 28em; line-height: 1.45; }
.colophon nav li + li { margin-top: 8px; }
.colophon a { color: #fff; text-underline-offset: 4px; }
.colophon nav a { text-decoration: none; }
.colophon nav a:hover { text-decoration: underline; }
.colophon__shop { display: inline-flex; align-items: center; gap: 6px; color: #8bdcdf !important; font-weight: 600; }
.colophon .coordinates dt { color: #8bdcdf; }
.colophon__end { padding-block: 16px 22px; border-top: 1px solid rgba(255, 255, 255, .16); font-size: 15px; color: #a9c8cc; }
@media (max-width: 859.98px) {
    .colophon__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .colophon__house { grid-column: 1 / -1; }
}
@media (max-width: 519.98px) {
    .colophon__grid { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { transition: none !important; }
}
@media print {
    .masthead, .shoplink, .map, .film { display: none; }
}
