/*
 * AMEDDIAS design for the "AMEDDIAS — Home page" template.
 * GENERATED from themes/ameddias/style.css by tools/sync-plugin-assets.py —
 * edit the theme file and run the script again; do not edit this copy.
 */

body.ameddias-page {
  --red: #a5321f;
  --red-dark: #7d0a13;
  --text: #2b2620;
  --muted: #6f6455;
  --paper: #f7f3e9;
  --paper-dark: #e8e1d1;
  --ink: #2b2620;
  --sepia: #bcae95;
  --font-heading: "Special Elite", "Courier Prime", "Noto Kufi Arabic", "Courier New", monospace;
  --font-body: "Courier Prime", "Noto Kufi Arabic", "Courier New", ui-monospace, monospace;
  --font-label: "Courier Prime", "Noto Kufi Arabic", "Courier New", ui-monospace, monospace;
}

* { box-sizing: border-box; }

body.ameddias-page {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background-color: var(--paper);
  /* Short pages: the footer stays at the bottom of the window. */
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--wp-admin--admin-bar--height, 0px));
  min-height: calc(100dvh - var(--wp-admin--admin-bar--height, 0px));
}

.site-main { flex: 1 0 auto; }

/*
 * Paper background.
 * Before: two SVGs with feTurbulence (recomputed on every paint) and
 * `background-attachment: fixed` (repaints the whole screen on every scroll;
 * iOS ignores it and stretches the gradients over the full page height).
 * Now: both textures are pre-rendered to WebP (same filter, same result) and
 * everything lives on a separate fixed layer that the browser composites once.
 * It looks the same and scrolling on phones never repaints it.
 */
body.ameddias-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  will-change: transform;
  background-image:
    /* worn corners and edges */
    radial-gradient(circle at 0% 0%, rgba(78, 64, 46, 0.20), transparent 24%),
    radial-gradient(circle at 100% 0%, rgba(78, 64, 46, 0.16), transparent 22%),
    radial-gradient(circle at 0% 100%, rgba(78, 64, 46, 0.19), transparent 24%),
    radial-gradient(circle at 100% 100%, rgba(78, 64, 46, 0.16), transparent 22%),
    /* vignette: the centre is lighter than the edges */
    radial-gradient(135% 120% at 50% 40%, transparent 62%, rgba(90, 72, 48, 0.13) 100%),
    /* overall tone (very subtle, almost neutral) */
    linear-gradient(160deg, rgba(214, 208, 192, 0.12), rgba(200, 190, 168, 0.05) 55%, rgba(165, 148, 116, 0.08)),
    /* faint vertical fold */
    linear-gradient(90deg, transparent calc(50% - 1px), rgba(80, 64, 40, 0.045) 50%, transparent calc(50% + 1px)),
    /* foxing: sepia stains and clouds */
    url("../img/paper-stains.webp"),
    /* fine paper grain */
    url("../img/paper-grain.webp");
  background-size:
    100% 100%, 100% 100%, 100% 100%, 100% 100%,
    100% 100%, 100% 100%, 100% 100%,
    1000px 1000px, 200px 200px;
  background-repeat:
    no-repeat, no-repeat, no-repeat, no-repeat,
    no-repeat, no-repeat, no-repeat,
    repeat, repeat;
}

a { color: var(--red); }

img { max-width: 100%; height: auto; }

/* ----- Accessibility ----- */
.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  clip: auto;
  width: auto;
  height: auto;
  margin: 0;
  z-index: 100;
  top: 8px;
  inset-inline-start: 8px;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}

/* ----- Header ----- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 32px;
  border-bottom: 1px solid var(--sepia);
  background: transparent;
}

.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.brand-logo {
  display: block;
  height: 88px;
  width: auto;
  margin: -2px 0;
}

.site-header nav {
  margin-inline-start: auto;
}

.site-header nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-header nav a {
  text-decoration: none;
  color: var(--muted);
  font-family: var(--font-label);
  font-size: 13px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.site-header nav a:hover,
.site-header nav .current-menu-item > a { color: var(--text); text-decoration: underline; }

/* Language switcher (Polylang) — dropdown menu */
.lang-switch {
  position: relative;
  margin-inline-start: 22px;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--ink);
  color: var(--text);
  font-family: var(--font-label);
  font-size: 12px;
  letter-spacing: 0.06em;
  line-height: 1;
  cursor: pointer;
}

.lang-toggle:hover { background: rgba(43, 38, 32, 0.06); }

.lang-toggle[aria-expanded="true"] { background: var(--ink); color: var(--paper); }

.lang-menu {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 6px);
  z-index: 40;
  margin: 0;
  padding: 4px;
  min-width: 170px;
  list-style: none;
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: 3px 4px 0 rgba(43, 38, 32, 0.18);
}

.lang-item {
  display: block;
  width: 100%;
  text-align: start;
  padding: 8px 10px;
  background: transparent;
  border: 0;
  color: var(--text);
  font-family: var(--font-label);
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
}

.lang-item:hover { background: rgba(43, 38, 32, 0.08); }

.lang-item.is-active {
  background: var(--ink);
  color: var(--paper);
}

/* ----- Section header / home hero ----- */
.hero {
  max-width: 1120px;
  margin: 0 auto;
  padding: 48px 24px 72px;
}

.hero-text { text-align: center; margin-bottom: 28px; }

.hero-text h1 {
  font-family: var(--font-heading);
  font-size: clamp(28px, 4.6vw, 46px);
  margin: 0 auto 14px;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.15;
  color: var(--ink);
}

.hero-text p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  max-width: 620px;
  margin: 0 auto;
}

/* ----- Blog: archive list, grouped by year ----- */
.blog-list {
  max-width: 760px;
  margin: 0 auto;
}

.blog-year + .blog-year {
  margin-top: 36px;
}

.blog-year__label {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 400;
  color: var(--ink);
  margin: 0 0 14px;
  padding-bottom: 6px;
  border-bottom: 3px double var(--sepia);
}

.blog-year__posts {
  display: flex;
  flex-direction: column;
}

.blog-post {
  padding: 16px 0;
  border-bottom: 1px solid var(--paper-dark);
}

.blog-year__posts > .blog-post:last-child { border-bottom: none; }

.blog-post__date {
  font-family: var(--font-label);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 4px;
}

.blog-post__date a { color: inherit; }

.blog-post__title {
  margin: 0 0 6px;
  font-size: 17px;
  line-height: 1.35;
}

.blog-post__title a {
  color: var(--ink);
  text-decoration: none;
}

.blog-post__title a:hover { text-decoration: underline; }

.blog-post__excerpt {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}

.blog-post__excerpt p { margin: 0; }

.blog-post__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--red);
  text-decoration: none;
}

.blog-post__link:hover { text-decoration: underline; }

.blog-empty {
  text-align: center;
  color: var(--muted);
  font-style: italic;
}

/* List pagination */
.pagination {
  max-width: 760px;
  margin: 40px auto 0;
  font-family: var(--font-label);
  font-size: 13px;
}

.pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.pagination .page-numbers {
  display: inline-block;
  min-width: 34px;
  padding: 7px 10px;
  border: 1px solid var(--sepia);
  color: var(--text);
  text-align: center;
  text-decoration: none;
}

.pagination .page-numbers.current {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.pagination a.page-numbers:hover { background: rgba(43, 38, 32, 0.06); }

.pagination .page-numbers.dots { border-color: transparent; }

/* ----- Pillars: Mediatisation / Communication / Organisation ----- */
.pillars {
  max-width: 1120px;
  margin: 0 auto;
  padding: 8px 24px 72px;
}

.pillars__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.pillar {
  padding: 0 30px;
  text-align: center;
  border-inline-start: 1px solid var(--paper-dark);
}

.pillar:first-child { border-inline-start: none; }

.pillar__icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--red);
  color: #f3ece0;
}

.pillar__icon svg { width: 26px; height: 26px; }

.pillar__label {
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--red);
  margin: 0 0 8px;
}

.pillar__title {
  font-family: var(--font-heading);
  font-size: 19px;
  font-weight: 400;
  color: var(--ink);
  margin: 0 0 10px;
  line-height: 1.3;
}

.pillar__text {
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
}

@media (max-width: 700px) {
  .pillars__grid { grid-template-columns: 1fr; gap: 32px; }
  .pillar { border-inline-start: none; border-top: 1px solid var(--paper-dark); padding: 28px 12px 0; }
  .pillar:first-child { border-top: none; padding-top: 0; }
}

/* ----- Home: latest articles and editable content ----- */
.home-section {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px 72px;
}

.home-section__title {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 400;
  color: var(--ink);
  text-align: center;
  margin: 0 0 14px;
  padding-bottom: 6px;
  border-bottom: 3px double var(--sepia);
}

.home-section__more {
  margin: 18px 0 0;
  text-align: center;
}

/* ----- Article / page ----- */
.entry {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 24px 72px;
}

.entry-header { text-align: center; margin-bottom: 28px; }

.entry-meta {
  font-family: var(--font-label);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 12px;
}

.entry-meta a { color: inherit; }

.entry-title {
  font-family: var(--font-heading);
  font-size: clamp(26px, 4.2vw, 40px);
  font-weight: 400;
  line-height: 1.2;
  color: var(--ink);
  margin: 0;
}

.entry-thumbnail { margin: 0 0 32px; }

.entry-thumbnail img {
  display: block;
  width: 100%;
  border: 1px solid var(--sepia);
}

.entry-content {
  font-size: 16px;
  line-height: 1.75;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
  font-family: var(--font-heading);
  font-weight: 400;
  color: var(--ink);
  line-height: 1.3;
  margin: 1.8em 0 0.6em;
}

.entry-content h2 { font-size: 26px; }
.entry-content h3 { font-size: 21px; }
.entry-content h4 { font-size: 18px; }

.entry-content blockquote {
  margin: 1.6em 0;
  padding-block: 4px;
  padding-inline: 20px 0;
  border-inline-start: 3px solid var(--red);
  color: var(--muted);
  font-style: italic;
}

.entry-content figure { margin: 1.6em 0; }

.entry-content figcaption,
.wp-caption-text {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin-top: 6px;
}

.entry-content hr {
  border: 0;
  border-top: 3px double var(--sepia);
  margin: 2.4em 0;
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.entry-content th,
.entry-content td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--paper-dark);
  text-align: start;
}

.entry-footer {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--paper-dark);
  font-family: var(--font-label);
  font-size: 13px;
  color: var(--muted);
}

.post-navigation {
  max-width: 760px;
  margin: -40px auto 72px;
  padding: 0 24px;
}

.post-navigation .nav-links {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  font-size: 14px;
}

.post-navigation a { color: var(--ink); text-decoration: none; }
.post-navigation a:hover { text-decoration: underline; }
.post-navigation .nav-next { margin-inline-start: auto; text-align: end; }

.alignleft { float: left; margin: 0.4em 1.4em 1em 0; }
.alignright { float: right; margin: 0.4em 0 1em 1.4em; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }

/* ----- Search ----- */
.search-form {
  display: flex;
  max-width: 480px;
  margin: 24px auto 0;
}

.search-form input[type="search"] {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--ink);
  border-inline-end: 0;
  background: rgba(255, 255, 255, 0.5);
  color: var(--text);
  font: inherit;
  font-size: 15px;
}

.search-form button {
  padding: 10px 16px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-label);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.search-form button:hover { background: var(--red); border-color: var(--red); }

/* ----- Footer ----- */
.site-footer {
  border-top: 1px solid var(--sepia);
  padding: 24px 32px 32px;
  text-align: center;
  font-family: var(--font-label);
  font-size: 12px;
  color: var(--muted);
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.site-footer a {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.site-footer a:hover { color: var(--text); text-decoration: underline; }

.site-footer__copy { margin: 0; }

@media (max-width: 820px) {
  .site-header { flex-wrap: wrap; gap: 12px 0; padding: 6px 20px; }
  .site-header nav { margin-inline-start: 0; width: 100%; order: 3; }
  .lang-switch { margin-inline-start: auto; }
}

@media (max-width: 600px) {
  .site-header nav ul { gap: 6px 14px; }
  .brand-logo { height: 66px; }
}

/* ----- Right-to-left languages (Arabic) -----
 * The layout follows the reading direction on its own (flexbox and logical
 * properties such as margin-inline-start); only these details need help. */

/* The "→" arrows point in the reading direction. */
[dir="rtl"] .blog-post__link svg { transform: scaleX(-1); }

/* Arabic letters are joined: letter spacing would break words apart. :lang()
   leaves out the French or English text shown inside an Arabic page. */
:lang(ar) { letter-spacing: 0 !important; }

/* Arabic needs more room between lines than the typewriter fonts. */
:lang(ar) .entry-content,
:lang(ar) .hero-text p,
:lang(ar) .blog-post__excerpt { line-height: 1.9; }
