/* ============================================================
   PHHP — greenskin.css
   Drop-in replacement pour PHHP.css
   Activer : $PHHP_THEME = "greenskin" dans skin/global.inc
   ============================================================ */

/* ----------------------------------------------------------
   Variables
   ---------------------------------------------------------- */
:root {
  --c-primary:    #4e6e46;
  --c-primary-dk: #344a2c;
  --c-heading:    #5c8a4a;
  --c-primary-lt: #6e9462;
  --c-accent:     #5a8a00;
  --c-accent-lt:  #d4edaa;
  --c-border:     #9aba92;
  --c-bg-side:    #e6ede4;
  --c-bg-light:   #eef4ec;
  --c-bg:         #ffffff;
  --c-text:       #1a2a1a;
  --c-muted:      #5a705a;
  --radius:       7px;
  --shadow:       0 1px 4px rgba(0,0,0,.12);
}

/* ----------------------------------------------------------
   Base
   ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 0.875rem;
  line-height: 1.6;
  background: var(--c-bg-side);
  color: var(--c-text);
  margin: 0;
  padding: 0;
}

table { font-size: 100%; }
td.main table { width: 100%; }
td.main table.map_tree, td.main table.map_tree table { width: auto; }

a {
  text-decoration: none;
  color: var(--c-primary);
}
a:hover {
  color: var(--c-primary-lt);
  text-decoration: underline;
}

img { border: none; vertical-align: middle; }

p {
  margin: 0.4em 0 0.9em;
  text-align: justify;
  line-height: 1.6;
}
p a        { text-decoration: underline; }
p a:active { color: #c0392b; }

hr {
  clear: both;
  height: 1px;
  border: none;
  background: var(--c-border);
  margin: 1em 0;
}

/* ----------------------------------------------------------
   Headings
   ---------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  color: var(--c-heading);
  font-family: inherit;
  font-weight: 600;
  clear: left;
  margin: 0 0 0.25em;
  padding-top: 0.5em;
  border-bottom: 1px solid var(--c-border);
  line-height: 1.3;
}
h1 { font-size: 1.35rem; }
h2 { font-size: 1.15rem; margin-left: 0.5em; }
h3 { font-size: 1.05rem; margin-left: 1em; }
h4 { font-size: 1rem;    margin-left: 1.5em; }
h5 { font-size: 0.9rem; }
h6 { font-size: 0.8rem; }

/* ----------------------------------------------------------
   Lists
   ---------------------------------------------------------- */
ul {
  line-height: 1.6;
  list-style-image: url("bullet.gif");
  margin-left: 1.5em;
  padding: 0;
}
.list ul { margin-left: 1em; }
ol {
  line-height: 1.6;
  margin-left: 1.5em;
  padding: 0;
}
ul a, ol a { text-decoration: underline; }
dt { font-weight: 600; }
dd { line-height: 1.6; margin-bottom: 0.75em; }

/* ----------------------------------------------------------
   Forms
   ---------------------------------------------------------- */
fieldset {
  border: 1px solid var(--c-border);
  margin: 1.5em 0 1em;
  padding: 0.75em;
  border-radius: var(--radius);
}
legend  { background: white; padding: 0 0.4em; }
form    { border: none; margin: 0; }
textarea {
  border: 1px solid var(--c-border);
  color: var(--c-text);
  background: white;
  width: 88%;
  padding: 0.3em;
  border-radius: 4px;
}
input {
  font: inherit;
  border: 1px solid var(--c-border);
  color: var(--c-text);
  background: white;
  vertical-align: middle;
  padding: 0.15em 0.4em;
  border-radius: 4px;
}
select {
  font: inherit;
  border: 1px solid var(--c-border);
  border-radius: 4px;
}

/* ----------------------------------------------------------
   Inline text
   ---------------------------------------------------------- */
abbr, acronym, .explain {
  border-bottom: 1px dotted var(--c-text);
  cursor: help;
}
q {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 1.1em;
}
blockquote {
  font-size: 1.05em;
  padding: 0.6em 1em;
  background: #fafbec;
  border-left: 3px solid #c8b85a;
  margin: 0.75em 0;
  border-radius: 0 4px 4px 0;
}
code {
  font-family: "SF Mono", "Fira Code", Consolas, "Courier New", monospace;
  font-size: 0.88em;
  color: var(--c-primary-dk);
  background: var(--c-bg-light);
  padding: 1px 4px;
  border-radius: 3px;
}
pre {
  font-family: "SF Mono", "Fira Code", Consolas, "Courier New", monospace;
  font-size: 0.84rem;
  padding: 1em;
  border: 1px solid var(--c-border);
  background: var(--c-bg-light);
  border-radius: var(--radius);
  overflow-x: auto;
  line-height: 1.5;
}
div.memo {
  font-size: 1.05em;
  background: #e8e8e8;
  margin: 0.5em;
  padding: 1em;
  border-radius: var(--radius);
}
div.memo div.encart {
  font-size: 1.1em;
  background: #f0f0f0;
  margin: 0.5em;
  padding: 1em;
  border-radius: 4px;
}

/* ----------------------------------------------------------
   Layout — top banner
   ---------------------------------------------------------- */
div.top, #header {
  background: var(--c-bg-side);
}
.logo {
  margin: 0.4em 0 0 1.5em;
}

/* Navigation tabs */
div.tabs {
  background: var(--c-bg-side);
  border-bottom: 2px solid var(--c-border);
  padding: 0.4em 0 0 1.5em;
  white-space: nowrap;
}
div.tabs a {
  display: inline-block;
  background: white;
  border: 1px solid var(--c-border);
  border-bottom: none;
  color: var(--c-primary);
  font-weight: 500;
  font-size: 0.9em;
  padding: 0.2em 1.2em;
  margin-right: 0.3em;
  border-radius: 4px 4px 0 0;
  transition: background .15s;
}
div.tabs a.selected {
  background: var(--c-bg-light);
  border-bottom: 2px solid var(--c-bg-light);
  color: var(--c-primary-dk);
  font-weight: 600;
}
div.tabs a:hover {
  background: var(--c-bg-light);
  text-decoration: none;
}

/* Barre combinée path + date */
div.infoBar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--c-bg-side);
  border-bottom: 1px solid var(--c-border);
  padding: 0.25em 1em;
  font-size: 0.82em;
  color: var(--c-muted);
}
div.infoBar a { color: var(--c-primary); }
div.infoBar img { vertical-align: 0px; }
.infoBar-path { flex: 1; }
.infoBar-date  { white-space: nowrap; margin-left: 1.5em; }

/* ----------------------------------------------------------
   Layout — 3-column table
   ---------------------------------------------------------- */
table.columns {
  width: 100%;
  margin: 0;
  padding: 0;
  border-collapse: collapse;
}
table.columns td.left {
  vertical-align: top;
  width: 15em;
  padding: 1.5em 0.75em 1em 1.25em;
  background: var(--c-bg-side);
}
table.columns td.main {
  background: var(--c-bg);
  vertical-align: top;
  padding: 1em 2em 1.5em;
  border-left: 1px solid var(--c-border);
}
table.columns td.right {
  vertical-align: top;
  width: 14%;
  padding: 1.5em 1.25em 1em 0.75em;
}

/* Footer */
.footer {
  background: var(--c-bg-side);
  border-top: 1px solid var(--c-border);
  color: var(--c-muted);
  clear: both;
  text-align: center;
  padding: 0.4em;
  font-size: 0.8em;
}
.footer td { margin: 0; padding: 0; }
.header    { background: var(--c-bg-side); clear: both; text-align: center; }

/* ----------------------------------------------------------
   Sidebox — boîtes de contenu (remplace les GIFs roundcorner)
   ---------------------------------------------------------- */
.sidebox, .greysidebox {
  margin: 0 0.75em 2.5em;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  background: white;
}
td.main .sidebox, td.main .greysidebox { margin-bottom: 1.2em; }

.boxhead {
  margin: 0;
  padding: 0;
}
.boxhead h2 {
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-lt) 80%);
  color: white;
  margin: 0;
  padding: 0.5em 1em;
  font-size: 1em;
  font-weight: 600;
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  text-shadow: 0 1px 2px rgba(0,0,0,.3);
}
.boxbody {
  padding: 0.75em 1em 1em;
  background: #dfdfdf;
  font-size: 0.95em;
}

/* Variante grise */
.greysidebox .boxhead h2 {
  background: linear-gradient(135deg, #8a9ea6 0%, #6e878f 100%);
}
.greysidebox .boxbody {
  color: var(--c-muted);
  font-size: 0.88em;
}

/* ----------------------------------------------------------
   Barre de navigation (remplace bar-l.gif / bar-r.gif)
   ---------------------------------------------------------- */
.barbox {
  position: relative;
  overflow: hidden;
  margin: 0 0 1em;
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-dk) 100%);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.barbody {
  margin: 0;
  padding: 0.4em 0.75em 0.5em;
  vertical-align: middle;
}
.barbody ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.barbody li       { float: left; }
.barbody li.back  { width: 0; height: 0; }
.barbody li .left { display: none; }
.barbody li a {
  display: block;
  text-decoration: none;
  font: 600 0.82rem/1 inherit;
  color: rgba(255,255,255,.92);
  padding: 0.35em 0.75em;
  border-radius: 4px;
  margin: 0 0.15em;
  transition: background .15s;
}
.barbody li a:hover {
  background: rgba(255,255,255,.2);
  text-decoration: none;
  color: white;
}

/* ----------------------------------------------------------
   Petites boîtes sidebar (navigation, login…)
   ---------------------------------------------------------- */
div.box {
  border: none;
  margin: 0 0 2.5em;
}
div.box h5 {
  background: var(--c-bg-light);
  border: 1px solid var(--c-border);
  border-bottom: none;
  color: var(--c-primary);
  padding: 0.2em 0.75em;
  font-size: 0.88em;
  font-weight: 600;
  border-radius: 4px 4px 0 0;
  display: block;
}
div.box h6 {
  background: var(--c-bg-light);
  border: 1px solid var(--c-border);
  border-bottom: none;
  color: var(--c-primary);
  padding: 0.2em 0.75em;
  font-size: 0.88em;
  border-radius: 4px 4px 0 0;
  display: block;
}
div.box h4 { font-size: 0.95em; }
div.box div.body {
  background: white;
  border: 1px solid var(--c-border);
  border-radius: 0 0 4px 4px;
}
div.box h1, div.box h2, div.box h3, div.box h4 { margin: 0; padding: 0; }
div.content    { padding: 0.5em 0.75em; }
.boxDetails    { text-align: right; }
div.box .even  { background: var(--c-bg-light); }
div.box .odd   { background: transparent; }
div.box .highlight { background: #ffe0a0; }
div.box a.close {
  float: right;
  border-left: 1px solid var(--c-border);
  padding: 0 0.2em;
}

/* ----------------------------------------------------------
   Onglets de contenu (accent vert)
   ---------------------------------------------------------- */
#contentTabs, #contentSubtabs {
  border-bottom: 2px solid var(--c-accent);
  padding-left: 0.5em;
  margin-top: 1.5em;
  white-space: nowrap;
}
#contentTabs a, #contentSubtabs a {
  display: inline-block;
  background: white;
  border: 1px solid var(--c-accent);
  border-bottom: none;
  color: var(--c-accent);
  padding: 0.1em 1em;
  margin-right: 0.3em;
  border-radius: 4px 4px 0 0;
  font-size: 0.88em;
}
#contentTabs a.selected, #contentSubtabs a.selected {
  background: var(--c-accent-lt);
  border-bottom: 2px solid var(--c-accent-lt);
  color: var(--c-accent);
  font-weight: 600;
}
#contentTabs a:hover, #contentSubtabs a:hover {
  background: var(--c-accent-lt);
  text-decoration: none;
}
#contentSubtabs a.confidential {
  color: #c0392b;
  background: #ffe0de;
}
#contentBar, #submenuBar {
  background: var(--c-accent-lt);
  border: 1px solid var(--c-accent);
  border-top: none;
  color: var(--c-accent);
  text-align: right;
  padding: 0.1em 0.5em;
  font-size: 0.85em;
}

/* ----------------------------------------------------------
   Zone de contenu principal
   ---------------------------------------------------------- */
div.document {
  background: var(--c-bg);
  padding: 0;
  margin: 0 0 1.5em;
}
div.documentActions {
  float: right;
  margin: 4px 4px -16px;
}
div.title       { margin-top: 0.75em; }
.description    { font-weight: 600; display: block; margin: 0.75em 0; line-height: 1.5; }
table.twocols   { margin: 0; }

/* Écrase les bgcolor="#9DADC6" (bleu HTML4) du contenu vers le vert du thème */
td[bgcolor="#9DADC6"] { background-color: var(--c-border) !important; }

/* ----------------------------------------------------------
   Tables listing
   ---------------------------------------------------------- */
table.listing, div.stx table {
  border-collapse: collapse;
  border-left: 1px solid var(--c-border);
  border-bottom: 1px solid var(--c-border);
  font-size: 0.88em;
  margin: 0 0 1em;
  clear: both;
  width: 100%;
}
table.listing th, div.stx table th {
  background: var(--c-bg-light);
  border-top: 1px solid var(--c-border);
  border-bottom: 1px solid var(--c-border);
  border-right: 1px solid var(--c-border);
  font-weight: 600;
  padding: 0.3em 0.75em;
  white-space: nowrap;
}
table.listing td, div.stx table td {
  border-right: 1px solid var(--c-border);
  padding: 0.2em 0.75em;
}
table.listing tr.odd      { background: transparent; }
table.listing tr.even     { background: var(--c-bg-light); }
table.listing tr.odd_off  { background: #d0d0d0; color: #888; }
table.listing tr.even_off { background: #c8c8c8; color: #888; }
table.listing a:hover     { text-decoration: underline; }
table.listing img         { vertical-align: middle; }

/* Couleurs emploi du temps */
table.listing td.premiere_heure          { background: #44d0aa; border-top: 1px solid var(--c-border); }
table.listing td.derniere_heure          { background: #44edaa; border-bottom: 1px solid var(--c-border); }
table.listing td.heure_pleine            { background: #44ddaa; }
table.listing td.premiere_heure_nonhebdo { background: #66f0cc; border-top: 1px solid var(--c-border); }
table.listing td.derniere_heure_nonhebdo { background: #66f0cc; border-bottom: 1px solid var(--c-border); }
table.listing td.heure_pleine_nonhebdo   { background: #66ffcc; }

div.stx table p  { margin: 0; padding: 0; }
div.stx table    { border: 1px solid var(--c-border); }
div.stx table td { border-bottom: 1px solid var(--c-border); }

/* ----------------------------------------------------------
   Divers
   ---------------------------------------------------------- */
.currentNavItem { color: var(--c-primary-dk); font-weight: 600; }
.private        { color: var(--c-text); }
.published      { color: var(--c-accent); }
.pending        { color: #e07b00; }
.expired        { color: #c0392b; }
.syndicated     { color: #27ae60; }
.even           { background: var(--c-bg-light); }
.odd            { background: transparent; }
.highlight      { background: #fff3cd; }

div.message {
  background: #fff3cd;
  border: 1px solid #e0a800;
  color: var(--c-text);
  font-size: 0.88em;
  font-weight: 600;
  margin: 1.5em 0 0.75em;
  padding: 0.5em 0.9em;
  border-radius: 4px;
}
div.message a { color: var(--c-text); text-decoration: underline; }

.error {
  background: #fff3cd;
  border: 1px solid #e0a800;
  padding: 0.75em;
  border-radius: 4px;
}
.download {
  margin: 0.75em;
  font-size: 0.95em;
  text-align: justify;
  background: var(--c-bg-light);
  border: 1px solid var(--c-border);
  border-radius: 4px;
  padding: 0.4em 0.6em;
}
.small { font-size: 0.82em; }

span.card {
  background: var(--c-bg-light);
  border: 1px solid var(--c-border);
  float: left;
  margin: 0.75em;
  padding: 0.75em;
  text-align: center;
  width: 15%;
  border-radius: var(--radius);
}
div.spacer { margin: 0.75em; }
div.row {
  clear: both;
  min-height: 3em;
  margin: 0 0 0.75em;
  position: relative;
}
.group {
  border: 1px solid var(--c-border);
  margin: 0.75em 0;
  padding: 0 0.75em;
  border-radius: var(--radius);
}
span.legend {
  background: white;
  font-size: 0.8em;
  padding: 0 0.4em;
  position: relative;
  top: -0.8em;
  left: 0;
}
div.label { font-weight: 600; display: inline; padding-right: 0.4em; }
div.field { margin-top: 0.15em; }
div.help {
  background: #ffffcc;
  border: 1px solid #999;
  font-size: 0.82em;
  position: absolute;
  left: -18em;
  top: 1.5em;
  width: 16em;
  padding: 0.4em;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
div.listingBar {
  background: var(--c-bg-light);
  border: 1px solid var(--c-border);
  padding: 0.2em 0.75em;
  text-align: center;
  clear: both;
  margin: 0.75em 0;
  border-radius: 4px;
  font-size: 0.88em;
}
div.listingBar span.previous { float: left; }
div.listingBar span.next     { float: right; }

.map_tree {
  font-size: 0.9em;
  background: white;
  border: 1px solid var(--c-border);
  border-radius: 4px;
}
.alert {
  font-size: 0.88em;
  color: white;
  background: #993333;
  border: 1px solid #c0392b;
  border-radius: 4px;
  padding: 2px 4px;
}

/* ----------------------------------------------------------
   Calendrier
   ---------------------------------------------------------- */
div.day {
  background: #ffffcc;
  border: 1px solid #aaa;
  padding: 0.2em;
  position: absolute;
  visibility: hidden;
  width: 12em;
  z-index: 2;
  border-radius: 4px;
  box-shadow: var(--shadow);
}
div.date { font-weight: 600; }
table.calendar {
  border: 1px solid var(--c-border);
  margin: 0 0.75em 1.5em 0;
  text-align: right;
  border-radius: var(--radius);
  overflow: hidden;
}
table.calendar a               { text-decoration: none; color: var(--c-primary); }
table.calendar th              { background: var(--c-bg-light); font-weight: 600; text-align: center; padding: 0.2em; }
table.calendar td              { background: transparent; width: 1.6em; padding: 2px; }
table.calendar td.weekdays     { background: var(--c-bg-light); border-block: 1px solid var(--c-border); text-align: center; }
table.calendar td.event        { background: var(--c-bg-light); font-weight: 600; }
table.calendar td.noevent      { background: transparent; }
table.calendar td.todayevent   { background: var(--c-bg-light); border: 2px solid #e07b00; font-weight: 600; }
table.calendar td.todaynoevent { border: 2px solid #e07b00; }

/* ----------------------------------------------------------
   Math / utilitaires finaux
   ---------------------------------------------------------- */
math { font-size: 1.6em; }

.vertical-text {
  writing-mode: vertical-rl;
  text-orientation: sideways;
  white-space: nowrap;
}
input.standalone {
  background: var(--c-bg-light);
  border: 1px solid var(--c-border);
  color: var(--c-text);
  cursor: pointer;
  font-size: 0.85em;
  margin-bottom: 0.75em;
  padding: 0.15em 0.5em;
  border-radius: 4px;
}
input.context {
  background: white;
  border: 1px solid var(--c-border);
  cursor: pointer;
  font-size: 0.75em;
  border-radius: 3px;
  padding: 0.1em 0.3em;
}
input.noborder {
  border: none;
  margin: 0;
  background: transparent;
}
