.pm-social-bar{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  align-items:center;
  gap:8px;
  margin:4px auto 10px auto;
  padding:6px 0 10px 0;
  border-bottom:1px solid #d9e1e8;
  font-family:Arial, Helvetica, sans-serif;
}

.pm-social-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:36px;
  padding:0 12px;
  border-radius:10px;
  border:1px solid #c8d2dc;
  background:#f7f9fb;
  color:#16324f !important;
  text-decoration:none !important;
  font-size:13px;
  font-weight:700;
  line-height:1;
  box-shadow:0 2px 6px rgba(0,0,0,.08);
  transition:transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.pm-social-btn:hover{
  transform:translateY(-2px);
  box-shadow:0 5px 14px rgba(0,0,0,.14);
  filter:saturate(1.04);
}

.pm-social-btn:active{
  transform:translateY(0);
}

.pm-social-btn svg{
  width:17px;
  height:17px;
  stroke:currentColor;
}

.pm-social-btn.pm-icon{
  width:38px;
  min-width:38px;
  height:38px;
  min-height:38px;
  padding:0;
  border-radius:10px;
}

/* Facebook */
.pm-social-bar a[aria-label="Facebook"]{
  background:linear-gradient(135deg,#1877f2,#0f5fcb);
  color:#fff !important;
  border-color:#135fc8;
}

/* Instagram */
.pm-social-bar a[aria-label="Instagram"]{
  background:linear-gradient(135deg,#f58529,#dd2a7b,#8134af,#515bd4);
  color:#fff !important;
  border-color:#b04a9e;
}

/* X */
.pm-social-bar a[aria-label="X"]{
  background:linear-gradient(135deg,#3a3a3a,#111111);
  color:#fff !important;
  border-color:#222;
}

/* WhatsApp */
.pm-social-bar a[aria-label="WhatsApp"]{
  background:linear-gradient(135deg,#2ed573,#1faa59);
  color:#fff !important;
  border-color:#1b9c50;
}

/* Copiar ligação */
.pm-social-bar a[aria-label="Copiar ligação"]{
  background:linear-gradient(135deg,#f7f8fa,#e6ebf1);
  color:#35516f !important;
  border-color:#c6d2de;
}

/* Administração */
.pm-social-btn.pm-admin{
  background:linear-gradient(135deg,#eef4fb,#dbe8f6);
  color:#143a63 !important;
  border-color:#b7cde4;
  padding:0 16px;
}

/* Portal */
.pm-social-btn.pm-portal{
  background:linear-gradient(135deg,#ffd45b,#f0b31a);
  color:#5c3a00 !important;
  border-color:#d39a12;
  padding:0 16px;
}

/* Pequeno destaque visual entre grupos */
.pm-social-btn.pm-admin,
.pm-social-btn.pm-portal{
  margin-left:2px;
}

/* Telemóvel */
@media (max-width: 768px){
  .pm-social-bar{
    gap:6px;
    padding:6px 0 8px 0;
  }

  .pm-social-btn{
    font-size:12px;
    min-height:34px;
    padding:0 10px;
  }

  .pm-social-btn.pm-icon{
    width:35px;
    min-width:35px;
    height:35px;
    min-height:35px;
  }

  .pm-social-btn svg{
    width:16px;
    height:16px;
  }
}

/* PM-SOCIAL-V3-INICIO
   Portal Educativo - botoes compactos e alinhados a direita
*/

#header .pm-social-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 5px;

    width: max-content;
    max-width: 100%;

    margin: 4px 0 8px auto;
    padding: 3px 4px;

    border: 0;
    background: transparent;
    box-shadow: none;
}

/* Aspeto comum */

#header .pm-social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;

    width: auto;
    min-width: 0;
    height: 29px;
    min-height: 29px;

    padding: 0 9px;
    margin: 0;

    border-radius: 7px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;

    text-decoration: none !important;
    box-shadow: 0 2px 5px rgba(0,0,0,.15);

    transition:
        transform .18s ease,
        box-shadow .18s ease,
        filter .18s ease;
}

/* Os botoes de icones passam a ter texto */

#header .pm-social-btn.pm-icon {
    width: auto;
    min-width: 0;
    height: 29px;
    min-height: 29px;
    padding: 0 9px;
    border-radius: 7px;
}

/* Texto dos botoes */

#header a[aria-label="Facebook"]::after {
    content: "Facebook";
}

#header a[aria-label="Instagram"]::after {
    content: "Instagram";
}

#header a[aria-label="X"]::after {
    content: "Partilhar";
}

#header a[aria-label="WhatsApp"]::after {
    content: "WhatsApp";
}

#header a[aria-label="Copiar ligação"]::after {
    content: "Copiar";
}

#header .pm-social-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Cores das redes */

#header a[aria-label="Facebook"] {
    background: #1877f2;
    border-color: #1877f2;
    color: #fff !important;
}

#header a[aria-label="Instagram"] {
    background: linear-gradient(
        120deg,
        #f58529,
        #dd2a7b 50%,
        #8134af
    );
    border-color: #c13584;
    color: #fff !important;
}

#header a[aria-label="X"] {
    background: #202124;
    border-color: #202124;
    color: #fff !important;
}

#header a[aria-label="WhatsApp"] {
    background: #20b866;
    border-color: #20b866;
    color: #fff !important;
}

#header a[aria-label="Copiar ligação"] {
    background: #456789;
    border-color: #456789;
    color: #fff !important;
}

/* Administração */

#header .pm-social-btn.pm-admin {
    background: #e8f2ff;
    border-color: #b5d3f5;
    color: #16436d !important;
    padding: 0 10px;
}

/* Portal ProfIsmael */

#header .pm-social-btn.pm-portal {
    background: linear-gradient(
        120deg,
        #ffe075,
        #ffc83d
    );
    border-color: #e2aa24;
    color: #593b00 !important;
    padding: 0 10px;
}

/* Interacao */

#header .pm-social-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,.24);
    filter: brightness(1.08);
}

#header .pm-social-btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

/* Ecras pequenos */

@media (max-width: 768px) {
    #header .pm-social-bar {
        justify-content: flex-end;
        gap: 4px;
    }

    #header .pm-social-btn,
    #header .pm-social-btn.pm-icon {
        height: 27px;
        min-height: 27px;
        padding: 0 7px;
        font-size: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #header .pm-social-btn {
        transition: none;
    }
}

/* PM-SOCIAL-V3-FIM */

/* PM-CABECALHO-V4-INICIO
   Centro de Recursos - titulo e alinhamento
*/

/* Manter a altura original do cabecalho */
#main #header {
    height: 100px;
    box-sizing: border-box;
}

/* Libertar a largura ocupada pelas antigas margens */
#main #header #pageheader {
    margin: 0;
    padding: 5px 6px 0;
    width: auto;
    box-sizing: border-box;
    text-align: right;
    line-height: 1.15;
}

/* Titulo principal */
#main #header #pageheader strong {
    display: inline-block;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.15;
    color: #ffffff;
    text-shadow: 0 2px 5px rgba(0,0,0,.6);
}

/* Subtitulo ja existente no tema */
#main #header #pageheader span {
    display: inline-block;
    margin-top: 2px;
    font-size: 11px;
    line-height: 1.2;
    color: #c6e3ff;
    text-shadow: 0 1px 3px rgba(0,0,0,.7);
}

/* Barra alinhada a direita, sem alterar os botoes */
#main #header .pm-social-bar {
    justify-content: flex-end;
    width: calc(100% - 12px);
    max-width: none;
    margin: 5px 6px 0;
    padding: 0;
    box-sizing: border-box;
    gap: 5px;
    border: 0;
}

/* Manter os botoes compactos */
#main #header .pm-social-btn,
#main #header .pm-social-btn.pm-icon {
    height: 29px;
    min-height: 29px;
}

/* Foco acessivel */
#main #header .pm-social-btn:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* Ecras pequenos */
@media (max-width: 768px) {
    #main #header #pageheader strong {
        font-size: 17px;
    }

    #main #header .pm-social-bar {
        gap: 4px;
        margin-top: 4px;
    }
}

/* PM-CABECALHO-V4-FIM */
