/* ==========================================================
   style.css - shared look of all pages (index.html, algII.html)
   Each rule has the form:   selector { property: value; }
   The selector says WHICH elements are styled:
     header      -> every <header> tag
     .classes    -> every tag with class="classes"
     a:hover     -> every <a> link while the mouse is over it
   ========================================================== */


/* === PALETTE ===
   Colours are defined once here as variables and used below
   as var(--name). Change a value here to recolour the whole site. */
:root {
	--green-dark: #2A7C13;    /* header, headings, links */
	--green-light: #76C457;   /* accents: stripes, underlines, hover */
	--cream: #FFF8CF;         /* content card background, header text */
	--sand: #FBE6C2;          /* page background, separator lines */
	--text: #2B2A22;          /* main text (almost black, slightly warm) */
}

/* === WHOLE PAGE ===
   Settings on body are inherited by everything inside it. */
body {
	/* the browser uses the first font on this list that the visitor has;
	   Futura exists on Mac/iPhone, the rest are fallbacks for other systems */
	font-family: Futura, "Century Gothic", "Trebuchet MS", Arial, sans-serif;
	font-size: 17px;
	line-height: 1.6;           /* space between lines (1.6 x font size) */
	margin: 0;                  /* remove the default white frame around the page */
	background: var(--sand);
	color: var(--text);
}

/* === HEADER === (the green bar at the top) */
header {
	background: var(--green-dark);
	color: var(--cream);
	padding: 35px 15px 30px;    /* inner space: top, left/right, bottom */
	text-align: center;
	border-bottom: 6px solid var(--green-light);   /* light green stripe */
}
/* subtitle under the title (used on algII.html) */
header p {
	margin: 8px 0 0;
	color: var(--sand);
	font-style: italic;
}
/* page title */
h1 {
	text-align: center;
	margin: 0;
	font-weight: normal;        /* not bold */
	letter-spacing: 0.5px;      /* slightly wider gaps between letters */
}

/* === CONTENT CARD ===
   <main> is the cream box holding all content below the header. */
main {
	max-width: 1000px;          /* never wider than this, even on big screens */
	margin: 30px auto;          /* 30px above/below; "auto" centres it horizontally */
	padding: 10px 35px 25px;    /* inner space: top, left/right, bottom */
	background: var(--cream);
	border-radius: 10px;        /* rounded corners */
	box-shadow: 0 2px 10px rgba(42, 124, 19, 0.15);   /* soft greenish shadow */
}

/* === ONE COLUMN === */
.one-column {
	display: block;     /* normal document flow */
}

/* === TWO COLUMNS === (used on algII.html) */
.two-columns {
	display: flex;        /* side-by-side columns */
	flex-direction: row;
	gap: 30px;            /* space between the columns */
	margin-bottom: 30px;
}

/* left and right inside two-column layout;
   "flex: 1" on both gives them equal width */
.two-columns > .left {
	flex: 1;
}

.two-columns > .right {
	flex: 1;
	border-left: 2px solid var(--green-light);   /* vertical divider line */
	padding-left: 30px;
}

/* === HEADINGS AND SEPARATORS === */
/* section titles, e.g. "Dydaktyka", "Publikacje" */
h2 {
	color: var(--green-dark);
	font-weight: normal;
	font-size: 1.4em;           /* 1.4 x the normal text size */
	margin: 25px 0 12px;        /* outer space: top, left/right, bottom */
	padding-left: 12px;
	border-left: 5px solid var(--green-light);   /* green bar beside the title */
}
/* <hr> = horizontal line between sections */
hr {
	border: none;                        /* remove the default grey line */
	border-top: 1px solid var(--sand);   /* draw a thin sand-coloured one */
	margin: 25px 0;
}

/* === LINKS === */
a {
	color: var(--green-dark);
	text-decoration: underline;
	text-decoration-color: var(--green-light);   /* underline colour */
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;  /* distance of underline from the text */
	border-radius: 3px;          /* rounds the hover highlight below */
	transition: 0.2s;            /* smooth color change */
}
/* link while the mouse is over it */
a:hover {
	background-color: var(--green-light);
	color: var(--text);
	text-decoration-color: transparent;   /* hide the underline */
}

/* === LISTS === */
li {
	margin-bottom: 10px;        /* space between list items */
}
/* ::marker = the bullet or number in front of a list item */
li::marker {
	color: var(--green-dark);
	font-weight: bold;
}

/* "back to main page" link at the bottom of subpages */
.back-link {
	margin-top: 30px;
	display: block;
	text-align: center;
}
/* make that link look like a rounded button */
.back-link a {
	display: inline-block;      /* lets padding apply on all sides */
	padding: 8px 18px;
	background: var(--green-dark);
	color: var(--cream);
	text-decoration: none;      /* no underline */
	border-radius: 20px;        /* pill shape */
}
.back-link a:hover {
	background: var(--green-light);
	color: var(--text);
}

/* Remove bullets from top-level list */
.classes {
	list-style: none;
	padding-left: 0;
	margin-left: 0;
}

/* Each class as a block with spacing */
.classes > li {
	margin-bottom: 12px;
	font-weight: bold;     /* makes "Class 1" stand out */
}

/* Materials list (indented) */
.materials {
	list-style-type: none;
	padding-left: 20px;
	margin-top: 5px;
	margin-bottom: 5px;
	font-weight: normal;   /* cancel the bold inherited from .classes > li */
}
.materials > li {
	margin-bottom: 3px;
}

/* === SMALL SCREENS ===
   Rules inside apply only when the window is 700px wide or less (phones);
   they override the rules above. */
@media (max-width: 700px) {
	/* smaller margins so the card uses almost the full width */
	main {
		margin: 15px 10px;
		padding: 5px 18px 20px;
	}
	/* stack the two columns one under the other */
	.two-columns {
		flex-direction: column;
		gap: 0;
	}
	/* the divider line moves from the left side to the top */
	.two-columns > .right {
		border-left: none;
		padding-left: 0;
		border-top: 2px solid var(--green-light);
		margin-top: 25px;
	}
}
