/*
Theme Name:   ADDR Theme
Theme URI:    https://github.com/Ahcene21/DZ-Reposiotries-Directory
Description:  Accessible, bilingual-ready (Arabic RTL / French / English) theme for the Algerian Directory of Digital Repositories. Works with the "ADDR Directory" plugin: green/white/grey identity, geometric star motif, skip link, responsive menu, language switcher in the header.
Author:       ADDR project
Version:      1.0.0
Requires at least: 6.2
Requires PHP: 7.4
License:      GNU Affero General Public License v3.0
License URI:  https://www.gnu.org/licenses/agpl-3.0.html
Text Domain:  addr-theme
Tags:         accessibility-ready, custom-logo, custom-menu, rtl-language-support, translation-ready, one-column, featured-images
*/

:root {
	--c-green: #006233; --c-green-d: #0a3f29; --c-green-m: #1c7250; --c-green-l: #f0f9f4; --c-green-xl: #d9f0e3;
	--c-red: #d21034; --c-ink: #111827; --c-muted: #4b5563; --c-line: #e5e7eb; --c-bg: #f7f8f7; --c-white: #fff;
	--radius: 12px; --maxw: 1200px; --readw: 46rem;
	/* 8-pointed star tessellation (two overlaid squares), drawn once, reused as a subtle texture */
	--star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.13' stroke-width='1.2'%3E%3Cpath d='M32 6l7.3 18.7L58 32l-18.7 7.3L32 58l-7.3-18.7L6 32l18.7-7.3z'/%3E%3Cpath d='M12 12h40v40H12z' transform='rotate(45 32 32)' stroke-opacity='.07'/%3E%3C/g%3E%3C/svg%3E");
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--c-bg); color: var(--c-ink); font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Naskh Arabic", Arial, sans-serif; display: flex; flex-direction: column; min-height: 100vh; }
img, svg { max-width: 100%; height: auto; }
a { color: var(--c-green); text-underline-offset: 2px; } a:hover { color: var(--c-green-d); }
:focus-visible { outline: 3px solid var(--c-green-m); outline-offset: 2px; border-radius: 3px; }
.screen-reader-text, .skip-link { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link:focus { clip: auto; width: auto; height: auto; inset-block-start: .5rem; inset-inline-start: .5rem; z-index: 1000; background: #fff; color: var(--c-green-d); padding: .6rem 1rem; border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,.25); }
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 1rem; }

/* ---------- header (white bar, compact links; banner + hero follow on the home page) ---------- */
.site-header { background: #fff; border-block-start: 4px solid var(--c-green); position: relative; box-shadow: 0 1px 0 var(--c-line); }
.site-header__bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: .7rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .7rem; color: var(--c-ink); text-decoration: none; }
.brand:hover { color: var(--c-green-d); }
.brand__mark { width: 2.4rem; height: 2.4rem; flex: none; }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__text strong { font-size: 1.25rem; letter-spacing: .05em; font-weight: 800; color: var(--c-green-d); }
.brand__text small { font-size: .74rem; color: var(--c-muted); max-width: 20rem; }
.custom-logo { max-height: 2.6rem; width: auto; }
.header-tools { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .1rem 1.4rem; align-items: center; }
.site-nav a { display: inline-block; color: var(--c-ink); text-decoration: none; padding: .35rem 0; font-size: .82rem; font-weight: 700; border-block-end: 2px solid transparent; }
.site-nav a:hover { color: var(--c-green); border-block-end-color: var(--c-green); }
.site-nav .current-menu-item > a, .site-nav .current_page_item > a, .site-nav a[aria-current="page"] { border-block-end-color: var(--c-green); color: var(--c-green-d); }
.site-nav .ext::after { content: "↗"; font-size: .7em; margin-inline-start: .25em; }
.nav-toggle { display: none; background: #fff; color: var(--c-green-d); border: 1px solid var(--c-green); border-radius: 8px; padding: .4rem .9rem; font: inherit; font-weight: 700; cursor: pointer; }
.site-header .addr-langs { display: flex; gap: .3rem; }
.site-header .addr-langs a { color: var(--c-ink); text-decoration: none; padding: .2rem .55rem; border-radius: 6px; border: 1px solid var(--c-line); font-size: .78rem; font-weight: 600; }
.site-header .addr-langs a[aria-current] { background: var(--c-green); color: #fff; border-color: var(--c-green); }
.site-header .addr-langs a:hover { border-color: var(--c-green); }
.site-banner { background: var(--c-green-d); color: #fff; text-align: center; padding: .6rem 1rem; font-size: .85rem; }
.site-banner a { color: #fff; font-weight: 700; } .site-banner svg { vertical-align: -2px; margin-inline-end: .35rem; }
@media (max-width: 860px) {
	.site-nav { width: 100%; order: 3; }
	.nav-toggle { display: inline-block; }
	.js .site-nav ul { display: none; flex-direction: column; align-items: flex-start; padding-block: .4rem; } .js .site-nav.is-open ul { display: flex; }
	.header-tools { width: 100%; justify-content: space-between; }
}

/* ---------- content ---------- */
.site-main { flex: 1; padding-block: 2rem; }
.site-main--full { padding-block: 0; max-width: none; padding-inline: 0; }
.entry { max-width: var(--readw); margin-inline: auto; background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius); padding: 1.5rem 1.75rem; }
.entry--wide { max-width: none; background: transparent; border: 0; padding: 0; }
.entry__title { margin: 0 0 1rem; font-size: 2rem; line-height: 1.2; color: var(--c-green-d); }
.entry--wide .entry__title { margin-bottom: 1.25rem; }
.entry--bare .entry__title { display: none; }
.entry__meta { color: var(--c-muted); font-size: .85rem; margin: -.5rem 0 1rem; }
.entry-content > * + * { margin-block-start: 1em; } .entry-content h2, .entry-content h3 { color: var(--c-green-d); line-height: 1.25; }
.post-list { display: grid; gap: 1rem; max-width: var(--readw); margin-inline: auto; } .post-list article { background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius); padding: 1.1rem 1.25rem; }
.post-list h2 { margin: 0 0 .3rem; font-size: 1.3rem; } .post-list h2 a { text-decoration: none; }
.pagination, .nav-links { display: flex; justify-content: space-between; margin-block-start: 1.5rem; max-width: var(--readw); margin-inline: auto; }
.error-404 { text-align: center; padding-block: 3rem; } .error-404 .big { font-size: 5rem; font-weight: 800; color: var(--c-green); line-height: 1; margin: 0; }
.btn { display: inline-block; background: var(--c-green); color: #fff; padding: .6rem 1.2rem; border-radius: 8px; font-weight: 600; text-decoration: none; } .btn:hover { background: var(--c-green-d); color: #fff; }

/* ---------- footer: grey link band, dark about band, brand-colour licence bar ---------- */
.site-footer { margin-block-start: 0; color: #e6ece9; }
.site-footer a { color: #fff; }
.site-footer__links { background: #5c6360; padding-block: 2rem 2.2rem; }
.site-footer__links .site-title { font-size: 1.15rem; margin: 0 0 1rem; color: #fff; font-weight: 500; }
.site-footer__grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
.site-footer h2 { font-size: .95rem; margin: 0 0 .6rem; color: #fff; font-weight: 700; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; font-size: .82rem; }
.site-footer__about { background: #2e3331; padding-block: 1.6rem; }
.site-footer__about .container { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; }
.site-footer__about .brand__mark { width: 5rem; height: 5rem; } .site-footer__about p { margin: 0 0 .5rem; max-width: 42rem; }
.site-footer__bar { background: var(--c-green-d); padding-block: .9rem; font-size: .85rem; }
.site-footer__bar .container { display: flex; gap: .5rem 1.5rem; flex-wrap: wrap; justify-content: space-between; align-items: center; }

/* wordpress core alignment helpers */
.alignwide { max-width: var(--maxw); } .alignleft { float: inline-start; margin-inline-end: 1rem; } .alignright { float: inline-end; margin-inline-start: 1rem; } .aligncenter { display: block; margin-inline: auto; }
.wp-caption-text, .gallery-caption { font-size: .85rem; color: var(--c-muted); } .sticky .entry__title::before { content: "★ "; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
@media print { .site-header, .site-footer, .skip-link { display: none; } body { background: #fff; } }
