/* Dark theme, responsive layout, simple hover effects                     */

:root {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --accent-color: #ff5252;      /* a vivid red for links / highlights   */
    --muted-color: #777777;
    --brighter-muted-color: #888888;  /* a slightly brighter gray than muted-color for figure captions   */
    --max-width: 1200px;
    --font-sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* Reset & base ------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html { font-size: 100%; }           /* 16 px default */
body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-sans);
    line-height: 1.6;
}

/* Layout helpers ----------------------------------------------------------- */
.container {
    width: 90%;
    max-width: var(--max-width);
    margin: 0 auto;
}
header, nav, main, footer { padding: 1rem 0; }

/* Header & navigation ------------------------------------------------------ */
header {
    background-color: #1e1e1e;
    border-bottom: 2px solid var(--muted-color);
}
nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
    justify-content: center;
}
nav a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    padding: .3rem .6rem;
    border-radius: 4px;
    transition: background-color .2s, color .2s;
}
nav a:hover,
nav a.active {                     /* the page you are on */
    background-color: var(--accent-color);
    color: #fff;
}

/* Hero image --------------------------------------------------------------- */
.hero {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    margin-top: 1rem;
}
.hero img {
    width: 100%;
    height: auto;
    display: block;
}

/* Content sections ---------------------------------------------------------- */
h1, h2, h3 { margin-bottom: .5rem; }
h1 { font-size: 2.2rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.0rem; }
p { margin-bottom: 1rem; }
a { color: var(--accent-color);
    text-decoration: none; }
a:hover { text-decoration: underline; }
img { width: 600px;                /* medium size, keep aspect ratio */
    height: auto;
    border-radius: 4px; }
figcaption { font-size: 0.9rem;            /* slightly smaller than body text */
    			 color: var(--brighter-muted-color); }

/* Lists of links (e.g., articles) --------------------------------- */
.link-list {
    list-style: none;
    padding-left: 0;
}
.link-list li {
    margin: .5rem 0;
}
.link-list a {
    color: var(--accent-color);
    text-decoration: none;
}
.link-list a:hover { text-decoration: underline; }

/* Footer ------------------------------------------------------------------- */
footer {
    font-size: .85rem;
    text-align: center;
    border-top: 1px solid var(--muted-color);
    margin-top: 2rem;
    padding-top: .8rem;
}

/* Responsive --------------------------------------------------------------- */
@media (max-width: 600px) {
    nav ul { flex-direction: column; gap: .5rem; }
}

/* -------------------------------------------------
   Image‑link block
   ------------------------------------------------- */
.image-link {
    display: flex;               /* image left, text right */
    align-items: center;
    gap: 1.5rem;                 /* space between image & text */
    margin-top: 2rem;            /* distance from a previous image */
}

/* ---- image part --------------------------------------------------- */
.image-link .img-wrapper {
    display: block;              /* makes the whole area clickable */
}
.image-link .img-wrapper img {
    width: 300px;                /* medium size, keep aspect ratio */
    height: auto;
    border-radius: 4px;
    transition: opacity .3s ease;
}

/* optical feedback – change opacity on hover over the image only */
.image-link .img-wrapper:hover img {
    opacity: 0.7;
}

/* ---- text part ---------------------------------------------------- */
.image-link .link-text {
    font-size: 1.4rem;           /* larger than normal paragraph */
    color: var(--accent-color);    /* same colour as the heading */
    text-decoration: none;
}
.image-link .link-text:hover {
    text-decoration: underline;
}

/* Keeps navigation hover style untouched – more specific selector
   prevents interference with the generic navigation rules. */

/*--------------------------------------------------------------------*/
/*  Photo‑grid for gallery pages                         */
/*--------------------------------------------------------------------*/

.photo-grid {
    display: grid;
    /* Two equal columns; they collapse to one column on very narrow screens */
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

/* Make the images fill their cell while keeping aspect ratio */
.photo-grid a img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
    transition: opacity .3s ease;
}

/* Hover effect – dim to 70 % */
.photo-grid a img:hover {
    opacity: 0.7;
}

/* Responsive fallback – single column on <500 px width */
@media (max-width: 500px) {
    .photo-grid {
        grid-template-columns: 1fr;
    }
}

/* --------------------------------------------------------------
   Typography improvement for long article texts
   -------------------------------------------------------------- */
.article-content {
    /* Limit line length to a comfortable reading width (≈80 characters) */
    max-width: 80ch;
    margin-left: auto;
    margin-right: auto;

    /* Keep the existing body‑wide line‑height but add a little more vertical rhythm */
    line-height: 1.8;
    font-size: 1rem;               /* base size – inherits from body */
    padding-top: 2rem;
}

/* --------------------------------------------------------------
   Figure styling – for a figure in an article
   -------------------------------------------------------------- */
/* For images that are not a link */

.article-content figure {
    margin: 2rem auto;            /* vertical spacing, centre horizontally */
    text-align: center;           /* centre image & caption */
    max-width: 100%;              /* never overflow its container */
}

.article-content figure img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;        		/* same radius as used for other photos */
    transition: opacity .3s ease;	/* smooth fade on hover */
}

/* Hover dim – keeps the same feel as the photo‑grid images */
.article-content figure img:hover {
    opacity: 0.7;
}

/* And now for images that are a link */

.article-content figure a img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;               /* same radius used for other photos */
    transition: opacity .3s ease;     /* smooth fade on hover */
}

/* Hover dim – keeps the same feel as the photo‑grid images */
.article-content figure a:hover img {
    opacity: 0.7;
}

.article-content figcaption {
    margin-top: 0.5rem;
    font-size: 0.9rem;            /* slightly smaller than body text */
    color: var(--brighter-muted-color);
}