/* #### VARIABLES #### */

/* #282829 = color $body-bg from _variables_bootstrap.scss */

:root {
    --discover-color: #006B00;
    /* Light Mode */
}

[data-bs-theme="dark"] {
    --discover-color: #4ec86e;
    /* Dark Mode */
}

[data-bs-theme="dark"] .dc-logo {
    filter: brightness(0) saturate(100%) invert(69%) sepia(52%) saturate(491%) hue-rotate(82deg) brightness(89%) contrast(86%);
}

/* #### LINK COLOR #### */

.article-title a,
.teaser-read-more-button a,
article.node--type-article .node__content a {
    color: var(--discover-color);
}

/* #### MARGINS AND PADDINGS #### */

/* Article Info Block */
.metadata-row {
    margin: 5px 0;
}

.metadata-row.article-title,
.metadata-row.article-tags {
    margin: 8px 0;
}

/* Margins of the upper block on the DIS.COVER front page */
#block-discover-frontpage-upper-block {
    margin-top: 0;
    margin-bottom: 0;
}

/* Margin before block "Das Magazin auf COVER.INFO" */
#block-magazine-block,
#block-cover-info-dasmagazinaufcoverinfo {
    margin-top: 0px;
}

/* Margin between blocks in the right column*/
.page-content-right-wrapper .block {
    margin-bottom: 1rem;
}

/* Remove default margin-top on first block in right columns (Bootstrap gutter override) */
.page-content-right-wrapper .block:first-child,
.region-discover-right .block:first-child {
    margin-top: 0;
}

/* Margin in Article Views */
.article-view-box-title {
    margin-bottom: 0;
}

/* Margin after "More From Our Magazine" box title */
.block-content .view-random-articles {
    margin-top: 1rem;
}

/* Margin after block titles */
#block-cover-info-page-title {
    margin-bottom: 0;
}

/* Bottom of Taxonomy Pages */
.feed-icon {
    margin-top: 1.5rem;
}

/* All Tags boxes */
#block-cover-info-views-block-list-of-tags-all-tags-block .block-content,
#block-cover-info-views-block-list-of-tags-all-tags-block-2 .block-content {
    padding-top: 1.5rem;
}

/* #### ARTICLE INFO BLOCK #### */

/* Also applies to Taxonony Terms underneath articles */

.metadata-icon {
    float: left;
    width: 24px;
    height: 24px;
    margin-top: 2px;
    margin-right: 14px;
}

/* Mehrzeilige Artikel-Titel: Umbruchzeilen buendig unter Zeile 1 (wie bei
   Song-Titeln, vgl. h2.node-title in main.scss), nicht unter dem Icon.
   Nur auf die Titel-Zeile gescopt — Autor-/Datum-/Tags-Zeilen behalten
   das Float-Icon. */
.metadata-row.article-title {
    display: flex;
    align-items: flex-start;
}

.metadata-row.article-title .metadata-icon {
    float: none;
    flex-shrink: 0;
}

.metadata-row.article-title .metadata-value {
    min-width: 0;
}


/* #### TAXONOMY TERMS #### */

.article-tags-box {
    display: flex;
    flex-wrap: wrap;
    column-gap: 0.5rem;
    row-gap: 0.6rem;
}

.list-of-tags .view-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
    gap: 1rem;
}

.list-of-tags .views-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.tag,
.list-of-tags .views-row .views-field-name {
    background-color: transparent;
    border: 2px solid var(--discover-color);
    border-radius: 10px;
    font-size: 0.9rem;
    padding: 3px 6px;
}

.tag a,
.list-of-tags .views-row .views-field-name a {
    color: var(--discover-color);
}

/* Counter Number in Lists*/
.list-of-tags .views-row .views-field-nid {
    color: var(--discover-color)
}

.article-tags-box-bottom {
    gap: 1rem;
}

.article-tags-box-bottom>.tag-container>.tag {
    font-size: 1rem;
    padding: 4px 8px;
}


/* #### ARTICLES AND TEASERS #### */

.article-teaser {
    display: flex;
    column-gap: 1rem;
}

.teaser-text {
    height: fit-content;
}

.article-title {
    font-size: 1.375rem;
    font-weight: bold;
    color: var(--discover-color);
}

.article-teaser-metadata .article-title {
    font-size: 1rem;
}

/* Konstanter Abstand zwischen Teaser-Text und "Weiterlesen ..."-Link:
   Der getrimmte Body endet mal mit <p> (mit margin-bottom), mal mit nacktem
   Text -- deshalb Body-Endmargin neutralisieren und den Abstand fest am
   Button-Wrapper definieren. */
.article-teaser-text .field--name-body > :last-child {
    margin-bottom: 0;
}

.teaser-read-more-button {
    margin-top: 1rem;
}

.article-author {
    font-size: 1rem;
    color: currentColor;
    text-decoration: none;
}

/* in case there is a link to the author */
.article-author a {
    color: inherit;
    text-decoration: none;
}

.article-author a:hover {
    text-decoration: underline;
}

.article-date {
    font-size: 1rem;
}

/* Article Image */
.img-fluid {
    float: left;
    margin-right: 1.25rem;
    margin-bottom: 1.25rem;
}

/* Beitragsbild-Umfluss nur, wenn neben dem Bild genug Platz für Text bleibt.
   Der Kasten (nicht der Viewport) entscheidet -> Container-Query, gleiches
   Muster wie bei den Suchtreffern (540px-Schwelle). */
.node--type-article .node__content {
    container-type: inline-size;
}

/* Gefloatet nie mehr als ~55% der Kastenbreite einnehmen, sonst bleiben
   neben hochformatigen Bildern nur einzelne Wörter pro Zeile. */
.node--type-article .node__content .field--name-field-image img.img-fluid {
    max-width: 55%;
}

/* Schmaler Kasten: Umfluss aufgeben, Bild als Block über dem Text.
   Schwelle 480px: Die Desktop-Artikelspalte ist ~500px breit und soll den
   Umfluss behalten; auf Mobilgeräten (~340px Kasten) wird gestapelt. */
@container (max-width: 479px) {
    .node--type-article .node__content .field--name-field-image img.img-fluid {
        float: none;
        display: block;
        max-width: 100%;
        margin-right: 0;
    }
}

/* Dividers */

/* Divider after article metadata */

.horizontal-divider {
    border-top: 1px solid #ACACAC;
    height: 1.5625rem;
    margin-top: 1.5625rem;
}

/* Divider on search results page and between article teasers */

/* Views with 1 column (views-row): Divider after every item, except the last */
.horizontal-divider-large,
.views-row:has(article.node--view-mode-teaser):not(:last-child) {
    border-bottom: 5px solid var(--bs-body-bg);
    padding-bottom: 1.5625rem;
    margin-bottom: 1.5625rem;
    margin-left: calc(-1.5rem - 1px);
    margin-right: calc(-1.5rem - 1px);
    padding-left: calc(1.5rem + 1px);
    padding-right: calc(1.5rem + 1px);
}

/* Grid view with 1 column (below 992px): Divider, except after the last */
@media (max-width: 991.98px) {
    .views-view-responsive-grid__item:not(:last-child) {
        border-bottom: 5px solid var(--bs-body-bg);
        padding-bottom: 1.5625rem;
        margin-bottom: 1.5625rem;
        margin-left: calc(-1.5rem - 1px);
        margin-right: calc(-1.5rem - 1px);
        padding-left: calc(1.5rem + 1px);
        padding-right: calc(1.5rem + 1px);
    }

    .views-view-responsive-grid--horizontal {
        row-gap: 0;
    }
}

.view-article-search .view-filters {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.view-article-search .view-filters form {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.view-article-search .view-filters .horizontal-divider-large {
    width: calc(100% + 3rem + 2px);
    margin-left: calc(-1.5rem - 1px);
    margin-right: calc(-1.5rem - 1px);
    align-self: stretch;
}

/* Exceptional divider in Dark Mode */
[data-bs-theme="dark"] .views-row:has(article.node--view-mode-teaser):not(:last-child),
[data-bs-theme="dark"] .views-view-responsive-grid__item:not(:last-child) {
    border-bottom-color: var(--ci-border);
}

/* Headings in Articles*/

article.node--type-article h2 {
    font-size: 1.375rem;
    font-weight: bold;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    line-height: normal;
    color: var(--discover-color);
    background-color: inherit;
}

article.node--type-article h3 {
    font-size: 1.2rem;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

article.node--type-article h4 {
    font-size: 1.0rem;
    font-weight: bold;
    color: var(--discover-color);
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

article.node--type-article h5 {
    font-size: 1.0rem;
    font-style: italic;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

article.node--type-article h6 {
    font-size: 0.9rem;
    font-style: italic;
    color: var(--discover-color);
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

/* ALL-TAGS AND ARCHIVE BOX */

/* Place Icons (Without Tooltips) Before Title*/

.block-views-blocklist-of-tags-all-tags-block h2::before {
    content: "";
    display: inline-block;

    width: 24px;
    height: 24px;

    background-image: url("/themes/custom/cover_info/icons/hangtag_weiss.svg");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;

    margin-right: 10px;
    vertical-align: middle;
}

#block-cover-info-views-block-archive-by-year-and-month-block-1 h2::before,
#block-cover-info-views-block-archive-by-year-and-month-block-2 h2::before {
    content: "";
    display: inline-block;

    width: 24px;
    height: 24px;

    background-image: url("/themes/custom/cover_info/icons/date_weiss.svg");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;

    margin-right: 10px;
    vertical-align: middle;
}

.region-more-articles {
    margin-top: 10px;
}


/* #### DIS.COVER Article Search Field #### */

.discover-search-form {
    max-width: 20rem;
}

.view-article-search .view-filters {
    padding-left: 0;
    padding-right: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.discover-search-form {
    display: flex;
    align-items: stretch;
}

.discover-search-form .form-item {
    flex: 1;
    /* Bezugsrahmen für das absolut positionierte Clear-X (JS-injiziert). */
    position: relative;
}

.discover-search-form__input {
    width: 100%;
    height: 38px;
    border-radius: 10px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    box-shadow: inset 2px 3px 5px rgba(0, 0, 0, 0.2), inset 0 -1px 2px rgba(0, 0, 0, 0.1);
    border: 1px solid #ccc;
    /* Platz für das Clear-X rechts im Feld. */
    padding-right: 30px;
}

/* Browser-eigenes Such-X (WebKit) ausblenden – wir liefern ein eigenes. */
.discover-search-form__input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}

/* Clear-X der Artikelsuche – identisch zum site-weiten Suchfeld: schlichtes X im
   Icon-Grau, kein Kreis, hell/dunkel sichtbar. Sitzt rechts im Feld, links vom
   grünen Lupen-Button. */
.discover-search-form .ci-search-clear {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    display: none;
    padding: 0;
    border: none;
    background: none;
    color: var(--ci-text-muted);
    font-size: 22px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
}

.discover-search-form .ci-search-clear:hover {
    color: var(--ci-text-main);
}

.discover-search-form .ci-search-clear.is-visible {
    display: block;
}

.discover-search-form__input:focus {
    outline: none;
    box-shadow: inset 2px 3px 5px rgba(0, 0, 0, 0.2), inset 0 -1px 2px rgba(0, 0, 0, 0.1);
    background-color: #fff;
    border: 1px solid #ccc;
}

.discover-search-form .form-actions {
    display: flex;
    align-items: stretch;
}

.discover-search-form__button {
    background-color: #282829;
    border: none;
    border-radius: 0 8px 8px 0;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    height: 100%;
}

.discover-search-form__button:hover {
    background-color: #282829;
}

/* Lupe der Artikel-Suche in DIS.COVER-Grün statt Orange: Der Kasten sucht nur
   in Magazin-Artikeln, die Farbe signalisiert den Scope. In BEIDEN Modi das
   helle Dark-Mode-Logo-Grün (exakt dieselbe Filterkette wie .dc-logo oben,
   ergibt #4FC76D) — das dunkle Light-Mode-Grün #006b00 wäre auf dem dunklen
   Button-Hintergrund (#282829) zu kontrastarm. */
.discover-search-form__button img {
    filter: brightness(0) saturate(100%) invert(69%) sepia(52%) saturate(491%) hue-rotate(82deg) brightness(89%) contrast(86%);
}


/* #### ARCHIVE WIDGET #### */

/* Hide output until grouped by JavaScript */
.view-archive-by-year-and-month .view-content {
    display: none;
}

.view-archive-by-year-and-month .archive-tree,
.view-archive-by-year-and-month .archive-months,
.view-archive-by-year-and-month .archive-articles {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Year Header */
.view-archive-by-year-and-month .archive-year-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    user-select: none;
    padding: 0.2rem 0;
}

/* Month List Closed */
.view-archive-by-year-and-month .archive-months {
    display: none;
    padding-left: 1rem;
    border-left: 1px solid currentColor;
    opacity: 0.15;
    margin-left: 0.4rem;
}

.view-archive-by-year-and-month .archive-months {
    opacity: 1;
    border-left: 1px solid;
    border-color: inherit;
    padding-left: 1rem;
    margin-left: 0.5rem;
}

.view-archive-by-year-and-month .archive-year.open>.archive-months {
    display: block;
}

/* Month Header */
.view-archive-by-year-and-month .archive-month-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    user-select: none;
    padding: 0.15rem 0;
}

/* Article List Closed */
.view-archive-by-year-and-month .archive-articles {
    display: none;
    padding-left: 1rem;
    margin-left: 0.5rem;
}

.view-archive-by-year-and-month .archive-month.open>.archive-articles {
    display: block;
}

/* Arrow Icon */
.view-archive-by-year-and-month .archive-arrow {
    display: inline-block;
    width: 0.45em;
    height: 0.45em;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    transition: transform 0.2s ease;
    flex-shrink: 0;
    opacity: 0.6;
}

.view-archive-by-year-and-month .archive-year.open>.archive-year-header .archive-arrow,
.view-archive-by-year-and-month .archive-month.open>.archive-month-header .archive-arrow {
    transform: rotate(45deg);
}

/* Article Entries */
.view-archive-by-year-and-month .archive-articles li {
    padding: 0.1rem 0;
}


/* #### DIS.COVER Front Page #### */

.page-content-front-right .block {
    margin-bottom: 1rem;
}

#block-discover-front-page-tags-block .block-content .shadow-line {
    border-bottom: 8px solid #ededed;
    margin-top: 5px;
    margin-bottom: 6px;
}

#block-discover-front-page-tags-block .block-content .logo {
    text-align: center;
    margin-top: 8px;
}

#block-cover-info-views-block-list-of-tags-all-tags-block .block-content .info-text {
    margin-top: 8px;
}

#block-cover-info-views-block-list-of-tags-all-tags-block .list-of-tags .view-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 0;
}


/* DIS.COVER LOGO IN ARTICLE VIEWS */

.dc-logo-article-view {
    margin-top: 2.5rem;
    display: flex;
    justify-content: center
}


/* #### BREADCRUMBS #### */

.breadcrumb-icon {
    height: 15px;
    margin-left: 2px;
    margin-right: 3px;
    width: auto;
    vertical-align: middle;
}


/* #### LATEST / PREVIOUS ARTICLE BOXES (equal height) on Front Page #### */

.page-content-front-left,
.page-content-front-right,
.page-content-front-left2,
.page-content-front-right2 {
    display: flex;
    flex-direction: column;
}

.page-content-front-left .region,
.page-content-front-right .region,
.page-content-front-left2 .region,
.page-content-front-right2 .region {
    height: 100%;
}

#block-cover-info-views-block-latest-article-block-1,
#block-cover-info-views-block-previous-article-block-1 {
    height: 100%;
    display: flex;
    flex-direction: column;
}

#block-cover-info-views-block-latest-article-block-1 .block-content,
#block-cover-info-views-block-previous-article-block-1 .block-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

#block-cover-info-views-block-latest-article-block-1 .block-content > div,
#block-cover-info-views-block-previous-article-block-1 .block-content > div {
    height: 100%;
}

#block-cover-info-views-block-latest-article-block-1 .view,
#block-cover-info-views-block-previous-article-block-1 .view {
    height: 100%;
    display: flex;
    flex-direction: column;
}

#block-cover-info-views-block-latest-article-block-1 .view-content,
#block-cover-info-views-block-previous-article-block-1 .view-content {
    flex: 1;
}

#block-cover-info-views-block-latest-article-block-1 .dc-logo-article-view,
#block-cover-info-views-block-previous-article-block-1 .dc-logo-article-view {
    margin-bottom: 12px;
}