/* Resource detail page (single-storm_resource.php), also the Case History
   page. Badges, status dots, the facts list, notices and buttons come from
   storm-ui.css; same page frame as the initiative page. */

.storm-resource-single {
    padding: var(--wp--preset--spacing--70, 3rem) var(--wp--preset--spacing--50, 1.5rem) var(--wp--preset--spacing--80, 5rem);
    background: var(--theme-palette-color-7);
}

.storm-resource-single__inner {
    width: min(100%, var(--theme-normal-container-max-width, 1290px));
    margin: 0 auto;
}

.storm-resource-single__back {
    display: inline-flex;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
    text-decoration: none;
}

.storm-resource-single__back:hover,
.storm-resource-single__back:focus-visible {
    text-decoration: underline;
    text-underline-offset: 3px;
}


/* Header */

.storm-resource-single__header {
    max-width: 52rem;
    margin-bottom: 2rem;
}

.storm-resource-single__badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.storm-resource-single__title {
    margin: 0 0 0.75rem;
}

.storm-resource-single__summary {
    font-size: 1.15rem;
    line-height: 1.6;
}

.storm-resource-single__summary p {
    margin: 0;
}

.storm-resource-single__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 1rem 0 0;
    color: var(--theme-palette-color-5);
    font-size: 0.95rem;
}


/* Image */

.storm-resource-single__image {
    margin: 0 0 2.5rem;
}

/* Shown whole, never cropped or enlarged; crop or scale it in the Media
   Library (Edit Image) if needed. */
.storm-resource-single__image img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.storm-resource-single__image figcaption {
    margin-top: 0.5rem;
    color: var(--theme-palette-color-5);
    font-size: 0.85rem;
    font-style: italic;
}


/* Layout */

.storm-resource-single__layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(16rem, 1fr);
    gap: 2rem;
    align-items: start;
}

.storm-resource-single__main {
    min-width: 0;
}


/* Tabs (with the script; without it both sections follow each other) */

.storm-resource-single__tab-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    margin-bottom: 1.75rem;
    border-bottom: 1px solid var(--theme-palette-color-6);
}

.storm-resource-single__tab-buttons[hidden] {
    display: none;
}

.storm-resource-single__tab-button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;

    min-height: 44px;
    margin-bottom: -1px;
    padding: 0.5rem 0;

    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    background: transparent;
    color: var(--theme-palette-color-4);

    font: inherit;
    font-weight: 500;
    cursor: pointer;
}

.storm-resource-single__tab-button:hover {
    color: var(--theme-palette-color-1);
}

.storm-resource-single__tab-button.is-active {
    border-bottom-color: var(--theme-palette-color-1);
    color: var(--theme-palette-color-1);
    font-weight: 600;
}

.storm-resource-single__tab-button:focus-visible {
    outline: 2px solid var(--theme-palette-color-1);
    outline-offset: 2px;
}

.storm-resource-single__tab-count {
    min-width: 1.4rem;
    padding: 0 0.35rem;
    border-radius: 4px;
    background: var(--theme-palette-color-6);
    color: var(--theme-palette-color-4);
    font-size: 0.8rem;
    text-align: center;
}

.storm-resource-single__panel + .storm-resource-single__panel {
    margin-top: 2.5rem;
}

.storm-resource-single__tab-buttons:not([hidden]) ~ .storm-resource-single__panel {
    margin-top: 0;
}

.storm-resource-single__panel:focus-visible {
    outline: 2px solid var(--theme-palette-color-1);
    outline-offset: 4px;
}

.storm-resource-single__panel-title {
    margin: 0 0 1.25rem;
    font-size: 1.4rem;
}

.storm-resource-single__content > :first-child {
    margin-top: 0;
}


/* Key figures (Case Histories: own figures plus the linked initiative's) */

.storm-key-figures {
    margin-bottom: var(--wp--preset--spacing--70, 3rem);
}

.storm-key-figures__title {
    margin: 0 0 1rem;
}

/* One white surface; the figures in columns, separated by space. */
.storm-key-figures__list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr));
    gap: 1.25rem 2rem;
    margin: 0;
    padding: 1.5rem 1.75rem;
    border: 1px solid var(--storm-ui-border-faint);
    border-radius: 8px;
    background: var(--theme-palette-color-8);
}

.storm-key-figures__item dt {
    color: var(--theme-palette-color-5);
    font-size: 0.85rem;
}

.storm-key-figures__item dd {
    margin: 0.2rem 0 0;
    color: var(--theme-palette-color-1);
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

@media (max-width: 479.98px) {

    .storm-key-figures__list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem 1.25rem;
        padding: 1.25rem;
    }
}


/* Downloads */

.storm-resource-single__licence {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.5rem;
    margin: 0 0 1rem;
    color: var(--theme-palette-color-4);
    font-size: 0.95rem;
}

.storm-resource-single__condition {
    margin-bottom: 1.25rem;
}

.storm-resource-single__condition p + p {
    margin-top: 0.75rem;
}

.storm-resource-single__files {
    display: grid;
    gap: 0.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.storm-resource-single__file {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;

    padding: 0.9rem 1.1rem;

    border: 1px solid var(--theme-palette-color-6);
    border-radius: 6px;
    background: var(--theme-palette-color-8);
}

.storm-resource-single__file-name {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-wrap: anywhere;
}

.storm-resource-single__file-meta {
    color: var(--theme-palette-color-5);
    font-size: 0.85rem;
}


/* Sidebar */

.storm-resource-single__sidebar {
    display: grid;
    gap: 1.5rem;
}

.storm-resource-single__box {
    padding: 1.75rem;
    border: 1px solid var(--theme-palette-color-6);
    border-radius: 8px;
    background: var(--theme-palette-color-8);
}

.storm-resource-single__box h2 {
    margin: 0 0 1.25rem;
    font-size: 1.25rem;
}

.storm-resource-single__more {
    width: 100%;
    margin-top: 1.5rem;
}


@media (max-width: 999.98px) {

    .storm-resource-single__layout {
        grid-template-columns: minmax(0, 1fr);
    }
}
