/* ONPhI.pro — palette et esprit d’onphi.org (Editorial / HTML5 UP) */

:root {
  --onphi-accent: #f56a6a;
  --onphi-accent-hover: #f67878;
  --onphi-accent-active: #f45c5c;
  --onphi-accent-dark: #cc0000;
  --onphi-accent-darker: #9b1c1c;
  --onphi-text: #7f888f;
  --onphi-heading: #3d4449;
  --onphi-muted: #888;
  --onphi-border: rgba(210, 215, 217, 0.75);
  --onphi-border-soft: rgba(210, 215, 217, 0.45);
  --onphi-sidebar: #f5f6f7;
  --onphi-white: #ffffff;
  --onphi-code-bg: rgba(230, 235, 237, 0.25);
  --onphi-sidebar-width: 22em;
  --bs-primary: #f56a6a;
  --bs-link-color: #f56a6a;
  --bs-link-hover-color: #e55a5a;
}

html {
  box-sizing: border-box;
  scroll-behavior: smooth;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

body {
  background: var(--onphi-white);
  color: var(--onphi-text);
  font-family: "Open Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 13pt;
  font-weight: 400;
  line-height: 1.65;
}

@media screen and (max-width: 1680px) {
  body { font-size: 11pt; }
}

@media screen and (max-width: 1280px) {
  body { font-size: 10pt; }
}

a {
  color: var(--onphi-accent);
  text-decoration: none;
  border-bottom: dotted 1px;
  transition: color 0.2s ease-in-out, border-bottom-color 0.2s ease-in-out;
}

a:hover,
a:focus-visible {
  color: var(--onphi-accent) !important;
  border-bottom-color: var(--onphi-accent);
}

a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.nav-link:focus-visible {
  outline: 2px solid var(--onphi-accent);
  outline-offset: 3px;
}

strong, b {
  color: var(--onphi-heading);
  font-weight: 600;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--onphi-heading);
  font-family: "Roboto Slab", Georgia, serif;
  font-weight: 700;
  line-height: 1.5;
  margin: 0 0 1em;
}

h1 { font-size: 3.25em; line-height: 1.3; margin-bottom: 0.5em; }
h2 { font-size: 1.75em; }
h3 { font-size: 1.25em; }

@media screen and (max-width: 736px) {
  h1 { font-size: 2em; line-height: 1.4; }
  h2 { font-size: 1.5em; }
}

p { margin: 0 0 1.5em; }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}

blockquote {
  border-left: solid 3px var(--onphi-border);
  font-style: italic;
  margin: 0 0 2em;
  padding: 0.5em 0 0.5em 2em;
}

hr {
  border: 0;
  border-bottom: solid 1px var(--onphi-border);
  margin: 2em 0;
}

/* Liens d’évitement */
.skip-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10050;
  background: var(--onphi-accent);
  color: #fff !important;
  border: 0;
  padding: 0.6rem 1rem;
  font-family: "Roboto Slab", serif;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.skip-link:focus {
  left: 0.75rem;
  top: 0.75rem;
}

/* Layout Editorial */
#wrapper {
  display: flex;
  flex-direction: row-reverse;
  min-height: 100vh;
}

#main {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
}

#main > .inner {
  padding: 0 5em 2em;
  margin: 0 auto;
  max-width: 110em;
}

#main > .inner > section {
  padding: 4.5em 0 3em;
  border-top: solid 2px var(--onphi-border);
}

#main > .inner > section:first-of-type {
  border-top: 0 !important;
  padding-top: 2em;
}

@media screen and (max-width: 1280px) {
  #main > .inner { padding: 0 3em 1.5em; }
}

@media screen and (max-width: 736px) {
  #main > .inner { padding: 0 1.5em 1.5em; }
  #main > .inner > section { padding: 2.5em 0 1.5em; }
}

/* Header */
#header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
  border-bottom: solid 5px var(--onphi-accent);
  padding: 1em 0;
  margin-bottom: 0.5rem;
}

.header-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1 1 auto;
  min-width: 0;
  gap: 0.15rem;
}

#header .logo {
  border-bottom: 0;
  color: inherit;
  font-family: "Roboto Slab", serif;
  font-size: 1.125em;
  font-weight: 700;
  line-height: 1.2;
}

#header .logo:hover {
  color: var(--onphi-heading) !important;
}

.header-hello {
  margin: 0;
  font-size: 0.8em;
  line-height: 1.25;
  color: var(--onphi-muted);
  font-weight: 400;
}

.site-title-short { display: none; }

@media screen and (max-width: 736px) {
  .site-title-full { display: none; }
  .site-title-short { display: inline; }
}

#header .icons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.28rem;
  list-style: none;
  margin: 0 0 0 auto;
  padding: 0;
}

#header .icons li {
  margin: 0;
  padding: 0;
}

.header-major > :last-child {
  border-bottom: solid 3px var(--onphi-accent);
  display: inline-block;
  margin: 0 0 1.5em;
  padding: 0 0.75em 0.5em 0;
}

.header-major p {
  font-family: "Roboto Slab", serif;
  font-size: 1em;
  font-weight: 400;
  letter-spacing: 0.075em;
  text-transform: uppercase;
  color: var(--onphi-text);
  margin-top: -0.25em;
}

/* Boutons — esprit Editorial */
.btn-onphi,
a.btn-onphi,
button.btn-onphi {
  appearance: none;
  background-color: transparent;
  border-radius: 0.375em;
  border: 0;
  box-shadow: inset 0 0 0 2px var(--onphi-accent);
  color: var(--onphi-accent) !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-family: "Roboto Slab", serif;
  font-size: 0.8em;
  font-weight: 700;
  letter-spacing: 0.075em;
  line-height: 1.2;
  min-height: 3.5em;
  padding: 0.85em 2.25em;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  border-bottom: 0;
  transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

.btn-onphi:hover,
a.btn-onphi:hover {
  background-color: rgba(245, 106, 106, 0.05);
  color: var(--onphi-accent) !important;
  border-bottom: 0;
}

.btn-onphi.primary {
  background-color: var(--onphi-accent);
  box-shadow: none;
  color: #fff !important;
}

.btn-onphi.primary:hover {
  background-color: var(--onphi-accent-hover);
  color: #fff !important;
}

.btn-onphi.small {
  min-height: 0;
  height: auto;
  padding: 0.22rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  border-radius: 4px;
}

#header .btn-onphi.small {
  box-shadow: none;
  border: 1px solid var(--onphi-accent);
  background: #fff;
  color: var(--onphi-accent-dark) !important;
}

#header .btn-onphi.small:hover {
  background: #fff8f8;
  color: var(--onphi-accent-darker) !important;
}

/* Sidebar */
#sidebar {
  flex: 0 0 auto;
  width: var(--onphi-sidebar-width);
  background-color: var(--onphi-sidebar);
  font-size: 0.9em;
  position: relative;
  transition: margin-left 0.45s ease, box-shadow 0.45s ease;
}

#sidebar > .inner {
  padding: 1.75em 1.75em 2em;
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow-y: auto;
}

#sidebar.inactive {
  margin-left: calc(var(--onphi-sidebar-width) * -1);
}

.sidebar-logo {
  display: block;
  border-bottom: 0;
  margin-bottom: 1.5rem;
}

.sidebar-logo img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  overflow: hidden;
}

#menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: "Roboto Slab", serif;
  font-weight: 400;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

#menu ul li {
  border-bottom: 1px solid var(--onphi-border-soft);
}

#menu ul li:last-child {
  border-bottom: 0;
}

#menu ul a {
  border-bottom: 0;
  color: inherit;
  display: block;
  font-size: 0.9em;
  padding: 0.625em 0;
}

#menu ul a:hover,
#menu ul a.active {
  color: var(--onphi-accent) !important;
}

.sidebar-note {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--onphi-border-soft);
  font-size: 0.85em;
  color: var(--onphi-text);
}

.sidebar-footer {
  margin-top: 2rem;
  font-size: 0.8em;
  color: #5b5e61;
}

#sidebar-toggle {
  text-decoration: none;
  border: 0;
  display: block;
  height: 3rem;
  width: 3rem;
  min-width: 3rem;
  position: fixed;
  right: 0;
  top: 1rem;
  z-index: 10002;
  overflow: hidden;
  text-indent: 4rem;
  white-space: nowrap;
  background-color: var(--onphi-accent);
  color: #fff;
  border-radius: 0.375em 0 0 0.375em;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

#sidebar-toggle::before {
  font-family: "Font Awesome 6 Free", "Font Awesome 5 Free";
  font-weight: 900;
  content: "\f0c9";
  font-size: 1.25em;
  color: #fff;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  text-indent: 0;
}

#sidebar-toggle[aria-expanded="true"]::before {
  content: "\f00d";
}

/* Cartes / articles */
.work-card {
  height: 100%;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.work-card .icon-wrap {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 0.375em;
  box-shadow: inset 0 0 0 2px var(--onphi-accent);
  color: var(--onphi-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.work-card h3 {
  margin-bottom: 0.5em;
}

.work-card p {
  margin-bottom: 0;
}

.posts-grid {
  --bs-gutter-x: 3rem;
  --bs-gutter-y: 3rem;
}

.posts-grid > [class*="col"] {
  position: relative;
}

@media (min-width: 768px) {
  .posts-grid > [class*="col"]:not(:first-child)::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--onphi-border);
  }
}

.badge-pro {
  display: inline-block;
  font-family: "Roboto Slab", serif;
  font-size: 0.72em;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--onphi-accent);
  box-shadow: inset 0 0 0 2px var(--onphi-accent);
  border-radius: 0.375em;
  padding: 0.25em 0.7em;
  margin-bottom: 1.25em;
}

.compare {
  background: var(--onphi-sidebar);
  border-radius: 0.5rem;
  border-left: 4px solid var(--onphi-accent);
  padding: 1.75rem;
  height: 100%;
}

.compare h3 {
  border-bottom: solid 2px var(--onphi-accent);
  display: inline-block;
  padding-bottom: 0.35em;
  margin-bottom: 1em;
}

.compare ul {
  margin: 0;
  padding-left: 1.1em;
}

.compare li {
  margin-bottom: 0.45em;
}

/* Formulaire */
.form-onphi label {
  color: var(--onphi-heading);
  font-weight: 600;
  font-size: 0.9em;
}

.form-onphi .form-control {
  background: var(--onphi-code-bg);
  border: 1px solid var(--onphi-border);
  border-radius: 0.375em;
  color: var(--onphi-heading);
  padding: 0.75em 1em;
  font-size: 1em;
}

.form-onphi .form-control:focus {
  border-color: var(--onphi-accent);
  box-shadow: 0 0 0 1px var(--onphi-accent);
  background: #fff;
}

/* Footer */
#footer {
  border-top: solid 2px var(--onphi-border);
  padding: 2.5em 0 1.5em;
  color: #5b5e61;
  font-size: 0.9em;
}

#footer a {
  color: inherit;
}

.fab-share {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1050;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--onphi-accent);
  background: #fff;
  color: var(--onphi-accent-dark) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
  cursor: pointer;
  text-decoration: none;
}

.fab-share:hover {
  transform: translateY(-2px);
  color: var(--onphi-accent-darker) !important;
}

.modal-content {
  border: 0;
  border-radius: 0.5rem;
}

.modal-header {
  border-bottom: solid 3px var(--onphi-accent);
}

.modal-title {
  font-family: "Roboto Slab", serif;
}

.sidebar-backdrop {
  display: none;
}

@media screen and (max-width: 980px) {
  #sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 10001;
    margin-left: calc(var(--onphi-sidebar-width) * -1);
    box-shadow: none;
  }

  #sidebar.active {
    margin-left: 0;
    box-shadow: 0 0 2em rgba(0, 0, 0, 0.18);
  }

  #sidebar.inactive {
    margin-left: calc(var(--onphi-sidebar-width) * -1);
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(61, 68, 73, 0.35);
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .sidebar-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
  }
}
