/* 
    CSS POUR LES BLOCKS DE PAGE
*/

.block:not(:last-child) { margin: var(--spacing) 0px; }
.aside-wrapper .block,
.page-is-homepage .block {
    margin: inherit;
}


/* ASIDE */
.column-wrapper aside .aside-wrapper {
    display: flex; flex-direction: column; align-items: start; gap: var(--spacing);
}

/*
    TITLE
*/
.page-wrapper .picto-title {
    position: relative;
    left: calc(-1 * var(--spacing) - 35px)
}
@media screen and (max-width: 1000px) {
    .page-wrapper .picto-title { left: 0px; }
}


/* BLOCK PAGE TITLE */
.block-pageTitle {
    font: var(--asap-1);
    display: flex; align-items: center; gap: var(--spacing);
}
.block-pageTitle:before {
    content: "";
    flex-shrink: 0;
    width: var(--spacing); aspect-ratio: 1/3;
    background-color: var(--bleu);
}

/* BLOCK HEADING */
.block.block-heading {
    display: flex; align-items: center; gap: var(--spacing);
}
.block.block-heading:before {
    content: "";
    flex-shrink: 0;
    width: var(--spacing); aspect-ratio: 1/3;
    background-color: var(--bleu);
}

/* BLOCK HTML */
.block h1,
.block h2,
.block h3,
.block h4,
.block h5,
.block h6 {
    font: var(--asap-1);
    font-weight: bold;
}
.block.block-html {
    max-width: 800px;
}
.block.block-html > *:not(:last-child) {
    margin-bottom: var(--spacing);
}
.block.block-html h1,
.block.block-html h2,
.block.block-html h3,
.block.block-html h4,
.block.block-html h5,
.block.block-html h6 {
    display: flex; align-items: center; gap: var(--spacing);
}
.block.block-html h1:before,
.block.block-html h2:before,
.block.block-html h3:before,
.block.block-html h4:before,
.block.block-html h5:before,
.block.block-html h6:before {
    content: "";
    flex-shrink: 0;
    width: var(--spacing); aspect-ratio: 1/3;
    background-color: var(--bleu);
}
.block.block-html a { text-decoration: underline; }
.block.block-html a:hover { color: var(--orange); }
.block.block-html ul,
.block.block-html ol { list-style-position:inside; }

/* BLOCK ASSET PAR DÉFAUT / Fichier */
/* voir .grid dans main.css */
/* pour le template de page par colonnes, on réécrit un peu le css du par défaut */
aside .grid { display:block; }
aside .grid .element:not(:first-child) { display: none; }

/* BLOCK ASSET RESOURCES / Fichier */
/* 
    déclaré par le block template "resources"
    view/common/block-template/resources.phtml
*/
/*
    .resources-grid : grille/gaufrier responsive sur la base d'une largeur px de la colonne
    Utilisé sur :
    - browse-items
    - bloc asset
*/
.article-figures .element figure img{
    width: 800px;
}
.article-figures .element .element-caption {
    font-family: "asap";
    font-size: ;
    font-style: italic;
    font-weight: 300;
}

.resources-grid {
  display: grid;

  row-gap: var(--spacing);
  column-gap: calc(2 * var(--spacing));
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--resources-grid-element-min-width)), 1fr));

  list-style: none;
}
.resources-grid .element {
    background-color: var(--beige);
}
.resources-grid figure { aspect-ratio: 16/10; background-color: var(--beige); }
.resources-grid figure img { object-fit: cover; height: 100%; width: 100%; }
.resources-grid span { display: block; margin: var(--spacing); }
.resources-grid span.element-title { font-weight: bold; }
.resources-grid span.element-caption { font-family: "asap_condensed"; }
.resources-grid .element:hover { background-color: var(--orange); color: var(--white); }





/* BLOCK BROWSE PREVIEW / Aperçu des ressources */
/* view/common/block-layout/browse-preview.phtml */
.block.block-browsePreview { margin-bottom: 0px !important; margin-top: 0px !important; }
/* layout */
.browse-preview-wrapper { display:flex; }
.browse-preview-wrapper .browse-preview-text { flex-shrink: 0; width: var(--aside-width); }
.browse-preview-wrapper .browse-preview-img { flex: 1; }

.browse-preview-wrapper { border-bottom: 1px solid white; }

/*browse-preview-txt*/
.browse-preview-text {
    padding: var(--spacing);
    background-color: var(--beige);
}
.browse-preview-text .resource-list {
    padding-left: var(--spacing);
    list-style:none;
}
.browse-preview-text .resource-list li {
    padding-top: var(--spacing);
}
.browse-preview-wrapper .resource-list a:hover { text-decoration: underline; }

/*browse-preview-img*/
.browse-preview-img {
    padding: calc(3 * var(--spacing)) calc(3 * var(--spacing));
}
.browse-preview-img .img-list {
    list-style: none;
    display: grid;
    grid-gap: calc(2 * var(--spacing));
    grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--home-resources-grid-element-min-width)), 1fr));
}
.browse-preview-img figure { aspect-ratio: 16/10; }
.browse-preview-img figure img { object-fit: cover; height: 100%; width: 100%; }
.browse-preview-img {
    background-color: var(--bleu);
    color: white;
}
.browse-preview-img .resource-name {
    padding-top: calc(1 * var(--spacing));
    display: block;
    text-align: center;
}

/* responsive */
@media screen and (max-width: 1000px) {
    .browse-preview-wrapper {
        flex-direction: column;
    }
    .browse-preview-wrapper .browse-preview-text { width: 100%; }
    .browse-preview-img {
        padding: calc(2 * var(--spacing)) calc(2 * var(--spacing));
    }
}


/* BLOCK GROUP CITATION */
.block-group.citation {
  display: none;
}
.block-group.citation.active {
  display: block;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 2 * var(--spacing)); max-width: 450px;
  max-height: 75vh;
  overflow: scroll;
  background: var(--white);

  padding: var(--spacing);
  border: 1px solid var(--bleu);
}
.block-group.citation button {
  cursor: pointer; background: unset; border: none;
  position: absolute; top: var(--spacing); right: var(--spacing); width: var(--picto-width);
}
.block-group.citation h3,
.block-group.citation h4 {
    display: flex; align-items: center; gap: var(--spacing);
}
.block-group.citation h3:before,
.block-group.citation h4:before {
    content: "";
    flex-shrink: 0;
    width: var(--spacing); aspect-ratio: 1/3;
    background-color: var(--bleu);
}




/* BLOCK GROUP ACCORDION */
.block-blockGroup.accordion { position: relative; }
.block-blockGroup.accordion .block.block-heading {
    cursor: pointer;
    background-color: var(--beige);
}
.block-blockGroup.accordion .block.block-heading::before {
    background-color: var(--bleu);
}
.block-blockGroup.accordion .block.block-heading::after {
    content: "";
    background-color: var(--bleu);
    width: calc(1.5 * var(--spacing)); aspect-ratio: 1/1;
    mask: url('../media/fleche-gris.svg') no-repeat center / 100%;
    transform: rotate(-90deg);
    margin: 0px var(--spacing) 0px auto;
}
.block-blockGroup.accordion .block.block-heading:hover {
    color: var(--white);
    background-color: var(--orange);
}
.block-blockGroup.accordion .block.block-heading:hover::before {
    background-color: var(--orange);
}
.block-blockGroup.accordion .block.block-heading:hover::after {
    background-color: var(--white);
}
/* .active arrive au click en JS */
.block.block-blockGroup.accordion.active .block.block-heading::after {
    transform: rotate(90deg);
}
.block-blockGroup.accordion .block-asset {
    display: none;
}
.block-blockGroup.accordion.active .block-asset {
    display: block;
}



/* BLOCK group html_with_translation */
.html_with_translation {
    display: grid; grid-template-columns: 1fr 1fr;
    margin-top: var(--common-header-height) !important;
    border-bottom: 1px solid var(--bleu);
}
.html_with_translation .block.block-html {
    margin: calc(2 * var(--spacing));
}
/* BLOCK html_with_nav */
.html_with_nav h1::before, .html_with_nav h2::before, .html_with_nav h3::before, .html_with_nav h4::before, .html_with_nav h5::before, .html_with_nav h6::before {
    display: none;
}
.html_with_nav .text p:not(:last-child) {
  margin-bottom: var(--spacing);
}
@media screen and (max-width: 1000px) {
    .html_with_translation {
        margin-top: 0px !important;
        display: block;
    }
    .html_with_nav .text {
        margin-top: calc(2 * var(--spacing));
    }
}


/* ARTICLE */
.page-is-article #content .column-wrapper main .block.block-html p {
    text-indent: var(--spacing);
    font: var(--poly-txt);
    font-weight: 400;
    font-style: normal;
    text-align: justify;
    hyphens: auto;
}
.page-is-article strong {
    font-weight: normal;
}

.page-is-article #content .column-wrapper main .block.block-html blockquote p {
    font: var(--poly-txt); 
    font-weight: 400;
    font-style: italic;
}
.page-is-article #content .column-wrapper main .block.block-html ul {
    text-indent: var(--spacing);
    font: var(--poly-txt);
    font-weight: 400;
}
.page-is-article #content .column-wrapper main .block.block-html ol {
    text-indent: var(--spacing);
    font: var(--poly-txt); 
    font-weight: 400;
}
/* article figure */
.assets.article-figures .element .element-caption {
    font: var(--poly-fig); 
    font-weight: 400;
    font-style: italic;
    display: inline-block;
    margin-bottom: var(--spacing);
    margin-top: calc(var(--spacing)/2);
}
.assets.article-figures .element figure {
    width: 100%;
}
.assets.article-figures .element figure img {
    max-width: 100%;
    width: 100%;
}
/* article footnote */
.footnotes h2 { margin-bottom: var(--spacing); }
.footnotes cite {
    font: var(--poly-fig);
    font-style: normal;
    font-weight: 300;
}

/* Video */
.page-is-article #content .column-wrapper main .block.block-html p:has(iframe) {
   text-indent: inherit;
}
.block.block-html p iframe {
    width: 100%;
}

@media (max-width: 1000px) {
.block.block-html p iframe {
    width: 100%;
    max-height: 350px;
    }
}